1
1
/*
2
- * Copyright 2022 ObjectBox Ltd. All rights reserved.
2
+ * Copyright 2023 ObjectBox Ltd. All rights reserved.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
18
18
19
19
package io .objectbox .model ;
20
20
21
- import java .nio .*;
22
- import java .lang .*;
23
- import java .util .*;
24
- import io .objectbox .flatbuffers .*;
21
+ import io .objectbox .flatbuffers .BaseVector ;
22
+ import io .objectbox .flatbuffers .BooleanVector ;
23
+ import io .objectbox .flatbuffers .ByteVector ;
24
+ import io .objectbox .flatbuffers .Constants ;
25
+ import io .objectbox .flatbuffers .DoubleVector ;
26
+ import io .objectbox .flatbuffers .FlatBufferBuilder ;
27
+ import io .objectbox .flatbuffers .FloatVector ;
28
+ import io .objectbox .flatbuffers .IntVector ;
29
+ import io .objectbox .flatbuffers .LongVector ;
30
+ import io .objectbox .flatbuffers .ShortVector ;
31
+ import io .objectbox .flatbuffers .StringVector ;
32
+ import io .objectbox .flatbuffers .Struct ;
33
+ import io .objectbox .flatbuffers .Table ;
34
+ import io .objectbox .flatbuffers .UnionVector ;
35
+ import java .nio .ByteBuffer ;
36
+ import java .nio .ByteOrder ;
25
37
26
38
/**
27
39
* Options to open a store with. Set only the values you want; defaults are used otherwise.
31
43
*/
32
44
@ SuppressWarnings ("unused" )
33
45
public final class FlatStoreOptions extends Table {
34
- public static void ValidateVersion () { Constants .FLATBUFFERS_2_0_8 (); }
46
+ public static void ValidateVersion () { Constants .FLATBUFFERS_23_5_26 (); }
35
47
public static FlatStoreOptions getRootAsFlatStoreOptions (ByteBuffer _bb ) { return getRootAsFlatStoreOptions (_bb , new FlatStoreOptions ()); }
36
48
public static FlatStoreOptions getRootAsFlatStoreOptions (ByteBuffer _bb , FlatStoreOptions obj ) { _bb .order (ByteOrder .LITTLE_ENDIAN ); return (obj .__assign (_bb .getInt (_bb .position ()) + _bb .position (), _bb )); }
37
49
public void __init (int _i , ByteBuffer _bb ) { __reset (_i , _bb ); }
@@ -85,7 +97,7 @@ public final class FlatStoreOptions extends Table {
85
97
* OSes, file systems, or hardware.
86
98
* Note: ObjectBox builds upon ACID storage, which already has strong consistency mechanisms in place.
87
99
*/
88
- public int validateOnOpen () { int o = __offset (14 ); return o != 0 ? bb .getShort (o + bb_pos ) & 0xFFFF : 0 ; }
100
+ public int validateOnOpenPages () { int o = __offset (14 ); return o != 0 ? bb .getShort (o + bb_pos ) & 0xFFFF : 0 ; }
89
101
/**
90
102
* To fine-tune database validation, you can specify a limit on how much data is looked at.
91
103
* This is measured in "pages" with a page typically holding 4K.
@@ -143,14 +155,19 @@ public final class FlatStoreOptions extends Table {
143
155
* Max data and DB sizes can be combined; data size must be below the DB size.
144
156
*/
145
157
public long maxDataSizeInKbyte () { int o = __offset (32 ); return o != 0 ? bb .getLong (o + bb_pos ) : 0L ; }
158
+ /**
159
+ * When a database is opened, ObjectBox can perform additional consistency checks on its database structure.
160
+ * This enum is used to enable validation checks on a key/value level.
161
+ */
162
+ public int validateOnOpenKv () { int o = __offset (34 ); return o != 0 ? bb .getShort (o + bb_pos ) & 0xFFFF : 0 ; }
146
163
147
164
public static int createFlatStoreOptions (FlatBufferBuilder builder ,
148
165
int directoryPathOffset ,
149
166
int modelBytesOffset ,
150
167
long maxDbSizeInKbyte ,
151
168
long fileMode ,
152
169
long maxReaders ,
153
- int validateOnOpen ,
170
+ int validateOnOpenPages ,
154
171
long validateOnOpenPageLimit ,
155
172
int putPaddingMode ,
156
173
boolean skipReadSchema ,
@@ -159,8 +176,9 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
159
176
boolean readOnly ,
160
177
long debugFlags ,
161
178
boolean noReaderThreadLocals ,
162
- long maxDataSizeInKbyte ) {
163
- builder .startTable (15 );
179
+ long maxDataSizeInKbyte ,
180
+ int validateOnOpenKv ) {
181
+ builder .startTable (16 );
164
182
FlatStoreOptions .addMaxDataSizeInKbyte (builder , maxDataSizeInKbyte );
165
183
FlatStoreOptions .addValidateOnOpenPageLimit (builder , validateOnOpenPageLimit );
166
184
FlatStoreOptions .addMaxDbSizeInKbyte (builder , maxDbSizeInKbyte );
@@ -169,8 +187,9 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
169
187
FlatStoreOptions .addFileMode (builder , fileMode );
170
188
FlatStoreOptions .addModelBytes (builder , modelBytesOffset );
171
189
FlatStoreOptions .addDirectoryPath (builder , directoryPathOffset );
190
+ FlatStoreOptions .addValidateOnOpenKv (builder , validateOnOpenKv );
172
191
FlatStoreOptions .addPutPaddingMode (builder , putPaddingMode );
173
- FlatStoreOptions .addValidateOnOpen (builder , validateOnOpen );
192
+ FlatStoreOptions .addValidateOnOpenPages (builder , validateOnOpenPages );
174
193
FlatStoreOptions .addNoReaderThreadLocals (builder , noReaderThreadLocals );
175
194
FlatStoreOptions .addReadOnly (builder , readOnly );
176
195
FlatStoreOptions .addUsePreviousCommitOnValidationFailure (builder , usePreviousCommitOnValidationFailure );
@@ -179,7 +198,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
179
198
return FlatStoreOptions .endFlatStoreOptions (builder );
180
199
}
181
200
182
- public static void startFlatStoreOptions (FlatBufferBuilder builder ) { builder .startTable (15 ); }
201
+ public static void startFlatStoreOptions (FlatBufferBuilder builder ) { builder .startTable (16 ); }
183
202
public static void addDirectoryPath (FlatBufferBuilder builder , int directoryPathOffset ) { builder .addOffset (0 , directoryPathOffset , 0 ); }
184
203
public static void addModelBytes (FlatBufferBuilder builder , int modelBytesOffset ) { builder .addOffset (1 , modelBytesOffset , 0 ); }
185
204
public static int createModelBytesVector (FlatBufferBuilder builder , byte [] data ) { return builder .createByteVector (data ); }
@@ -188,7 +207,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
188
207
public static void addMaxDbSizeInKbyte (FlatBufferBuilder builder , long maxDbSizeInKbyte ) { builder .addLong (2 , maxDbSizeInKbyte , 0L ); }
189
208
public static void addFileMode (FlatBufferBuilder builder , long fileMode ) { builder .addInt (3 , (int ) fileMode , (int ) 0L ); }
190
209
public static void addMaxReaders (FlatBufferBuilder builder , long maxReaders ) { builder .addInt (4 , (int ) maxReaders , (int ) 0L ); }
191
- public static void addValidateOnOpen (FlatBufferBuilder builder , int validateOnOpen ) { builder .addShort (5 , (short ) validateOnOpen , (short ) 0 ); }
210
+ public static void addValidateOnOpenPages (FlatBufferBuilder builder , int validateOnOpenPages ) { builder .addShort (5 , (short ) validateOnOpenPages , (short ) 0 ); }
192
211
public static void addValidateOnOpenPageLimit (FlatBufferBuilder builder , long validateOnOpenPageLimit ) { builder .addLong (6 , validateOnOpenPageLimit , 0L ); }
193
212
public static void addPutPaddingMode (FlatBufferBuilder builder , int putPaddingMode ) { builder .addShort (7 , (short ) putPaddingMode , (short ) 0 ); }
194
213
public static void addSkipReadSchema (FlatBufferBuilder builder , boolean skipReadSchema ) { builder .addBoolean (8 , skipReadSchema , false ); }
@@ -198,6 +217,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
198
217
public static void addDebugFlags (FlatBufferBuilder builder , long debugFlags ) { builder .addInt (12 , (int ) debugFlags , (int ) 0L ); }
199
218
public static void addNoReaderThreadLocals (FlatBufferBuilder builder , boolean noReaderThreadLocals ) { builder .addBoolean (13 , noReaderThreadLocals , false ); }
200
219
public static void addMaxDataSizeInKbyte (FlatBufferBuilder builder , long maxDataSizeInKbyte ) { builder .addLong (14 , maxDataSizeInKbyte , 0L ); }
220
+ public static void addValidateOnOpenKv (FlatBufferBuilder builder , int validateOnOpenKv ) { builder .addShort (15 , (short ) validateOnOpenKv , (short ) 0 ); }
201
221
public static int endFlatStoreOptions (FlatBufferBuilder builder ) {
202
222
int o = builder .endTable ();
203
223
return o ;
0 commit comments