diff --git a/ObjectiveRocks.xcodeproj/project.pbxproj b/ObjectiveRocks.xcodeproj/project.pbxproj index 3561598..91c2abb 100644 --- a/ObjectiveRocks.xcodeproj/project.pbxproj +++ b/ObjectiveRocks.xcodeproj/project.pbxproj @@ -31,6 +31,16 @@ 6221B7A81A629E2700D28BF5 /* RockDBTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6221B7A41A629B3600D28BF5 /* RockDBTests.swift */; }; 62269EDC1A1FF27A005A58D3 /* checkpoint.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62269EDB1A1FF27A005A58D3 /* checkpoint.cc */; }; 62269EE01A1FF2DC005A58D3 /* leveldb_options.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62269EDF1A1FF2DC005A58D3 /* leveldb_options.cc */; }; + 62297D521B6AC05000F72BF2 /* write_batch_with_index_internal.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62297D501B6AC05000F72BF2 /* write_batch_with_index_internal.cc */; }; + 62297D531B6AC05000F72BF2 /* write_batch_with_index_internal.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62297D501B6AC05000F72BF2 /* write_batch_with_index_internal.cc */; }; + 62297D561B6AC08B00F72BF2 /* event_logger_helpers.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62297D541B6AC08B00F72BF2 /* event_logger_helpers.cc */; }; + 62297D571B6AC08B00F72BF2 /* event_logger_helpers.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62297D541B6AC08B00F72BF2 /* event_logger_helpers.cc */; }; + 62297D5A1B6AC8CE00F72BF2 /* build_version.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62297D591B6AC8CE00F72BF2 /* build_version.cc */; }; + 62297D5B1B6AC8CE00F72BF2 /* build_version.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62297D591B6AC8CE00F72BF2 /* build_version.cc */; }; + 622DB8661A7EA1D40026C73F /* memenv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 622DB8651A7EA1CB0026C73F /* memenv.cc */; }; + 622DB8671A7EA1D50026C73F /* memenv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 622DB8651A7EA1CB0026C73F /* memenv.cc */; }; + 622DB8691A7EA2300026C73F /* thread_status_updater_debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62451ACC1A4BC85400AF11C8 /* thread_status_updater_debug.cc */; }; + 622DB86A1A7EA2310026C73F /* thread_status_updater_debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62451ACC1A4BC85400AF11C8 /* thread_status_updater_debug.cc */; }; 6231475B1A5AE18A0019D14A /* RocksDBEnv.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6231475A1A5AE18A0019D14A /* RocksDBEnv.mm */; }; 6231475C1A5AE18A0019D14A /* RocksDBEnv.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6231475A1A5AE18A0019D14A /* RocksDBEnv.mm */; }; 6231475F1A5AE3E30019D14A /* RocksDBThreadStatus.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6231475E1A5AE3E30019D14A /* RocksDBThreadStatus.mm */; }; @@ -54,6 +64,32 @@ 62456CBB1A66FE0500329F11 /* RocksDBMergeOperatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62456CBA1A66FE0500329F11 /* RocksDBMergeOperatorTests.swift */; }; 62456CBC1A66FE0500329F11 /* RocksDBMergeOperatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62456CBA1A66FE0500329F11 /* RocksDBMergeOperatorTests.swift */; }; 6249A3CC1A4A43CA00949B07 /* RocksDBTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6249A3CB1A4A43CA00949B07 /* RocksDBTests.mm */; }; + 624C22181AF01485006DC8FA /* xfunc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22171AF01485006DC8FA /* xfunc.cc */; }; + 624C22191AF01485006DC8FA /* xfunc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22171AF01485006DC8FA /* xfunc.cc */; }; + 624C221C1AF014E0006DC8FA /* thread_status_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C221B1AF014E0006DC8FA /* thread_status_impl.cc */; }; + 624C221D1AF014E0006DC8FA /* thread_status_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C221B1AF014E0006DC8FA /* thread_status_impl.cc */; }; + 624C22241AF015E4006DC8FA /* thread_status_util_debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22231AF015E4006DC8FA /* thread_status_util_debug.cc */; }; + 624C22251AF015E4006DC8FA /* thread_status_util_debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22231AF015E4006DC8FA /* thread_status_util_debug.cc */; }; + 624C22281AF0161E006DC8FA /* managed_iterator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22261AF0161E006DC8FA /* managed_iterator.cc */; }; + 624C22291AF0161E006DC8FA /* managed_iterator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22261AF0161E006DC8FA /* managed_iterator.cc */; }; + 624C22341AF016EE006DC8FA /* json_document_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22331AF016EE006DC8FA /* json_document_builder.cc */; }; + 624C22351AF016EE006DC8FA /* json_document_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22331AF016EE006DC8FA /* json_document_builder.cc */; }; + 624C22391AF0174B006DC8FA /* convenience.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22381AF0174B006DC8FA /* convenience.cc */; }; + 624C223A1AF0174B006DC8FA /* convenience.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22381AF0174B006DC8FA /* convenience.cc */; }; + 624C22411AF017B6006DC8FA /* event_logger.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C223D1AF017B6006DC8FA /* event_logger.cc */; }; + 624C22421AF017B6006DC8FA /* event_logger.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C223D1AF017B6006DC8FA /* event_logger.cc */; }; + 624C224B1AF01880006DC8FA /* slice.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C224A1AF01880006DC8FA /* slice.cc */; }; + 624C224C1AF01880006DC8FA /* slice.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C224A1AF01880006DC8FA /* slice.cc */; }; + 624C224E1AF0188C006DC8FA /* write_batch_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C224D1AF0188B006DC8FA /* write_batch_base.cc */; }; + 624C224F1AF0188C006DC8FA /* write_batch_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C224D1AF0188B006DC8FA /* write_batch_base.cc */; }; + 624C22571AF0195F006DC8FA /* flashcache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22551AF0195F006DC8FA /* flashcache.cc */; }; + 624C22581AF0195F006DC8FA /* flashcache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22551AF0195F006DC8FA /* flashcache.cc */; }; + 624C22601AF01C8E006DC8FA /* db_impl_experimental.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C225F1AF01C8E006DC8FA /* db_impl_experimental.cc */; }; + 624C22611AF01C8E006DC8FA /* db_impl_experimental.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C225F1AF01C8E006DC8FA /* db_impl_experimental.cc */; }; + 624C22631AF01CA7006DC8FA /* experimental.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22621AF01CA7006DC8FA /* experimental.cc */; }; + 624C22641AF01CA7006DC8FA /* experimental.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22621AF01CA7006DC8FA /* experimental.cc */; }; + 624C226B1AF02B1B006DC8FA /* instrumented_mutex.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22691AF02B1B006DC8FA /* instrumented_mutex.cc */; }; + 624C226C1AF02B1B006DC8FA /* instrumented_mutex.cc in Sources */ = {isa = PBXBuildFile; fileRef = 624C22691AF02B1B006DC8FA /* instrumented_mutex.cc */; }; 625F8F1C1A59C3EB007796BA /* RocksDBProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 625F8F1B1A59C3EB007796BA /* RocksDBProperties.m */; }; 625F8F1D1A59C3EB007796BA /* RocksDBProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 625F8F1B1A59C3EB007796BA /* RocksDBProperties.m */; }; 625F8F1F1A59C9B3007796BA /* RocksDBPropertiesTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 625F8F1E1A59C9B3007796BA /* RocksDBPropertiesTests.mm */; }; @@ -132,7 +168,6 @@ 62A8AF9B1A58C30E0069B4C8 /* hash_skiplist_rep.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B481A1ABA2000486C31 /* hash_skiplist_rep.cc */; }; 62A8AF9C1A58C30E0069B4C8 /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B5C1A1ABA2000486C31 /* logging.cc */; }; 62A8AF9D1A58C30E0069B4C8 /* compacted_db_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2BA31A1ABA2000486C31 /* compacted_db_impl.cc */; }; - 62A8AF9E1A58C30E0069B4C8 /* ldb_cmd.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B521A1ABA2000486C31 /* ldb_cmd.cc */; }; 62A8AF9F1A58C30E0069B4C8 /* stringappend.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2BB61A1ABA2000486C31 /* stringappend.cc */; }; 62A8AFA01A58C30E0069B4C8 /* geodb_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2BAE1A1ABA2000486C31 /* geodb_impl.cc */; }; 62A8AFA11A58C30E0069B4C8 /* file_indexer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE29411A1ABA1F00486C31 /* file_indexer.cc */; }; @@ -188,15 +223,12 @@ 62A8AFD31A58C30E0069B4C8 /* plain_table_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2ADC1A1ABA1F00486C31 /* plain_table_reader.cc */; }; 62A8AFD41A58C30E0069B4C8 /* RocksDBTableFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = 62F3ED5A1A574F7500EBFEBF /* RocksDBTableFactory.mm */; }; 62A8AFD51A58C30E0069B4C8 /* iterator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2AC41A1ABA1F00486C31 /* iterator.cc */; }; - 62A8AFD61A58C30E0069B4C8 /* build_version.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B1A1A1ABA2000486C31 /* build_version.cc */; }; 62A8AFD71A58C30E0069B4C8 /* meta_blocks.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2ACB1A1ABA1F00486C31 /* meta_blocks.cc */; }; 62A8AFD81A58C30E0069B4C8 /* block_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2A9D1A1ABA1F00486C31 /* block_builder.cc */; }; 62A8AFD91A58C30E0069B4C8 /* dynamic_bloom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B2E1A1ABA2000486C31 /* dynamic_bloom.cc */; }; 62A8AFDA1A58C30E0069B4C8 /* RocksDBBlockBasedTableOptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 62F3ED501A57175F00EBFEBF /* RocksDBBlockBasedTableOptions.mm */; }; 62A8AFDB1A58C30E0069B4C8 /* json_document.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2BAA1A1ABA2000486C31 /* json_document.cc */; }; - 62A8AFDC1A58C30E0069B4C8 /* memenv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE29AE1A1ABA1F00486C31 /* memenv.cc */; }; 62A8AFDD1A58C30E0069B4C8 /* RocksDBError.mm in Sources */ = {isa = PBXBuildFile; fileRef = 628B0CE91A1C104D0099C39B /* RocksDBError.mm */; }; - 62A8AFDE1A58C30E0069B4C8 /* testutil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B921A1ABA2000486C31 /* testutil.cc */; }; 62A8AFDF1A58C30E0069B4C8 /* RocksDBPrefixExtractor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6236E2561A4DD25000A81ED6 /* RocksDBPrefixExtractor.mm */; }; 62A8AFE01A58C30E0069B4C8 /* leveldb_options.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62269EDF1A1FF2DC005A58D3 /* leveldb_options.cc */; }; 62A8AFE11A58C30E0069B4C8 /* uint64add.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2BBD1A1ABA2000486C31 /* uint64add.cc */; }; @@ -253,7 +285,6 @@ 62A8B0141A58C30E0069B4C8 /* bloom_block.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2AA81A1ABA1F00486C31 /* bloom_block.cc */; }; 62A8B0151A58C30E0069B4C8 /* merger.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2AC71A1ABA1F00486C31 /* merger.cc */; }; 62A8B0161A58C30E0069B4C8 /* env_hdfs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B341A1ABA2000486C31 /* env_hdfs.cc */; }; - 62A8B0171A58C30E0069B4C8 /* blob_store.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B131A1ABA2000486C31 /* blob_store.cc */; }; 62A8B0181A58C30E0069B4C8 /* db_iter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE29371A1ABA1F00486C31 /* db_iter.cc */; }; 62A8B0191A58C30E0069B4C8 /* thread_status_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62451ACF1A4BC85400AF11C8 /* thread_status_util.cc */; }; 62A8B01A1A58C30E0069B4C8 /* mutable_cf_options.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B661A1ABA2000486C31 /* mutable_cf_options.cc */; }; @@ -335,7 +366,6 @@ 62EE2C341A1ABA2000486C31 /* write_batch.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE29901A1ABA1F00486C31 /* write_batch.cc */; }; 62EE2C371A1ABA2000486C31 /* write_controller.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE29941A1ABA1F00486C31 /* write_controller.cc */; }; 62EE2C3A1A1ABA2000486C31 /* write_thread.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE29981A1ABA1F00486C31 /* write_thread.cc */; }; - 62EE2C411A1ABA2000486C31 /* memenv.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE29AE1A1ABA1F00486C31 /* memenv.cc */; }; 62EE2CBD1A1ABA2000486C31 /* port_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2A7E1A1ABA1F00486C31 /* port_posix.cc */; }; 62EE2CBF1A1ABA2000486C31 /* stack_trace.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2A821A1ABA1F00486C31 /* stack_trace.cc */; }; 62EE2CC31A1ABA2000486C31 /* adaptive_table_factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2A8A1A1ABA1F00486C31 /* adaptive_table_factory.cc */; }; @@ -371,9 +401,7 @@ 62EE2D091A1ABA2000486C31 /* sst_dump.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B041A1ABA2000486C31 /* sst_dump.cc */; }; 62EE2D0A1A1ABA2000486C31 /* arena.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B061A1ABA2000486C31 /* arena.cc */; }; 62EE2D0D1A1ABA2100486C31 /* auto_roll_logger.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B0A1A1ABA2000486C31 /* auto_roll_logger.cc */; }; - 62EE2D131A1ABA2100486C31 /* blob_store.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B131A1ABA2000486C31 /* blob_store.cc */; }; 62EE2D161A1ABA2100486C31 /* bloom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B171A1ABA2000486C31 /* bloom.cc */; }; - 62EE2D191A1ABA2100486C31 /* build_version.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B1A1A1ABA2000486C31 /* build_version.cc */; }; 62EE2D1B1A1ABA2100486C31 /* cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B1D1A1ABA2000486C31 /* cache.cc */; }; 62EE2D1F1A1ABA2100486C31 /* coding.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B211A1ABA2000486C31 /* coding.cc */; }; 62EE2D221A1ABA2100486C31 /* comparator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B251A1ABA2000486C31 /* comparator.cc */; }; @@ -391,7 +419,6 @@ 62EE2D3E1A1ABA2100486C31 /* hash_skiplist_rep.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B481A1ABA2000486C31 /* hash_skiplist_rep.cc */; }; 62EE2D401A1ABA2100486C31 /* histogram.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B4B1A1ABA2000486C31 /* histogram.cc */; }; 62EE2D431A1ABA2100486C31 /* iostats_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B4F1A1ABA2000486C31 /* iostats_context.cc */; }; - 62EE2D451A1ABA2100486C31 /* ldb_cmd.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B521A1ABA2000486C31 /* ldb_cmd.cc */; }; 62EE2D471A1ABA2100486C31 /* ldb_tool.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B561A1ABA2000486C31 /* ldb_tool.cc */; }; 62EE2D491A1ABA2100486C31 /* log_buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B581A1ABA2000486C31 /* log_buffer.cc */; }; 62EE2D4C1A1ABA2100486C31 /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B5C1A1ABA2000486C31 /* logging.cc */; }; @@ -404,12 +431,10 @@ 62EE2D5E1A1ABA2100486C31 /* rate_limiter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B771A1ABA2000486C31 /* rate_limiter.cc */; }; 62EE2D621A1ABA2100486C31 /* skiplistrep.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B7D1A1ABA2000486C31 /* skiplistrep.cc */; }; 62EE2D641A1ABA2100486C31 /* slice.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B7F1A1ABA2000486C31 /* slice.cc */; }; - 62EE2D661A1ABA2100486C31 /* sst_dump_tool.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B811A1ABA2000486C31 /* sst_dump_tool.cc */; }; 62EE2D681A1ABA2100486C31 /* statistics.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B831A1ABA2000486C31 /* statistics.cc */; }; 62EE2D6A1A1ABA2100486C31 /* status.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B861A1ABA2000486C31 /* status.cc */; }; 62EE2D6C1A1ABA2100486C31 /* string_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B8A1A1ABA2000486C31 /* string_util.cc */; }; 62EE2D6E1A1ABA2100486C31 /* sync_point.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B8D1A1ABA2000486C31 /* sync_point.cc */; }; - 62EE2D711A1ABA2100486C31 /* testutil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B921A1ABA2000486C31 /* testutil.cc */; }; 62EE2D721A1ABA2100486C31 /* thread_local.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B941A1ABA2000486C31 /* thread_local.cc */; }; 62EE2D751A1ABA2100486C31 /* vectorrep.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B981A1ABA2000486C31 /* vectorrep.cc */; }; 62EE2D771A1ABA2100486C31 /* xxhash.cc in Sources */ = {isa = PBXBuildFile; fileRef = 62EE2B9A1A1ABA2000486C31 /* xxhash.cc */; }; @@ -570,6 +595,16 @@ 62269EDB1A1FF27A005A58D3 /* checkpoint.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = checkpoint.cc; sourceTree = ""; }; 62269EDD1A1FF2B2005A58D3 /* leveldb_options.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = leveldb_options.h; sourceTree = ""; }; 62269EDF1A1FF2DC005A58D3 /* leveldb_options.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = leveldb_options.cc; sourceTree = ""; }; + 62297D501B6AC05000F72BF2 /* write_batch_with_index_internal.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = write_batch_with_index_internal.cc; sourceTree = ""; }; + 62297D511B6AC05000F72BF2 /* write_batch_with_index_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = write_batch_with_index_internal.h; sourceTree = ""; }; + 62297D541B6AC08B00F72BF2 /* event_logger_helpers.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = event_logger_helpers.cc; sourceTree = ""; }; + 62297D551B6AC08B00F72BF2 /* event_logger_helpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = event_logger_helpers.h; sourceTree = ""; }; + 62297D591B6AC8CE00F72BF2 /* build_version.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = build_version.cc; sourceTree = ""; }; + 622DB85E1A7E9FFB0026C73F /* compression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = compression.h; sourceTree = ""; }; + 622DB8621A7EA1470026C73F /* fault_injection_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = fault_injection_test.cc; sourceTree = ""; }; + 622DB8641A7EA1CB0026C73F /* memenv_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = memenv_test.cc; sourceTree = ""; }; + 622DB8651A7EA1CB0026C73F /* memenv.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = memenv.cc; sourceTree = ""; }; + 622DB86B1A7EA2970026C73F /* slice_transform_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = slice_transform_test.cc; sourceTree = ""; }; 623147591A5AE18A0019D14A /* RocksDBEnv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RocksDBEnv.h; sourceTree = ""; }; 6231475A1A5AE18A0019D14A /* RocksDBEnv.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RocksDBEnv.mm; sourceTree = ""; }; 6231475D1A5AE3E30019D14A /* RocksDBThreadStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RocksDBThreadStatus.h; sourceTree = ""; }; @@ -614,6 +649,49 @@ 62456CBA1A66FE0500329F11 /* RocksDBMergeOperatorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RocksDBMergeOperatorTests.swift; sourceTree = ""; }; 6249A3CB1A4A43CA00949B07 /* RocksDBTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RocksDBTests.mm; sourceTree = ""; }; 6249A3CD1A4A6E4000949B07 /* RocksDBTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RocksDBTests.h; sourceTree = ""; }; + 624C22171AF01485006DC8FA /* xfunc.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xfunc.cc; sourceTree = ""; }; + 624C221A1AF0148B006DC8FA /* xfunc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = xfunc.h; sourceTree = ""; }; + 624C221B1AF014E0006DC8FA /* thread_status_impl.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = thread_status_impl.cc; sourceTree = ""; }; + 624C221E1AF01590006DC8FA /* dbench_monitor */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = dbench_monitor; sourceTree = ""; }; + 624C221F1AF01597006DC8FA /* pflag */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = pflag; sourceTree = ""; }; + 624C22231AF015E4006DC8FA /* thread_status_util_debug.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = thread_status_util_debug.cc; sourceTree = ""; }; + 624C22261AF0161E006DC8FA /* managed_iterator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = managed_iterator.cc; sourceTree = ""; }; + 624C22271AF0161E006DC8FA /* managed_iterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = managed_iterator.h; sourceTree = ""; }; + 624C222B1AF016B7006DC8FA /* COMMIT.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = COMMIT.md; sourceTree = ""; }; + 624C222C1AF016B7006DC8FA /* FbsonDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FbsonDocument.h; sourceTree = ""; }; + 624C222D1AF016B7006DC8FA /* FbsonJsonParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FbsonJsonParser.h; sourceTree = ""; }; + 624C222E1AF016B7006DC8FA /* FbsonStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FbsonStream.h; sourceTree = ""; }; + 624C222F1AF016B7006DC8FA /* FbsonUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FbsonUtil.h; sourceTree = ""; }; + 624C22301AF016B7006DC8FA /* FbsonWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FbsonWriter.h; sourceTree = ""; }; + 624C22331AF016EE006DC8FA /* json_document_builder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = json_document_builder.cc; sourceTree = ""; }; + 624C22361AF01719006DC8FA /* src.mk */ = {isa = PBXFileReference; lastKnownFileType = text; path = src.mk; sourceTree = ""; }; + 624C22381AF0174B006DC8FA /* convenience.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = convenience.cc; sourceTree = ""; }; + 624C223B1AF01773006DC8FA /* compact_files_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = compact_files_test.cc; sourceTree = ""; }; + 624C223C1AF017B6006DC8FA /* event_logger_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = event_logger_test.cc; sourceTree = ""; }; + 624C223D1AF017B6006DC8FA /* event_logger.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = event_logger.cc; sourceTree = ""; }; + 624C223E1AF017B6006DC8FA /* event_logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = event_logger.h; sourceTree = ""; }; + 624C22461AF017F1006DC8FA /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-all.cc"; sourceTree = ""; }; + 624C22471AF017F1006DC8FA /* gtest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gtest.h; sourceTree = ""; }; + 624C224A1AF01880006DC8FA /* slice.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = slice.cc; sourceTree = ""; }; + 624C224D1AF0188B006DC8FA /* write_batch_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = write_batch_base.cc; sourceTree = ""; }; + 624C22501AF018B6006DC8FA /* write_batch_base.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = write_batch_base.h; sourceTree = ""; }; + 624C22511AF0193B006DC8FA /* flashcache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = flashcache.h; path = utilities/flashcache.h; sourceTree = ""; }; + 624C22531AF0194E006DC8FA /* flashcache_ioctl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = flashcache_ioctl.h; sourceTree = ""; }; + 624C22551AF0195F006DC8FA /* flashcache.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flashcache.cc; sourceTree = ""; }; + 624C22561AF0195F006DC8FA /* flashcache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flashcache.h; sourceTree = ""; }; + 624C225A1AF01B1F006DC8FA /* USERS.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = USERS.md; sourceTree = ""; }; + 624C225B1AF01B3E006DC8FA /* check_format_compatible.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = check_format_compatible.sh; sourceTree = ""; }; + 624C225C1AF01B45006DC8FA /* generate_random_db.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = generate_random_db.sh; sourceTree = ""; }; + 624C225D1AF01B4C006DC8FA /* verify_random_db.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = verify_random_db.sh; sourceTree = ""; }; + 624C225E1AF01B7A006DC8FA /* memtable_list_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = memtable_list_test.cc; sourceTree = ""; }; + 624C225F1AF01C8E006DC8FA /* db_impl_experimental.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = db_impl_experimental.cc; path = rocksdb/db/db_impl_experimental.cc; sourceTree = SOURCE_ROOT; }; + 624C22621AF01CA7006DC8FA /* experimental.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = experimental.cc; path = rocksdb/db/experimental.cc; sourceTree = SOURCE_ROOT; }; + 624C22651AF01CE0006DC8FA /* experimental.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = experimental.h; sourceTree = ""; }; + 624C22661AF01D30006DC8FA /* benchmark_leveldb.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = benchmark_leveldb.sh; sourceTree = ""; }; + 624C22671AF01D36006DC8FA /* run_leveldb.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = run_leveldb.sh; sourceTree = ""; }; + 624C22681AF0217C006DC8FA /* thread_list_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = thread_list_test.cc; sourceTree = ""; }; + 624C22691AF02B1B006DC8FA /* instrumented_mutex.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = instrumented_mutex.cc; sourceTree = ""; }; + 624C226A1AF02B1B006DC8FA /* instrumented_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = instrumented_mutex.h; sourceTree = ""; }; 625F8F1A1A59C3EB007796BA /* RocksDBProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RocksDBProperties.h; sourceTree = ""; }; 625F8F1B1A59C3EB007796BA /* RocksDBProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RocksDBProperties.m; sourceTree = ""; }; 625F8F1E1A59C9B3007796BA /* RocksDBPropertiesTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RocksDBPropertiesTests.mm; sourceTree = ""; }; @@ -665,24 +743,8 @@ 62AEF9B91A1D5DA900E63E89 /* RocksDBOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RocksDBOptions.h; sourceTree = ""; }; 62AEF9BA1A1D5DA900E63E89 /* RocksDBOptions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RocksDBOptions.mm; sourceTree = ""; }; 62E173E51A6AD40E00A00DF3 /* RocksDBBackupTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RocksDBBackupTests.swift; sourceTree = ""; }; - 62EE28FE1A1ABA1F00486C31 /* .arcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .arcconfig; sourceTree = ""; }; - 62EE28FF1A1ABA1F00486C31 /* .clang-format */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ".clang-format"; sourceTree = ""; }; - 62EE29001A1ABA1F00486C31 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; - 62EE29011A1ABA1F00486C31 /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .travis.yml; sourceTree = ""; }; 62EE29021A1ABA1F00486C31 /* AUTHORS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AUTHORS; sourceTree = ""; }; - 62EE29041A1ABA1F00486C31 /* build_detect_platform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build_detect_platform; sourceTree = ""; }; - 62EE29051A1ABA1F00486C31 /* build_detect_version */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build_detect_version; sourceTree = ""; }; - 62EE29061A1ABA1F00486C31 /* fbcode_config.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = fbcode_config.sh; sourceTree = ""; }; - 62EE29071A1ABA1F00486C31 /* format-diff.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "format-diff.sh"; sourceTree = ""; }; - 62EE29091A1ABA1F00486C31 /* make_new_version.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = make_new_version.sh; sourceTree = ""; }; - 62EE290A1A1ABA1F00486C31 /* make_package.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = make_package.sh; sourceTree = ""; }; - 62EE290B1A1ABA1F00486C31 /* regression_build_test.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = regression_build_test.sh; sourceTree = ""; }; - 62EE290C1A1ABA1F00486C31 /* unity */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = unity; sourceTree = ""; }; - 62EE290D1A1ABA1F00486C31 /* valgrind_test.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = valgrind_test.sh; sourceTree = ""; }; - 62EE290E1A1ABA1F00486C31 /* version.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = version.sh; sourceTree = ""; }; 62EE290F1A1ABA1F00486C31 /* CONTRIBUTING.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = ""; }; - 62EE29111A1ABA1F00486C31 /* coverage_test.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = coverage_test.sh; sourceTree = ""; }; - 62EE29121A1ABA1F00486C31 /* parse_gcov_output.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = parse_gcov_output.py; sourceTree = ""; }; 62EE29141A1ABA1F00486C31 /* builder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builder.cc; sourceTree = ""; }; 62EE29151A1ABA1F00486C31 /* builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = builder.h; sourceTree = ""; }; 62EE29171A1ABA1F00486C31 /* c.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = c.cc; sourceTree = ""; }; @@ -733,7 +795,6 @@ 62EE29541A1ABA1F00486C31 /* internal_stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal_stats.h; sourceTree = ""; }; 62EE29561A1ABA1F00486C31 /* job_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = job_context.h; sourceTree = ""; }; 62EE29571A1ABA1F00486C31 /* listener_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listener_test.cc; sourceTree = ""; }; - 62EE29581A1ABA1F00486C31 /* log_and_apply_bench.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = log_and_apply_bench.cc; sourceTree = ""; }; 62EE29591A1ABA1F00486C31 /* log_format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log_format.h; sourceTree = ""; }; 62EE295A1A1ABA1F00486C31 /* log_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = log_reader.cc; sourceTree = ""; }; 62EE295B1A1ABA1F00486C31 /* log_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log_reader.h; sourceTree = ""; }; @@ -786,8 +847,6 @@ 62EE29A91A1ABA1F00486C31 /* env_hdfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = env_hdfs.h; sourceTree = ""; }; 62EE29AA1A1ABA1F00486C31 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; 62EE29AB1A1ABA1F00486C31 /* setup.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = setup.sh; sourceTree = ""; }; - 62EE29AE1A1ABA1F00486C31 /* memenv.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memenv.cc; sourceTree = ""; }; - 62EE29AF1A1ABA1F00486C31 /* memenv_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memenv_test.cc; sourceTree = ""; }; 62EE29B01A1ABA1F00486C31 /* HISTORY.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = HISTORY.md; sourceTree = ""; }; 62EE29B31A1ABA1F00486C31 /* c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = c.h; sourceTree = ""; }; 62EE29B41A1ABA1F00486C31 /* cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cache.h; sourceTree = ""; }; @@ -839,13 +898,6 @@ 62EE29E41A1ABA1F00486C31 /* utility_db.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utility_db.h; sourceTree = ""; }; 62EE29E51A1ABA1F00486C31 /* INSTALL.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = INSTALL.md; sourceTree = ""; }; 62EE2A6D1A1ABA1F00486C31 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; - 62EE2A6F1A1ABA1F00486C31 /* __phutil_library_init__.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = __phutil_library_init__.php; sourceTree = ""; }; - 62EE2A701A1ABA1F00486C31 /* __phutil_library_map__.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = __phutil_library_map__.php; sourceTree = ""; }; - 62EE2A721A1ABA1F00486C31 /* ArcanistCpplintLinter.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = ArcanistCpplintLinter.php; sourceTree = ""; }; - 62EE2A731A1ABA1F00486C31 /* cpplint.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = cpplint.py; sourceTree = ""; }; - 62EE2A741A1ABA1F00486C31 /* FbcodeCppLinter.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = FbcodeCppLinter.php; sourceTree = ""; }; - 62EE2A751A1ABA1F00486C31 /* PfffCppLinter.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = PfffCppLinter.php; sourceTree = ""; }; - 62EE2A771A1ABA1F00486C31 /* FacebookFbcodeLintEngine.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = FacebookFbcodeLintEngine.php; sourceTree = ""; }; 62EE2A781A1ABA1F00486C31 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 62EE2A791A1ABA1F00486C31 /* PATENTS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PATENTS; sourceTree = ""; }; 62EE2A7B1A1ABA1F00486C31 /* likely.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = likely.h; sourceTree = ""; }; @@ -927,20 +979,8 @@ 62EE2AE51A1ABA1F00486C31 /* table_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = table_test.cc; sourceTree = ""; }; 62EE2AE61A1ABA1F00486C31 /* two_level_iterator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = two_level_iterator.cc; sourceTree = ""; }; 62EE2AE71A1ABA1F00486C31 /* two_level_iterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = two_level_iterator.h; sourceTree = ""; }; - 62EE2AEB1A1ABA2000486C31 /* document.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = document.h; sourceTree = ""; }; - 62EE2AEC1A1ABA2000486C31 /* filestream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filestream.h; sourceTree = ""; }; - 62EE2AEE1A1ABA2000486C31 /* pow10.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pow10.h; sourceTree = ""; }; - 62EE2AEF1A1ABA2000486C31 /* stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stack.h; sourceTree = ""; }; - 62EE2AF01A1ABA2000486C31 /* strfunc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strfunc.h; sourceTree = ""; }; - 62EE2AF11A1ABA2000486C31 /* license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = license.txt; sourceTree = ""; }; - 62EE2AF21A1ABA2000486C31 /* prettywriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prettywriter.h; sourceTree = ""; }; - 62EE2AF31A1ABA2000486C31 /* rapidjson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rapidjson.h; sourceTree = ""; }; - 62EE2AF41A1ABA2000486C31 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = ""; }; - 62EE2AF51A1ABA2000486C31 /* stringbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringbuffer.h; sourceTree = ""; }; - 62EE2AF61A1ABA2000486C31 /* writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = ""; }; 62EE2AF81A1ABA2000486C31 /* auto_sanity_test.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = auto_sanity_test.sh; sourceTree = ""; }; 62EE2AF91A1ABA2000486C31 /* benchmark.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = benchmark.sh; sourceTree = ""; }; - 62EE2AFA1A1ABA2000486C31 /* blob_store_bench.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = blob_store_bench.cc; sourceTree = ""; }; 62EE2AFB1A1ABA2000486C31 /* db_crashtest.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = db_crashtest.py; sourceTree = ""; }; 62EE2AFC1A1ABA2000486C31 /* db_crashtest2.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = db_crashtest2.py; sourceTree = ""; }; 62EE2AFD1A1ABA2000486C31 /* db_repl_stress.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = db_repl_stress.cc; sourceTree = ""; }; @@ -959,15 +999,8 @@ 62EE2B0D1A1ABA2000486C31 /* auto_roll_logger_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = auto_roll_logger_test.cc; sourceTree = ""; }; 62EE2B0E1A1ABA2000486C31 /* autovector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autovector.h; sourceTree = ""; }; 62EE2B0F1A1ABA2000486C31 /* autovector_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = autovector_test.cc; sourceTree = ""; }; - 62EE2B101A1ABA2000486C31 /* benchharness.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = benchharness.cc; sourceTree = ""; }; - 62EE2B111A1ABA2000486C31 /* benchharness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = benchharness.h; sourceTree = ""; }; - 62EE2B121A1ABA2000486C31 /* benchharness_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = benchharness_test.cc; sourceTree = ""; }; - 62EE2B131A1ABA2000486C31 /* blob_store.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = blob_store.cc; sourceTree = ""; }; - 62EE2B141A1ABA2000486C31 /* blob_store.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blob_store.h; sourceTree = ""; }; - 62EE2B161A1ABA2000486C31 /* blob_store_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = blob_store_test.cc; sourceTree = ""; }; 62EE2B171A1ABA2000486C31 /* bloom.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bloom.cc; sourceTree = ""; }; 62EE2B191A1ABA2000486C31 /* bloom_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bloom_test.cc; sourceTree = ""; }; - 62EE2B1A1A1ABA2000486C31 /* build_version.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = build_version.cc; sourceTree = ""; }; 62EE2B1B1A1ABA2000486C31 /* build_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = build_version.h; sourceTree = ""; }; 62EE2B1D1A1ABA2000486C31 /* cache.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cache.cc; sourceTree = ""; }; 62EE2B1F1A1ABA2000486C31 /* cache_bench.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cache_bench.cc; sourceTree = ""; }; @@ -1036,7 +1069,6 @@ 62EE2B781A1ABA2000486C31 /* rate_limiter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rate_limiter.h; sourceTree = ""; }; 62EE2B7A1A1ABA2000486C31 /* rate_limiter_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rate_limiter_test.cc; sourceTree = ""; }; 62EE2B7B1A1ABA2000486C31 /* scoped_arena_iterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scoped_arena_iterator.h; sourceTree = ""; }; - 62EE2B7C1A1ABA2000486C31 /* signal_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = signal_test.cc; sourceTree = ""; }; 62EE2B7D1A1ABA2000486C31 /* skiplistrep.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = skiplistrep.cc; sourceTree = ""; }; 62EE2B7F1A1ABA2000486C31 /* slice.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = slice.cc; sourceTree = ""; }; 62EE2B811A1ABA2000486C31 /* sst_dump_tool.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sst_dump_tool.cc; sourceTree = ""; }; @@ -1302,6 +1334,69 @@ name = Snapshot; sourceTree = ""; }; + 624C222A1AF016B7006DC8FA /* fbson */ = { + isa = PBXGroup; + children = ( + 624C222B1AF016B7006DC8FA /* COMMIT.md */, + 624C222C1AF016B7006DC8FA /* FbsonDocument.h */, + 624C222D1AF016B7006DC8FA /* FbsonJsonParser.h */, + 624C222E1AF016B7006DC8FA /* FbsonStream.h */, + 624C222F1AF016B7006DC8FA /* FbsonUtil.h */, + 624C22301AF016B7006DC8FA /* FbsonWriter.h */, + ); + path = fbson; + sourceTree = ""; + }; + 624C22371AF0174B006DC8FA /* convenience */ = { + isa = PBXGroup; + children = ( + 624C22381AF0174B006DC8FA /* convenience.cc */, + ); + path = convenience; + sourceTree = ""; + }; + 624C22431AF017F1006DC8FA /* gtest-1.7.0 */ = { + isa = PBXGroup; + children = ( + 624C22441AF017F1006DC8FA /* fused-src */, + ); + path = "gtest-1.7.0"; + sourceTree = ""; + }; + 624C22441AF017F1006DC8FA /* fused-src */ = { + isa = PBXGroup; + children = ( + 624C22451AF017F1006DC8FA /* gtest */, + ); + path = "fused-src"; + sourceTree = ""; + }; + 624C22451AF017F1006DC8FA /* gtest */ = { + isa = PBXGroup; + children = ( + 624C22461AF017F1006DC8FA /* gtest-all.cc */, + 624C22471AF017F1006DC8FA /* gtest.h */, + ); + path = gtest; + sourceTree = ""; + }; + 624C22521AF0194E006DC8FA /* flashcache */ = { + isa = PBXGroup; + children = ( + 624C22531AF0194E006DC8FA /* flashcache_ioctl.h */, + ); + path = flashcache; + sourceTree = ""; + }; + 624C22541AF0195F006DC8FA /* flashcache */ = { + isa = PBXGroup; + children = ( + 624C22551AF0195F006DC8FA /* flashcache.cc */, + 624C22561AF0195F006DC8FA /* flashcache.h */, + ); + path = flashcache; + sourceTree = ""; + }; 625F8F261A59D78E007796BA /* Mem Table */ = { isa = PBXGroup; children = ( @@ -1430,64 +1525,32 @@ 62EE28FD1A1ABA1F00486C31 /* rocksdb */ = { isa = PBXGroup; children = ( - 62EE28FE1A1ABA1F00486C31 /* .arcconfig */, - 62EE28FF1A1ABA1F00486C31 /* .clang-format */, - 62EE29001A1ABA1F00486C31 /* .gitignore */, - 62EE29011A1ABA1F00486C31 /* .travis.yml */, 62EE29021A1ABA1F00486C31 /* AUTHORS */, - 62EE29031A1ABA1F00486C31 /* build_tools */, 62EE290F1A1ABA1F00486C31 /* CONTRIBUTING.md */, - 62EE29101A1ABA1F00486C31 /* coverage */, 62EE29131A1ABA1F00486C31 /* db */, 62EE29A81A1ABA1F00486C31 /* hdfs */, - 62EE29AC1A1ABA1F00486C31 /* helpers */, 62EE29B01A1ABA1F00486C31 /* HISTORY.md */, 62EE29B11A1ABA1F00486C31 /* include */, 62EE29E51A1ABA1F00486C31 /* INSTALL.md */, 62EE2A6D1A1ABA1F00486C31 /* LICENSE */, - 62EE2A6E1A1ABA1F00486C31 /* linters */, 62EE2A781A1ABA1F00486C31 /* Makefile */, 62EE2A791A1ABA1F00486C31 /* PATENTS */, 62EE2A7A1A1ABA1F00486C31 /* port */, 62EE2A871A1ABA1F00486C31 /* README.md */, 62EE2A881A1ABA1F00486C31 /* ROCKSDB_LITE.md */, + 624C22361AF01719006DC8FA /* src.mk */, 62EE2A891A1ABA1F00486C31 /* table */, 62EE2AE91A1ABA2000486C31 /* third-party */, 62EE2AF71A1ABA2000486C31 /* tools */, 62EE2B051A1ABA2000486C31 /* util */, 62EE2B9D1A1ABA2000486C31 /* utilities */, + 624C225A1AF01B1F006DC8FA /* USERS.md */, 62EE2BD61A1ABA2000486C31 /* Vagrantfile */, ); name = rocksdb; path = ../rocksdb; sourceTree = ""; }; - 62EE29031A1ABA1F00486C31 /* build_tools */ = { - isa = PBXGroup; - children = ( - 62EE29041A1ABA1F00486C31 /* build_detect_platform */, - 62EE29051A1ABA1F00486C31 /* build_detect_version */, - 62EE29061A1ABA1F00486C31 /* fbcode_config.sh */, - 62EE29071A1ABA1F00486C31 /* format-diff.sh */, - 62EE29091A1ABA1F00486C31 /* make_new_version.sh */, - 62EE290A1A1ABA1F00486C31 /* make_package.sh */, - 62EE290B1A1ABA1F00486C31 /* regression_build_test.sh */, - 62EE290C1A1ABA1F00486C31 /* unity */, - 62EE290D1A1ABA1F00486C31 /* valgrind_test.sh */, - 62EE290E1A1ABA1F00486C31 /* version.sh */, - ); - path = build_tools; - sourceTree = ""; - }; - 62EE29101A1ABA1F00486C31 /* coverage */ = { - isa = PBXGroup; - children = ( - 62EE29111A1ABA1F00486C31 /* coverage_test.sh */, - 62EE29121A1ABA1F00486C31 /* parse_gcov_output.py */, - ); - path = coverage; - sourceTree = ""; - }; 62EE29131A1ABA1F00486C31 /* db */ = { isa = PBXGroup; children = ( @@ -1498,6 +1561,7 @@ 62EE291A1A1ABA1F00486C31 /* column_family.cc */, 62EE291B1A1ABA1F00486C31 /* column_family.h */, 62EE291D1A1ABA1F00486C31 /* column_family_test.cc */, + 624C223B1AF01773006DC8FA /* compact_files_test.cc */, 62EE291E1A1ABA1F00486C31 /* compaction.cc */, 62EE291F1A1ABA1F00486C31 /* compaction.h */, 62EE29211A1ABA1F00486C31 /* compaction_job.cc */, @@ -1511,6 +1575,7 @@ 62EE292B1A1ABA1F00486C31 /* cuckoo_table_db_test.cc */, 62EE292C1A1ABA1F00486C31 /* db_bench.cc */, 62EE292D1A1ABA1F00486C31 /* db_filesnapshot.cc */, + 624C225F1AF01C8E006DC8FA /* db_impl_experimental.cc */, 62EE292F1A1ABA1F00486C31 /* db_impl.cc */, 62EE29301A1ABA1F00486C31 /* db_impl.h */, 62EE29321A1ABA1F00486C31 /* db_impl_debug.cc */, @@ -1524,6 +1589,10 @@ 62EE293D1A1ABA1F00486C31 /* dbformat.h */, 62EE293F1A1ABA1F00486C31 /* dbformat_test.cc */, 62EE29401A1ABA1F00486C31 /* deletefile_test.cc */, + 62297D541B6AC08B00F72BF2 /* event_logger_helpers.cc */, + 62297D551B6AC08B00F72BF2 /* event_logger_helpers.h */, + 624C22621AF01CA7006DC8FA /* experimental.cc */, + 622DB8621A7EA1470026C73F /* fault_injection_test.cc */, 62EE29411A1ABA1F00486C31 /* file_indexer.cc */, 62EE29421A1ABA1F00486C31 /* file_indexer.h */, 62EE29441A1ABA1F00486C31 /* file_indexer_test.cc */, @@ -1541,17 +1610,19 @@ 62EE29541A1ABA1F00486C31 /* internal_stats.h */, 62EE29561A1ABA1F00486C31 /* job_context.h */, 62EE29571A1ABA1F00486C31 /* listener_test.cc */, - 62EE29581A1ABA1F00486C31 /* log_and_apply_bench.cc */, 62EE29591A1ABA1F00486C31 /* log_format.h */, 62EE295A1A1ABA1F00486C31 /* log_reader.cc */, 62EE295B1A1ABA1F00486C31 /* log_reader.h */, 62EE295D1A1ABA1F00486C31 /* log_test.cc */, 62EE295E1A1ABA1F00486C31 /* log_writer.cc */, 62EE295F1A1ABA1F00486C31 /* log_writer.h */, + 624C22261AF0161E006DC8FA /* managed_iterator.cc */, + 624C22271AF0161E006DC8FA /* managed_iterator.h */, 62EE29611A1ABA1F00486C31 /* memtable.cc */, 62EE29621A1ABA1F00486C31 /* memtable.h */, 6235339E1A47722900D5CD14 /* memtable_allocator.cc */, 6235339F1A47722900D5CD14 /* memtable_allocator.h */, + 624C225E1AF01B7A006DC8FA /* memtable_list_test.cc */, 62EE29641A1ABA1F00486C31 /* memtable_list.cc */, 62EE29651A1ABA1F00486C31 /* memtable_list.h */, 62A74F831A60385D00BAD95B /* memtablerep_bench.cc */, @@ -1566,6 +1637,7 @@ 62EE29711A1ABA1F00486C31 /* repair.cc */, 62EE29731A1ABA1F00486C31 /* skiplist.h */, 62EE29741A1ABA1F00486C31 /* skiplist_test.cc */, + 624C224A1AF01880006DC8FA /* slice.cc */, 62EE29751A1ABA1F00486C31 /* snapshot.h */, 62EE29761A1ABA1F00486C31 /* table_cache.cc */, 62EE29771A1ABA1F00486C31 /* table_cache.h */, @@ -1586,6 +1658,7 @@ 62EE298C1A1ABA1F00486C31 /* wal_manager.cc */, 62EE298D1A1ABA1F00486C31 /* wal_manager.h */, 62EE298F1A1ABA1F00486C31 /* wal_manager_test.cc */, + 624C224D1AF0188B006DC8FA /* write_batch_base.cc */, 62EE29901A1ABA1F00486C31 /* write_batch.cc */, 62EE29921A1ABA1F00486C31 /* write_batch_internal.h */, 62EE29931A1ABA1F00486C31 /* write_batch_test.cc */, @@ -1609,23 +1682,6 @@ path = hdfs; sourceTree = ""; }; - 62EE29AC1A1ABA1F00486C31 /* helpers */ = { - isa = PBXGroup; - children = ( - 62EE29AD1A1ABA1F00486C31 /* memenv */, - ); - path = helpers; - sourceTree = ""; - }; - 62EE29AD1A1ABA1F00486C31 /* memenv */ = { - isa = PBXGroup; - children = ( - 62EE29AE1A1ABA1F00486C31 /* memenv.cc */, - 62EE29AF1A1ABA1F00486C31 /* memenv_test.cc */, - ); - path = memenv; - sourceTree = ""; - }; 62EE29B11A1ABA1F00486C31 /* include */ = { isa = PBXGroup; children = ( @@ -1645,7 +1701,9 @@ 62EE29B61A1ABA1F00486C31 /* comparator.h */, 62EE29B71A1ABA1F00486C31 /* db.h */, 62EE29B81A1ABA1F00486C31 /* env.h */, + 624C22651AF01CE0006DC8FA /* experimental.h */, 62EE29B91A1ABA1F00486C31 /* filter_policy.h */, + 624C22511AF0193B006DC8FA /* flashcache.h */, 62EE29BA1A1ABA1F00486C31 /* flush_block_policy.h */, 62EE29BB1A1ABA1F00486C31 /* immutable_options.h */, 62EE29BC1A1ABA1F00486C31 /* iostats_context.h */, @@ -1672,6 +1730,7 @@ 62EE29D01A1ABA1F00486C31 /* utilities */, 62EE29DB1A1ABA1F00486C31 /* version.h */, 62EE29DC1A1ABA1F00486C31 /* write_batch.h */, + 624C22501AF018B6006DC8FA /* write_batch_base.h */, ); path = rocksdb; sourceTree = ""; @@ -1708,36 +1767,6 @@ path = utilities; sourceTree = ""; }; - 62EE2A6E1A1ABA1F00486C31 /* linters */ = { - isa = PBXGroup; - children = ( - 62EE2A6F1A1ABA1F00486C31 /* __phutil_library_init__.php */, - 62EE2A701A1ABA1F00486C31 /* __phutil_library_map__.php */, - 62EE2A711A1ABA1F00486C31 /* cpp_linter */, - 62EE2A761A1ABA1F00486C31 /* lint_engine */, - ); - path = linters; - sourceTree = ""; - }; - 62EE2A711A1ABA1F00486C31 /* cpp_linter */ = { - isa = PBXGroup; - children = ( - 62EE2A721A1ABA1F00486C31 /* ArcanistCpplintLinter.php */, - 62EE2A731A1ABA1F00486C31 /* cpplint.py */, - 62EE2A741A1ABA1F00486C31 /* FbcodeCppLinter.php */, - 62EE2A751A1ABA1F00486C31 /* PfffCppLinter.php */, - ); - path = cpp_linter; - sourceTree = ""; - }; - 62EE2A761A1ABA1F00486C31 /* lint_engine */ = { - isa = PBXGroup; - children = ( - 62EE2A771A1ABA1F00486C31 /* FacebookFbcodeLintEngine.php */, - ); - path = lint_engine; - sourceTree = ""; - }; 62EE2A7A1A1ABA1F00486C31 /* port */ = { isa = PBXGroup; children = ( @@ -1840,54 +1869,36 @@ 62EE2AE91A1ABA2000486C31 /* third-party */ = { isa = PBXGroup; children = ( - 62EE2AEA1A1ABA2000486C31 /* rapidjson */, + 624C222A1AF016B7006DC8FA /* fbson */, + 624C22521AF0194E006DC8FA /* flashcache */, + 624C22431AF017F1006DC8FA /* gtest-1.7.0 */, ); path = "third-party"; sourceTree = ""; }; - 62EE2AEA1A1ABA2000486C31 /* rapidjson */ = { - isa = PBXGroup; - children = ( - 62EE2AEB1A1ABA2000486C31 /* document.h */, - 62EE2AEC1A1ABA2000486C31 /* filestream.h */, - 62EE2AED1A1ABA2000486C31 /* internal */, - 62EE2AF11A1ABA2000486C31 /* license.txt */, - 62EE2AF21A1ABA2000486C31 /* prettywriter.h */, - 62EE2AF31A1ABA2000486C31 /* rapidjson.h */, - 62EE2AF41A1ABA2000486C31 /* reader.h */, - 62EE2AF51A1ABA2000486C31 /* stringbuffer.h */, - 62EE2AF61A1ABA2000486C31 /* writer.h */, - ); - path = rapidjson; - sourceTree = ""; - }; - 62EE2AED1A1ABA2000486C31 /* internal */ = { - isa = PBXGroup; - children = ( - 62EE2AEE1A1ABA2000486C31 /* pow10.h */, - 62EE2AEF1A1ABA2000486C31 /* stack.h */, - 62EE2AF01A1ABA2000486C31 /* strfunc.h */, - ); - path = internal; - sourceTree = ""; - }; 62EE2AF71A1ABA2000486C31 /* tools */ = { isa = PBXGroup; children = ( 626A7D4B1A27EC570098A979 /* rdb */, 62EE2AF81A1ABA2000486C31 /* auto_sanity_test.sh */, 62EE2AF91A1ABA2000486C31 /* benchmark.sh */, - 62EE2AFA1A1ABA2000486C31 /* blob_store_bench.cc */, + 624C22661AF01D30006DC8FA /* benchmark_leveldb.sh */, + 624C225B1AF01B3E006DC8FA /* check_format_compatible.sh */, 62EE2AFB1A1ABA2000486C31 /* db_crashtest.py */, 62EE2AFC1A1ABA2000486C31 /* db_crashtest2.py */, 62EE2AFD1A1ABA2000486C31 /* db_repl_stress.cc */, 62EE2AFE1A1ABA2000486C31 /* db_sanity_test.cc */, 62EE2AFF1A1ABA2000486C31 /* db_stress.cc */, + 624C221E1AF01590006DC8FA /* dbench_monitor */, + 624C225C1AF01B45006DC8FA /* generate_random_db.sh */, 62EE2B001A1ABA2000486C31 /* ldb.cc */, 62EE2B011A1ABA2000486C31 /* ldb_test.py */, + 624C221F1AF01597006DC8FA /* pflag */, 62EE2B021A1ABA2000486C31 /* reduce_levels_test.cc */, 62EE2B031A1ABA2000486C31 /* run_flash_bench.sh */, + 624C22671AF01D36006DC8FA /* run_leveldb.sh */, 62EE2B041A1ABA2000486C31 /* sst_dump.cc */, + 624C225D1AF01B4C006DC8FA /* verify_random_db.sh */, ); path = tools; sourceTree = ""; @@ -1904,16 +1915,10 @@ 62EE2B0D1A1ABA2000486C31 /* auto_roll_logger_test.cc */, 62EE2B0E1A1ABA2000486C31 /* autovector.h */, 62EE2B0F1A1ABA2000486C31 /* autovector_test.cc */, - 62EE2B101A1ABA2000486C31 /* benchharness.cc */, - 62EE2B111A1ABA2000486C31 /* benchharness.h */, - 62EE2B121A1ABA2000486C31 /* benchharness_test.cc */, - 62EE2B131A1ABA2000486C31 /* blob_store.cc */, - 62EE2B141A1ABA2000486C31 /* blob_store.h */, - 62EE2B161A1ABA2000486C31 /* blob_store_test.cc */, 62EE2B171A1ABA2000486C31 /* bloom.cc */, 62EE2B191A1ABA2000486C31 /* bloom_test.cc */, - 62EE2B1A1A1ABA2000486C31 /* build_version.cc */, 62EE2B1B1A1ABA2000486C31 /* build_version.h */, + 62297D591B6AC8CE00F72BF2 /* build_version.cc */, 62EE2B1D1A1ABA2000486C31 /* cache.cc */, 62EE2B1F1A1ABA2000486C31 /* cache_bench.cc */, 62EE2B201A1ABA2000486C31 /* cache_test.cc */, @@ -1921,6 +1926,7 @@ 62EE2B221A1ABA2000486C31 /* coding.h */, 62EE2B241A1ABA2000486C31 /* coding_test.cc */, 62EE2B251A1ABA2000486C31 /* comparator.cc */, + 622DB85E1A7E9FFB0026C73F /* compression.h */, 62EE2B271A1ABA2000486C31 /* crc32c.cc */, 62EE2B281A1ABA2000486C31 /* crc32c.h */, 62EE2B2A1A1ABA2000486C31 /* crc32c_test.cc */, @@ -1933,6 +1939,9 @@ 62EE2B341A1ABA2000486C31 /* env_hdfs.cc */, 62EE2B361A1ABA2000486C31 /* env_posix.cc */, 62EE2B381A1ABA2000486C31 /* env_test.cc */, + 624C223C1AF017B6006DC8FA /* event_logger_test.cc */, + 624C223D1AF017B6006DC8FA /* event_logger.cc */, + 624C223E1AF017B6006DC8FA /* event_logger.h */, 62EE2B391A1ABA2000486C31 /* file_util.cc */, 62EE2B3A1A1ABA2000486C31 /* file_util.h */, 62EE2B3C1A1ABA2000486C31 /* filelock_test.cc */, @@ -1948,6 +1957,8 @@ 62EE2B4B1A1ABA2000486C31 /* histogram.cc */, 62EE2B4C1A1ABA2000486C31 /* histogram.h */, 62EE2B4E1A1ABA2000486C31 /* histogram_test.cc */, + 624C22691AF02B1B006DC8FA /* instrumented_mutex.cc */, + 624C226A1AF02B1B006DC8FA /* instrumented_mutex.h */, 62EE2B4F1A1ABA2000486C31 /* iostats_context.cc */, 62EE2B511A1ABA2000486C31 /* iostats_context_imp.h */, 62EE2B521A1ABA2000486C31 /* ldb_cmd.cc */, @@ -1960,6 +1971,8 @@ 62EE2B5C1A1ABA2000486C31 /* logging.cc */, 62EE2B5D1A1ABA2000486C31 /* logging.h */, 62EE2B5F1A1ABA2000486C31 /* manual_compaction_test.cc */, + 622DB8641A7EA1CB0026C73F /* memenv_test.cc */, + 622DB8651A7EA1CB0026C73F /* memenv.cc */, 62EE2B601A1ABA2000486C31 /* mock_env.cc */, 62EE2B611A1ABA2000486C31 /* mock_env.h */, 62EE2B621A1ABA2000486C31 /* mock_env_test.cc */, @@ -1981,8 +1994,8 @@ 62EE2B781A1ABA2000486C31 /* rate_limiter.h */, 62EE2B7A1A1ABA2000486C31 /* rate_limiter_test.cc */, 62EE2B7B1A1ABA2000486C31 /* scoped_arena_iterator.h */, - 62EE2B7C1A1ABA2000486C31 /* signal_test.cc */, 62EE2B7D1A1ABA2000486C31 /* skiplistrep.cc */, + 622DB86B1A7EA2970026C73F /* slice_transform_test.cc */, 62EE2B7F1A1ABA2000486C31 /* slice.cc */, 62EE2B811A1ABA2000486C31 /* sst_dump_tool.cc */, 62EE2B831A1ABA2000486C31 /* statistics.cc */, @@ -2001,16 +2014,21 @@ 62EE2B911A1ABA2000486C31 /* testharness.h */, 62EE2B921A1ABA2000486C31 /* testutil.cc */, 62EE2B931A1ABA2000486C31 /* testutil.h */, + 624C22681AF0217C006DC8FA /* thread_list_test.cc */, 62EE2B941A1ABA2000486C31 /* thread_local.cc */, 62EE2B951A1ABA2000486C31 /* thread_local.h */, 62EE2B971A1ABA2000486C31 /* thread_local_test.cc */, 62A74F821A6037F500BAD95B /* thread_operation.h */, + 624C221B1AF014E0006DC8FA /* thread_status_impl.cc */, 62451ACC1A4BC85400AF11C8 /* thread_status_updater_debug.cc */, 62451ACD1A4BC85400AF11C8 /* thread_status_updater.cc */, 62451ACE1A4BC85400AF11C8 /* thread_status_updater.h */, + 624C22231AF015E4006DC8FA /* thread_status_util_debug.cc */, 62451ACF1A4BC85400AF11C8 /* thread_status_util.cc */, 62451AD01A4BC85400AF11C8 /* thread_status_util.h */, 62EE2B981A1ABA2000486C31 /* vectorrep.cc */, + 624C22171AF01485006DC8FA /* xfunc.cc */, + 624C221A1AF0148B006DC8FA /* xfunc.h */, 62EE2B9A1A1ABA2000486C31 /* xxhash.cc */, 62EE2B9B1A1ABA2000486C31 /* xxhash.h */, ); @@ -2023,7 +2041,9 @@ 62EE2B9E1A1ABA2000486C31 /* backupable */, 62269EDA1A1FF27A005A58D3 /* checkpoint */, 62EE2BA21A1ABA2000486C31 /* compacted_db */, + 624C22371AF0174B006DC8FA /* convenience */, 62EE2BA61A1ABA2000486C31 /* document */, + 624C22541AF0195F006DC8FA /* flashcache */, 62EE2BAD1A1ABA2000486C31 /* geodb */, 62269EDE1A1FF2DC005A58D3 /* leveldb_options */, 62EE2BB21A1ABA2000486C31 /* merge_operators */, @@ -2059,6 +2079,7 @@ children = ( 62EE2BA71A1ABA2000486C31 /* document_db.cc */, 62EE2BA91A1ABA2000486C31 /* document_db_test.cc */, + 624C22331AF016EE006DC8FA /* json_document_builder.cc */, 62EE2BAA1A1ABA2000486C31 /* json_document.cc */, 62EE2BAC1A1ABA2000486C31 /* json_document_test.cc */, ); @@ -2133,6 +2154,8 @@ 62EE2BD21A1ABA2000486C31 /* write_batch_with_index */ = { isa = PBXGroup; children = ( + 62297D501B6AC05000F72BF2 /* write_batch_with_index_internal.cc */, + 62297D511B6AC05000F72BF2 /* write_batch_with_index_internal.h */, 62EE2BD31A1ABA2000486C31 /* write_batch_with_index.cc */, 62EE2BD51A1ABA2000486C31 /* write_batch_with_index_test.cc */, ); @@ -2174,6 +2197,7 @@ isa = PBXNativeTarget; buildConfigurationList = 6299F81D1A17B28200123F56 /* Build configuration list for PBXNativeTarget "ObjectiveRocks" */; buildPhases = ( + 62297D581B6AC4E900F72BF2 /* ShellScript */, 6299F8051A17B28200123F56 /* Sources */, 6299F8061A17B28200123F56 /* Frameworks */, 6299F8071A17B28200123F56 /* CopyFiles */, @@ -2246,7 +2270,7 @@ 6299F8011A17B28200123F56 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastUpgradeCheck = 0630; ORGANIZATIONNAME = BrainCookie; TargetAttributes = { 6299F8081A17B28200123F56 = { @@ -2294,6 +2318,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 62297D581B6AC4E900F72BF2 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "#!/bin/sh\n\nROCKSDB_DIR=\"$PWD/rocksdb/.git\"\nOUTFILE=\"$PWD/rocksdb/util/build_version.cc\"\nGIT_SHA=\"\"\n\nif command -v git >/dev/null 2>&1; then\nGIT_SHA=$(git --git-dir=\"$ROCKSDB_DIR\" rev-parse HEAD 2>/dev/null)\nfi\n\ncat > \"${OUTFILE}\" < +/** + Holds information about a database backup. + */ @interface RocksDBBackupInfo : NSObject +/** + @brief The backup ID. + */ @property (nonatomic, assign) uint32_t backupId; + +/** + @brief The timestamp when the backup was created. + */ @property (nonatomic, assign) int64_t timestamp; + +/** + @brief The size of the backup in bytes. + */ @property (nonatomic, assign) uint64_t size; + +/** + @brief The number of files in the backup. + */ @property (nonatomic, assign) uint32_t numberFiles; @end diff --git a/ObjectiveRocks/RocksDBBlockBasedTableOptions.h b/ObjectiveRocks/RocksDBBlockBasedTableOptions.h index a755d88..ee2d645 100644 --- a/ObjectiveRocks/RocksDBBlockBasedTableOptions.h +++ b/ObjectiveRocks/RocksDBBlockBasedTableOptions.h @@ -12,7 +12,19 @@ typedef NS_ENUM(char, BlockBasedTableIndexType) { + + /** + @brief A space efficient index block that is optimized for + binary-search-based index. + */ BlockBasedTableIndexBinarySearch, + + /** + @brief The hash index, if enabled, will do the hash lookup when + a prefix extractor is provided. + + @see RocksDBPrefixExtractor + */ BlockBasedTableIndexHashSearch }; @@ -24,17 +36,100 @@ typedef NS_ENUM(char, BlockBasedTableChecksumType) { @interface RocksDBBlockBasedTableOptions : NSObject +/** + @brief + Indicate to put index/filter blocks to the block cache. + If not specified, each "table reader" object will pre-load index/filter + block during table initialization. + */ @property (nonatomic, assign) BOOL cacheIndexAndFilterBlocks; + +/** + @brief The index type that will be used for this table. + */ @property (nonatomic, assign) BlockBasedTableIndexType indexType; + +/** + @brief + Influence the behavior when kHashSearch is used. + if false, stores a precise prefix to block range mapping + if true, does not store prefix and allows prefix hash collision + (less memory consumption) + */ @property (nonatomic, assign) BOOL hashIndexAllowCollision; + +/** + @brief + Use the specified checksum type. Newly created table files will be + protected with this checksum type. Old table files will still be readable, + even though they have different checksum type. + */ @property (nonatomic, assign) BlockBasedTableChecksumType checksumType; + +/** + @brief + Disable block cache. If this is set to true, + then no block cache should be used, and the block_cache should + point to a nullptr object. + */ @property (nonatomic, assign) BOOL noBlockCache; + +/** + @brief + Use the specified cache for blocks. + If nil, rocksdb will automatically create and use an 8MB internal cache. + + @see RocksDBCache + */ @property (nonatomic, strong) RocksDBCache *blockCache; + +/** + @brief + Use the specified cache for compressed blocks. + + @see RocksDBCache + */ @property (nonatomic, strong) RocksDBCache *blockCacheCompressed; + +/** + @brief + Approximate size of user data packed per block. Note that the + block size specified here corresponds to uncompressed data. The + actual size of the unit read from disk may be smaller if + compression is enabled. This parameter can be changed dynamically. + */ @property (nonatomic, assign) size_t blockSize; + +/** + @brief + This is used to close a block before it reaches the configured + 'blockSize'. If the percentage of free space in the current block is less + than this specified number and adding a new record to the block will + exceed the configured block size, then this block will be closed and the + new record will be written to the next block. + */ @property (nonatomic, assign) int blockSizeDeviation; + +/** + @brief + Number of keys between restart points for delta encoding of keys. + This parameter can be changed dynamically. + */ @property (nonatomic, assign) int blockRestartInterval; + +/** + @brief + Use the specified filter policy to reduce disk reads. + + @see RocksDBFilterPolicy + */ @property (nonatomic, strong) RocksDBFilterPolicy *filterPolicy; + +/** + @brief + If true, place whole keys in the filter (not just prefixes). + This must generally be true for gets to be efficient. + */ @property (nonatomic, assign) BOOL wholeKeyFiltering; @end diff --git a/ObjectiveRocks/RocksDBCache.h b/ObjectiveRocks/RocksDBCache.h index 525cab6..a6804d4 100644 --- a/ObjectiveRocks/RocksDBCache.h +++ b/ObjectiveRocks/RocksDBCache.h @@ -8,10 +8,29 @@ #import +/** + RocksDB cache. + */ @interface RocksDBCache : NSObject +/** + Create a new cache with a fixed size capacity. The cache is sharded + to 2^numShardBits shards, by hash of the key. The total capacity + is divided and evenly assigned to each shard. The default + numShardBits is 4. + + @see capacity The cache capcity. + */ + (instancetype)LRUCacheWithCapacity:(size_t)capacity; + +/** + Create a new cache with a fixed size capacity. The cache is sharded + to 2^numShardBits shards, by hash of the key. The total capacity + is divided and evenly assigned to each shard. + + @see capacity The cache capcity. + @see numShardBits The number of shard bits. + */ + (instancetype)LRUCacheWithCapacity:(size_t)capacity numShardsBits:(int)numShardBits; -+ (instancetype)LRUCacheWithCapacity:(size_t)capacity numShardsBits:(int)numShardBits removeScanCountLimit:(int)removeScanCountLimit; @end diff --git a/ObjectiveRocks/RocksDBCache.mm b/ObjectiveRocks/RocksDBCache.mm index b29e68b..570c391 100644 --- a/ObjectiveRocks/RocksDBCache.mm +++ b/ObjectiveRocks/RocksDBCache.mm @@ -30,11 +30,6 @@ + (instancetype)LRUCacheWithCapacity:(size_t)capacity numShardsBits:(int)numShar return [[RocksDBCache alloc] initWithNativeCache:rocksdb::NewLRUCache(capacity, numShardBits)]; } -+ (instancetype)LRUCacheWithCapacity:(size_t)capacity numShardsBits:(int)numShardBits removeScanCountLimit:(int)removeScanCountLimit -{ - return [[RocksDBCache alloc] initWithNativeCache:rocksdb::NewLRUCache(capacity, numShardBits, removeScanCountLimit)]; -} - - (instancetype)initWithNativeCache:(std::shared_ptr)cache { self = [super init]; diff --git a/ObjectiveRocks/RocksDBCheckpoint.h b/ObjectiveRocks/RocksDBCheckpoint.h index ac6b121..8954ade 100644 --- a/ObjectiveRocks/RocksDBCheckpoint.h +++ b/ObjectiveRocks/RocksDBCheckpoint.h @@ -9,10 +9,28 @@ #import #import "RocksDB.h" +/** + A checkpoint is an openable Snapshot of a database at a point in time. The `RocksDBCheckpoint` is used to + create such Snapshots for a given DB. + + @see RocksDBSnapshot + */ @interface RocksDBCheckpoint : NSObject +/** + Initializes a new Checkpoint object instance for the given DB which is the nused to created the checkpoints. + + @return A newly-initialized Checkoint object instance. + */ - (instancetype)initWithDatabase:(RocksDB *)db; +/** + Creates a checkpoint, i.e. an openable snapshot, of the DB under the given path. + + @param path The path where the checkpint is to be created. + @param error If an error occurs, upon return contains an `NSError` object that describes the problem. + @return `YES` if the checkpoint was created, `NO` otherwise. + */ - (BOOL)createCheckpointAtPath:(NSString *)path error:(NSError **)error; @end diff --git a/ObjectiveRocks/RocksDBColumnFamily+Private.h b/ObjectiveRocks/RocksDBColumnFamily+Private.h index be1352e..ab6788e 100644 --- a/ObjectiveRocks/RocksDBColumnFamily+Private.h +++ b/ObjectiveRocks/RocksDBColumnFamily+Private.h @@ -13,10 +13,24 @@ namespace rocksdb { class ColumnFamilyHandle; } +/** + This category is intended to hide all C++ types from the public interface in order to + maintain a pure Objective-C API for Swift compatibility. + */ @interface RocksDBColumnFamily (Private) +/** @brief The underlying rocksdb::ColumnFamilyHandle associated with this instance. */ @property (nonatomic, assign) rocksdb::ColumnFamilyHandle *columnFamily; +/** + Initializes a new instance of `RocksDBColumnFamily` with the given options for + rocks::DB and rocks::ColumnFamilyHandle instances. + + @param db The rocks::DB instance. + @param columnFamily The rocks::ColumnFamilyHandle instance. + @param options The DB options. + @return a newly-initialized instance of `RocksDBColumnFamily`. + */ - (instancetype)initWithDBInstance:(rocksdb::DB *)db columnFamily:(rocksdb::ColumnFamilyHandle *)columnFamily andOptions:(RocksDBOptions *)options; diff --git a/ObjectiveRocks/RocksDBColumnFamily.h b/ObjectiveRocks/RocksDBColumnFamily.h index 369cef4..b463fe1 100644 --- a/ObjectiveRocks/RocksDBColumnFamily.h +++ b/ObjectiveRocks/RocksDBColumnFamily.h @@ -9,6 +9,14 @@ #import "RocksDB.h" #import "RocksDBOptions.h" +/** + Column Families provide a way to logically partition the database. Each key-value pair in RocksDB is associated + with exactly one Column Family. If there is no Column Family specified, key-value pair is associated with Column + Family "default". + + The `RocksDBColumnFamily` is a subclass of the `RocksDB`, which means that all methods are inherited. Nevertheless, + a Column Family can only be created via a `RocksDB` instance, thus all initializers are unavailable. + */ @interface RocksDBColumnFamily : RocksDB - (instancetype)initWithPath:(NSString *)path __attribute__((unavailable("Create column family via a RocksDB instance"))); @@ -22,6 +30,9 @@ - (RocksDBColumnFamily *)createColumnFamilyWithName:(NSString *)name andOptions:(void (^)(RocksDBColumnFamilyOptions *options))optionsBlock __attribute__((unavailable("Use the superclass RocksDB instead"))); +/** + @breaf Drops this Column Family form the DB instance it is associated with. + */ - (void)drop; @end diff --git a/ObjectiveRocks/RocksDBColumnFamilyDescriptor.h b/ObjectiveRocks/RocksDBColumnFamilyDescriptor.h index d4b3f4c..c4f37b0 100644 --- a/ObjectiveRocks/RocksDBColumnFamilyDescriptor.h +++ b/ObjectiveRocks/RocksDBColumnFamilyDescriptor.h @@ -11,9 +11,30 @@ extern NSString * const RocksDBDefaultColumnFamilyName; +/** + When opening a DB in a read-write mode, all Column Families that currently exist in a DB must be specified via + a `RocksDBColumnFamilyDescriptor` instance, which should hold the names and the desired options for the Column + Families. + */ @interface RocksDBColumnFamilyDescriptor : NSObject +/** + Adds the default Column Family to this descriptor instance with the given options. + + @param options A block for specifying the options for the default Column Family. + + @see RocksDBColumnFamilyOptions + */ - (void)addDefaultColumnFamilyWithOptions:(void (^)(RocksDBColumnFamilyOptions *options))options; + +/** + Adds a Column Family to this descriptor instance with the given name and options. + + @param name The name of the Column Family. + @param options A block for specifying the options for the Column Family. + + @see RocksDBColumnFamilyOptions + */ - (void)addColumnFamilyWithName:(NSString *)name andOptions:(void (^)(RocksDBColumnFamilyOptions *options))options; @end diff --git a/ObjectiveRocks/RocksDBColumnFamilyMetaData+Private.h b/ObjectiveRocks/RocksDBColumnFamilyMetaData+Private.h index 30aa48b..9ab3bd3 100644 --- a/ObjectiveRocks/RocksDBColumnFamilyMetaData+Private.h +++ b/ObjectiveRocks/RocksDBColumnFamilyMetaData+Private.h @@ -14,20 +14,44 @@ namespace rocksdb { class SstFileMetaData; } +/** + This category is intended to hide all C++ types from the public interface in order to + maintain a pure Objective-C API for Swift compatibility. + */ @interface RocksDBColumnFamilyMetaData (Private) +/** + Initializes a new instance of `RocksDBColumnFamilyMetaData` with the given + rocksdb::ColumnFamilyMetaData + */ - (instancetype)initWithMetaData:(rocksdb::ColumnFamilyMetaData)metadata; @end +/** + This category is intended to hide all C++ types from the public interface in order to + maintain a pure Objective-C API for Swift compatibility. + */ @interface RocksDBLevelFileMetaData (Private) +/** + Initializes a new instance of `RocksDBLevelFileMetaData` with the given + rocksdb::LevelMetaData + */ - (instancetype)initWithLevelMetaData:(rocksdb::LevelMetaData)metadata; @end +/** + This category is intended to hide all C++ types from the public interface in order to + maintain a pure Objective-C API for Swift compatibility. + */ @interface RocksDBSstFileMetaData (Private) +/** + Initializes a new instance of `RocksDBSstFileMetaData` with the given + rocksdb::SstFileMetaData + */ - (instancetype)initWithSstFileMetaData:(rocksdb::SstFileMetaData)metadata; @end diff --git a/ObjectiveRocks/RocksDBColumnFamilyMetadata.h b/ObjectiveRocks/RocksDBColumnFamilyMetadata.h index bba03a0..bf77e2c 100644 --- a/ObjectiveRocks/RocksDBColumnFamilyMetadata.h +++ b/ObjectiveRocks/RocksDBColumnFamilyMetadata.h @@ -8,32 +8,98 @@ #import +/** + The metadata that describes a Column Family. + */ @interface RocksDBColumnFamilyMetaData : NSObject +/** + @brief The size of this Column Family in bytes, which is equal to the sum of the file size of its "levels". + */ @property (nonatomic, assign) uint64_t size; + +/** + @brief The number of files in this Clumn Family. + */ @property (nonatomic, assign) size_t fileCount; + +/** + @brief The name of the Column Family. + */ @property (nonatomic, assign) NSString *name; + +/** + @brief The metadata of all levels in this Column Family. + */ @property (nonatomic, strong, readonly) NSArray *levels; @end +/** + The metadata that describes a level. + */ @interface RocksDBLevelFileMetaData : NSObject +/** + @brief The level which this meta data describes. + */ @property (nonatomic, assign) const int level; + +/** + @brief The size of this level in bytes, which is equal to the sum of the file size of its "files". + */ @property (nonatomic, assign) const uint64_t size; + +/** + @brief The metadata of all sst files in this level. + */ @property (nonatomic, strong, readonly) NSArray *files; @end +/** + The metadata that describes a SST file. + */ @interface RocksDBSstFileMetaData : NSObject +/** + @brief File size in bytes. + */ @property (nonatomic, assign) uint64_t size; + +/** + @brief The name of the file. + */ @property (nonatomic, assign) NSString *name; + +/** + @brief The full path where the file locates. + */ @property (nonatomic, assign) NSString *dbPath; + +/** + @brief Smallest sequence number in file. + */ @property (nonatomic, assign) uint64_t smallestSeqno; + +/** + @brief Largest sequence number in file. + */ @property (nonatomic, assign) uint64_t largestSeqno; + +/** + @brief Smallest user defined key in the file. + */ @property (nonatomic, assign) NSString *smallestKey; + +/** + @brief Largest user defined key in the file. + */ @property (nonatomic, assign) NSString *largestKey; + +/** + @brief `true` if the file is currently being compacted. + */ @property (nonatomic, assign) bool beingCompacted; @end diff --git a/ObjectiveRocks/RocksDBColumnFamilyOptions.h b/ObjectiveRocks/RocksDBColumnFamilyOptions.h index 66aba58..6fadca2 100644 --- a/ObjectiveRocks/RocksDBColumnFamilyOptions.h +++ b/ObjectiveRocks/RocksDBColumnFamilyOptions.h @@ -14,6 +14,7 @@ #import "RocksDBPrefixExtractor.h" #import "RocksDBTypes.h" +/** The DB compression type. */ typedef NS_ENUM(char, RocksDBCompressionType) { RocksDBCompressionNone = 0x0, @@ -26,53 +27,220 @@ typedef NS_ENUM(char, RocksDBCompressionType) @interface RocksDBColumnFamilyOptions : NSObject +/** @brief Comparator used to define the order of keys in the table. + Default: a comparator that uses lexicographic byte-wise ordering. + + @see RocksDBComparator + */ @property (nonatomic, strong) RocksDBComparator *comparator; + +/** @brief The client must provide a merge operator if Merge operation + needs to be accessed. + Default: nil + + @warning The client must ensure that the merge operator supplied here has + the same name and *exactly* the same semantics as the merge operator provided + to previous open calls on the same DB. + + @see RocksDBMergeOperator + */ @property (nonatomic, strong) RocksDBMergeOperator *mergeOperator; -@property (nonatomic, strong) RocksDBPrefixExtractor *prefixExtractor; + +/** @brief Amount of data to build up in memory (backed by an unsorted log + on disk) before converting to a sorted on-disk file. + Default: 4MB. + */ @property (nonatomic, assign) size_t writeBufferSize; + +/** @brief The maximum number of write buffers that are built up in memory. + Default: 2 + */ @property (nonatomic, assign) int maxWriteBufferNumber; + +/** @brief The minimum number of write buffers that will be merged together + before writing to storage. + Default: 1 + */ @property (nonatomic, assign) int minWriteBufferNumberToMerge; + +/** @brief Compress blocks using the specified compression algorithm. + Default: RocksDBCompressionSnappy, which gives lightweight but fast compression. + */ @property (nonatomic, assign) RocksDBCompressionType compressionType; + +/** @brief If non-nil, the specified function to determine the + prefixes for keys will be used. These prefixes will be placed in the filter. + + @see RocksDBPrefixExtractor + */ +@property (nonatomic, strong) RocksDBPrefixExtractor *prefixExtractor; + +/** @brief Number of levels for this DB. */ @property (nonatomic, assign) int numLevels; + +/** @brief Number of files to trigger level-0 compaction. + Default: 4 + */ @property (nonatomic, assign) int level0FileNumCompactionTrigger; + +/** @brief Soft limit on number of level-0 files. */ @property (nonatomic, assign) int level0SlowdownWritesTrigger; + +/** @brief Maximum number of level-0 files. */ @property (nonatomic, assign) int level0StopWritesTrigger; + +/** @brief Maximum level to which a new compacted memtable is pushed if it + does not create overlap. */ @property (nonatomic, assign) int maxMemCompactionLevel; + +/** @brief Target file size for compaction. + Default: 2MB + */ @property (nonatomic, assign) uint64_t targetFileSizeBase; + +/** @brief By default target_file_size_multiplier is 1, which means + by default files in different levels will have similar size. */ @property (nonatomic, assign) int targetFileSizeMultiplier; + +/** @brief Control maximum total data size for a level. + Default: 10MB + */ @property (nonatomic, assign) uint64_t maxBytesForLevelBase; + +/** @brief Default: 10 */ @property (nonatomic, assign) int maxBytesForLevelMultiplier; + +/** @brief Maximum number of bytes in all compacted files. */ @property (nonatomic, assign) int expandedCompactionFactor; + +/** @brief Maximum number of bytes in all source files to be compacted in a + single compaction run. */ @property (nonatomic, assign) int sourceCompactionFactor; + +/** @brief Control maximum bytes of overlaps in grandparent (i.e., level+2) */ @property (nonatomic, assign) int maxGrandparentOverlapFactor; + +/** @brief Puts are delayed 0-1 ms when any level has a compaction score that + exceeds this limit. + Default: 0 (disabled) + */ @property (nonatomic, assign) double softRateLimit; + +/** @brief Puts are delayed 1ms at a time when any level has a compaction + score that exceeds this limit. + Default: 0 (disabled) + */ @property (nonatomic, assign) double hardRateLimit; -@property (nonatomic, assign) unsigned int rateLimitDelayMaxMilliseconds; + +/** @brief Size of one block in arena memory allocation. + Default: 0 + */ @property (nonatomic, assign) size_t arenaBlockSize; + +/** @brief Disable automatic compactions. Manual compactions can still be issued + on the column family. */ @property (nonatomic, assign) BOOL disableAutoCompactions; + +/** @brief Purge duplicate/deleted keys when a memtable is flushed to storage. */ @property (nonatomic, assign) BOOL purgeRedundantKvsWhileFlush; + +/** @brief If true, compaction will verify checksum on every read that happens + as part of compaction. + Default: true + */ @property (nonatomic, assign) BOOL verifyChecksumsInCompaction; + +/** @brief Use KeyMayExist API to filter deletes when this is true. + Default: false + */ @property (nonatomic, assign) BOOL filterDeletes; + +/** @brief An iteration->Next() sequentially skips over keys with the same + user-key unless this option is set. + Default: 0 + */ @property (nonatomic, assign) uint64_t maxSequentialSkipInIterations; + +/** @brief This is a factory that provides MemTableRep objects. + Default: A factory that provides a skip-list-based implementation of MemTableRep. + + @see RocksDBMemTableRepFactory + */ @property (nonatomic, strong) RocksDBMemTableRepFactory *memTableRepFactory; + +/** @brief This is a factory that provides TableFactory objects. + Default: A block-based table factory that provides a default + implementation of TableBuilder and TableReader with default + BlockBasedTableOptions. + + @see RocksDBTableFactory + */ @property (nonatomic, strong) RocksDBTableFactory *tableFacotry; + +/** @brief If prefixExtractor is set and bloom_bits is not 0, create prefix bloom + for memtable + + @see RocksDBPrefixExtractor + */ @property (nonatomic, assign) uint32_t memtablePrefixBloomBits; + +/** @brief Number of hash probes per key. */ @property (nonatomic, assign) uint32_t memtablePrefixBloomProbes; + +/** @brief Page size for huge page TLB for bloom in memtable. */ @property (nonatomic, assign) size_t memtablePrefixBloomHugePageTlbSize; + +/** @brief Control locality of bloom filter probes to improve cache miss rate. + Default: 0 + */ @property (nonatomic, assign) uint32_t bloomLocality; + +/** @brief Maximum number of successive merge operations on a key in the memtable. + Default: 0 (disabled) + */ @property (nonatomic, assign) size_t maxSuccessiveMerges; + +/** @brief The number of partial merge operands to accumulate before partial + merge will be performed. + Default: 2 + */ @property (nonatomic, assign) uint32_t minPartialMergeOperands; @end +/** + Options to define how arbitrary objects (keys & values) should be converted to + NSData and vise versa. + */ @interface RocksDBColumnFamilyOptions (Encoding) +/** @brief + A block to convert `id` keys to NSData objects. + */ @property (nonatomic, copy) NSData * (^ keyEncoder)(id key); + +/** @brief + A block to convert NSData objects to the corresponding `id` key. + */ @property (nonatomic, copy) id (^ keyDecoder)(NSData *data); + +/** @brief + A block to convert `id` values to NSData objects. The block takes two + parameters, the key-value pair to allow multiplexing. + */ @property (nonatomic, copy) NSData * (^ valueEncoder)(id key, id value); + +/** @brief A block to convert NSData objects to the corresponding value. */ @property (nonatomic, copy) id (^ valueDecoder)(id key, NSData *data); +/** @brief Use a predefined type for the keys. + @see RocksDBTypes + */ @property (nonatomic, assign) RocksDBType keyType; + +/** @brief Use a predefined type for the values. + @see RocksDBTypes + */ @property (nonatomic, assign) RocksDBType valueType; @end diff --git a/ObjectiveRocks/RocksDBColumnFamilyOptions.mm b/ObjectiveRocks/RocksDBColumnFamilyOptions.mm index c8b5df9..8f9f3d9 100644 --- a/ObjectiveRocks/RocksDBColumnFamilyOptions.mm +++ b/ObjectiveRocks/RocksDBColumnFamilyOptions.mm @@ -108,18 +108,6 @@ - (RocksDBMergeOperator *)mergeOperator return _mergeOperatorWrapper; } -- (void)setPrefixExtractor:(RocksDBPrefixExtractor *)prefixExtractor -{ - _prefixExtractorWrapper = prefixExtractor; - _prefixExtractorWrapper.encodingOptions = _encodingOptions; - _options.prefix_extractor.reset(_prefixExtractorWrapper.sliceTransform); -} - -- (RocksDBPrefixExtractor *)prefixExtractor -{ - return _prefixExtractorWrapper; -} - - (size_t)writeBufferSize { return _options.write_buffer_size; @@ -160,6 +148,18 @@ - (void)setCompressionType:(RocksDBCompressionType)compressionType _options.compression = (rocksdb::CompressionType)compressionType; } +- (void)setPrefixExtractor:(RocksDBPrefixExtractor *)prefixExtractor +{ + _prefixExtractorWrapper = prefixExtractor; + _prefixExtractorWrapper.encodingOptions = _encodingOptions; + _options.prefix_extractor.reset(_prefixExtractorWrapper.sliceTransform); +} + +- (RocksDBPrefixExtractor *)prefixExtractor +{ + return _prefixExtractorWrapper; +} + - (void)setNumLevels:(int)numLevels { _options.num_levels = numLevels; @@ -295,16 +295,6 @@ - (double)hardRateLimit return _options.hard_rate_limit; } -- (void)setRateLimitDelayMaxMilliseconds:(unsigned int)rateLimitDelayMaxMilliseconds -{ - _options.rate_limit_delay_max_milliseconds = rateLimitDelayMaxMilliseconds; -} - -- (unsigned int)rateLimitDelayMaxMilliseconds -{ - return _options.rate_limit_delay_max_milliseconds; -} - - (void)setArenaBlockSize:(size_t)arenaBlockSize { _options.arena_block_size = arenaBlockSize; diff --git a/ObjectiveRocks/RocksDBComparator.h b/ObjectiveRocks/RocksDBComparator.h index a8599a7..afae2b8 100644 --- a/ObjectiveRocks/RocksDBComparator.h +++ b/ObjectiveRocks/RocksDBComparator.h @@ -8,20 +8,53 @@ #import +/** + An enum defining the built-in Comparators. + */ typedef NS_ENUM(NSUInteger, RocksDBComparatorType) { + /** @brief Orders the keys lexicographically in ascending order. */ RocksDBComparatorBytewiseAscending, + + /** @brief Orders the keys lexicographically in descending order. */ RocksDBComparatorBytewiseDescending, + + /** @brief Orders NSString keys in ascending order via the compare selector. */ RocksDBComparatorStringCompareAscending, + + /** @brief Orders NSString keys in descending order via the compare selector. */ RocksDBComparatorStringCompareDescending, + + /** @brief Orders NSNumber keys in ascending order via the compare selector.*/ RocksDBComparatorNumberAscending, + + /** @brief Orders NSNumber keys in descending order via the compare selector. */ RocksDBComparatorNumberDescending }; +/** + The keys are ordered within the key-value store according to a specified comparator function. The default ordering + function for keys orders the bytes lexicographically. + + This behavior can be changed by supplying a custom Comparator when opening a database using the `RocksDBComparator`. + */ @interface RocksDBComparator : NSObject +/** + Intializes a new Comparator instance for the given built-in type. + + @param type The comparator type. + @return a newly-initialized instance of a keys comparator. + */ + (instancetype)comaparatorWithType:(RocksDBComparatorType)type; +/** + Intializes a new Comparator instance with the given name and comparison block. + + @param name The name of the comparator. + @param block The comparator block to apply on the keys in order to specify their order. + @return a newly-initialized instance of a keys comparator. + */ - (instancetype)initWithName:(NSString *)name andBlock:(int (^)(id key1, id key2))block; @end diff --git a/ObjectiveRocks/RocksDBCuckooTableOptions.h b/ObjectiveRocks/RocksDBCuckooTableOptions.h index 405e8fe..f227306 100644 --- a/ObjectiveRocks/RocksDBCuckooTableOptions.h +++ b/ObjectiveRocks/RocksDBCuckooTableOptions.h @@ -10,10 +10,49 @@ @interface RocksDBCuckooTableOptions : NSObject +/** + @brief + Determines the utilization of hash tables. Smaller values + result in larger hash tables with fewer collisions. + */ @property (nonatomic, assign) double hashTableRatio; + +/** + @brief + A property used by builder to determine the depth to go to + to search for a path to displace elements in case of + collision. Higher values result in more efficient hash tables + with fewer lookups but take more time to build. + */ @property (nonatomic, assign) uint32_t maxSearchDepth; + +/** + @brief + In case of collision while inserting, the builder + attempts to insert in the next `cuckooBlockSize` + locations before skipping over to the next Cuckoo hash + function. This makes lookups more cache friendly in case + of collisions. + */ @property (nonatomic, assign) uint32_t cuckooBlockSize; + +/** + @brief + If this option is enabled, user key is treated as uint64_t and its value + is used as hash value directly. This option changes builder's behavior. + Reader ignore this option and behave according to what specified in table + property. + */ @property (nonatomic, assign) BOOL identityAsFirstHash; + +/** + @brief + If this option is set to true, module is used during hash calculation. + This often yields better space efficiency at the cost of performance. + If this optino is set to false, # of entries in table is constrained to be + power of two, and bit and is used to calculate hash, which is faster in + general. + */ @property (nonatomic, assign) BOOL useModuleHash; @end diff --git a/ObjectiveRocks/RocksDBDatabaseOptions.h b/ObjectiveRocks/RocksDBDatabaseOptions.h index ac34f4d..cb07489 100644 --- a/ObjectiveRocks/RocksDBDatabaseOptions.h +++ b/ObjectiveRocks/RocksDBDatabaseOptions.h @@ -10,6 +10,7 @@ #import "RocksDBEnv.h" #import "RocksDBStatistics.h" +/** @brief The DB log level. */ typedef NS_ENUM(unsigned char, RocksDBLogLevel) { RocksDBLogLevelDebug = 0, @@ -19,24 +20,76 @@ typedef NS_ENUM(unsigned char, RocksDBLogLevel) RocksDBLogLevelFatal }; +/** + Options to control the behavior of the DB. + */ @interface RocksDBDatabaseOptions : NSObject +/** @brief If true, the database will be created if it is missing. + The default is false. */ @property (nonatomic, assign) BOOL createIfMissing; + +/** @brief If true, missing column families will be automatically created. + The default is false. */ @property (nonatomic, assign) BOOL createMissingColumnFamilies; + +/** @brief An error is raised if the database already exists. + The default is false. */ @property (nonatomic, assign) BOOL errorIfExists; + +/** @brief If true, RocksDB will aggressively check consistency of the data. + Also, if any of the writes to the database fails (Put, Delete, Merge, + Write), the database will switch to read-only mode and fail all other + Write operations. + The default is true. + */ @property (nonatomic, assign) BOOL paranoidChecks; -@property (nonatomic, strong) RocksDBEnv *env; + +/** @brief The info log level. */ @property (nonatomic, assign) RocksDBLogLevel infoLogLevel; + +/** @brief Number of open files that can be used by the DB. + The default is 5000. */ @property (nonatomic, assign) int maxOpenFiles; + +/** @brief Once write-ahead logs exceed this size, column families whose + memtables are backed by the oldest live WAL file will be forced to flush. + The default is 0. */ @property (nonatomic, assign) uint64_t maxWriteAheadLogSize; + +/** @brief If non-nil, metrics about database operations will be collected. + Statistics objects should not be shared between DB instances. + The default is nil. + + @see RocksDBStatistics + */ @property (nonatomic, strong) RocksDBStatistics *statistics; + +/** @brief If true, then the contents of manifest and data files are not + synced to stable storage. + The default is false. */ @property (nonatomic, assign) BOOL disableDataSync; + +/** @brief If true, then every store to stable storage will issue a fsync. + The default is false. */ @property (nonatomic, assign) BOOL useFSync; -@property (nonatomic, assign) int maxBackgroundCompactions; -@property (nonatomic, assign) int maxBackgroundFlushes; + +/** @brief Specify the maximal size of the info log file. If maxLogFileSize == 0, + all logs will be written to one log file. + The default is 0. */ @property (nonatomic, assign) size_t maxLogFileSize; + +/** @brief Time for the info log file to roll (in seconds). + The default is 0 (disabled). */ @property (nonatomic, assign) size_t logFileTimeToRoll; + +/** @brief Maximal info log files to be kept. + The default is 1000. */ @property (nonatomic, assign) size_t keepLogFileNum; + +/** @brief Allows OS to incrementally sync files to disk while they are being + written, asynchronously, in the background. + The default is 0. */ @property (nonatomic, assign) uint64_t bytesPerSync; @end diff --git a/ObjectiveRocks/RocksDBEncodingOptions.h b/ObjectiveRocks/RocksDBEncodingOptions.h index 533cfaf..d4c12fd 100644 --- a/ObjectiveRocks/RocksDBEncodingOptions.h +++ b/ObjectiveRocks/RocksDBEncodingOptions.h @@ -9,14 +9,39 @@ #import #import "RocksDBTypes.h" +/** + Options to define how arbitrary objects (keys & values) should be converted to + NSData and vise versa. + */ @interface RocksDBEncodingOptions : NSObject +/** @brief + A block to convert `id` keys to NSData objects. + */ @property (nonatomic, copy) NSData * (^ keyEncoder)(id key); + +/** @brief + A block to convert NSData objects to the corresponding `id` key. + */ @property (nonatomic, copy) id (^ keyDecoder)(NSData *data); + +/** @brief + A block to convert `id` values to NSData objects. The block takes two + parameters, the key-value pair to allow multiplexing. + */ @property (nonatomic, copy) NSData * (^ valueEncoder)(id key, id value); + +/** @brief A block to convert NSData objects to the corresponding value. */ @property (nonatomic, copy) id (^ valueDecoder)(id key, NSData *data); +/** @brief Use a predefined type for the keys. + @see RocksDBTypes + */ @property (nonatomic, assign) RocksDBType keyType; + +/** @brief Use a predefined type for the values. + @see RocksDBTypes + */ @property (nonatomic, assign) RocksDBType valueType; @end diff --git a/ObjectiveRocks/RocksDBEnv.h b/ObjectiveRocks/RocksDBEnv.h index 13776ca..e9fa72f 100644 --- a/ObjectiveRocks/RocksDBEnv.h +++ b/ObjectiveRocks/RocksDBEnv.h @@ -8,14 +8,35 @@ #import +/** + All file operations (and other operating system calls) issued by the RocksDB implementation are routed through an + `RocksDBEnv` object. Currently `RocksDBEnv` only exposes the high & low priority thread pool parameters. + */ @interface RocksDBEnv : NSObject +/** + Initializes a new Env instane with the given high & low priority background threads. + + @param lowPrio The count of thread for the high priority queue. + @param highPrio The count of thread for the low priority queue. + @return A newly-initialized instance with the given number of threads. + */ + (instancetype)envWithLowPriorityThreadCount:(int)lowPrio andHighPriorityThreadCount:(int)highPrio; +/** @brief Sets the count of thread for the high priority queue. */ - (void)setHighPriorityPoolThreadsCount:(int)numThreads; + +/** @brief Sets the count of thread for the low priority queue. */ - (void)setLowPriorityPoolThreadsCount:(int)numThreads; #if ROCKSDB_USING_THREAD_STATUS +/** + Returns an array with the status of all threads that belong to the current Env. + + @see RocksDBThreadStatus + + @warning This method is not available in RocksDB Lite. + */ - (NSArray *)threadList; #endif diff --git a/ObjectiveRocks/RocksDBFilterPolicy.h b/ObjectiveRocks/RocksDBFilterPolicy.h index cc8efbc..b09a2b7 100644 --- a/ObjectiveRocks/RocksDBFilterPolicy.h +++ b/ObjectiveRocks/RocksDBFilterPolicy.h @@ -8,9 +8,26 @@ #import +/** + Defines a filter policy for keys. + */ @interface RocksDBFilterPolicy : NSObject +/** + Return a new filter policy that uses a bloom filter with approximately + the specified number of bits per key. + + @param bitsPerKey The number of bits per key. + */ + (instancetype)bloomFilterPolicyWithBitsPerKey:(int)bitsPerKey; + +/** + Return a new filter policy that uses a bloom filter with approximately + the specified number of bits per key. + + @param bitsPerKey The number of bits per key. + @param useBlockBasedBuilder Use block-based builder. + */ + (instancetype)bloomFilterPolicyWithBitsPerKey:(int)bitsPerKey useBlockBasedBuilder:(BOOL)useBlockBasedBuilder; @end diff --git a/ObjectiveRocks/RocksDBIterator+Private.h b/ObjectiveRocks/RocksDBIterator+Private.h index 0472f92..d9cf4d9 100644 --- a/ObjectiveRocks/RocksDBIterator+Private.h +++ b/ObjectiveRocks/RocksDBIterator+Private.h @@ -12,8 +12,22 @@ namespace rocksdb { class Iterator; } +/** + This category is intended to hide all C++ types from the public interface in order to + maintain a pure Objective-C API for Swift compatibility. + */ @interface RocksDBIterator (Private) +/** + Initializes a new instance of `RocksDBIterator` with the given options and + rocksdb::Iterator instance. + + @param iterator The rocks::Iterator instance. + @param options The Encoding options. + @return a newly-initialized instance of `RocksDBIterator`. + + @see RocksDBEncodingOptions + */ - (instancetype)initWithDBIterator:(rocksdb::Iterator *)iterator andEncodingOptions:(RocksDBEncodingOptions *)options; diff --git a/ObjectiveRocks/RocksDBIterator.h b/ObjectiveRocks/RocksDBIterator.h index 5bad6a8..424ff86 100644 --- a/ObjectiveRocks/RocksDBIterator.h +++ b/ObjectiveRocks/RocksDBIterator.h @@ -9,13 +9,23 @@ #import #import "RocksDBEncodingOptions.h" +/** + Represents a range of keys. + */ @interface RocksDBIteratorKeyRange : NSObject +/* @breif Start key, inclusive */ @property (nonatomic, strong) id start; +/* @breif End key, exclusive */ @property (nonatomic, strong) id end; @end +/** + Creates a new RocksDBIteratorKeyRange from the specified values. + + @return RocksDBIteratorKeyRange with start and end keys. + */ NS_INLINE RocksDBIteratorKeyRange * RocksDBMakeKeyRange(id start, id end) { RocksDBIteratorKeyRange *range = [RocksDBIteratorKeyRange new]; range.start = start; @@ -24,28 +34,132 @@ NS_INLINE RocksDBIteratorKeyRange * RocksDBMakeKeyRange(id start, id end) { return range; } +/** + An iterator over the sorted DB keys. Supports iteration in the natural sort order, the reverse order, and prefix seek. + */ @interface RocksDBIterator : NSObject +/** @brief Closes this Iterator */ - (void)close; +/** + An iterator is either positioned at a key/value pair, or not valid. + + @return `YES` if the iterator is valid, `NO` otherwise. + */ - (BOOL)isValid; + +/** + Positions the iterator at the first key in the source. + The iterator `isValid` after this call if the source is not empty. + */ - (void)seekToFirst; + +/** + Positions the iterator at the last key in the source. + The iterator `isValid` after this call if the source is not empty. + */ - (void)seekToLast; + +/** + Positions the iterator at the first key in the source that at or past the given key. + The iterator `isValid` after this call if the source contains an entry that comes at + or past the given key. + + @param aKey The key to position the tartaritartor at. + */ - (void)seekToKey:(id)aKey; + +/** + Moves to the next entry in the source. After this call, `isValid` is + true if the iterator was not positioned at the last entry in the source. + */ - (void)next; + +/** + Moves to the previous entry in the source. After this call, `isValid` is + true iff the iterator was not positioned at the first entry in source. + */ - (void)previous; + +/** + Returns the key for the current entry. The underlying storage for the returned + value is valid only until the next modification of the iterator. + + @return The key at the current position. + */ - (id)key; + +/** + Returns the value for the current entry. The underlying storage for the returned + value is valid only until the next modification of the iterator. + + @return The value for the key at the current position. + */ - (id)value; +/** + Executes a given block for each key in the iterator. + + @param block The block to apply to elements. + */ - (void)enumerateKeysUsingBlock:(void (^)(id key, BOOL *stop))block; + +/** + Executes a given block for each key in the iterator in reverse order. + + @param reverse BOOL indicating whether to enumerate in the reverse order. + @param block The block to apply to elements. + */ - (void)enumerateKeysInReverse:(BOOL)reverse usingBlock:(void (^)(id key, BOOL *stop))block; + +/** + Executes a given block for each key in the iterator in the given key range. + + @param range The key range. + @param reverse BOOL indicating whether to enumerate in the reverse order. + @param block The block to apply to elements. + + @see RocksDBIteratorKeyRange + */ - (void)enumerateKeysInRange:(RocksDBIteratorKeyRange *)range reverse:(BOOL)reverse usingBlock:(void (^)(id key, BOOL *stop))block; +/** + Executes a given block for each key-value pair in the iterator. + + @param block The block to apply to elements. + */ - (void)enumerateKeysAndValuesUsingBlock:(void (^)(id key, id value, BOOL *stop))block; + +/** + Executes a given block for each key-value pair in the iterator in reverse order. + + @param reverse BOOL indicating whether to enumerate in the reverse order. + @param block The block to apply to elements. + */ - (void)enumerateKeysAndValuesInReverse:(BOOL)reverse usingBlock:(void (^)(id key, id value, BOOL *stop))block; + +/** + Executes a given block for each key-value pair in the iterator in the given key range. + + @param range The key range. + @parame reverse BOOL indicating whether to enumerate in the reverse order. + @param block The block to apply to elements. + */ - (void)enumerateKeysAndValuesInRange:(RocksDBIteratorKeyRange *)range reverse:(BOOL)reverse usingBlock:(void (^)(id key, id value, BOOL *stop))block; +/** + Executes a given block for each key with the given prefix in the iterator. + + @param block The block to apply to elements. + */ - (void)enumerateKeysWithPrefix:(id)prefix usingBlock:(void (^)(id key, BOOL *stop))block; + +/** + Executes a given block for each key-value pair with the given prefix in the iterator. + + @param block The block to apply to elements. + */ - (void)enumerateKeysAndValuesWithPrefix:(id)prefix usingBlock:(void (^)(id key, id value, BOOL *stop))block; @end diff --git a/ObjectiveRocks/RocksDBMemTableRepFactory.h b/ObjectiveRocks/RocksDBMemTableRepFactory.h index 16d0192..5d7e9c0 100644 --- a/ObjectiveRocks/RocksDBMemTableRepFactory.h +++ b/ObjectiveRocks/RocksDBMemTableRepFactory.h @@ -8,15 +8,48 @@ #import +/** + A factory for MemTableRep objects + */ @interface RocksDBMemTableRepFactory : NSObject +/** + Creates MemTableReps that use a skip list to store keys. + This is the default in RocksDB. + */ + (instancetype)skipListRepFacotry; #ifndef ROCKSDB_LITE +/** + Creates MemTableReps that are backed by an std::vector. + On iteration, the vector is sorted. This is useful for workloads + where iteration is very rare and writes are generally not issued + after reads begin. + */ + (instancetype)vectorRepFactory; + +/** + Creates MemTableRep that contain a fixed array of buckets, each + pointing to a skiplist. + */ + (instancetype)hashSkipListRepFactory; + +/** + Creates MemTableRep based on a hash table: it contains a fixed + array of buckets, each pointing to either a linked list or a skip + list if number of entries inside the bucket exceeds a predefined + threshold. + */ + (instancetype)hashLinkListRepFactory; + +/** + Creates cuckoo-hashing based MemTableRep. Cuckoo-hash is a closed-hash + strategy, in which all key/value pairs are stored in the bucket array + itself intead of in some data structures external to the bucket array. + + @param writeBufferSize The write buffer size in bytes. + */ + (instancetype)hashCuckooRepFactoryWithWriteBufferSize:(size_t)writeBufferSize; #endif diff --git a/ObjectiveRocks/RocksDBMergeOperator.h b/ObjectiveRocks/RocksDBMergeOperator.h index 10806b3..e330ba8 100644 --- a/ObjectiveRocks/RocksDBMergeOperator.h +++ b/ObjectiveRocks/RocksDBMergeOperator.h @@ -8,11 +8,48 @@ #import +/** + A Merge operator is an atomic Read-Modify-Write operation in RocksDB. + */ @interface RocksDBMergeOperator : NSObject +/** + Initializes a new instance of an associative merge operator. + + @discussion This Merge Operator can be use for associative data: + + * The merge operands are formatted the same as the Put values, AND + * It is okay to combine multiple operands into one (as long as they are in the same order) + + @param name The name of the merge operator. + @param block The block that merges the existing and new values for the given key. + @return A newly-initialized instance of the Merge Operator. + */ + (instancetype)operatorWithName:(NSString *)name andBlock:(id (^)(id key, id existingValue, id value))block; +/** + Initializes a new instance of a generic merge operator. + + @discussion If either of the two associativity constraints do not hold, then the Generic Merge Operator could + be used. + + The Generic Merge Operator has two methods, PartialMerge, FullMerge: + + * PartialMerge: used to combine two-merge operands (if possible). If the client-specified operator can logically + handle “combining” two merge-operands into a single operand, the semantics for doing so should be provided in this + method, which should then return a non-nil object. If `nil` is returned, then it means that the two merge-operands + couldn’t be combined into one. + + * FullMerge: this function is given an existingValue and a list of operands that have been stacked. The + client-specified MergeOperator should then apply the operands one-by-one and return the resulting object. + If `nil` is returned, then this indicates a failure, i.e. corrupted data, errors ... etc. + + @param name The name of the merge operator. + @param partialMergeBlock The block to perform a partial merge. + @param fullMergeBlock The block to perform the full merge. + @return A newly-initialized instance of the Merge Operator. + */ + (instancetype)operatorWithName:(NSString *)name partialMergeBlock:(NSString * (^)(id key, NSString *leftOperand, NSString *rightOperand))partialMergeBlock fullMergeBlock:(id (^)(id key, id existingValue, NSArray *operandList))fullMergeBlock; diff --git a/ObjectiveRocks/RocksDBOptions.h b/ObjectiveRocks/RocksDBOptions.h index 878a875..2b528d8 100644 --- a/ObjectiveRocks/RocksDBOptions.h +++ b/ObjectiveRocks/RocksDBOptions.h @@ -16,81 +16,320 @@ #import "RocksDBPrefixExtractor.h" #import "RocksDBTypes.h" +/** + A proxy object for `RocksDBDatabaseOptions` and `RocksDBColumnFamilyOptions`. + */ @interface RocksDBOptions : NSObject +/** + Initializes a new instance of `RocksDBOptions`. + + @param dbOptions The DB options. + @param columnFamilyOptions The Column Family options. + @return A newly-initialized instance of `RocksDBOptions`. + + @warning When creating multiple instances of `RocksDBOptions` for different Column + Families, make sure to pass an "equal" DB options object across all instances. + */ - (instancetype)initWithDatabaseOptions:(RocksDBDatabaseOptions *)dbOptions andColumnFamilyOptions:(RocksDBColumnFamilyOptions *)columnFamilyOptions; @end +/** + Options to define how arbitrary objects (keys & values) should be converted to + NSData and vise versa. + */ @interface RocksDBOptions (Encoding) +/** @brief + A block to convert `id` keys to NSData objects. + */ @property (nonatomic, copy) NSData * (^ keyEncoder)(id key); + +/** @brief + A block to convert NSData objects to the corresponding `id` key. + */ @property (nonatomic, copy) id (^ keyDecoder)(NSData *data); + +/** @brief + A block to convert `id` values to NSData objects. The block takes two + parameters, the key-value pair to allow multiplexing. + */ @property (nonatomic, copy) NSData * (^ valueEncoder)(id key, id value); + +/** @brief A block to convert NSData objects to the corresponding value. */ @property (nonatomic, copy) id (^ valueDecoder)(id key, NSData *data); +/** @brief Use a predefined type for the keys. + @see RocksDBTypes + */ @property (nonatomic, assign) RocksDBType keyType; + +/** @brief Use a predefined type for the values. + @see RocksDBTypes + */ @property (nonatomic, assign) RocksDBType valueType; @end +/** + Options to control the behavior of the DB. + */ @interface RocksDBOptions (DBOptions) +/** @brief If true, the database will be created if it is missing. + The default is false. */ @property (nonatomic, assign) BOOL createIfMissing; + +/** @brief If true, missing column families will be automatically created. + The default is false. */ @property (nonatomic, assign) BOOL createMissingColumnFamilies; + +/** @brief An error is raised if the database already exists. + The default is false. */ @property (nonatomic, assign) BOOL errorIfExists; + +/** @brief If true, RocksDB will aggressively check consistency of the data. + Also, if any of the writes to the database fails (Put, Delete, Merge, + Write), the database will switch to read-only mode and fail all other + Write operations. + The default is true. + */ @property (nonatomic, assign) BOOL paranoidChecks; + +/** @brief The info log level. */ @property (nonatomic, assign) RocksDBLogLevel infoLogLevel; + +/** @brief Number of open files that can be used by the DB. + The default is 5000. */ @property (nonatomic, assign) int maxOpenFiles; + +/** @brief Once write-ahead logs exceed this size, column families whose + memtables are backed by the oldest live WAL file will be forced to flush. + The default is 0. */ @property (nonatomic, assign) uint64_t maxWriteAheadLogSize; + +/** @brief If non-nil, metrics about database operations will be collected. + Statistics objects should not be shared between DB instances. + The default is nil. + + @see RocksDBStatistics + */ @property (nonatomic, strong) RocksDBStatistics *statistics; + +/** @brief If true, then the contents of manifest and data files are not + synced to stable storage. + The default is false. */ @property (nonatomic, assign) BOOL disableDataSync; + +/** @brief If true, then every store to stable storage will issue a fsync. + The default is false. */ @property (nonatomic, assign) BOOL useFSync; + +/** @brief Specify the maximal size of the info log file. If maxLogFileSize == 0, + all logs will be written to one log file. + The default is 0. */ @property (nonatomic, assign) size_t maxLogFileSize; + +/** @brief Time for the info log file to roll (in seconds). + The default is 0 (disabled). */ @property (nonatomic, assign) size_t logFileTimeToRoll; + +/** @brief Maximal info log files to be kept. + The default is 1000. */ @property (nonatomic, assign) size_t keepLogFileNum; + +/** @brief Allows OS to incrementally sync files to disk while they are being + written, asynchronously, in the background. + The default is 0. */ @property (nonatomic, assign) uint64_t bytesPerSync; @end +/** + Options to control the behaviour of Column Families. + @RocksDBColumnFamily + */ @interface RocksDBOptions (ColumnFamilyOptions) +/** @brief Comparator used to define the order of keys in the table. + Default: a comparator that uses lexicographic byte-wise ordering. + + @see RocksDBComparator + */ @property (nonatomic, strong) RocksDBComparator *comparator; + +/** @brief The client must provide a merge operator if Merge operation + needs to be accessed. + Default: nil + + @warning The client must ensure that the merge operator supplied here has + the same name and *exactly* the same semantics as the merge operator provided + to previous open calls on the same DB. + + @see RocksDBMergeOperator + */ @property (nonatomic, strong) RocksDBMergeOperator *mergeOperator; -@property (nonatomic, strong) RocksDBPrefixExtractor *prefixExtractor; + +/** @brief Amount of data to build up in memory (backed by an unsorted log + on disk) before converting to a sorted on-disk file. + Default: 4MB. + */ @property (nonatomic, assign) size_t writeBufferSize; + +/** @brief The maximum number of write buffers that are built up in memory. + Default: 2 + */ @property (nonatomic, assign) int maxWriteBufferNumber; + +/** @brief The minimum number of write buffers that will be merged together + before writing to storage. + Default: 1 + */ @property (nonatomic, assign) int minWriteBufferNumberToMerge; + +/** @brief Compress blocks using the specified compression algorithm. + Default: RocksDBCompressionSnappy, which gives lightweight but fast compression. + */ @property (nonatomic, assign) RocksDBCompressionType compressionType; + +/** @brief If non-nil, the specified function to determine the + prefixes for keys will be used. These prefixes will be placed in the filter. + + @see RocksDBPrefixExtractor + */ +@property (nonatomic, strong) RocksDBPrefixExtractor *prefixExtractor; + +/** @brief Number of levels for this DB. */ @property (nonatomic, assign) int numLevels; + +/** @brief Number of files to trigger level-0 compaction. + Default: 4 + */ @property (nonatomic, assign) int level0FileNumCompactionTrigger; + +/** @brief Soft limit on number of level-0 files. */ @property (nonatomic, assign) int level0SlowdownWritesTrigger; + +/** @brief Maximum number of level-0 files. */ @property (nonatomic, assign) int level0StopWritesTrigger; + +/** @brief Maximum level to which a new compacted memtable is pushed if it + does not create overlap. */ @property (nonatomic, assign) int maxMemCompactionLevel; + +/** @brief Target file size for compaction. + Default: 2MB + */ @property (nonatomic, assign) uint64_t targetFileSizeBase; + +/** @brief By default target_file_size_multiplier is 1, which means + by default files in different levels will have similar size. */ @property (nonatomic, assign) int targetFileSizeMultiplier; + +/** @brief Control maximum total data size for a level. + Default: 10MB + */ @property (nonatomic, assign) uint64_t maxBytesForLevelBase; + +/** @brief Default: 10 */ @property (nonatomic, assign) int maxBytesForLevelMultiplier; + +/** @brief Maximum number of bytes in all compacted files. */ @property (nonatomic, assign) int expandedCompactionFactor; + +/** @brief Maximum number of bytes in all source files to be compacted in a + single compaction run. */ @property (nonatomic, assign) int sourceCompactionFactor; + +/** @brief Control maximum bytes of overlaps in grandparent (i.e., level+2) */ @property (nonatomic, assign) int maxGrandparentOverlapFactor; + +/** @brief Puts are delayed 0-1 ms when any level has a compaction score that + exceeds this limit. + Default: 0 (disabled) + */ @property (nonatomic, assign) double softRateLimit; + +/** @brief Puts are delayed 1ms at a time when any level has a compaction + score that exceeds this limit. + Default: 0 (disabled) + */ @property (nonatomic, assign) double hardRateLimit; -@property (nonatomic, assign) unsigned int rateLimitDelayMaxMilliseconds; + +/** @brief Size of one block in arena memory allocation. + Default: 0 + */ @property (nonatomic, assign) size_t arenaBlockSize; + +/** @brief Disable automatic compactions. Manual compactions can still be issued + on the column family. */ @property (nonatomic, assign) BOOL disableAutoCompactions; + +/** @brief Purge duplicate/deleted keys when a memtable is flushed to storage. */ @property (nonatomic, assign) BOOL purgeRedundantKvsWhileFlush; + +/** @brief If true, compaction will verify checksum on every read that happens + as part of compaction. + Default: true + */ @property (nonatomic, assign) BOOL verifyChecksumsInCompaction; + +/** @brief Use KeyMayExist API to filter deletes when this is true. + Default: false + */ @property (nonatomic, assign) BOOL filterDeletes; + +/** @brief An iteration->Next() sequentially skips over keys with the same + user-key unless this option is set. + Default: 0 + */ @property (nonatomic, assign) uint64_t maxSequentialSkipInIterations; + +/** @brief This is a factory that provides MemTableRep objects. + Default: A factory that provides a skip-list-based implementation of MemTableRep. + + @see RocksDBMemTableRepFactory + */ @property (nonatomic, strong) RocksDBMemTableRepFactory *memTableRepFactory; + +/** @brief This is a factory that provides TableFactory objects. + Default: A block-based table factory that provides a default + implementation of TableBuilder and TableReader with default + BlockBasedTableOptions. + + @see RocksDBTableFactory + */ @property (nonatomic, strong) RocksDBTableFactory *tableFacotry; + +/** @brief If prefixExtractor is set and bloom_bits is not 0, create prefix bloom + for memtable + + @see RocksDBPrefixExtractor +*/ @property (nonatomic, assign) uint32_t memtablePrefixBloomBits; + +/** @brief Number of hash probes per key. */ @property (nonatomic, assign) uint32_t memtablePrefixBloomProbes; + +/** @brief Page size for huge page TLB for bloom in memtable. */ @property (nonatomic, assign) size_t memtablePrefixBloomHugePageTlbSize; + +/** @brief Control locality of bloom filter probes to improve cache miss rate. + Default: 0 + */ @property (nonatomic, assign) uint32_t bloomLocality; + +/** @brief Maximum number of successive merge operations on a key in the memtable. + Default: 0 (disabled) + */ @property (nonatomic, assign) size_t maxSuccessiveMerges; + +/** @brief The number of partial merge operands to accumulate before partial + merge will be performed. + Default: 2 + */ @property (nonatomic, assign) uint32_t minPartialMergeOperands; @end diff --git a/ObjectiveRocks/RocksDBPlainTableOptions.h b/ObjectiveRocks/RocksDBPlainTableOptions.h index 05f3a83..09d596f 100644 --- a/ObjectiveRocks/RocksDBPlainTableOptions.h +++ b/ObjectiveRocks/RocksDBPlainTableOptions.h @@ -16,13 +16,61 @@ typedef NS_ENUM(char, PlainTableEncodingType) @interface RocksDBPlainTableOptions : NSObject + +/** + @brief + Plain table has optimization for fix-sized keys, which can + be specified via userKeyLen. + */ @property (nonatomic, assign) uint32_t userKeyLen; + +/** + @brief + The number of bits used for bloom filer per prefix. + To disable it pass a zero. + */ @property (nonatomic, assign) int bloomBitsPerKey; + +/** + @brief + The desired utilization of the hash table used for prefix hashing. + `hashTableRatio` = number of prefixes / #buckets in the hash table. + */ @property (nonatomic, assign) double hashTableRatio; + +/** + @brief + Used to build one index record inside each prefix for the number of + keys for the binary search inside each hash bucket. + */ @property (nonatomic, assign) size_t indexSparseness; + +/** + @brief + Huge page TLB size. The user needs to reserve huge pages + for it to be allocated, like: + `sysctl -w vm.nr_hugepages=20` + */ @property (nonatomic, assign) size_t hugePageTlbSize; + +/** + @brief + Encoding type for the keys. The value will determine how to encode keys + when writing to a new SST file. + */ @property (nonatomic, assign) PlainTableEncodingType encodingType; + +/** + @brief + Mode for reading the whole file one record by one without using the index. + */ @property (nonatomic, assign) BOOL fullScanMode; + +/** + @brief + Compute plain table index and bloom filter during file building and store + it in file. When reading file, index will be mmaped instead of recomputation. + */ @property (nonatomic, assign) BOOL storeIndexInFile; @end diff --git a/ObjectiveRocks/RocksDBPrefixExtractor.h b/ObjectiveRocks/RocksDBPrefixExtractor.h index 8e7d66f..9d688f0 100644 --- a/ObjectiveRocks/RocksDBPrefixExtractor.h +++ b/ObjectiveRocks/RocksDBPrefixExtractor.h @@ -8,15 +8,43 @@ #import +/** + Constants for the built-in prefix extractors. + */ typedef NS_ENUM(NSUInteger, RocksDBPrefixType) { + /** @brief Extract a fixed-length prefix for each key. */ RocksDBPrefixFixedLength }; +/** + `RocksDBIterator` supports iterating inside a key-prefix by providing a `RocksDBPrefixExtractor`. + + The `RocksDBPrefixExtractor` defines a Slice-Transform function that is applied to each key when + itarating the DB in order to extract the prefix for the prefix-seek API. + */ @interface RocksDBPrefixExtractor : NSObject +/** + Intializes a new instance of the prefix extarctor with the given type and length. + + @param type The type of the prefix extractor. + @param length The length of the desired prefix. + @return A newly-initialized instance of a prefix extractor. + */ + (instancetype)prefixExtractorWithType:(RocksDBPrefixType)type length:(size_t)length; +/** + Intializes a new instance of the prefix extarctor with the given transformation functions. + + @param transformBlock A block to apply to each key to extract the prefix. + @param prefixCandidateBlock A block that is applied to each key before the transformation + in order to filter out keys that are not viable candidates for the custom prefix format, + e.g. key length is smaller than the target prefix length. + @param validPrefixBlock A block that is applied to each key after the transformation in + order to perform extra checks to verify that the extracted prefix is valid. + @return A newly-initialized instance of a prefix extractor. + */ - (instancetype)initWithName:(NSString *)name transformBlock:(id (^)(id key))transformBlock prefixCandidateBlock:(BOOL (^)(id key))prefixCandidateBlock diff --git a/ObjectiveRocks/RocksDBReadOptions.h b/ObjectiveRocks/RocksDBReadOptions.h index e0aedf9..93e5fe4 100644 --- a/ObjectiveRocks/RocksDBReadOptions.h +++ b/ObjectiveRocks/RocksDBReadOptions.h @@ -8,9 +8,20 @@ #import +/** Options that control read operations. */ @interface RocksDBReadOptions : NSObject +/** @brief If true, all data read from underlying storage will be + verified against corresponding checksums. + Default: true + */ @property (nonatomic, assign) BOOL verifyChecksums; + +/** @brief If true, the "data block"/"index block"/"filter block" read for this + iteration will be cached in memory. Callers may wish to set this field to false + for bulk scans. + Default: true + */ @property (nonatomic, assign) BOOL fillCache; @end diff --git a/ObjectiveRocks/RocksDBSnapshot+Private.h b/ObjectiveRocks/RocksDBSnapshot+Private.h index e292532..3dddc4b 100644 --- a/ObjectiveRocks/RocksDBSnapshot+Private.h +++ b/ObjectiveRocks/RocksDBSnapshot+Private.h @@ -13,8 +13,23 @@ namespace rocksdb { class ColumnFamilyHandle; } +/** + This category is intended to hide all C++ types from the public interface in order to + maintain a pure Objective-C API for Swift compatibility. + */ @interface RocksDBSnapshot (Private) +/** + Initializes a new instance of `RocksDBWriteBatch` with the given options and + rocksdb::DB abd rocksdb::ColumnFamilyHandle instances. + + @param db The rocks::DB instance. + @param columnFamily The rocks::ColumnFamilyHandle instance. + @param readOptions The read options. + @return a newly-initialized instance of `RocksDBSnapshot`. + + @see RocksDBReadOptions + */ - (instancetype)initWithDBInstance:(rocksdb::DB *)db columnFamily:(rocksdb::ColumnFamilyHandle *)columnFamily andReadOptions:(RocksDBReadOptions *)readOptions; diff --git a/ObjectiveRocks/RocksDBSnapshot.h b/ObjectiveRocks/RocksDBSnapshot.h index 80fa31a..91e0c03 100644 --- a/ObjectiveRocks/RocksDBSnapshot.h +++ b/ObjectiveRocks/RocksDBSnapshot.h @@ -11,33 +11,43 @@ #import "RocksDBReadOptions.h" #import "RocksDBSnapshotUnavailable.h" +/** + The `RocksDBSnapshot` provides a consistent read-only view over the state of the key-value store. + */ @interface RocksDBSnapshot : RocksDB +/** @brief Returns the Snapshot's sequence number. */ +- (uint64_t)sequenceNumber; + @end +/** + This category marks all mutating method inherited form the `RocksDB` parent class as unavailable since the + `RocksDBSnapshot` is a read-only unmodifiable view over the DB. + */ @interface RocksDBSnapshot (Unavailable) -- (instancetype)initWithPath:(NSString *)path NA("Create a snapshot via a DB instance"); +- (instancetype)initWithPath:(NSString *)path UNAVAILABLE("Create a snapshot via a DB instance"); - (instancetype)initWithPath:(NSString *)path - andDBOptions:(void (^)(RocksDBOptions *options))options NA("Create a snapshot via a DB instance"); + andDBOptions:(void (^)(RocksDBOptions *options))options UNAVAILABLE("Create a snapshot via a DB instance"); - (instancetype)initWithPath:(NSString *)path columnFamilies:(RocksDBColumnFamilyDescriptor *)descriptor - andDatabaseOptions:(void (^)(RocksDBDatabaseOptions *options))options NA("Create a snapshot via a DB instance"); + andDatabaseOptions:(void (^)(RocksDBDatabaseOptions *options))options UNAVAILABLE("Create a snapshot via a DB instance"); -+ (NSArray *)listColumnFamiliesInDatabaseAtPath:(NSString *)path NA("Column Family API not available"); ++ (NSArray *)listColumnFamiliesInDatabaseAtPath:(NSString *)path UNAVAILABLE("Column Family API not available"); - (RocksDBColumnFamily *)createColumnFamilyWithName:(NSString *)name - andOptions:(void (^)(RocksDBColumnFamilyOptions *options))optionsBlock NA("Column Family API not available"); -- (RocksDBColumnFamilyMetaData *)columnFamilyMetaData NA("Column Family API not available"); -- (NSArray *)columnFamilies NA("Column Family API not available"); + andOptions:(void (^)(RocksDBColumnFamilyOptions *options))optionsBlock UNAVAILABLE("Column Family API not available"); +- (RocksDBColumnFamilyMetaData *)columnFamilyMetaData UNAVAILABLE("Column Family API not available"); +- (NSArray *)columnFamilies UNAVAILABLE("Column Family API not available"); - (void)setDefaultReadOptions:(void (^)(RocksDBReadOptions *readOptions))readOptions - andWriteOptions:(void (^)(RocksDBWriteOptions *writeOptions))writeOptions NA("Specify options when creating snapshot via DB instance"); + andWriteOptions:(void (^)(RocksDBWriteOptions *writeOptions))writeOptions UNAVAILABLE("Specify options when creating snapshot via DB instance"); -- (RocksDBSnapshot *)snapshot NA("Yo Dawg, Snapshot in Snapshot ... "); -- (RocksDBSnapshot *)snapshotWithReadOptions:(void (^)(RocksDBReadOptions *readOptions))readOptions NA("Yo Dawg, Snapshot in Snapshot ... "); +- (RocksDBSnapshot *)snapshot UNAVAILABLE("Yo Dawg, Snapshot in Snapshot ... "); +- (RocksDBSnapshot *)snapshotWithReadOptions:(void (^)(RocksDBReadOptions *readOptions))readOptions UNAVAILABLE("Yo Dawg, Snapshot in Snapshot ... "); -#define NA_SELECTOR(sel) sel NA("Snapshot is read-only"); +#define NA_SELECTOR(sel) sel UNAVAILABLE("Snapshot is read-only"); SNAPSHOT_PUT_MERGE_DELETE_SELECTORS #undef NA_SELECTOR diff --git a/ObjectiveRocks/RocksDBSnapshot.mm b/ObjectiveRocks/RocksDBSnapshot.mm index 7a734d6..16ffaa7 100644 --- a/ObjectiveRocks/RocksDBSnapshot.mm +++ b/ObjectiveRocks/RocksDBSnapshot.mm @@ -17,6 +17,8 @@ @interface RocksDBReadOptions (Private) @implementation RocksDBSnapshot +#pragma mark - Lifecycle + - (instancetype)initWithDBInstance:(rocksdb::DB *)db columnFamily:(rocksdb::ColumnFamilyHandle *)columnFamily andReadOptions:(RocksDBReadOptions *)readOptions @@ -42,5 +44,11 @@ - (void)close } } +#pragma mark - + +- (uint64_t)sequenceNumber +{ + return self.readOptions.options.snapshot->GetSequenceNumber(); +} @end diff --git a/ObjectiveRocks/RocksDBSnapshotUnavailable.h b/ObjectiveRocks/RocksDBSnapshotUnavailable.h index c591662..46b26f0 100644 --- a/ObjectiveRocks/RocksDBSnapshotUnavailable.h +++ b/ObjectiveRocks/RocksDBSnapshotUnavailable.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 BrainCookie. All rights reserved. // -#define NA(x) __attribute__((unavailable(x))) +#define UNAVAILABLE(x) __attribute__((unavailable(x))) #define SNAPSHOT_PUT_MERGE_DELETE_SELECTORS \ NA_SELECTOR(- (BOOL)setObject:(id)anObject forKey:(id)aKey) \ diff --git a/ObjectiveRocks/RocksDBStatistics.h b/ObjectiveRocks/RocksDBStatistics.h index 13d7bed..b755824 100644 --- a/ObjectiveRocks/RocksDBStatistics.h +++ b/ObjectiveRocks/RocksDBStatistics.h @@ -9,92 +9,305 @@ #import #import "RocksDBStatisticsHistogram.h" +/** @brief An enum for the Ticker Types. */ typedef NS_ENUM(uint32_t, RocksDBTickerType) { + /** @brief Total block cache misses. */ RocksDBTickerBlockCacheMiss = 0, + + /** @brief Total block cache hits. */ RocksDBTickerBlockCacheHit, + + /** @brief Number of blocks added to block cache. */ RocksDBTickerBlockCacheAdd, + + /** @brief # of times cache miss when accessing index block + from block cache. */ RocksDBTickerBlockCacheIndexMiss, + + /** @brief # of times cache hit when accessing index block + from block cache. */ RocksDBTickerBlockCacheIndexHit, + + /** @brief # of times cache miss when accessing filter block + from block cache. */ RocksDBTickerBlockCacheFilterMiss, + + /** @brief # of times cache hit when accessing filter block + from block cache. */ RocksDBTickerBlockCacheFilterHit, + + /** @brief # of times cache miss when accessing data block + from block cache. */ RocksDBTickerBlockCacheDataMiss, + + /** @brief # of times cache hit when accessing data block + from block cache. */ RocksDBTickerBlockCacheDataHit, + + /** @brief # of times bloom filter has avoided file reads. */ RocksDBTickerBloomFilterUseful, + + /** @brief # of memtable hits. */ RocksDBTickerMemtableHit, + + /** @brief # of memtable misses. */ RocksDBTickerMemtableMiss, + + /** @brief # of Get() queries served by L0 */ + RocksDBTickerGetHit_L0, + + /** @brief #of Get() queries served by L1 */ + RocksDBTickerGetHit_L1, + + /** @brief # of Get() queries served by L2 and up */ + RocksDBTickerGetHit_L2_AndUp, + + /** @brief Reason for key drop during compaction: The key was written + with a newer value. */ RocksDBTickerCompactionKeyDropNewerEntry, + + /** @brief Reason for key drop during compaction: The key is obsolete. */ RocksDBTickerCompactionKeyDropObsolete, + + /** @brief Reason for key drop during compaction: User compaction + function has dropped the key. */ RocksDBTickerCompactionKeyDropUser, + + /** @brief Number of keys written to the database via the Put and + Write call's. */ RocksDBTickerNumberKeysWritten, + + /** @brief Number of Keys read. */ RocksDBTickerNumberKeysRead, + + /** @brief Number keys updated, if inplace update is enabled. */ RocksDBTickerNumberKeysUpdated, + + /** @brief Number of bytes written. */ RocksDBTickerBytesWritten, + + /** @brief Number of bytes read. */ RocksDBTickerBytesRead, + + /** @brief Number of file closes. */ RocksDBTickerNoFileCloses, + + /** @brief Number of file opens. */ RocksDBTickerNoFileOpens, + + /** @brief Number of file errors. */ RocksDBTickerNoFileErrors, + + /** @brief Time system had to wait to do LO-L1 compactions + @deprecated + */ RocksDBTickerStall_L0SlowdownMicros, + + /** @brief Time system had to wait to move memtable to L1. + @deprecated + */ RocksDBTickerStallMemtableCompactionMicros, + + /** @brief Write throttle because of too many files in L0 + @deprecated + */ RocksDBTickerStall_L0NumFilesMicros, - RocksDBTickerEateLimitDelayMillis, + + /** @brief Writer has to wait for compaction or flush to finish. */ + RocksDBTickerStallMicros, + + /** @brief The wait time for db mutex. */ + RocksDBTickerDBMutexWaitMicros, + + /** @brief The rate limit delay. */ + RocksDBTickerRateLimitDelayMillis, + + /** @brief Number of iterators currently open. */ RocksDBTickerNoIterators, + + /** @brief Number of MultiGet calls. */ RocksDBTickerNumberMultigetCalls, + + /** @brief Number of MultiGet keys read. */ RocksDBTickerNumberMultigetKeysRead, + + /** @brief Number of MultiGet bytes read. */ RocksDBTickerNumberMultigetBytesRead, + + /** @brief Number of deletes records that were not required + to be written to storage because key does not exist. */ RocksDBTickerNumberFilteredDeletes, + + /** @brief Number of merge failures. */ RocksDBTickerNumberMergeFailures, + + /** @brief The sequnce number. */ RocksDBTickerSequenceNumber, + + /** @brief Number of times bloom was checked before creating + iterator on a file. */ RocksDBTickerBloomFilterPrefixChecked, + + /** @brief Number of times the check was useful in avoiding + iterator creation (and thus likely IOPs). */ RocksDBTickerBloomFilterPrefixUseful, + + /** @brief Number reseeks inside an iteration to skip over + large number of keys with same userkey. */ RocksDBTickerNumberOfReseeksInIteration, + + /** @brief Number of calls to GetUpadtesSince. Useful to keep + track of transaction log iterator refreshes. */ RocksDBTickerGetUpdatesSinceCalls, + + /** @brief Number of misses in the compressed block cache. */ RocksDBTickerBlockCacheCompressedMiss, + + /** @brief Number of hits in the compressed block cache. */ RocksDBTickerBlockCacheCompressedHit, + + /** @brief Number of times WAL sync is done. */ RocksDBTickerWalFileSynced, + + /** @brief Number of bytes written to WAL. */ RocksDBTickerWalFileBytes, + + /** @brief Number of wrtites done by the requesting thread. */ RocksDBTickerWriteDoneBySelf, + + /** @brief Number of wrtites done by by a thread at thehead + of the writers queue. */ RocksDBTickerWriteDoneByOther, + + /** @brief Number of writes ending up with timed-out. */ RocksDBTickerWriteTimedout, + + /** @brief Number of Write calls that request WAL. */ RocksDBTickerWriteWithWal, + + /** @brief Bytes read during compaction. */ RocksDBTickerCompactReadBytes, + + /** @brief Bytes written during compaction. */ RocksDBTickerCompactWriteBytes, + + /** @brief Bytes written during flush. */ RocksDBTickerFlushWriteBytes, + + /** @brief Number of table's properties loaded directly from file, + without creating table reader object. */ RocksDBTickerNumberDirectLoadTableProperties, + + /** @brief Number of supervision acquires. */ RocksDBTickerNumberSuperversionAcquires, + + /** @brief Number of supervision releases. */ RocksDBTickerNumberSuperversionReleases, + + /** @brief Number of supervision cleanups. */ RocksDBTickerNumberSuperversionCleanups, + + /** @brief Number of blocks not compressed */ RocksDBTickerNumberBlockNotCompressed, + + /** @brief The total time of the merge operation. */ + RocksDBTickerMergeOprationTotalTime, + + /** @brief The total time of the filter operation. */ + RocksDBTickerFilterOperationTotalTime, }; +/** @brief An enum for the Histogram Types. */ typedef NS_ENUM(uint32_t, RocksDBHistogramType) { + /** @brief Time spent in DB Get() calls */ RocksDBHistogramDBGet = 0, + + /** @brief Time spent in DB Write() calls */ RocksDBHistogramDBWrite, + + /** @brief Time spent during compaction. */ RocksDBHistogramCompactionTime, + + /** @brief Time spent during table syncs. */ RocksDBHistogramTableSyncMicros, + + /** @brief Time spent during compaction outfile syncs. */ RocksDBHistogramCompactionOutfileSyncMicros, + + /** @brief Time spent during WAL file syncs. */ RocksDBHistogramWalFileSyncMicros, + + /** @brief Time spent during manifest file syncs. */ RocksDBHistogramManifestFileSyncMicros, + + /** @brief Time spent during in IO during table open. */ RocksDBHistogramTableOpenIOMicros, + + /** @brief Time spend during DB MultiGet() calls. */ RocksDBHistogramDBMultiget, + + /** @brief Time spend during read block compaction. */ RocksDBHistogramReadBlockCompactionMicros, + + /** @brief Time spend during read block Get(). */ RocksDBHistogramReadBlockGetMicros, + + /** @brief Time spend during write raw blocks. */ RocksDBHistogramWriteRawBlockMicros, + + /** @brief */ RocksDBHistogramStall_L0SlowdownCount, + + /** @brief */ RocksDBHistogramStallMemtableCompactionCount, + + /** @brief */ RocksDBHistogramStall_L0NumFilesCount, + + /** @brief */ RocksDBHistogramHardRateLimitDelayCount, + + /** @brief */ RocksDBHistogramSoftRateLimitDelayCount, + + /** @brief */ RocksDBHistogramNumFilesInSingleCompaction, + + /** @brief */ RocksDBHistogramDBSeek, + + /** @brief */ RocksDBHistogramWriteStall, }; +/** + The `RocksDBStatistics`, when set in the `RocksDBOptions`, is used to collect usage statistics. + + @see RocksDBOptions + */ @interface RocksDBStatistics : NSObject +/** + Returns the value for the given ticker. + + @param ticker The ticker type to get. + @return The value for the given ticker type. +*/ - (uint64_t)countForTicker:(RocksDBTickerType)ticker; -- (RocksDBStatisticsHistogram *)histogramDataForType:(RocksDBHistogramType)ticker; + +/** + Returns the histogram for the given histogram type. + + @param type The type of the histogram to get. + @return The value for the given histogram type. + + @see RocksDBStatisticsHistogram + */ +- (RocksDBStatisticsHistogram *)histogramDataForType:(RocksDBHistogramType)type; + +/** @brief String representation of the statistic object. */ - (NSString *)description; @end diff --git a/ObjectiveRocks/RocksDBStatisticsHistogram.h b/ObjectiveRocks/RocksDBStatisticsHistogram.h index 64d92c1..911d5bd 100644 --- a/ObjectiveRocks/RocksDBStatisticsHistogram.h +++ b/ObjectiveRocks/RocksDBStatisticsHistogram.h @@ -8,13 +8,25 @@ #import +/** @brief Holds histogram data. */ @interface RocksDBStatisticsHistogram : NSObject +/** @brief The name of this histogram type. */ @property (nonatomic, copy) NSString *ticker; + +/** @brief The median value. */ @property (nonatomic, assign) double median; + +/** @brief The percentile95 value. */ @property (nonatomic, assign) double percentile95; + +/** @brief The percentile99 value. */ @property (nonatomic, assign) double percentile99; + +/** @brief The average value. */ @property (nonatomic, assign) double average; + +/** @brief The standard deviation value. */ @property (nonatomic, assign) double standardDeviation; @end diff --git a/ObjectiveRocks/RocksDBTableFactory.h b/ObjectiveRocks/RocksDBTableFactory.h index cd7fecb..9cd2cfb 100644 --- a/ObjectiveRocks/RocksDBTableFactory.h +++ b/ObjectiveRocks/RocksDBTableFactory.h @@ -14,12 +14,35 @@ #import "RocksDBCuckooTableOptions.h" #endif +/** A factory for the TableFactory objects. */ @interface RocksDBTableFactory : NSObject +/** + Returns a BlockBased Table Factory object with thge given BlockBased table options. + + This is the default SST table format in RocksDB. + + @see RocksDBBlockBasedTableOptions + */ + (instancetype)blockBasedTableFactoryWithOptions:(void (^)(RocksDBBlockBasedTableOptions *options))options; #ifndef ROCKSDB_LITE +/** + Returns a Plain Table Factory object with thge given Plain table options. + + This is a RocksDB’s SST file format optimized for low query latency on pure-memory or really low-latency media + + @see RocksDBPlainTableOptions + */ + (instancetype)plainTableFactoryWithOptions:(void (^)(RocksDBPlainTableOptions *options))options; + +/** + Returns a Cuckoo Table Factory object with thge given Cuckoo table options. + + This is designed for applications that require fast point lookups but not fast range scans. + + @see RocksDBCuckooTableOptions + */ + (instancetype)cuckooTableFactoryWithOptions:(void (^)(RocksDBCuckooTableOptions *options))options; #endif diff --git a/ObjectiveRocks/RocksDBThreadStatus.h b/ObjectiveRocks/RocksDBThreadStatus.h index e361a7a..d71c944 100644 --- a/ObjectiveRocks/RocksDBThreadStatus.h +++ b/ObjectiveRocks/RocksDBThreadStatus.h @@ -8,32 +8,64 @@ #import +/** The type of a thread. */ typedef NS_ENUM(int, RocksDBThreadType) { + /** @brief RocksDB background thread in high priority thread pool. */ RocksDBThreadHighPiority = 0, + + /** @brief RocksDB background thread in low priority thread pool. */ RocksDBThreadLowPiority, + + /** @brief User thread (Non-RocksDB background thread). */ RocksDBThreadUser }; +/** + The type used to refer to a thread operation. A thread operation describes high-level action of a thread. + */ typedef NS_ENUM(int, RocksDBOperationType) { + /** Unknown operation. */ RocksDBOperationUnknown = 0, + + /** A compaction operation. */ RocksDBOperationCompaction, + + /** A flush operation. */ RocksDBOperationFlush }; +/** The type used to refer to a thread state. */ typedef NS_ENUM(int, RocksDBStateType) { + /** Unkown state. */ RocksDBStateUnknown = 0, }; +/** + Describes the current status of a thread. + */ @interface RocksDBThreadStatus : NSObject +/** @brief An unique ID for the thread. */ @property (nonatomic, assign) uint64_t threadId; + +/** @brief The type of the thread. */ @property (nonatomic, assign) RocksDBThreadType threadType; + +/** @brief The name of the DB instance where the thread is currently involved with. + It would be set to empty string if the thread does not involve in any DB operation. */ @property (nonatomic, strong) NSString *databaseName; + +/** @brief The name of the column family where the thread is currently It would be set + to empty string if the thread does not involve in any column family. */ @property (nonatomic, strong) NSString *columnFamilyname; + +/** @brief The operation (high-level action) that the current thread is involved. */ @property (nonatomic, assign) RocksDBOperationType operationType; + +/** @brief The state (lower-level action) that the current thread is involved. */ @property (nonatomic, assign) RocksDBStateType stateType; @end diff --git a/ObjectiveRocks/RocksDBTypes.h b/ObjectiveRocks/RocksDBTypes.h index a2e0b79..4807a49 100644 --- a/ObjectiveRocks/RocksDBTypes.h +++ b/ObjectiveRocks/RocksDBTypes.h @@ -8,18 +8,50 @@ #import +/** The predefined supported types */ typedef NS_ENUM(NSUInteger, RocksDBType) { + /** @brief Type for keys/values that are NSString objects. */ RocksDBTypeNSString, + /** @brief Type for keys/values that are serializable via + the NSJSONSerialization. */ RocksDBTypeNSJSONSerializable }; +/** Utility class for the predefined key/value encoders. */ @interface RocksDBTypes : NSObject +/** + Returns a predefined key encoder for the given type. + + @param type The predefined type. + @return The predefined key encoder. + */ + (NSData *(^)(id))keyEncoderForType:(RocksDBType)type; + +/** + Returns a predefined key decoder for the given type. + + @param type The predefined type. + @return The predefined key decoder. + */ + (id (^)(NSData *))keyDecoderForType:(RocksDBType)type; + +/** + Returns a predefined value decoder for the given type. + + @param type The predefined type. + @return The predefined value decoder. + */ + (NSData *(^)(id, id))valueEncoderForType:(RocksDBType)type; + +/** + Returns a predefined value decoder for the given type. + + @param type The predefined type. + @return The predefined value decoder. + */ + (id (^)(id, NSData *))valueDecoderForType:(RocksDBType)type; @end diff --git a/ObjectiveRocks/RocksDBWriteBatch+Private.h b/ObjectiveRocks/RocksDBWriteBatch+Private.h index 09adbc3..3d66dc2 100644 --- a/ObjectiveRocks/RocksDBWriteBatch+Private.h +++ b/ObjectiveRocks/RocksDBWriteBatch+Private.h @@ -13,10 +13,25 @@ namespace rocksdb { class WriteBatch; } +/** + This category is intended to hide all C++ types from the public interface in order to + maintain a pure Objective-C API for Swift compatibility. + */ @interface RocksDBWriteBatch (Private) +/** @brief The rocksdb::WriteBatch associated with this instance. */ @property (nonatomic, readonly) rocksdb::WriteBatch writeBatch; +/** + Initializes a new instance of `RocksDBWriteBatch` with the given options and + rocksdb::ColumnFamilyHandle instance. + + @param columnFamily The rocks::ColumnFamilyHandle instance. + @param options The Encoding options. + @return a newly-initialized instance of `RocksDBWriteBatch`. + + @see RocksDBEncodingOptions + */ - (instancetype)initWithColumnFamily:(rocksdb::ColumnFamilyHandle *)columnFamily andEncodingOptions:(RocksDBEncodingOptions *)options; diff --git a/ObjectiveRocks/RocksDBWriteBatch.h b/ObjectiveRocks/RocksDBWriteBatch.h index ef47c7e..46070f2 100644 --- a/ObjectiveRocks/RocksDBWriteBatch.h +++ b/ObjectiveRocks/RocksDBWriteBatch.h @@ -11,32 +11,154 @@ @class RocksDBColumnFamily; +/** + The `RocksDBWriteBatch` allows to place multiple updates in the same "batch" and apply them together + using a synchronous write. Operations on a Write Batch instance have no effect if not applied to a DB + instance, i.e. the Write Batch accumulates all modifications that are to be performed when applying + to a DB instance. Write batches can also span multiple Column Families. + + @warning If not specified otherwise, Write Batch operations are applied to the Column Family + used when initiazing the Batch instance. + */ @interface RocksDBWriteBatch : NSObject +/** + Stores the given key-object pair into the Write Batch. + + @param anObject The object for key. + @param aKey The key for object. + */ - (void)setObject:(id)anObject forKey:(id)aKey; + +/** + Stores the given key-data pair into the Write Batch. + + @param data The data for key. + @param aKey The key for object. + */ - (void)setData:(NSData *)data forKey:(NSData *)aKey; + +/** + Stores the given key-object pair for the given Column Family into the Write Batch. + + @param anObject The object for key. + @param aKey The key for object. + @param columnFamily The column family where data should be written. + */ - (void)setObject:(id)anObject forKey:(id)aKey inColumnFamily:(RocksDBColumnFamily *)columnFamily; + +/** + Stores the given key-data pair for the given Column Family into the Write Batch. + + @param data The data for key. + @param aKey The key for object. + @param columnFamily The column family where data should be written. + */ - (void)setData:(NSData *)data forKey:(NSData *)aKey inColumnFamily:(RocksDBColumnFamily *)columnFamily; +/** + Perform the merge operation in the Write Batch. + + @param aMerge A merge opration. + @param aKey The key for the merge. + */ - (void)mergeOperation:(NSString *)aMerge forKey:(id)aKey; + +/** + Perform the merge operation for the given Column Family in the Write Batch. + + @param aMerge A merge opration. + @param aKey The key for the merge. + @param columnFamily The column family where data should be merged. + */ +- (void)mergeOperation:(NSString *)aMerge forKey:(id)aKey inColumnFamily:(RocksDBColumnFamily *)columnFamily; + +/** + Merges the given key-object pair into the Write Batch. + + @param anObject The object for key. + @param aKey The key for object. + */ - (void)mergeObject:(id)anObject forKey:(id)aKey; + +/** + Merges the given key-object pair into the Write Batch. + + @param anObject The object for key. + @param aKey The key for object. + */ - (void)mergeData:(NSData *)data forKey:(NSData *)aKey; -- (void)mergeOperation:(NSString *)aMerge forKey:(id)aKey inColumnFamily:(RocksDBColumnFamily *)columnFamily; + + +/** + Merges the given key-object pair for the given Column Family into the Write Batch. + + @param anObject The object for key. + @param aKey The key for object. + @param columnFamily The column family where data should be written. + */ - (void)mergeObject:(id)anObject forKey:(id)aKey inColumnFamily:(RocksDBColumnFamily *)columnFamily; + +/** + Merges the given key-data pair for the given Column Family into the Write Batch. + + @param data The data for key. + @param aKey The key for object. + @param columnFamily The column family where data should be written. + */ - (void)mergeData:(NSData *)data forKey:(NSData *)aKey inColumnFamily:(RocksDBColumnFamily *)columnFamily; +/** + Deletes the object for the given key from this Write Batch. + @param aKey The key to delete. + */ - (void)deleteObjectForKey:(id)aKey; + +/** + Deletes the data for the given key from this Write Batch. + + @param aKey The key to delete. + */ - (void)deleteDataForKey:(NSData *)aKey; + +/** + Deletes the object for the given key in the given Column Family from this Write Batch. + + @param data The data for key. + @param aKey The key for object. + @param columnFamily The column family from which the data should be deleted. + */ - (void)deleteObjectForKey:(id)aKey inColumnFamily:(RocksDBColumnFamily *)columnFamily; + +/** + Deletes the object for the given key in the given Column Family from the Write Batch. + + @param data The data for key. + @param aKey The key for object. + @param columnFamily The column family from which the data should be deleted. + */ - (void)deleteDataForKey:(NSData *)aKey inColumnFamily:(RocksDBColumnFamily *)columnFamily; +/** + Append a blob of arbitrary size to the records in this batch. Blobs, puts, deletes, and merges + will be encountered in the same order in thich they were inserted. The blob will NOT consume + sequence number(s) and will NOT increase the count of the batch. + + Example application: add timestamps to the transaction log for use in replication. + */ - (void)putLogData:(NSData *)logData; +/** @brief Clear all updates buffered in this batch. */ - (void)clear; +/** @brief Returns the number of updates in the batch. */ - (int)count; + +/** @brief Retrieve the serialized version of this batch. */ - (NSData *)data; + +/** @brief Retrieve data size of the batch. */ - (size_t)dataSize; @end diff --git a/ObjectiveRocks/RocksDBWriteOptions.h b/ObjectiveRocks/RocksDBWriteOptions.h index 8c57feb..9cc4059 100644 --- a/ObjectiveRocks/RocksDBWriteOptions.h +++ b/ObjectiveRocks/RocksDBWriteOptions.h @@ -8,11 +8,30 @@ #import +/** Options that control write operations. */ @interface RocksDBWriteOptions : NSObject +/** @brief If true, the write will be flushed from the operating system + buffer cache before the write is considered complete. + Default: false + */ @property (nonatomic, assign) BOOL syncWrites; + +/** @brief If true, writes will not first go to the write ahead log, and + the write may got lost after a crash. +*/ @property (nonatomic, assign) BOOL disableWriteAheadLog; + +/** @brief If non-zero, then associated write waiting longer than the specified + time MAY be aborted and returns Status::TimedOut. + Default: 0 + */ @property (nonatomic, assign) uint64_t timeoutHint; + +/** @brief If true and if user is trying to write to column families that don't + exist then the write will be ignored. + Default: false +*/ @property (nonatomic, assign) BOOL ignoreMissingColumnFamilies; @end diff --git a/ObjectiveRocksTests/Info.plist b/ObjectiveRocksTests/Info.plist index a96fb94..2826c03 100644 --- a/ObjectiveRocksTests/Info.plist +++ b/ObjectiveRocksTests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.braincookie.$(PRODUCT_NAME:rfc1034identifier) + co.braincookie.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/ObjectiveRocksTests/RocksDBBackupTests.swift b/ObjectiveRocksTests/RocksDBBackupTests.swift index 47574aa..decb9dc 100644 --- a/ObjectiveRocksTests/RocksDBBackupTests.swift +++ b/ObjectiveRocksTests/RocksDBBackupTests.swift @@ -49,7 +49,7 @@ class RocksDBBackupTests : RocksDBTests { XCTAssertNotNil(backupInfo) XCTAssertEqual(backupInfo.count, 1); - let info = backupInfo[0] as RocksDBBackupInfo + let info = backupInfo[0] as! RocksDBBackupInfo XCTAssertEqual(info.backupId, 1 as UInt32) } diff --git a/ObjectiveRocksTests/RocksDBBasicTests.swift b/ObjectiveRocksTests/RocksDBBasicTests.swift index b73a044..9231f1f 100644 --- a/ObjectiveRocksTests/RocksDBBasicTests.swift +++ b/ObjectiveRocksTests/RocksDBBasicTests.swift @@ -69,9 +69,9 @@ class RocksDBBasicTests : RocksDBTests { rocks.setObject("value 3", forKey: "key 3") - XCTAssertEqual(rocks.objectForKey("key 1") as NSString, "value 1"); - XCTAssertEqual(rocks.objectForKey("key 2") as NSString, "value 2"); - XCTAssertEqual(rocks.objectForKey("key 3") as NSString, "value 3"); + XCTAssertEqual(rocks.objectForKey("key 1") as! NSString, "value 1"); + XCTAssertEqual(rocks.objectForKey("key 2") as! NSString, "value 2"); + XCTAssertEqual(rocks.objectForKey("key 3") as! NSString, "value 3"); rocks.deleteObjectForKey("key 2") XCTAssertNil(rocks.objectForKey("key 2")); diff --git a/ObjectiveRocksTests/RocksDBColumnFamilyMetadataTests.swift b/ObjectiveRocksTests/RocksDBColumnFamilyMetadataTests.swift index 4099dda..07e1d13 100644 --- a/ObjectiveRocksTests/RocksDBColumnFamilyMetadataTests.swift +++ b/ObjectiveRocksTests/RocksDBColumnFamilyMetadataTests.swift @@ -20,8 +20,8 @@ class RocksDBColumnFamilyMetadataTests : RocksDBTests { options.createMissingColumnFamilies = true }) - let defaultColumnFamily = rocks.columnFamilies()[0] as RocksDBColumnFamily - let newColumnFamily = rocks.columnFamilies()[1] as RocksDBColumnFamily + let defaultColumnFamily = rocks.columnFamilies()[0] as! RocksDBColumnFamily + let newColumnFamily = rocks.columnFamilies()[1] as! RocksDBColumnFamily defaultColumnFamily.setData(Data("df_value1"), forKey: Data("df_key1")) defaultColumnFamily.setData(Data("df_value2"), forKey: Data("df_key2")) diff --git a/ObjectiveRocksTests/RocksDBColumnFamilyTests.swift b/ObjectiveRocksTests/RocksDBColumnFamilyTests.swift index c3a835d..e9e00a1 100644 --- a/ObjectiveRocksTests/RocksDBColumnFamilyTests.swift +++ b/ObjectiveRocksTests/RocksDBColumnFamilyTests.swift @@ -20,7 +20,7 @@ class RocksDBColumnFamilyTests : RocksDBTests { let names = RocksDB.listColumnFamiliesInDatabaseAtPath(self.path) XCTAssertTrue(names.count == 1); - XCTAssertEqual(names[0] as NSString, "default") + XCTAssertEqual(names[0] as! NSString, "default") } func testSwift_ColumnFamilies_Create() { @@ -35,8 +35,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { let names = RocksDB.listColumnFamiliesInDatabaseAtPath(self.path) XCTAssertTrue(names.count == 2); - XCTAssertEqual(names[0] as NSString, "default") - XCTAssertEqual(names[1] as NSString, "new_cf") + XCTAssertEqual(names[0] as! NSString, "default") + XCTAssertEqual(names[1] as! NSString, "new_cf") } func testSwift_ColumnFamilies_Drop() { @@ -52,7 +52,7 @@ class RocksDBColumnFamilyTests : RocksDBTests { let names = RocksDB.listColumnFamiliesInDatabaseAtPath(self.path) XCTAssertTrue(names.count == 1); - XCTAssertEqual(names[0] as NSString, "default") + XCTAssertEqual(names[0] as! NSString, "default") } func testSwift_ColumnFamilies_Open() { @@ -72,8 +72,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { let names = RocksDB.listColumnFamiliesInDatabaseAtPath(self.path) XCTAssertTrue(names.count == 2) - XCTAssertEqual(names[0] as NSString, "default") - XCTAssertEqual(names[1] as NSString, "new_cf") + XCTAssertEqual(names[0] as! NSString, "default") + XCTAssertEqual(names[1] as! NSString, "new_cf") let descriptor = RocksDBColumnFamilyDescriptor() @@ -92,8 +92,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { XCTAssertTrue(rocks.columnFamilies().count == 2) - let defaultColumnFamily = rocks.columnFamilies()[0] as RocksDBColumnFamily - let newColumnFamily = rocks.columnFamilies()[1] as RocksDBColumnFamily + let defaultColumnFamily = rocks.columnFamilies()[0] as! RocksDBColumnFamily + let newColumnFamily = rocks.columnFamilies()[1] as! RocksDBColumnFamily XCTAssertNotNil(defaultColumnFamily) XCTAssertNotNil(newColumnFamily) @@ -119,8 +119,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { let names = RocksDB.listColumnFamiliesInDatabaseAtPath(self.path) XCTAssertTrue(names.count == 2) - XCTAssertEqual(names[0] as NSString, "default") - XCTAssertEqual(names[1] as NSString, "new_cf") + XCTAssertEqual(names[0] as! NSString, "default") + XCTAssertEqual(names[1] as! NSString, "new_cf") let descriptor = RocksDBColumnFamilyDescriptor() @@ -165,8 +165,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { options.createMissingColumnFamilies = true }) - let defaultColumnFamily = rocks.columnFamilies()[0] as RocksDBColumnFamily - let newColumnFamily = rocks.columnFamilies()[1] as RocksDBColumnFamily + let defaultColumnFamily = rocks.columnFamilies()[0] as! RocksDBColumnFamily + let newColumnFamily = rocks.columnFamilies()[1] as! RocksDBColumnFamily XCTAssertEqual(rocks.dataForKey(Data("df_key1")), Data("df_value")) XCTAssertEqual(rocks.dataForKey(Data("df_key2")), Data("df_value")) @@ -206,8 +206,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { options.createMissingColumnFamilies = true }) - let defaultColumnFamily = rocks.columnFamilies()[0] as RocksDBColumnFamily - let newColumnFamily = rocks.columnFamilies()[1] as RocksDBColumnFamily + let defaultColumnFamily = rocks.columnFamilies()[0] as! RocksDBColumnFamily + let newColumnFamily = rocks.columnFamilies()[1] as! RocksDBColumnFamily newColumnFamily.setData(Data("xyz_value"), forKey: Data("xyz")) @@ -247,8 +247,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { options.createMissingColumnFamilies = true }) - let defaultColumnFamily = rocks.columnFamilies()[0] as RocksDBColumnFamily - let newColumnFamily = rocks.columnFamilies()[1] as RocksDBColumnFamily + let defaultColumnFamily = rocks.columnFamilies()[0] as! RocksDBColumnFamily + let newColumnFamily = rocks.columnFamilies()[1] as! RocksDBColumnFamily defaultColumnFamily.setData(Data("df_value1"), forKey: Data("df_key1")) defaultColumnFamily.setData(Data("df_value2"), forKey: Data("df_key2")) @@ -261,8 +261,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { let actual = NSMutableArray() for dfIterator.seekToFirst(); dfIterator.isValid(); dfIterator.next() { - actual.addObject(Str(dfIterator.key() as NSData)) - actual.addObject(Str(dfIterator.value() as NSData)) + actual.addObject(Str(dfIterator.key() as! NSData)) + actual.addObject(Str(dfIterator.value() as! NSData)) } var expected = [ "df_key1", "df_value1", "df_key2", "df_value2" ] @@ -275,8 +275,8 @@ class RocksDBColumnFamilyTests : RocksDBTests { actual.removeAllObjects() for cfIterator.seekToFirst(); cfIterator.isValid(); cfIterator.next() { - actual.addObject(Str(cfIterator.key() as NSData)) - actual.addObject(Str(cfIterator.value() as NSData)) + actual.addObject(Str(cfIterator.key() as! NSData)) + actual.addObject(Str(cfIterator.value() as! NSData)) } expected = [ "cf_key1", "cf_value1", "cf_key2", "cf_value2" ] diff --git a/ObjectiveRocksTests/RocksDBComparatorTests.swift b/ObjectiveRocksTests/RocksDBComparatorTests.swift index af6e4b5..6df1f11 100644 --- a/ObjectiveRocksTests/RocksDBComparatorTests.swift +++ b/ObjectiveRocksTests/RocksDBComparatorTests.swift @@ -25,20 +25,20 @@ class RocksDBComparatorTests : RocksDBTests { iterator.seekToFirst() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc1")) - XCTAssertEqual(iterator.value() as NSData, Data("abc1")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc1")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc1")) iterator.next() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc2")) - XCTAssertEqual(iterator.value() as NSData, Data("abc2")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc2")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc2")) iterator.next() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc3")) - XCTAssertEqual(iterator.value() as NSData, Data("abc3")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc3")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc3")) iterator.next() @@ -47,14 +47,14 @@ class RocksDBComparatorTests : RocksDBTests { iterator.seekToLast() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc3")) - XCTAssertEqual(iterator.value() as NSData, Data("abc3")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc3")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc3")) iterator.seekToKey(Data("abc")) XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc1")) - XCTAssertEqual(iterator.value() as NSData, Data("abc1")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc1")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc1")) iterator.close() } @@ -74,20 +74,20 @@ class RocksDBComparatorTests : RocksDBTests { iterator.seekToFirst() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc3")) - XCTAssertEqual(iterator.value() as NSData, Data("abc3")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc3")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc3")) iterator.next() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc2")) - XCTAssertEqual(iterator.value() as NSData, Data("abc2")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc2")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc2")) iterator.next() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc1")) - XCTAssertEqual(iterator.value() as NSData, Data("abc1")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc1")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc1")) iterator.next() @@ -96,8 +96,8 @@ class RocksDBComparatorTests : RocksDBTests { iterator.seekToLast() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc1")) - XCTAssertEqual(iterator.value() as NSData, Data("abc1")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc1")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc1")) iterator.seekToKey(Data("abc")) @@ -106,8 +106,8 @@ class RocksDBComparatorTests : RocksDBTests { iterator.seekToKey(Data("abc999")) XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("abc3")) - XCTAssertEqual(iterator.value() as NSData, Data("abc3")) + XCTAssertEqual(iterator.key() as! NSData, Data("abc3")) + XCTAssertEqual(iterator.value() as! NSData, Data("abc3")) iterator.close() } @@ -134,7 +134,7 @@ class RocksDBComparatorTests : RocksDBTests { var idx = 0 iterator.enumerateKeysUsingBlock { (key, stop) -> Void in - XCTAssertEqual(key as NSString, expected[idx] as NSString) + XCTAssertEqual(key as! NSString, expected[idx] as! NSString) idx++ } } @@ -161,7 +161,7 @@ class RocksDBComparatorTests : RocksDBTests { var idx = 9999 iterator.enumerateKeysUsingBlock { (key, stop) -> Void in - XCTAssertEqual(key as NSString, expected[idx] as NSString) + XCTAssertEqual(key as! NSString, expected[idx] as! NSString) idx-- } } @@ -201,8 +201,8 @@ class RocksDBComparatorTests : RocksDBTests { let iterator = rocks.iterator() iterator.enumerateKeysUsingBlock { (key, stop) -> Void in - XCTAssertTrue(lastKey.compare(key as NSNumber) == .OrderedAscending) - lastKey = key as NSNumber + XCTAssertTrue(lastKey.compare(key as! NSNumber) == .OrderedAscending) + lastKey = key as! NSNumber count++ } @@ -244,8 +244,8 @@ class RocksDBComparatorTests : RocksDBTests { let iterator = rocks.iterator() iterator.enumerateKeysUsingBlock { (key, stop) -> Void in - XCTAssertTrue(lastKey.compare(key as NSNumber) == .OrderedDescending) - lastKey = key as NSNumber + XCTAssertTrue(lastKey.compare(key as! NSNumber) == .OrderedDescending) + lastKey = key as! NSNumber count++ } diff --git a/ObjectiveRocksTests/RocksDBIteratorTests.swift b/ObjectiveRocksTests/RocksDBIteratorTests.swift index e5cc85f..5e9ad75 100644 --- a/ObjectiveRocksTests/RocksDBIteratorTests.swift +++ b/ObjectiveRocksTests/RocksDBIteratorTests.swift @@ -23,7 +23,7 @@ class RocksDBIteratorTests : RocksDBTests { let iterator = rocks.iterator() for iterator.seekToFirst(); iterator.isValid(); iterator.next() { - actual.addObject(Str(iterator.key() as NSData)) + actual.addObject(Str(iterator.key() as! NSData)) } let expected = [ "key 1", "key 2", "key 3" ] @@ -45,14 +45,14 @@ class RocksDBIteratorTests : RocksDBTests { iterator.seekToFirst() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("key 1")) - XCTAssertEqual(iterator.value() as NSData, Data("value 1")) + XCTAssertEqual(iterator.key() as! NSData, Data("key 1")) + XCTAssertEqual(iterator.value() as! NSData, Data("value 1")) iterator.next() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("key 2")) - XCTAssertEqual(iterator.value() as NSData, Data("value 2")) + XCTAssertEqual(iterator.key() as! NSData, Data("key 2")) + XCTAssertEqual(iterator.value() as! NSData, Data("value 2")) iterator.next() @@ -62,15 +62,15 @@ class RocksDBIteratorTests : RocksDBTests { iterator.previous() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("key 1")) - XCTAssertEqual(iterator.value() as NSData, Data("value 1")) + XCTAssertEqual(iterator.key() as! NSData, Data("key 1")) + XCTAssertEqual(iterator.value() as! NSData, Data("value 1")) iterator.seekToFirst() iterator.seekToLast() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSData, Data("key 2")) - XCTAssertEqual(iterator.value() as NSData, Data("value 2")) + XCTAssertEqual(iterator.key() as! NSData, Data("key 2")) + XCTAssertEqual(iterator.value() as! NSData, Data("value 2")) iterator.close() } @@ -88,7 +88,7 @@ class RocksDBIteratorTests : RocksDBTests { let iterator = rocks.iterator() iterator.enumerateKeysUsingBlock { (key, stop) -> Void in - actual.addObject(Str(key as NSData)) + actual.addObject(Str(key as! NSData)) } @@ -111,7 +111,7 @@ class RocksDBIteratorTests : RocksDBTests { let iterator = rocks.iterator() iterator.enumerateKeysInReverse(true, usingBlock: { (key, stop) -> Void in - actual.addObject(Str(key as NSData)) + actual.addObject(Str(key as! NSData)) }) let expected = [ "key 3", "key 2", "key 1" ] @@ -136,7 +136,7 @@ class RocksDBIteratorTests : RocksDBTests { iterator.enumerateKeysInRange(RocksDBMakeKeyRange(Data("key 2"), nil), reverse: false) { (key, stop) -> Void in - actual.addObject(Str(key as NSData)) + actual.addObject(Str(key as! NSData)) } let expected = [ "key 2", "key 3", "key 4" ] @@ -161,7 +161,7 @@ class RocksDBIteratorTests : RocksDBTests { iterator.enumerateKeysInRange(RocksDBMakeKeyRange(nil, Data("key 4")), reverse: false) { (key, stop) -> Void in - actual.addObject(Str(key as NSData)) + actual.addObject(Str(key as! NSData)) } let expected = [ "key 1", "key 2", "key 3" ] @@ -186,7 +186,7 @@ class RocksDBIteratorTests : RocksDBTests { iterator.enumerateKeysInRange(RocksDBMakeKeyRange(Data("key 2"), Data("key 4")), reverse: false) { (key, stop) -> Void in - actual.addObject(Str(key as NSData)) + actual.addObject(Str(key as! NSData)) } let expected = [ "key 2", "key 3" ] @@ -232,8 +232,8 @@ class RocksDBIteratorTests : RocksDBTests { let iterator = rocks.iterator() iterator.enumerateKeysAndValuesUsingBlock { (key, value, stop) -> Void in - actual.addObject(Str(key as NSData)) - actual.addObject(Str(value as NSData)) + actual.addObject(Str(key as! NSData)) + actual.addObject(Str(value as! NSData)) } let expected = [ "key 1", "value 1", "key 2", "value 2", "key 3", "value 3" ] @@ -255,8 +255,8 @@ class RocksDBIteratorTests : RocksDBTests { let iterator = rocks.iterator() iterator.enumerateKeysAndValuesInReverse(true, usingBlock: { (key, value, stop) -> Void in - actual.addObject(Str(key as NSData)) - actual.addObject(Str(value as NSData)) + actual.addObject(Str(key as! NSData)) + actual.addObject(Str(value as! NSData)) }) let expected = [ "key 3", "value 3", "key 2", "value 2", "key 1", "value 1" ] @@ -281,8 +281,8 @@ class RocksDBIteratorTests : RocksDBTests { iterator.enumerateKeysAndValuesInRange(RocksDBMakeKeyRange(Data("key 2"), nil), reverse: false) { (key, value, stop) -> Void in - actual.addObject(Str(key as NSData)) - actual.addObject(Str(value as NSData)) + actual.addObject(Str(key as! NSData)) + actual.addObject(Str(value as! NSData)) } let expected = [ "key 2", "value 2", "key 3", "value 3", "key 4", "value 4" ] @@ -307,8 +307,8 @@ class RocksDBIteratorTests : RocksDBTests { iterator.enumerateKeysAndValuesInRange(RocksDBMakeKeyRange(nil, Data("key 4")), reverse: false) { (key, value, stop) -> Void in - actual.addObject(Str(key as NSData)) - actual.addObject(Str(value as NSData)) + actual.addObject(Str(key as! NSData)) + actual.addObject(Str(value as! NSData)) } let expected = [ "key 1", "value 1", "key 2", "value 2", "key 3", "value 3" ] @@ -333,8 +333,8 @@ class RocksDBIteratorTests : RocksDBTests { iterator.enumerateKeysAndValuesInRange(RocksDBMakeKeyRange(Data("key 2"), Data("key 4")), reverse: false) { (key, value, stop) -> Void in - actual.addObject(Str(key as NSData)) - actual.addObject(Str(value as NSData)) + actual.addObject(Str(key as! NSData)) + actual.addObject(Str(value as! NSData)) } let expected = [ "key 2", "value 2", "key 3", "value 3" ] diff --git a/ObjectiveRocksTests/RocksDBMergeOperatorTests.swift b/ObjectiveRocksTests/RocksDBMergeOperatorTests.swift index 4a02a54..e7356c6 100644 --- a/ObjectiveRocksTests/RocksDBMergeOperatorTests.swift +++ b/ObjectiveRocksTests/RocksDBMergeOperatorTests.swift @@ -82,7 +82,7 @@ class RocksDBMergeOperatorTests : RocksDBTests { func testSwift_AssociativeMergeOperator_DictionaryPut_Encoded() { let mergeOp = RocksDBMergeOperator(name: "operator") { (key, existing, value) -> AnyObject! in if (existing != nil) { - existing.addEntriesFromDictionary(value as NSDictionary) + existing.addEntriesFromDictionary(value as! [NSObject : AnyObject]) return existing } else { return value @@ -109,7 +109,7 @@ class RocksDBMergeOperatorTests : RocksDBTests { "key 4" : "value 4", "key 5" : "value 5"] - XCTAssertEqual(rocks.objectForKey("dict key") as NSDictionary, expected) + XCTAssertEqual(rocks.objectForKey("dict key") as! NSDictionary, expected) } func testSwift_MergeOperator_DictionaryUpdate_Encoded() { @@ -118,26 +118,26 @@ class RocksDBMergeOperatorTests : RocksDBTests { (key, leftOperand, rightOperand) -> String! in let left: NSString = leftOperand.componentsSeparatedByString(":")[0] let right: NSString = rightOperand.componentsSeparatedByString(":")[0] - if left.isEqualToString(right) { + if left.isEqualToString(right as String) { return rightOperand } return Optional.None! }, - { + fullMergeBlock: { (key, existing, operands) -> NSMutableDictionary! in - var dict: NSMutableDictionary = existing as NSMutableDictionary + var dict: NSMutableDictionary = existing as! NSMutableDictionary for op in operands as NSArray { let comp: NSArray = op.componentsSeparatedByString(":") - let action: NSString = comp[1] as NSString + let action: NSString = comp[1] as! NSString if action.isEqualToString("DELETE") { dict.removeObjectForKey(comp[0]) } else { - dict.setObject(comp[2], forKey: comp[0] as NSString) + dict.setObject(comp[2], forKey: comp[0] as! NSString) } } - return existing as NSMutableDictionary + return existing as! NSMutableDictionary }) rocks = RocksDB(path: self.path, andDBOptions: { (options) -> Void in @@ -162,6 +162,6 @@ class RocksDBMergeOperatorTests : RocksDBTests { "key 3" : "value 3", "key 4" : "value 4"]; - XCTAssertEqual(rocks.objectForKey("dict key") as NSDictionary, expected) + XCTAssertEqual(rocks.objectForKey("dict key") as! NSDictionary, expected) } } diff --git a/ObjectiveRocksTests/RocksDBPrefixExtractorTests.swift b/ObjectiveRocksTests/RocksDBPrefixExtractorTests.swift index 9e7be88..d99329b 100644 --- a/ObjectiveRocksTests/RocksDBPrefixExtractorTests.swift +++ b/ObjectiveRocksTests/RocksDBPrefixExtractorTests.swift @@ -51,12 +51,12 @@ class RocksDBPrefixExtractorTests : RocksDBTests { iterator.seekToKey("1000") XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSString, "100A") + XCTAssertEqual(iterator.key() as! NSString, "100A") iterator.next() XCTAssertTrue(iterator.isValid()) - XCTAssertEqual(iterator.key() as NSString, "100B") + XCTAssertEqual(iterator.key() as! NSString, "100B") } func testSwift_PrefixExtractor_FixedLength_CustomComparator() { @@ -65,7 +65,7 @@ class RocksDBPrefixExtractorTests : RocksDBTests { var sub1: NSString = key1.substringFromIndex(2) as NSString var sub2: NSString = key2.substringFromIndex(2) as NSString - let res = sub1.compare(sub2) + let res = sub1.compare(sub2 as String) switch res { case .OrderedAscending: return -1 diff --git a/ObjectiveRocksTests/RocksDBSnapshotTests.mm b/ObjectiveRocksTests/RocksDBSnapshotTests.mm index ab6f606..4345a31 100644 --- a/ObjectiveRocksTests/RocksDBSnapshotTests.mm +++ b/ObjectiveRocksTests/RocksDBSnapshotTests.mm @@ -77,4 +77,28 @@ - (void)testSnapshot_Iterator XCTAssertEqualObjects(actual, expected); } +- (void)testSnapshot_SequenceNumber +{ + _rocks = [[RocksDB alloc] initWithPath:_path andDBOptions:^(RocksDBOptions *options) { + options.createIfMissing = YES; + }]; + + [_rocks setData:Data(@"Value 1") forKey:Data(@"Key 1")]; + RocksDBSnapshot *snapshot1 = [_rocks snapshot]; + + [_rocks setData:Data(@"Value 2") forKey:Data(@"Key 2")]; + RocksDBSnapshot *snapshot2 = [_rocks snapshot]; + + [_rocks setData:Data(@"Value 3") forKey:Data(@"Key 3")]; + RocksDBSnapshot *snapshot3 = [_rocks snapshot]; + + XCTAssertEqual(snapshot1.sequenceNumber, 1); + XCTAssertEqual(snapshot2.sequenceNumber, 2); + XCTAssertEqual(snapshot3.sequenceNumber, 3); + + [snapshot1 close]; + [snapshot2 close]; + [snapshot3 close]; +} + @end diff --git a/ObjectiveRocksTests/RocksDBSnapshotTests.swift b/ObjectiveRocksTests/RocksDBSnapshotTests.swift index d9b8c4b..5c0f2c7 100644 --- a/ObjectiveRocksTests/RocksDBSnapshotTests.swift +++ b/ObjectiveRocksTests/RocksDBSnapshotTests.swift @@ -52,7 +52,7 @@ class RocksDBSnapshotTests : RocksDBTests { var actual: NSMutableArray = [] var iterator = snapshot.iterator() iterator.enumerateKeysUsingBlock { (key, stop) -> Void in - actual.addObject(Str(key as NSData)) + actual.addObject(Str(key as! NSData)) } var expected = [ "key 1", "key 2", "key 3" ] @@ -64,10 +64,33 @@ class RocksDBSnapshotTests : RocksDBTests { iterator = snapshot.iterator() iterator.enumerateKeysUsingBlock { (key, stop) -> Void in - actual.addObject(Str(key as NSData)) + actual.addObject(Str(key as! NSData)) } expected = [ "key 2", "key 3", "key 4" ] XCTAssertEqual(actual, expected) } + + func testSwift_Snapshot_SequenceNumber() { + rocks = RocksDB(path: self.path, andDBOptions: { (options) -> Void in + options.createIfMissing = true + }) + + rocks.setData(Data("value 1"), forKey: Data("key 1")) + let snapshot1 = rocks.snapshot() + + rocks.setData(Data("value 2"), forKey: Data("key 2")) + let snapshot2 = rocks.snapshot() + + rocks.setData(Data("value 3"), forKey: Data("key 3")) + let snapshot3 = rocks.snapshot() + + XCTAssertEqual(snapshot1.sequenceNumber(), 1 as UInt64) + XCTAssertEqual(snapshot2.sequenceNumber(), 2 as UInt64) + XCTAssertEqual(snapshot3.sequenceNumber(), 3 as UInt64) + + snapshot1.close() + snapshot2.close() + snapshot3.close() + } } diff --git a/ObjectiveRocksTests/RocksDBStatisticsTests.swift b/ObjectiveRocksTests/RocksDBStatisticsTests.swift index 6d65d3c..1f9eb44 100644 --- a/ObjectiveRocksTests/RocksDBStatisticsTests.swift +++ b/ObjectiveRocksTests/RocksDBStatisticsTests.swift @@ -51,7 +51,7 @@ class RocksDBStatisticsTests : RocksDBTests { for i in 0...10000 { let str = NSString(format: "a%d", i) - rocks.setData(Data(str), forKey: Data(str)) + rocks.setData(Data(str as String), forKey: Data(str as String)) } rocks.dataForKey(Data("a42")) diff --git a/ObjectiveRocksTests/RocksDBWriteBatchTests.swift b/ObjectiveRocksTests/RocksDBWriteBatchTests.swift index c739c27..7b3f57e 100644 --- a/ObjectiveRocksTests/RocksDBWriteBatchTests.swift +++ b/ObjectiveRocksTests/RocksDBWriteBatchTests.swift @@ -113,11 +113,11 @@ class RocksDBWriteBatchTests : RocksDBTests { options.mergeOperator = RocksDBMergeOperator(name: "merge", andBlock: { (key, existing, value) -> AnyObject! in var result: NSMutableString = "" if let existingValue = existing as? NSData { - result.setString(Str(existingValue)) + result.setString(Str(existingValue) as String) } result.appendString(",") - result.appendString(Str(value as NSData)) - return Data(result) + result.appendString(Str(value as! NSData) as String) + return Data(result as String) }) }) @@ -206,7 +206,7 @@ class RocksDBWriteBatchTests : RocksDBTests { } XCTAssertNil(rocks.objectForKey("Key 1")) - XCTAssertEqual(rocks.objectForKey("key 2") as NSString, "value 2"); - XCTAssertEqual(rocks.objectForKey("key 3") as NSString, "value 3"); + XCTAssertEqual(rocks.objectForKey("key 2") as! NSString, "value 2"); + XCTAssertEqual(rocks.objectForKey("key 3") as! NSString, "value 3"); } } diff --git a/rocksdb b/rocksdb index b89d58d..812c461 160000 --- a/rocksdb +++ b/rocksdb @@ -1 +1 @@ -Subproject commit b89d58dfa3887d561bd772421fb92ef01bd26fc4 +Subproject commit 812c461c96869ebcd8e629da8f01e1cea01c00ca