Package com.linkedin.davinci.store.cache
Class VeniceStoreCacheStoragePartition
java.lang.Object
com.linkedin.davinci.store.AbstractStoragePartition
com.linkedin.davinci.store.cache.VeniceStoreCacheStoragePartition
-
Field Summary
Fields inherited from class com.linkedin.davinci.store.AbstractStoragePartition
partitionId
-
Constructor Summary
ConstructorDescriptionVeniceStoreCacheStoragePartition
(Integer partitionId, ObjectCacheConfig cacheConfig, RecordDeserializer keyRecordDeserializer, com.github.benmanes.caffeine.cache.AsyncCacheLoader cacheLoader) VeniceStoreCacheStoragePartition
(Integer partitionId, ObjectCacheConfig cacheConfig, org.apache.avro.Schema keySchema, com.github.benmanes.caffeine.cache.AsyncCacheLoader cacheLoader) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the specific partitionvoid
Creates a snapshot of the current state of the storage if the blob transfer feature is enabled via the store configurationvoid
delete
(byte[] key) Delete a key from the partition databasevoid
drop()
Drop when it is not required anymore.byte[]
get
(byte[] key) Get a value from the partition databasebyte[]
get
(ByteBuffer key) <K,
V> V get
(K key) Get a Value from the partition databasevoid
getByKeyPrefix
(byte[] keyPrefix, BytesStreamingCallback callback) Populate provided callback with key-value pairs from the partition database where the keys have provided prefix.long
Get the partition database size in bytesvoid
put
(byte[] key, byte[] value) Puts a value into the partition databasevoid
put
(byte[] key, ByteBuffer value) <K,
V> void put
(K key, V value) sync()
Sync current database.boolean
verifyConfig
(StoragePartitionConfig storagePartitionConfig) Check whether current storage partition verifyConfig the given partition configMethods inherited from class com.linkedin.davinci.store.AbstractStoragePartition
beginBatchWrite, checkDatabaseIntegrity, deleteWithReplicationMetadata, endBatchWrite, get, getIterator, getPartitionId, getReplicationMetadata, getRmdByteUsage, putReplicationMetadata, putWithReplicationMetadata, putWithReplicationMetadata, reopen, validateBatchIngestion
-
Constructor Details
-
VeniceStoreCacheStoragePartition
public VeniceStoreCacheStoragePartition(Integer partitionId, ObjectCacheConfig cacheConfig, org.apache.avro.Schema keySchema, com.github.benmanes.caffeine.cache.AsyncCacheLoader cacheLoader) -
VeniceStoreCacheStoragePartition
public VeniceStoreCacheStoragePartition(Integer partitionId, ObjectCacheConfig cacheConfig, RecordDeserializer keyRecordDeserializer, com.github.benmanes.caffeine.cache.AsyncCacheLoader cacheLoader)
-
-
Method Details
-
put
public void put(byte[] key, byte[] value) Description copied from class:AbstractStoragePartition
Puts a value into the partition database- Specified by:
put
in classAbstractStoragePartition
-
put
- Specified by:
put
in classAbstractStoragePartition
-
put
public <K,V> void put(K key, V value) - Specified by:
put
in classAbstractStoragePartition
-
get
public byte[] get(byte[] key) Description copied from class:AbstractStoragePartition
Get a value from the partition database- Specified by:
get
in classAbstractStoragePartition
- Parameters:
key
- key to be retrieved- Returns:
- null if the key does not exist, byte[] value if it exists.
-
get
public <K,V> V get(K key) Description copied from class:AbstractStoragePartition
Get a Value from the partition database- Specified by:
get
in classAbstractStoragePartition
- Type Parameters:
K
- the type for KeyV
- the type for the return value- Parameters:
key
- key to be retrieved- Returns:
- null if the key does not exist, V value if it exists
-
get
- Specified by:
get
in classAbstractStoragePartition
-
getByKeyPrefix
Description copied from class:AbstractStoragePartition
Populate provided callback with key-value pairs from the partition database where the keys have provided prefix. If prefix is null, callback will be populated will all key-value pairs from the partition database.- Specified by:
getByKeyPrefix
in classAbstractStoragePartition
-
delete
public void delete(byte[] key) Description copied from class:AbstractStoragePartition
Delete a key from the partition database- Specified by:
delete
in classAbstractStoragePartition
-
sync
Description copied from class:AbstractStoragePartition
Sync current database.- Specified by:
sync
in classAbstractStoragePartition
- Returns:
- Database related info, which is required to be checkpointed.
-
drop
public void drop()Description copied from class:AbstractStoragePartition
Drop when it is not required anymore.- Specified by:
drop
in classAbstractStoragePartition
-
close
public void close()Description copied from class:AbstractStoragePartition
Close the specific partition- Specified by:
close
in classAbstractStoragePartition
-
verifyConfig
Description copied from class:AbstractStoragePartition
Check whether current storage partition verifyConfig the given partition config- Specified by:
verifyConfig
in classAbstractStoragePartition
- Returns:
-
getPartitionSizeInBytes
public long getPartitionSizeInBytes()Description copied from class:AbstractStoragePartition
Get the partition database size in bytes- Specified by:
getPartitionSizeInBytes
in classAbstractStoragePartition
- Returns:
- partition database size
-
getVeniceCache
-
createSnapshot
public void createSnapshot()Description copied from class:AbstractStoragePartition
Creates a snapshot of the current state of the storage if the blob transfer feature is enabled via the store configuration- Specified by:
createSnapshot
in classAbstractStoragePartition
-