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.KRaftSnapshotMetadata, 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 |
Supplier<Boolean> |
throwOnListCondition |
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,
org.apache.kafka.common.metrics.Metrics metrics,
MockInMemoryTierObjectStoreConfig config,
Optional<io.confluent.kafka.storage.checksum.E2EChecksumStore> checksumStoreOpt) |
MockInMemoryTierObjectStore(org.apache.kafka.common.utils.Time time,
MockInMemoryTierObjectStoreConfig config) |
MockInMemoryTierObjectStore(org.apache.kafka.common.utils.Time time,
MockInMemoryTierObjectStoreConfig config,
Optional<io.confluent.kafka.storage.checksum.E2EChecksumStore> checksumStoreOpt) |
Modifier and Type | Method and Description |
---|---|
BucketHealthResult |
checkBucketHealth() |
void |
clearForClusterId() |
void |
close() |
void |
deleteSegment(TierObjectStore.ObjectMetadata objectMetadata) |
void |
deleteVersions(List<TierObjectStore.KeyAndVersion> keys) |
TierObjectStore.Backend |
getBackend() |
ConcurrentHashMap<TierObjectStore.FileType,io.confluent.kafka.storage.checksum.ChecksumInfo> |
getChecksums() |
TierObjectStoreResponse |
getObject(TierObjectStore.ObjectStoreMetadata objectMetadata,
TierObjectStore.FileType objectFileType,
Integer byteOffset,
Integer byteOffsetEnd,
VersionInformation versionInformation) |
ConcurrentHashMap<TierObjectStore.FileType,Integer> |
getObjectCounts() |
ByteBuffer |
getSnapshot(TierObjectStore.ObjectStoreMetadata metadata,
TierObjectStore.FileType fileType,
int estimatedBufferSize) |
ConcurrentHashMap<String,byte[]> |
getStored() |
List<String> |
getStoredKeys()
Returns the set of keys which are currently stored.
|
Map<String,List<VersionInformation>> |
listObject(String keyPrefix,
boolean getVersionInfo)
Gets the blobs whose key matches the given keyPrefix, along with all the uploaded versions for such blobs if getVersionInfo
is set to true.
|
TierObjectAttribute |
objectExists(TierObjectStore.ObjectStoreMetadata objectMetadata,
TierObjectStore.FileType type) |
TierObjectStore.OpaqueData |
prepPutSegment() |
void |
putBuffer(TierObjectStore.ObjectStoreMetadata objectMetadata,
ByteBuffer buffer,
TierObjectStore.FileType fileType) |
void |
putInMemorySegment(TierObjectStore.ObjectMetadata objectMetadata,
File segmentData,
File offsetIndexData,
File timestampIndexData,
Optional<ByteBuffer> producerStateSnapshotData,
Optional<ByteBuffer> transactionIndexData,
Optional<ByteBuffer> epochState) |
void |
putObject(TierObjectStore.ObjectStoreMetadata objectMetadata,
File file,
TierObjectStore.FileType fileType) |
void |
putSegment(TierObjectStore.ObjectMetadata objectMetadata,
File segmentData,
File offsetIndexData,
File timestampIndexData,
Optional<File> producerStateSnapshotData,
Optional<ByteBuffer> transactionIndexData,
Optional<ByteBuffer> epochState,
Optional<kafka.utils.Throttler> throttlerOpt) |
void |
restoreObjectByCopy(TierObjectStore.ObjectMetadata objectMetadata,
String key,
VersionInformation lastLiveVersion)
There are usually 2 ways to restore a deleted object:
- to remove the deleteMarker of the object to expose its last live version again as current version.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFileTypesPerSegment, getObject, getObject, getObject, putSegment
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, MockInMemoryTierObjectStoreConfig config, Optional<io.confluent.kafka.storage.checksum.E2EChecksumStore> checksumStoreOpt)
public MockInMemoryTierObjectStore(org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, MockInMemoryTierObjectStoreConfig config)
public MockInMemoryTierObjectStore(org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, MockInMemoryTierObjectStoreConfig config, Optional<io.confluent.kafka.storage.checksum.E2EChecksumStore> checksumStoreOpt)
public List<String> getStoredKeys()
public ConcurrentHashMap<TierObjectStore.FileType,Integer> getObjectCounts()
public ConcurrentHashMap<TierObjectStore.FileType,io.confluent.kafka.storage.checksum.ChecksumInfo> getChecksums()
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 ByteBuffer getSnapshot(TierObjectStore.ObjectStoreMetadata metadata, TierObjectStore.FileType fileType, int estimatedBufferSize)
getSnapshot
in interface TierObjectStore
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, Optional<kafka.utils.Throttler> throttlerOpt) 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.ObjectStoreMetadata objectMetadata, TierObjectStore.FileType type)
objectExists
in interface TierObjectStore
public BucketHealthResult checkBucketHealth()
checkBucketHealth
in interface TierObjectStore
public void clearForClusterId()