public class MockInMemoryTierObjectStore extends Object implements TierObjectStore, AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
MockInMemoryTierObjectStore.UploadedObject |
TierObjectStore.Backend, TierObjectStore.BackupObjectsListMetadata, TierObjectStore.DataTypePathPrefix, TierObjectStore.DurabilityAuditsOffsetMapMetadata, TierObjectStore.FileType, TierObjectStore.HealthMetadata, TierObjectStore.KeyAndVersion, TierObjectStore.LifecycleManagerStateMetadata, TierObjectStore.ObjectMetadata, TierObjectStore.ObjectStoreMetadata, TierObjectStore.OpaqueData, TierObjectStore.TierPartitionStateSnapshotMetadata, TierObjectStore.TierStateRestoreSnapshotMetadata, TierObjectStore.TierTopicSnapshotMetadata
Modifier and Type | Field and Description |
---|---|
static MockInMemoryTierObjectStore.UploadedObject |
deleteMarker |
boolean |
throwExceptionOnSegmentFetch |
boolean |
throwExceptionOnTransactionFetch |
scala.Function3<String,TierObjectStore.ObjectStoreMetadata,TierObjectStore.FileType,Boolean> |
throwOnCondition |
Constructor and Description |
---|
MockInMemoryTierObjectStore(org.apache.kafka.common.utils.Time time,
org.apache.kafka.common.metrics.Metrics metrics,
MockInMemoryTierObjectStoreConfig config) |
MockInMemoryTierObjectStore(org.apache.kafka.common.utils.Time time,
MockInMemoryTierObjectStoreConfig config) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getObject, getObject, getObject
public static MockInMemoryTierObjectStore.UploadedObject deleteMarker
public volatile boolean throwExceptionOnSegmentFetch
public volatile boolean throwExceptionOnTransactionFetch
public scala.Function3<String,TierObjectStore.ObjectStoreMetadata,TierObjectStore.FileType,Boolean> throwOnCondition
public MockInMemoryTierObjectStore(org.apache.kafka.common.utils.Time time, MockInMemoryTierObjectStoreConfig config)
public MockInMemoryTierObjectStore(org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, MockInMemoryTierObjectStoreConfig config)
public List<String> getStoredKeys()
public ConcurrentHashMap<TierObjectStore.FileType,Integer> getObjectCounts()
public ConcurrentHashMap<String,byte[]> getStored()
public TierObjectStore.Backend getBackend()
getBackend
in interface TierObjectStore
public Map<String,List<VersionInformation>> listObject(String keyPrefix, boolean getVersionInfo)
listObject
in interface TierObjectStore
public TierObjectStoreResponse getObject(TierObjectStore.ObjectStoreMetadata objectMetadata, TierObjectStore.FileType objectFileType, Integer byteOffset, Integer byteOffsetEnd, VersionInformation versionInformation) throws TierObjectStoreRetriableException
getObject
in interface TierObjectStore
TierObjectStoreRetriableException
public TierObjectStore.OpaqueData prepPutSegment() throws TierObjectStoreRetriableException
prepPutSegment
in interface TierObjectStore
TierObjectStoreRetriableException
public void close()
close
in interface AutoCloseable
close
in interface TierObjectStore
public void putInMemorySegment(TierObjectStore.ObjectMetadata objectMetadata, File segmentData, File offsetIndexData, File timestampIndexData, Optional<ByteBuffer> producerStateSnapshotData, Optional<ByteBuffer> transactionIndexData, Optional<ByteBuffer> epochState) throws IOException
putInMemorySegment
in interface TierObjectStore
IOException
public void putSegment(TierObjectStore.ObjectMetadata objectMetadata, File segmentData, File offsetIndexData, File timestampIndexData, Optional<File> producerStateSnapshotData, Optional<ByteBuffer> transactionIndexData, Optional<ByteBuffer> epochState) throws IOException
putSegment
in interface TierObjectStore
IOException
public void putObject(TierObjectStore.ObjectStoreMetadata objectMetadata, File file, TierObjectStore.FileType fileType)
putObject
in interface TierObjectStore
public void putBuffer(TierObjectStore.ObjectStoreMetadata objectMetadata, ByteBuffer buffer, TierObjectStore.FileType fileType)
putBuffer
in interface TierObjectStore
public void restoreObjectByCopy(TierObjectStore.ObjectMetadata objectMetadata, String key, VersionInformation lastLiveVersion)
TierObjectStore
restoreObjectByCopy
in interface TierObjectStore
public void deleteSegment(TierObjectStore.ObjectMetadata objectMetadata)
deleteSegment
in interface TierObjectStore
public void deleteVersions(List<TierObjectStore.KeyAndVersion> keys)
deleteVersions
in interface TierObjectStore
public TierObjectAttribute objectExists(TierObjectStore.ObjectMetadata objectMetadata, TierObjectStore.FileType type)
objectExists
in interface TierObjectStore
public TierObjectAttribute objectExists(TierObjectStore.ObjectStoreMetadata objectMetadata, TierObjectStore.FileType type)
public BucketHealthResult checkBucketHealth()
checkBucketHealth
in interface TierObjectStore
public void clearForClusterId()