2626/**
2727 * Options to open a store with. Set only the values you want; defaults are used otherwise.
2828 * Reminder: enable "force defaults" in the FlatBuffers builder, e.g. to pass in booleans with value "false".
29+ * NOTE: some setting are for "advanced" purposes that you can typically ignore for regular usage.
30+ * When using advanced setting, you should know exactly what you are doing.
2931 */
3032@ SuppressWarnings ("unused" )
3133public final class FlatStoreOptions extends Table {
@@ -35,16 +37,31 @@ public final class FlatStoreOptions extends Table {
3537 public void __init (int _i , ByteBuffer _bb ) { __reset (_i , _bb ); }
3638 public FlatStoreOptions __assign (int _i , ByteBuffer _bb ) { __init (_i , _bb ); return this ; }
3739
40+ /**
41+ * Location of the database on disk; this will be a directory containing files.
42+ */
3843 public String directoryPath () { int o = __offset (4 ); return o != 0 ? __string (o + bb_pos ) : null ; }
3944 public ByteBuffer directoryPathAsByteBuffer () { return __vector_as_bytebuffer (4 , 1 ); }
4045 public ByteBuffer directoryPathInByteBuffer (ByteBuffer _bb ) { return __vector_in_bytebuffer (_bb , 4 , 1 ); }
46+ /**
47+ * Provide a data model, e.g. to initialize or update the schema.
48+ */
4149 public int modelBytes (int j ) { int o = __offset (6 ); return o != 0 ? bb .get (__vector (o ) + j * 1 ) & 0xFF : 0 ; }
4250 public int modelBytesLength () { int o = __offset (6 ); return o != 0 ? __vector_len (o ) : 0 ; }
4351 public ByteVector modelBytesVector () { return modelBytesVector (new ByteVector ()); }
4452 public ByteVector modelBytesVector (ByteVector obj ) { int o = __offset (6 ); return o != 0 ? obj .__assign (__vector (o ), bb ) : null ; }
4553 public ByteBuffer modelBytesAsByteBuffer () { return __vector_as_bytebuffer (6 , 1 ); }
4654 public ByteBuffer modelBytesInByteBuffer (ByteBuffer _bb ) { return __vector_in_bytebuffer (_bb , 6 , 1 ); }
55+ /**
56+ * This maximum size setting is meant to prevent your database from growing to unexpected sizes,
57+ * e.g. caused by programming error.
58+ * If your app runs into errors like "db full", you may consider to raise the limit.
59+ */
4760 public long maxDbSizeInKByte () { int o = __offset (8 ); return o != 0 ? bb .getLong (o + bb_pos ) : 0L ; }
61+ /**
62+ * File permissions given in Unix style octal bit flags (e.g. 0644). Ignored on Windows.
63+ * Note: directories become searchable if the "read" or "write" permission is set (e.g. 0640 becomes 0750).
64+ */
4865 public long fileMode () { int o = __offset (10 ); return o != 0 ? (long )bb .getInt (o + bb_pos ) & 0xFFFFFFFFL : 0L ; }
4966 /**
5067 * The maximum number of readers.
@@ -72,16 +89,25 @@ public final class FlatStoreOptions extends Table {
7289 * This is only to be used with ValidateOnOpenMode "Regular" and "WithLeaves".
7390 */
7491 public long validateOnOpenPageLimit () { int o = __offset (16 ); return o != 0 ? bb .getLong (o + bb_pos ) : 0L ; }
92+ /**
93+ * Don't touch unless you know exactly what you are doing:
94+ * Advanced setting typically meant for language bindings (not end users). See PutPaddingMode description.
95+ */
7596 public int putPaddingMode () { int o = __offset (18 ); return o != 0 ? bb .getShort (o + bb_pos ) & 0xFFFF : 0 ; }
76- public boolean readSchema () { int o = __offset (20 ); return o != 0 ? 0 !=bb .get (o + bb_pos ) : false ; }
7797 /**
78- * Recommended to be used together with read-only mode to ensure no data is lost.
98+ * Advanced setting meant only for special scenarios: opens the database in a limited, schema-less mode.
99+ * If you don't know what this means exactly: ignore this flag.
100+ */
101+ public boolean skipReadSchema () { int o = __offset (20 ); return o != 0 ? 0 !=bb .get (o + bb_pos ) : false ; }
102+ /**
103+ * Advanced setting recommended to be used together with read-only mode to ensure no data is lost.
79104 * Ignores the latest data snapshot (committed transaction state) and uses the previous snapshot instead.
80105 * When used with care (e.g. backup the DB files first), this option may also recover data removed by the latest
81106 * transaction.
82107 */
83108 public boolean usePreviousCommit () { int o = __offset (22 ); return o != 0 ? 0 !=bb .get (o + bb_pos ) : false ; }
84109 /**
110+ * NOT IMPLEMENTED YET. Placeholder for a future version only.
85111 * If consistency checks fail during opening the DB (see also the pagesToValidateOnOpen setting), ObjectBox
86112 * automatically switches to the previous commit (see also usePreviousCommit). This way, this constitutes
87113 * an auto-recover mode from severe failures. HOWEVER, keep in mind that any consistency failure
@@ -93,6 +119,9 @@ public final class FlatStoreOptions extends Table {
93119 * Open store in read-only mode: no schema update, no write transactions.
94120 */
95121 public boolean readOnly () { int o = __offset (26 ); return o != 0 ? 0 !=bb .get (o + bb_pos ) : false ; }
122+ /**
123+ * For debugging purposes you may want enable specific logging.
124+ */
96125 public long debugFlags () { int o = __offset (28 ); return o != 0 ? (long )bb .getInt (o + bb_pos ) & 0xFFFFFFFFL : 0L ; }
97126
98127 public static int createFlatStoreOptions (FlatBufferBuilder builder ,
@@ -104,7 +133,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
104133 int validateOnOpen ,
105134 long validateOnOpenPageLimit ,
106135 int putPaddingMode ,
107- boolean readSchema ,
136+ boolean skipReadSchema ,
108137 boolean usePreviousCommit ,
109138 boolean usePreviousCommitOnValidationFailure ,
110139 boolean readOnly ,
@@ -122,7 +151,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
122151 FlatStoreOptions .addReadOnly (builder , readOnly );
123152 FlatStoreOptions .addUsePreviousCommitOnValidationFailure (builder , usePreviousCommitOnValidationFailure );
124153 FlatStoreOptions .addUsePreviousCommit (builder , usePreviousCommit );
125- FlatStoreOptions .addReadSchema (builder , readSchema );
154+ FlatStoreOptions .addSkipReadSchema (builder , skipReadSchema );
126155 return FlatStoreOptions .endFlatStoreOptions (builder );
127156 }
128157
@@ -138,7 +167,7 @@ public static int createFlatStoreOptions(FlatBufferBuilder builder,
138167 public static void addValidateOnOpen (FlatBufferBuilder builder , int validateOnOpen ) { builder .addShort (5 , (short )validateOnOpen , (short )0 ); }
139168 public static void addValidateOnOpenPageLimit (FlatBufferBuilder builder , long validateOnOpenPageLimit ) { builder .addLong (6 , validateOnOpenPageLimit , 0L ); }
140169 public static void addPutPaddingMode (FlatBufferBuilder builder , int putPaddingMode ) { builder .addShort (7 , (short )putPaddingMode , (short )0 ); }
141- public static void addReadSchema (FlatBufferBuilder builder , boolean readSchema ) { builder .addBoolean (8 , readSchema , false ); }
170+ public static void addSkipReadSchema (FlatBufferBuilder builder , boolean skipReadSchema ) { builder .addBoolean (8 , skipReadSchema , false ); }
142171 public static void addUsePreviousCommit (FlatBufferBuilder builder , boolean usePreviousCommit ) { builder .addBoolean (9 , usePreviousCommit , false ); }
143172 public static void addUsePreviousCommitOnValidationFailure (FlatBufferBuilder builder , boolean usePreviousCommitOnValidationFailure ) { builder .addBoolean (10 , usePreviousCommitOnValidationFailure , false ); }
144173 public static void addReadOnly (FlatBufferBuilder builder , boolean readOnly ) { builder .addBoolean (11 , readOnly , false ); }
0 commit comments