@@ -590,9 +590,9 @@ cdef class BlockBasedTableFactory(PyTableFactory):
590590 block_size_deviation = None ,
591591 block_restart_interval = None ,
592592 whole_key_filtering = None ,
593- enable_index_compression = False ,
594- cache_index_and_filter_blocks = False ,
595- format_version = 2 ,
593+ enable_index_compression = None ,
594+ cache_index_and_filter_blocks = None ,
595+ format_version = None ,
596596 ):
597597
598598 cdef table_factory.BlockBasedTableOptions table_options
@@ -609,18 +609,19 @@ cdef class BlockBasedTableFactory(PyTableFactory):
609609 else :
610610 table_options.hash_index_allow_collision = False
611611
612- if enable_index_compression:
613- table_options.enable_index_compression = True
614- else :
615- table_options.enable_index_compression = False
616-
617612 if checksum == ' crc32' :
618613 table_options.checksum = table_factory.kCRC32c
619614 elif checksum == ' xxhash' :
620615 table_options.checksum = table_factory.kxxHash
621616 else :
622617 raise ValueError (" Unknown checksum: %s " % checksum)
623618
619+ if block_cache is not None :
620+ table_options.block_cache = block_cache.get_cache()
621+
622+ if block_cache_compressed is not None :
623+ table_options.block_cache_compressed = block_cache_compressed.get_cache()
624+
624625 if no_block_cache:
625626 table_options.no_block_cache = True
626627 else :
@@ -642,18 +643,18 @@ cdef class BlockBasedTableFactory(PyTableFactory):
642643 else :
643644 table_options.whole_key_filtering = False
644645
646+ if enable_index_compression is not None :
647+ if enable_index_compression:
648+ table_options.enable_index_compression = True
649+ else :
650+ table_options.enable_index_compression = False
651+
645652 if cache_index_and_filter_blocks is not None :
646653 if cache_index_and_filter_blocks:
647654 table_options.cache_index_and_filter_blocks = True
648655 else :
649656 table_options.cache_index_and_filter_blocks = False
650657
651- if block_cache is not None :
652- table_options.block_cache = block_cache.get_cache()
653-
654- if block_cache_compressed is not None :
655- table_options.block_cache_compressed = block_cache_compressed.get_cache()
656-
657658 if format_version is not None :
658659 table_options.format_version = format_version
659660
@@ -911,6 +912,7 @@ cdef class ColumnFamilyOptions(object):
911912 self .copts.min_write_buffer_number_to_merge = value
912913
913914 property compression_opts :
915+ # FIXME: add missing fields.
914916 def __get__ (self ):
915917 cdef dict ret_ob = {}
916918
@@ -934,6 +936,8 @@ cdef class ColumnFamilyOptions(object):
934936 if ' max_dict_bytes' in value:
935937 copts.max_dict_bytes = value[' max_dict_bytes' ]
936938
939+ # FIXME: add bottommost_compression_opts
940+
937941 property compaction_pri :
938942 def __get__ (self ):
939943 if self .copts.compaction_pri == options.kByCompensatedSize:
@@ -1003,6 +1007,8 @@ cdef class ColumnFamilyOptions(object):
10031007 else :
10041008 raise TypeError (" Unknown compression: %s " % value)
10051009
1010+ # FIXME: add bottommost_compression
1011+
10061012 property max_compaction_bytes :
10071013 def __get__ (self ):
10081014 return self .copts.max_compaction_bytes
0 commit comments