K - the type of the keyV - the type of the valuepublic class RocksDbTableDescriptor<K,V> extends org.apache.samza.table.descriptors.LocalTableDescriptor<K,V,RocksDbTableDescriptor<K,V>>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONTAINER_CACHE_SIZE_BYTES |
static java.lang.String |
CONTAINER_WRITE_BUFFER_SIZE_BYTES |
static java.lang.String |
OBJECT_CACHE_SIZE |
static java.lang.String |
ROCKSDB_BLOCK_SIZE_BYTES |
static java.lang.String |
ROCKSDB_COMPACTION_STYLE |
static java.lang.String |
ROCKSDB_COMPRESSION |
static java.lang.String |
ROCKSDB_KEEP_LOG_FILE_NUM |
static java.lang.String |
ROCKSDB_MAX_LOG_FILE_SIZE_BYTES |
static java.lang.String |
ROCKSDB_NUM_WRITE_BUFFERS |
static java.lang.String |
ROCKSDB_TTL_MS |
static java.lang.String |
WRITE_BATCH_SIZE |
| Constructor and Description |
|---|
RocksDbTableDescriptor(java.lang.String tableId,
org.apache.samza.serializers.KVSerde<K,V> serde)
Constructs a table descriptor instance
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getProviderFactoryClassName() |
java.util.Map<java.lang.String,java.lang.String> |
toConfig(org.apache.samza.config.Config jobConfig) |
RocksDbTableDescriptor<K,V> |
withBlockSize(int blockSize)
If compression is enabled, RocksDB groups approximately this many uncompressed
bytes into one compressed block.
|
RocksDbTableDescriptor<K,V> |
withCacheSize(int cacheSize)
The size of RocksDB's block cache in bytes, per container.
|
RocksDbTableDescriptor<K,V> |
withCompactionStyle(java.lang.String compactionStyle)
This property controls the compaction style that RocksDB will employ when compacting
its levels.
|
RocksDbTableDescriptor<K,V> |
withCompressionType(java.lang.String compressionType)
Controls whether RocksDB should compress data on disk and in the block cache.
|
RocksDbTableDescriptor<K,V> |
withMaxLogFileSize(int maxLogFileSize)
The maximum size in bytes of the RocksDB LOG file before it is rotated.
|
RocksDbTableDescriptor<K,V> |
withNumLogFilesToKeep(int numLogFilesToKeep)
The number of RocksDB LOG files (including rotated LOG.old.* files) to keep.
|
RocksDbTableDescriptor<K,V> |
withNumWriteBuffers(int numWriteBuffers)
Configures the
number of write buffers that a RocksDB store uses.
|
RocksDbTableDescriptor |
withObjectCacheSize(int objectCacheSize)
Samza maintains an additional cache in front of RocksDB for frequently-accessed objects.
|
RocksDbTableDescriptor<K,V> |
withTtl(long ttl)
The time-to-live of the store.
|
RocksDbTableDescriptor |
withWriteBatchSize(int writeBatchSize)
For better write performance, the storage engine buffers writes and applies them to the
underlying store in a batch.
|
RocksDbTableDescriptor<K,V> |
withWriteBufferSize(int writeBufferSize)
The amount of memory (in bytes) that RocksDB uses for buffering writes before they are
written to disk, per container.
|
addStoreConfig, getSerde, getSideInputs, validate, withChangelogEnabled, withChangelogReplicationFactor, withChangelogStream, withSideInputs, withSideInputsProcessorpublic static final java.lang.String WRITE_BATCH_SIZE
public static final java.lang.String OBJECT_CACHE_SIZE
public static final java.lang.String CONTAINER_CACHE_SIZE_BYTES
public static final java.lang.String CONTAINER_WRITE_BUFFER_SIZE_BYTES
public static final java.lang.String ROCKSDB_COMPRESSION
public static final java.lang.String ROCKSDB_BLOCK_SIZE_BYTES
public static final java.lang.String ROCKSDB_TTL_MS
public static final java.lang.String ROCKSDB_COMPACTION_STYLE
public static final java.lang.String ROCKSDB_NUM_WRITE_BUFFERS
public static final java.lang.String ROCKSDB_MAX_LOG_FILE_SIZE_BYTES
public static final java.lang.String ROCKSDB_KEEP_LOG_FILE_NUM
public RocksDbTableDescriptor withWriteBatchSize(int writeBatchSize)
withObjectCacheSize(int).
Default value is 500.
Refer to stores.store-name.write.batch.size in Samza configuration guide
writeBatchSize - write batch sizepublic RocksDbTableDescriptor withObjectCacheSize(int objectCacheSize)
withCacheSize(int)), which caches
serialized objects. This property determines the number of objects to keep in Samza's
cache, per task instance. This same cache is also used for write buffering
(see withWriteBatchSize(int)). A value of 0 disables all caching and batching.
Default value is 1,000.
Refer to stores.store-name.object.cache.size in Samza configuration guide
objectCacheSize - the object cache sizepublic RocksDbTableDescriptor<K,V> withCacheSize(int cacheSize)
Default value is 104,857,600.
Refer to stores.store-name.container.cache.size.bytes in Samza configuration guide
cacheSize - the cache size in bytespublic RocksDbTableDescriptor<K,V> withWriteBufferSize(int writeBufferSize)
Default value is 33,554,432.
Refer to stores.store-name.container.write.buffer.size.bytes in Samza configuration guide
writeBufferSize - the write buffer size in bytespublic RocksDbTableDescriptor<K,V> withCompressionType(java.lang.String compressionType)
Default value is snappy.
Refer to stores.store-name.rocksdb.compression in Samza configuration guide
compressionType - the compression typepublic RocksDbTableDescriptor<K,V> withBlockSize(int blockSize)
Default value is 4,096.
Refer to stores.store-name.rocksdb.block.size.bytes in Samza configuration guide
blockSize - the block size in bytespublic RocksDbTableDescriptor<K,V> withTtl(long ttl)
Refer to stores.store-name.rocksdb.ttl.ms in Samza configuration guide
ttl - the time to live in millisecondspublic RocksDbTableDescriptor<K,V> withCompactionStyle(java.lang.String compactionStyle)
Default value is universal.
Refer to stores.store-name.rocksdb.compaction.style in Samza configuration guide
compactionStyle - the compaction stylepublic RocksDbTableDescriptor<K,V> withNumWriteBuffers(int numWriteBuffers)
Default value is 3.
Refer to stores.store-name.rocksdb.num.write.buffers in Samza configuration guide
numWriteBuffers - the number of write bufferspublic RocksDbTableDescriptor<K,V> withMaxLogFileSize(int maxLogFileSize)
Default value is 67,108,864.
Refer to stores.store-name.rocksdb.max.log.file.size.bytes in Samza configuration guide
maxLogFileSize - the maximal log file size in bytespublic RocksDbTableDescriptor<K,V> withNumLogFilesToKeep(int numLogFilesToKeep)
Default value is 2.
Refer to stores.store-name.rocksdb.keep.log.file.num in Samza configuration guide
numLogFilesToKeep - the number of log files to keeppublic java.lang.String getProviderFactoryClassName()
getProviderFactoryClassName in class org.apache.samza.table.descriptors.BaseTableDescriptor<K,V,RocksDbTableDescriptor<K,V>>public java.util.Map<java.lang.String,java.lang.String> toConfig(org.apache.samza.config.Config jobConfig)
toConfig in interface org.apache.samza.table.descriptors.TableDescriptor<K,V,RocksDbTableDescriptor<K,V>>toConfig in class org.apache.samza.table.descriptors.LocalTableDescriptor<K,V,RocksDbTableDescriptor<K,V>>