|
| 1 | +/* |
| 2 | + * Copyright © 2026 ObjectBox Ltd. <https://objectbox.io> |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +// automatically generated by the FlatBuffers compiler, do not modify |
| 18 | + |
| 19 | +package io.objectbox.config; |
| 20 | + |
| 21 | +import java.nio.ByteBuffer; |
| 22 | +import java.nio.ByteOrder; |
| 23 | + |
| 24 | +import io.objectbox.flatbuffers.BaseVector; |
| 25 | +import io.objectbox.flatbuffers.Constants; |
| 26 | +import io.objectbox.flatbuffers.FlatBufferBuilder; |
| 27 | +import io.objectbox.flatbuffers.Table; |
| 28 | + |
| 29 | +/** |
| 30 | + * Options to enable and configure WAL. |
| 31 | + */ |
| 32 | +@SuppressWarnings("unused") |
| 33 | +public final class WalOptions extends Table { |
| 34 | + public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } |
| 35 | + public static WalOptions getRootAsWalOptions(ByteBuffer _bb) { return getRootAsWalOptions(_bb, new WalOptions()); } |
| 36 | + public static WalOptions getRootAsWalOptions(ByteBuffer _bb, WalOptions obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } |
| 37 | + public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } |
| 38 | + public WalOptions __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 39 | + |
| 40 | + /** |
| 41 | + * Flags to enable and change default WAL behavior, e.g. no sync to disk option. |
| 42 | + */ |
| 43 | + public long walFlags() { int o = __offset(4); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0L; } |
| 44 | + /** |
| 45 | + * The WAL file gets consolidated when it reached this size limit when opening the database. |
| 46 | + * This setting is meant for applications that prefer to consolidate on startup, |
| 47 | + * which may avoid consolidations on commits while the application is running. |
| 48 | + * The default is 4096 (4 MB). |
| 49 | + */ |
| 50 | + public long maxWalFileSizeOnOpenInKbyte() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0L; } |
| 51 | + /** |
| 52 | + * The WAL file gets consolidated when it reaches this size limit after a commit. |
| 53 | + * As consolidation takes some time, it is a trade-off between accumulating enough data |
| 54 | + * and the time the consolidation takes (longer with more data). |
| 55 | + * The default is 16384 (16 MB). |
| 56 | + */ |
| 57 | + public long maxWalFileSizeInKbyte() { int o = __offset(8); return o != 0 ? bb.getLong(o + bb_pos) : 0L; } |
| 58 | + |
| 59 | + public static int createWalOptions(FlatBufferBuilder builder, |
| 60 | + long walFlags, |
| 61 | + long maxWalFileSizeOnOpenInKbyte, |
| 62 | + long maxWalFileSizeInKbyte) { |
| 63 | + builder.startTable(3); |
| 64 | + WalOptions.addMaxWalFileSizeInKbyte(builder, maxWalFileSizeInKbyte); |
| 65 | + WalOptions.addMaxWalFileSizeOnOpenInKbyte(builder, maxWalFileSizeOnOpenInKbyte); |
| 66 | + WalOptions.addWalFlags(builder, walFlags); |
| 67 | + return WalOptions.endWalOptions(builder); |
| 68 | + } |
| 69 | + |
| 70 | + public static void startWalOptions(FlatBufferBuilder builder) { builder.startTable(3); } |
| 71 | + public static void addWalFlags(FlatBufferBuilder builder, long walFlags) { builder.addInt(0, (int) walFlags, (int) 0L); } |
| 72 | + public static void addMaxWalFileSizeOnOpenInKbyte(FlatBufferBuilder builder, long maxWalFileSizeOnOpenInKbyte) { builder.addLong(1, maxWalFileSizeOnOpenInKbyte, 0L); } |
| 73 | + public static void addMaxWalFileSizeInKbyte(FlatBufferBuilder builder, long maxWalFileSizeInKbyte) { builder.addLong(2, maxWalFileSizeInKbyte, 0L); } |
| 74 | + public static int endWalOptions(FlatBufferBuilder builder) { |
| 75 | + int o = builder.endTable(); |
| 76 | + return o; |
| 77 | + } |
| 78 | + |
| 79 | + public static final class Vector extends BaseVector { |
| 80 | + public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; } |
| 81 | + |
| 82 | + public WalOptions get(int j) { return get(new WalOptions(), j); } |
| 83 | + public WalOptions get(WalOptions obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); } |
| 84 | + } |
| 85 | +} |
| 86 | + |
0 commit comments