1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
8 * The config for plain table sst format.
10 * BlockBasedTable is a RocksDB's default SST file format.
12 //TODO(AR) should be renamed BlockBasedTableOptions
13 public class BlockBasedTableConfig
extends TableFormatConfig
{
15 public BlockBasedTableConfig() {
16 //TODO(AR) flushBlockPolicyFactory
17 cacheIndexAndFilterBlocks
= false;
18 cacheIndexAndFilterBlocksWithHighPriority
= false;
19 pinL0FilterAndIndexBlocksInCache
= false;
20 pinTopLevelIndexAndFilter
= true;
21 indexType
= IndexType
.kBinarySearch
;
22 dataBlockIndexType
= DataBlockIndexType
.kDataBlockBinarySearch
;
23 dataBlockHashTableUtilRatio
= 0.75;
24 checksumType
= ChecksumType
.kCRC32c
;
27 persistentCache
= null;
28 blockCacheCompressed
= null;
30 blockSizeDeviation
= 10;
31 blockRestartInterval
= 16;
32 indexBlockRestartInterval
= 1;
33 metadataBlockSize
= 4096;
34 partitionFilters
= false;
35 useDeltaEncoding
= true;
37 wholeKeyFiltering
= true;
38 verifyCompression
= true;
39 readAmpBytesPerBit
= 0;
41 enableIndexCompression
= true;
44 // NOTE: ONLY used if blockCache == null
45 blockCacheSize
= 8 * 1024 * 1024;
46 blockCacheNumShardBits
= 0;
48 // NOTE: ONLY used if blockCacheCompressed == null
49 blockCacheCompressedSize
= 0;
50 blockCacheCompressedNumShardBits
= 0;
54 * Indicating if we'd put index/filter blocks to the block cache.
55 * If not specified, each "table reader" object will pre-load index/filter
56 * block during table initialization.
58 * @return if index and filter blocks should be put in block cache.
60 public boolean cacheIndexAndFilterBlocks() {
61 return cacheIndexAndFilterBlocks
;
65 * Indicating if we'd put index/filter blocks to the block cache.
66 * If not specified, each "table reader" object will pre-load index/filter
67 * block during table initialization.
69 * @param cacheIndexAndFilterBlocks and filter blocks should be put in block cache.
70 * @return the reference to the current config.
72 public BlockBasedTableConfig
setCacheIndexAndFilterBlocks(
73 final boolean cacheIndexAndFilterBlocks
) {
74 this.cacheIndexAndFilterBlocks
= cacheIndexAndFilterBlocks
;
79 * Indicates if index and filter blocks will be treated as high-priority in the block cache.
80 * See note below about applicability. If not specified, defaults to false.
82 * @return if index and filter blocks will be treated as high-priority.
84 public boolean cacheIndexAndFilterBlocksWithHighPriority() {
85 return cacheIndexAndFilterBlocksWithHighPriority
;
89 * If true, cache index and filter blocks with high priority. If set to true,
90 * depending on implementation of block cache, index and filter blocks may be
91 * less likely to be evicted than data blocks.
93 * @param cacheIndexAndFilterBlocksWithHighPriority if index and filter blocks
94 * will be treated as high-priority.
95 * @return the reference to the current config.
97 public BlockBasedTableConfig
setCacheIndexAndFilterBlocksWithHighPriority(
98 final boolean cacheIndexAndFilterBlocksWithHighPriority
) {
99 this.cacheIndexAndFilterBlocksWithHighPriority
= cacheIndexAndFilterBlocksWithHighPriority
;
104 * Indicating if we'd like to pin L0 index/filter blocks to the block cache.
105 If not specified, defaults to false.
107 * @return if L0 index and filter blocks should be pinned to the block cache.
109 public boolean pinL0FilterAndIndexBlocksInCache() {
110 return pinL0FilterAndIndexBlocksInCache
;
114 * Indicating if we'd like to pin L0 index/filter blocks to the block cache.
115 If not specified, defaults to false.
117 * @param pinL0FilterAndIndexBlocksInCache pin blocks in block cache
118 * @return the reference to the current config.
120 public BlockBasedTableConfig
setPinL0FilterAndIndexBlocksInCache(
121 final boolean pinL0FilterAndIndexBlocksInCache
) {
122 this.pinL0FilterAndIndexBlocksInCache
= pinL0FilterAndIndexBlocksInCache
;
127 * Indicates if top-level index and filter blocks should be pinned.
129 * @return if top-level index and filter blocks should be pinned.
131 public boolean pinTopLevelIndexAndFilter() {
132 return pinTopLevelIndexAndFilter
;
136 * If cacheIndexAndFilterBlocks is true and the below is true, then
137 * the top-level index of partitioned filter and index blocks are stored in
138 * the cache, but a reference is held in the "table reader" object so the
139 * blocks are pinned and only evicted from cache when the table reader is
140 * freed. This is not limited to l0 in LSM tree.
142 * @param pinTopLevelIndexAndFilter if top-level index and filter blocks should be pinned.
143 * @return the reference to the current config.
145 public BlockBasedTableConfig
setPinTopLevelIndexAndFilter(final boolean pinTopLevelIndexAndFilter
) {
146 this.pinTopLevelIndexAndFilter
= pinTopLevelIndexAndFilter
;
151 * Get the index type.
153 * @return the currently set index type
155 public IndexType
indexType() {
160 * Sets the index type to used with this table.
162 * @param indexType {@link org.rocksdb.IndexType} value
163 * @return the reference to the current option.
165 public BlockBasedTableConfig
setIndexType(
166 final IndexType indexType
) {
167 this.indexType
= indexType
;
172 * Get the data block index type.
174 * @return the currently set data block index type
176 public DataBlockIndexType
dataBlockIndexType() {
177 return dataBlockIndexType
;
181 * Sets the data block index type to used with this table.
183 * @param dataBlockIndexType {@link org.rocksdb.DataBlockIndexType} value
184 * @return the reference to the current option.
186 public BlockBasedTableConfig
setDataBlockIndexType(
187 final DataBlockIndexType dataBlockIndexType
) {
188 this.dataBlockIndexType
= dataBlockIndexType
;
193 * Get the #entries/#buckets. It is valid only when {@link #dataBlockIndexType()} is
194 * {@link DataBlockIndexType#kDataBlockBinaryAndHash}.
196 * @return the #entries/#buckets.
198 public double dataBlockHashTableUtilRatio() {
199 return dataBlockHashTableUtilRatio
;
203 * Set the #entries/#buckets. It is valid only when {@link #dataBlockIndexType()} is
204 * {@link DataBlockIndexType#kDataBlockBinaryAndHash}.
206 * @param dataBlockHashTableUtilRatio #entries/#buckets
207 * @return the reference to the current option.
209 public BlockBasedTableConfig
setDataBlockHashTableUtilRatio(
210 final double dataBlockHashTableUtilRatio
) {
211 this.dataBlockHashTableUtilRatio
= dataBlockHashTableUtilRatio
;
216 * Get the checksum type to be used with this table.
218 * @return the currently set checksum type
220 public ChecksumType
checksumType() {
227 * @param checksumType {@link org.rocksdb.ChecksumType} value.
228 * @return the reference to the current option.
230 public BlockBasedTableConfig
setChecksumType(
231 final ChecksumType checksumType
) {
232 this.checksumType
= checksumType
;
237 * Determine if the block cache is disabled.
239 * @return if block cache is disabled
241 public boolean noBlockCache() {
246 * Disable block cache. If this is set to true,
247 * then no block cache should be used, and the {@link #setBlockCache(Cache)}
248 * should point to a {@code null} object.
252 * @param noBlockCache if use block cache
253 * @return the reference to the current config.
255 public BlockBasedTableConfig
setNoBlockCache(final boolean noBlockCache
) {
256 this.noBlockCache
= noBlockCache
;
261 * Use the specified cache for blocks.
262 * When not null this take precedence even if the user sets a block cache size.
264 * {@link org.rocksdb.Cache} should not be disposed before options instances
265 * using this cache is disposed.
267 * {@link org.rocksdb.Cache} instance can be re-used in multiple options
270 * @param blockCache {@link org.rocksdb.Cache} Cache java instance
273 * @return the reference to the current config.
275 public BlockBasedTableConfig
setBlockCache(final Cache blockCache
) {
276 this.blockCache
= blockCache
;
281 * Use the specified persistent cache.
283 * If {@code !null} use the specified cache for pages read from device,
284 * otherwise no page cache is used.
286 * @param persistentCache the persistent cache
288 * @return the reference to the current config.
290 public BlockBasedTableConfig
setPersistentCache(
291 final PersistentCache persistentCache
) {
292 this.persistentCache
= persistentCache
;
297 * Use the specified cache for compressed blocks.
299 * If {@code null}, RocksDB will not use a compressed block cache.
301 * Note: though it looks similar to {@link #setBlockCache(Cache)}, RocksDB
302 * doesn't put the same type of object there.
304 * {@link org.rocksdb.Cache} should not be disposed before options instances
305 * using this cache is disposed.
307 * {@link org.rocksdb.Cache} instance can be re-used in multiple options
310 * @param blockCacheCompressed {@link org.rocksdb.Cache} Cache java instance
313 * @return the reference to the current config.
315 public BlockBasedTableConfig
setBlockCacheCompressed(
316 final Cache blockCacheCompressed
) {
317 this.blockCacheCompressed
= blockCacheCompressed
;
322 * Get the approximate size of user data packed per block.
324 * @return block size in bytes
326 public long blockSize() {
331 * Approximate size of user data packed per block. Note that the
332 * block size specified here corresponds to uncompressed data. The
333 * actual size of the unit read from disk may be smaller if
334 * compression is enabled. This parameter can be changed dynamically.
337 * @param blockSize block size in bytes
338 * @return the reference to the current config.
340 public BlockBasedTableConfig
setBlockSize(final long blockSize
) {
341 this.blockSize
= blockSize
;
346 * @return the hash table ratio.
348 public int blockSizeDeviation() {
349 return blockSizeDeviation
;
353 * This is used to close a block before it reaches the configured
354 * {@link #blockSize()}. If the percentage of free space in the current block
355 * is less than this specified number and adding a new record to the block
356 * will exceed the configured block size, then this block will be closed and
357 * the new record will be written to the next block.
361 * @param blockSizeDeviation the deviation to block size allowed
362 * @return the reference to the current config.
364 public BlockBasedTableConfig
setBlockSizeDeviation(
365 final int blockSizeDeviation
) {
366 this.blockSizeDeviation
= blockSizeDeviation
;
371 * Get the block restart interval.
373 * @return block restart interval
375 public int blockRestartInterval() {
376 return blockRestartInterval
;
380 * Set the block restart interval.
382 * @param restartInterval block restart interval.
383 * @return the reference to the current config.
385 public BlockBasedTableConfig
setBlockRestartInterval(
386 final int restartInterval
) {
387 blockRestartInterval
= restartInterval
;
392 * Get the index block restart interval.
394 * @return index block restart interval
396 public int indexBlockRestartInterval() {
397 return indexBlockRestartInterval
;
401 * Set the index block restart interval
403 * @param restartInterval index block restart interval.
404 * @return the reference to the current config.
406 public BlockBasedTableConfig
setIndexBlockRestartInterval(
407 final int restartInterval
) {
408 indexBlockRestartInterval
= restartInterval
;
413 * Get the block size for partitioned metadata.
415 * @return block size for partitioned metadata.
417 public long metadataBlockSize() {
418 return metadataBlockSize
;
422 * Set block size for partitioned metadata.
424 * @param metadataBlockSize Partitioned metadata block size.
425 * @return the reference to the current config.
427 public BlockBasedTableConfig
setMetadataBlockSize(
428 final long metadataBlockSize
) {
429 this.metadataBlockSize
= metadataBlockSize
;
434 * Indicates if we're using partitioned filters.
436 * @return if we're using partition filters.
438 public boolean partitionFilters() {
439 return partitionFilters
;
443 * Use partitioned full filters for each SST file. This option is incompatible
444 * with block-based filters.
448 * @param partitionFilters use partition filters.
449 * @return the reference to the current config.
451 public BlockBasedTableConfig
setPartitionFilters(final boolean partitionFilters
) {
452 this.partitionFilters
= partitionFilters
;
457 * Determine if delta encoding is being used to compress block keys.
459 * @return true if delta encoding is enabled, false otherwise.
461 public boolean useDeltaEncoding() {
462 return useDeltaEncoding
;
466 * Use delta encoding to compress keys in blocks.
468 * NOTE: {@link ReadOptions#pinData()} requires this option to be disabled.
472 * @param useDeltaEncoding true to enable delta encoding
474 * @return the reference to the current config.
476 public BlockBasedTableConfig
setUseDeltaEncoding(
477 final boolean useDeltaEncoding
) {
478 this.useDeltaEncoding
= useDeltaEncoding
;
483 * Use the specified filter policy to reduce disk reads.
485 * {@link org.rocksdb.Filter} should not be disposed before options instances
486 * using this filter is disposed. If {@link Filter#dispose()} function is not
487 * called, then filter object will be GC'd automatically.
489 * {@link org.rocksdb.Filter} instance can be re-used in multiple options
492 * @param filterPolicy {@link org.rocksdb.Filter} Filter Policy java instance.
493 * @return the reference to the current config.
495 public BlockBasedTableConfig
setFilterPolicy(
496 final Filter filterPolicy
) {
497 this.filterPolicy
= filterPolicy
;
502 * @deprecated Use {@link #setFilterPolicy(Filter)}
505 public BlockBasedTableConfig
setFilter(
506 final Filter filter
) {
507 return setFilterPolicy(filter
);
511 * Determine if whole keys as opposed to prefixes are placed in the filter.
513 * @return if whole key filtering is enabled
515 public boolean wholeKeyFiltering() {
516 return wholeKeyFiltering
;
520 * If true, place whole keys in the filter (not just prefixes).
521 * This must generally be true for gets to be efficient.
524 * @param wholeKeyFiltering if enable whole key filtering
525 * @return the reference to the current config.
527 public BlockBasedTableConfig
setWholeKeyFiltering(
528 final boolean wholeKeyFiltering
) {
529 this.wholeKeyFiltering
= wholeKeyFiltering
;
534 * Returns true when compression verification is enabled.
536 * See {@link #setVerifyCompression(boolean)}.
538 * @return true if compression verification is enabled.
540 public boolean verifyCompression() {
541 return verifyCompression
;
545 * Verify that decompressing the compressed block gives back the input. This
546 * is a verification mode that we use to detect bugs in compression
549 * @param verifyCompression true to enable compression verification.
551 * @return the reference to the current config.
553 public BlockBasedTableConfig
setVerifyCompression(
554 final boolean verifyCompression
) {
555 this.verifyCompression
= verifyCompression
;
560 * Get the Read amplification bytes per-bit.
562 * See {@link #setReadAmpBytesPerBit(int)}.
564 * @return the bytes per-bit.
566 public int readAmpBytesPerBit() {
567 return readAmpBytesPerBit
;
571 * Set the Read amplification bytes per-bit.
573 * If used, For every data block we load into memory, we will create a bitmap
574 * of size ((block_size / `read_amp_bytes_per_bit`) / 8) bytes. This bitmap
575 * will be used to figure out the percentage we actually read of the blocks.
577 * When this feature is used Tickers::READ_AMP_ESTIMATE_USEFUL_BYTES and
578 * Tickers::READ_AMP_TOTAL_READ_BYTES can be used to calculate the
579 * read amplification using this formula
580 * (READ_AMP_TOTAL_READ_BYTES / READ_AMP_ESTIMATE_USEFUL_BYTES)
582 * value => memory usage (percentage of loaded blocks memory)
589 * Note: This number must be a power of 2, if not it will be sanitized
590 * to be the next lowest power of 2, for example a value of 7 will be
591 * treated as 4, a value of 19 will be treated as 16.
593 * Default: 0 (disabled)
595 * @param readAmpBytesPerBit the bytes per-bit
597 * @return the reference to the current config.
599 public BlockBasedTableConfig
setReadAmpBytesPerBit(final int readAmpBytesPerBit
) {
600 this.readAmpBytesPerBit
= readAmpBytesPerBit
;
605 * Get the format version.
606 * See {@link #setFormatVersion(int)}.
608 * @return the currently configured format version.
610 public int formatVersion() {
611 return formatVersion
;
615 * <p>We currently have five versions:</p>
618 * <li><strong>0</strong> - This version is currently written
619 * out by all RocksDB's versions by default. Can be read by really old
620 * RocksDB's. Doesn't support changing checksum (default is CRC32).</li>
621 * <li><strong>1</strong> - Can be read by RocksDB's versions since 3.0.
622 * Supports non-default checksum, like xxHash. It is written by RocksDB when
623 * BlockBasedTableOptions::checksum is something other than kCRC32c. (version
624 * 0 is silently upconverted)</li>
625 * <li><strong>2</strong> - Can be read by RocksDB's versions since 3.10.
626 * Changes the way we encode compressed blocks with LZ4, BZip2 and Zlib
627 * compression. If you don't plan to run RocksDB before version 3.10,
628 * you should probably use this.</li>
629 * <li><strong>3</strong> - Can be read by RocksDB's versions since 5.15. Changes the way we
630 * encode the keys in index blocks. If you don't plan to run RocksDB before
631 * version 5.15, you should probably use this.
632 * This option only affects newly written tables. When reading existing
633 * tables, the information about version is read from the footer.</li>
634 * <li><strong>4</strong> - Can be read by RocksDB's versions since 5.16. Changes the way we
635 * encode the values in index blocks. If you don't plan to run RocksDB before
636 * version 5.16 and you are using index_block_restart_interval > 1, you should
637 * probably use this as it would reduce the index size.</li>
639 * <p> This option only affects newly written tables. When reading existing
640 * tables, the information about version is read from the footer.</p>
642 * @param formatVersion integer representing the version to be used.
644 * @return the reference to the current option.
646 public BlockBasedTableConfig
setFormatVersion(
647 final int formatVersion
) {
648 assert(formatVersion
>= 0 && formatVersion
<= 4);
649 this.formatVersion
= formatVersion
;
654 * Determine if index compression is enabled.
656 * See {@link #setEnableIndexCompression(boolean)}.
658 * @return true if index compression is enabled, false otherwise
660 public boolean enableIndexCompression() {
661 return enableIndexCompression
;
665 * Store index blocks on disk in compressed format.
667 * Changing this option to false will avoid the overhead of decompression
668 * if index blocks are evicted and read back.
670 * @param enableIndexCompression true to enable index compression,
673 * @return the reference to the current option.
675 public BlockBasedTableConfig
setEnableIndexCompression(
676 final boolean enableIndexCompression
) {
677 this.enableIndexCompression
= enableIndexCompression
;
682 * Determines whether data blocks are aligned on the lesser of page size
685 * @return true if data blocks are aligned on the lesser of page size
688 public boolean blockAlign() {
693 * Set whether data blocks should be aligned on the lesser of page size
696 * @param blockAlign true to align data blocks on the lesser of page size
699 * @return the reference to the current option.
701 public BlockBasedTableConfig
setBlockAlign(final boolean blockAlign
) {
702 this.blockAlign
= blockAlign
;
708 * Get the size of the cache in bytes that will be used by RocksDB.
710 * @return block cache size in bytes
713 public long blockCacheSize() {
714 return blockCacheSize
;
718 * Set the size of the cache in bytes that will be used by RocksDB.
719 * If cacheSize is non-positive, then cache will not be used.
722 * @param blockCacheSize block cache size in bytes
723 * @return the reference to the current config.
725 * @deprecated Use {@link #setBlockCache(Cache)}.
728 public BlockBasedTableConfig
setBlockCacheSize(final long blockCacheSize
) {
729 this.blockCacheSize
= blockCacheSize
;
734 * Returns the number of shard bits used in the block cache.
735 * The resulting number of shards would be 2 ^ (returned value).
736 * Any negative number means use default settings.
738 * @return the number of shard bits used in the block cache.
741 public int cacheNumShardBits() {
742 return blockCacheNumShardBits
;
746 * Controls the number of shards for the block cache.
747 * This is applied only if cacheSize is set to non-negative.
749 * @param blockCacheNumShardBits the number of shard bits. The resulting
750 * number of shards would be 2 ^ numShardBits. Any negative
751 * number means use default settings."
752 * @return the reference to the current option.
754 * @deprecated Use {@link #setBlockCache(Cache)}.
757 public BlockBasedTableConfig
setCacheNumShardBits(
758 final int blockCacheNumShardBits
) {
759 this.blockCacheNumShardBits
= blockCacheNumShardBits
;
764 * Size of compressed block cache. If 0, then block_cache_compressed is set
767 * @return size of compressed block cache.
770 public long blockCacheCompressedSize() {
771 return blockCacheCompressedSize
;
775 * Size of compressed block cache. If 0, then block_cache_compressed is set
778 * @param blockCacheCompressedSize of compressed block cache.
779 * @return the reference to the current config.
781 * @deprecated Use {@link #setBlockCacheCompressed(Cache)}.
784 public BlockBasedTableConfig
setBlockCacheCompressedSize(
785 final long blockCacheCompressedSize
) {
786 this.blockCacheCompressedSize
= blockCacheCompressedSize
;
791 * Controls the number of shards for the block compressed cache.
792 * This is applied only if blockCompressedCacheSize is set to non-negative.
794 * @return numShardBits the number of shard bits. The resulting
795 * number of shards would be 2 ^ numShardBits. Any negative
796 * number means use default settings.
799 public int blockCacheCompressedNumShardBits() {
800 return blockCacheCompressedNumShardBits
;
804 * Controls the number of shards for the block compressed cache.
805 * This is applied only if blockCompressedCacheSize is set to non-negative.
807 * @param blockCacheCompressedNumShardBits the number of shard bits. The resulting
808 * number of shards would be 2 ^ numShardBits. Any negative
809 * number means use default settings."
810 * @return the reference to the current option.
812 * @deprecated Use {@link #setBlockCacheCompressed(Cache)}.
815 public BlockBasedTableConfig
setBlockCacheCompressedNumShardBits(
816 final int blockCacheCompressedNumShardBits
) {
817 this.blockCacheCompressedNumShardBits
= blockCacheCompressedNumShardBits
;
822 * Influence the behavior when kHashSearch is used.
823 * if false, stores a precise prefix to block range mapping
824 * if true, does not store prefix and allows prefix hash collision
825 * (less memory consumption)
827 * @return if hash collisions should be allowed.
829 * @deprecated This option is now deprecated. No matter what value it
830 * is set to, it will behave as
831 * if {@link #hashIndexAllowCollision()} == true.
834 public boolean hashIndexAllowCollision() {
839 * Influence the behavior when kHashSearch is used.
840 * if false, stores a precise prefix to block range mapping
841 * if true, does not store prefix and allows prefix hash collision
842 * (less memory consumption)
844 * @param hashIndexAllowCollision points out if hash collisions should be allowed.
846 * @return the reference to the current config.
848 * @deprecated This option is now deprecated. No matter what value it
849 * is set to, it will behave as
850 * if {@link #hashIndexAllowCollision()} == true.
853 public BlockBasedTableConfig
setHashIndexAllowCollision(
854 final boolean hashIndexAllowCollision
) {
859 @Override protected long newTableFactoryHandle() {
860 final long filterPolicyHandle
;
861 if (filterPolicy
!= null) {
862 filterPolicyHandle
= filterPolicy
.nativeHandle_
;
864 filterPolicyHandle
= 0;
867 final long blockCacheHandle
;
868 if (blockCache
!= null) {
869 blockCacheHandle
= blockCache
.nativeHandle_
;
871 blockCacheHandle
= 0;
874 final long persistentCacheHandle
;
875 if (persistentCache
!= null) {
876 persistentCacheHandle
= persistentCache
.nativeHandle_
;
878 persistentCacheHandle
= 0;
881 final long blockCacheCompressedHandle
;
882 if (blockCacheCompressed
!= null) {
883 blockCacheCompressedHandle
= blockCacheCompressed
.nativeHandle_
;
885 blockCacheCompressedHandle
= 0;
888 return newTableFactoryHandle(cacheIndexAndFilterBlocks
,
889 cacheIndexAndFilterBlocksWithHighPriority
,
890 pinL0FilterAndIndexBlocksInCache
, pinTopLevelIndexAndFilter
,
891 indexType
.getValue(), dataBlockIndexType
.getValue(),
892 dataBlockHashTableUtilRatio
, checksumType
.getValue(), noBlockCache
,
893 blockCacheHandle
, persistentCacheHandle
, blockCacheCompressedHandle
,
894 blockSize
, blockSizeDeviation
, blockRestartInterval
,
895 indexBlockRestartInterval
, metadataBlockSize
, partitionFilters
,
896 useDeltaEncoding
, filterPolicyHandle
, wholeKeyFiltering
,
897 verifyCompression
, readAmpBytesPerBit
, formatVersion
,
898 enableIndexCompression
, blockAlign
,
899 blockCacheSize
, blockCacheNumShardBits
,
900 blockCacheCompressedSize
, blockCacheCompressedNumShardBits
);
903 private native long newTableFactoryHandle(
904 final boolean cacheIndexAndFilterBlocks
,
905 final boolean cacheIndexAndFilterBlocksWithHighPriority
,
906 final boolean pinL0FilterAndIndexBlocksInCache
,
907 final boolean pinTopLevelIndexAndFilter
,
908 final byte indexTypeValue
,
909 final byte dataBlockIndexTypeValue
,
910 final double dataBlockHashTableUtilRatio
,
911 final byte checksumTypeValue
,
912 final boolean noBlockCache
,
913 final long blockCacheHandle
,
914 final long persistentCacheHandle
,
915 final long blockCacheCompressedHandle
,
916 final long blockSize
,
917 final int blockSizeDeviation
,
918 final int blockRestartInterval
,
919 final int indexBlockRestartInterval
,
920 final long metadataBlockSize
,
921 final boolean partitionFilters
,
922 final boolean useDeltaEncoding
,
923 final long filterPolicyHandle
,
924 final boolean wholeKeyFiltering
,
925 final boolean verifyCompression
,
926 final int readAmpBytesPerBit
,
927 final int formatVersion
,
928 final boolean enableIndexCompression
,
929 final boolean blockAlign
,
931 @Deprecated final long blockCacheSize
,
932 @Deprecated final int blockCacheNumShardBits
,
934 @Deprecated final long blockCacheCompressedSize
,
935 @Deprecated final int blockCacheCompressedNumShardBits
938 //TODO(AR) flushBlockPolicyFactory
939 private boolean cacheIndexAndFilterBlocks
;
940 private boolean cacheIndexAndFilterBlocksWithHighPriority
;
941 private boolean pinL0FilterAndIndexBlocksInCache
;
942 private boolean pinTopLevelIndexAndFilter
;
943 private IndexType indexType
;
944 private DataBlockIndexType dataBlockIndexType
;
945 private double dataBlockHashTableUtilRatio
;
946 private ChecksumType checksumType
;
947 private boolean noBlockCache
;
948 private Cache blockCache
;
949 private PersistentCache persistentCache
;
950 private Cache blockCacheCompressed
;
951 private long blockSize
;
952 private int blockSizeDeviation
;
953 private int blockRestartInterval
;
954 private int indexBlockRestartInterval
;
955 private long metadataBlockSize
;
956 private boolean partitionFilters
;
957 private boolean useDeltaEncoding
;
958 private Filter filterPolicy
;
959 private boolean wholeKeyFiltering
;
960 private boolean verifyCompression
;
961 private int readAmpBytesPerBit
;
962 private int formatVersion
;
963 private boolean enableIndexCompression
;
964 private boolean blockAlign
;
966 // NOTE: ONLY used if blockCache == null
967 @Deprecated private long blockCacheSize
;
968 @Deprecated private int blockCacheNumShardBits
;
970 // NOTE: ONLY used if blockCacheCompressed == null
971 @Deprecated private long blockCacheCompressedSize
;
972 @Deprecated private int blockCacheCompressedNumShardBits
;