@@ -40,10 +40,19 @@ namespace RocksDbSharp
40
40
{
41
41
using size_t = System . UIntPtr ;
42
42
43
+ public delegate void PutDelegate ( IntPtr p0 , IntPtr k , size_t klen , IntPtr v , size_t vlen ) ;
44
+ public delegate void DeletedDelegate ( IntPtr p0 , IntPtr k , size_t klen ) ;
45
+ public delegate void DestructorDelegate ( IntPtr p0 ) ;
46
+ public delegate IntPtr NameDelegate ( IntPtr p0 ) ;
47
+ public delegate int CompareDelegate ( IntPtr p0 , IntPtr a , size_t alen , IntPtr b , size_t blen ) ;
48
+
43
49
//void (*put)(IntPtr s, /*(const char*)*/ IntPtr k, /*(size_t)*/ UIntPtr klen, /*(const char*)*/ IntPtr v, /*(size_t)*/ UIntPtr vlen),
50
+ [ Obsolete ( "Use PutDelegate" ) ]
44
51
public delegate void WriteBatchIteratePutCallback ( IntPtr s , /*(const char*)*/ IntPtr k , /*(size_t)*/ size_t klen , /*(const char*)*/ IntPtr v , /*(size_t)*/ size_t vlen ) ;
45
52
//void (*deleted)(void*, const char* k, /*(size_t)*/ UIntPtr klen)
53
+ [ Obsolete ( "Use DeletedDelegate" ) ]
46
54
public delegate void WriteBatchIterateDeleteCallback ( IntPtr s , /*(const char*)*/ IntPtr k , /*(size_t)*/ size_t klen ) ;
55
+
47
56
public abstract partial class Native
48
57
{
49
58
/* BEGIN c.h */
@@ -567,12 +576,19 @@ public unsafe abstract void rocksdb_writebatch_delete_rangev_cf(
567
576
/*(const size_t)*/ IntPtr end_keys_list_sizes ) ;
568
577
public abstract void rocksdb_writebatch_put_log_data (
569
578
/*(rocksdb_writebatch_t*)*/ IntPtr writeBatch , byte [ ] blob , UIntPtr len ) ;
579
+ [ Obsolete ( "Use PutDelegate and DeletedDelegate overload" ) ]
570
580
public abstract void rocksdb_writebatch_iterate (
571
581
/*(rocksdb_writebatch_t*)*/ IntPtr writeBatch , /*(void*)*/ IntPtr state ,
572
582
//void (*put)(IntPtr s, /*(const char*)*/ IntPtr k, /*(size_t)*/ ulong klen, /*(const char*)*/ IntPtr v, /*(size_t)*/ ulong vlen),
573
583
WriteBatchIteratePutCallback put ,
574
584
//void (*deleted)(void*, const char* k, /*(size_t)*/ ulong klen)
575
585
WriteBatchIterateDeleteCallback deleted ) ;
586
+ public abstract void rocksdb_writebatch_iterate (
587
+ /*(rocksdb_writebatch_t*)*/ IntPtr writeBatch , /*(void*)*/ IntPtr state ,
588
+ //void (*put)(IntPtr s, /*(const char*)*/ IntPtr k, /*(size_t)*/ ulong klen, /*(const char*)*/ IntPtr v, /*(size_t)*/ ulong vlen),
589
+ PutDelegate put ,
590
+ //void (*deleted)(void*, const char* k, /*(size_t)*/ ulong klen)
591
+ DeletedDelegate deleted ) ;
576
592
public abstract /* const char* */ IntPtr rocksdb_writebatch_data (
577
593
/*(rocksdb_writebatch_t*)*/ IntPtr writeBatch , /*(size_t*)*/ out size_t size ) ;
578
594
public abstract void rocksdb_writebatch_set_save_point (
@@ -691,11 +707,17 @@ public abstract void rocksdb_writebatch_wi_put_log_data(
691
707
/*(rocksdb_writebatch_wi_t*)*/ IntPtr b , /*(const char*)*/ byte [ ] blob , /*(size_t)*/ size_t len ) ;
692
708
public abstract void rocksdb_writebatch_wi_put_log_data (
693
709
/*(rocksdb_writebatch_wi_t*)*/ IntPtr b , /*(const char*)*/ IntPtr blob , /*(size_t)*/ size_t len ) ;
710
+ [ Obsolete ( "Use PutDelegate and DeletedDelegate overload" ) ]
694
711
public abstract void rocksdb_writebatch_wi_iterate (
695
712
/*(rocksdb_writebatch_wi_t*)*/ IntPtr b ,
696
713
/*(void*)*/ IntPtr state ,
697
714
/*(void (*put)(void*, const char* k, size_t klen, const char* v, size_t vlen))*/ WriteBatchIteratePutCallback put ,
698
715
/*(void (*deleted)(void*, const char* k, size_t klen))*/ WriteBatchIterateDeleteCallback deleted ) ;
716
+ public abstract void rocksdb_writebatch_wi_iterate (
717
+ /*(rocksdb_writebatch_wi_t*)*/ IntPtr b ,
718
+ /*(void*)*/ IntPtr state ,
719
+ /*(void (*put)(void*, const char* k, size_t klen, const char* v, size_t vlen))*/ PutDelegate put ,
720
+ /*(void (*deleted)(void*, const char* k, size_t klen))*/ DeletedDelegate deleted ) ;
699
721
public abstract /*(const char*)*/ IntPtr rocksdb_writebatch_wi_data (
700
722
/*(rocksdb_writebatch_wi_t*)*/ IntPtr b ,
701
723
/*(size_t*)*/ out size_t size ) ;
@@ -809,9 +831,15 @@ public abstract void rocksdb_block_based_options_set_format_version(
809
831
/*(rocksdb_block_based_table_options_t*)*/ IntPtr bbto , int format_version ) ;
810
832
}
811
833
public enum BlockBasedTableIndexType {
834
+ [ Obsolete ( "Use Binary" ) ]
812
835
BinarySearch = 0 ,
836
+ Binary = 0 ,
837
+ [ Obsolete ( "Use Hash" ) ]
813
838
HashSearch = 1 ,
839
+ Hash = 1 ,
840
+ [ Obsolete ( "Use TwoLevelIndex" ) ]
814
841
TwoLevelIndexSearch = 2 ,
842
+ TwoLevelIndex = 2 ,
815
843
} ;
816
844
public abstract partial class Native {
817
845
public abstract void rocksdb_block_based_options_set_index_type (
@@ -936,8 +964,6 @@ public abstract void rocksdb_options_set_max_bytes_for_level_multiplier_addition
936
964
/* rocksdb_options_t* */ IntPtr options , /*(int*)*/ int [ ] level_values , UIntPtr num_levels ) ;
937
965
public abstract void rocksdb_options_enable_statistics (
938
966
/* rocksdb_options_t* */ IntPtr options ) ;
939
- public abstract void rocksdb_options_set_skip_stats_update_on_db_open (
940
- /* rocksdb_options_t* */ IntPtr opt , /* unsigned char */ bool val ) ;
941
967
942
968
/* returns a pointer to a malloc()-ed, null terminated string */
943
969
public abstract /* char* */ IntPtr rocksdb_options_statistics_get_string (
@@ -1073,17 +1099,39 @@ public abstract void rocksdb_options_set_report_bg_io_stats(
1073
1099
/* rocksdb_options_t* */ IntPtr options , int value ) ;
1074
1100
1075
1101
}
1102
+ public enum Recovery
1103
+ {
1104
+ TolerateCorruptedTailRecords = 0 ,
1105
+ AbsoluteConsistency = 1 ,
1106
+ PointInTime = 2 ,
1107
+ SkipAnyCorruptedRecords = 3 ,
1108
+ }
1109
+ [ Obsolete ( "Use Recovery" ) ]
1076
1110
public enum WalRecoveryMode {
1077
1111
rocksdb_tolerate_corrupted_tail_records_recovery = 0 ,
1078
1112
rocksdb_absolute_consistency_recovery = 1 ,
1079
1113
rocksdb_point_in_time_recovery = 2 ,
1080
1114
rocksdb_skip_any_corrupted_records_recovery = 3
1081
1115
}
1082
1116
public abstract partial class Native {
1117
+ [ Obsolete ( "Use Recovery enum" ) ]
1083
1118
public abstract void rocksdb_options_set_wal_recovery_mode (
1084
1119
/* rocksdb_options_t* */ IntPtr options , WalRecoveryMode mode ) ;
1120
+ public abstract void rocksdb_options_set_wal_recovery_mode (
1121
+ /* rocksdb_options_t* */ IntPtr options , Recovery mode ) ;
1085
1122
}
1086
-
1123
+ public enum Compression
1124
+ {
1125
+ No = 0 ,
1126
+ Snappy = 1 ,
1127
+ Zlib = 2 ,
1128
+ Bz2 = 3 ,
1129
+ Lz4 = 4 ,
1130
+ Lz4hc = 5 ,
1131
+ Xpress = 6 ,
1132
+ Zstd = 7 ,
1133
+ }
1134
+ [ Obsolete ( "Use Compression" ) ]
1087
1135
public enum CompressionTypeEnum {
1088
1136
rocksdb_no_compression = 0 ,
1089
1137
rocksdb_snappy_compression = 1 ,
@@ -1095,17 +1143,30 @@ public enum CompressionTypeEnum {
1095
1143
rocksdb_zstd_compression = 7
1096
1144
}
1097
1145
public abstract partial class Native {
1146
+ [ Obsolete ( "Use Compression enum" ) ]
1098
1147
public abstract void rocksdb_options_set_compression (
1099
1148
/* rocksdb_options_t* */ IntPtr options , CompressionTypeEnum value ) ;
1149
+ public abstract void rocksdb_options_set_compression (
1150
+ /* rocksdb_options_t* */ IntPtr options , Compression value ) ;
1100
1151
}
1152
+ public enum Compaction
1153
+ {
1154
+ Level = 0 ,
1155
+ Universal = 1 ,
1156
+ Fifo = 2 ,
1157
+ }
1158
+ [ Obsolete ( "Use Compaction" ) ]
1101
1159
public enum CompactionStyleEnum {
1102
1160
rocksdb_level_compaction = 0 ,
1103
1161
rocksdb_universal_compaction = 1 ,
1104
1162
rocksdb_fifo_compaction = 2 ,
1105
1163
}
1106
1164
public abstract partial class Native {
1165
+ [ Obsolete ( "Use Compaction enum" ) ]
1107
1166
public abstract void rocksdb_options_set_compaction_style (
1108
1167
/* rocksdb_options_t* */ IntPtr options , CompactionStyleEnum value ) ;
1168
+ public abstract void rocksdb_options_set_compaction_style (
1169
+ /* rocksdb_options_t* */ IntPtr options , Compaction value ) ;
1109
1170
public abstract void rocksdb_options_set_universal_compaction_options (
1110
1171
/* rocksdb_options_t* */ IntPtr options , /*(rocksdb_universal_compaction_options_t*)*/ IntPtr universal_compaction_options ) ;
1111
1172
public abstract void rocksdb_options_set_fifo_compaction_options (
@@ -1275,6 +1336,11 @@ public abstract void rocksdb_compactionfilterfactory_destroy(
1275
1336
/*(int (*compare)(void*, const char* a, size_t alen, const char* b,
1276
1337
size_t blen))*/ IntPtr compare ,
1277
1338
/*(const char* (*name)(void*))*/ IntPtr getName ) ;
1339
+ public abstract /* rocksdb_comparator_t* */ IntPtr rocksdb_comparator_create (
1340
+ /*(void*)*/ IntPtr state , /*(void (*destructor)(void*))*/ DestructorDelegate destructor ,
1341
+ /*(int (*compare)(void*, const char* a, size_t alen, const char* b,
1342
+ size_t blen))*/ CompareDelegate compare ,
1343
+ /*(const char* (*name)(void*))*/ NameDelegate name ) ;
1278
1344
public abstract void rocksdb_comparator_destroy (
1279
1345
/*(rocksdb_comparator_t*)*/ IntPtr comparator ) ;
1280
1346
@@ -1416,19 +1482,17 @@ public abstract void rocksdb_flushoptions_set_wait(
1416
1482
#endregion
1417
1483
1418
1484
#region Cache
1419
- #if ROCKSDB_CACHE
1420
1485
1421
1486
public abstract /* rocksdb_cache_t* */ IntPtr rocksdb_cache_create_lru (
1422
1487
size_t capacity ) ;
1423
- public abstract void rocksdb_cache_destroy ( rocksdb_cache_t * cache ) ;
1488
+ public abstract void rocksdb_cache_destroy ( /* rocksdb_cache_t* */ IntPtr cache ) ;
1424
1489
public abstract void rocksdb_cache_set_capacity (
1425
- rocksdb_cache_t * cache , size_t capacity ) ;
1426
- public abstract /*(size_t)*/ ulong
1490
+ /* rocksdb_cache_t* */ IntPtr cache , size_t capacity ) ;
1491
+ public abstract /*(size_t)*/ UIntPtr
1427
1492
rocksdb_cache_get_usage ( /*(rocksdb_cache_t*)*/ IntPtr cache ) ;
1428
- public abstract /*(size_t)*/ ulong
1493
+ public abstract /*(size_t)*/ UIntPtr
1429
1494
rocksdb_cache_get_pinned_usage ( /*(rocksdb_cache_t*)*/ IntPtr cache ) ;
1430
1495
1431
- #endif
1432
1496
#endregion
1433
1497
1434
1498
#region DBPath
0 commit comments