Update database

This commit is contained in:
Andrea Cavalli 2021-06-27 17:04:48 +02:00
parent fa347a2c17
commit daf48f0330
2 changed files with 6 additions and 5 deletions

View File

@ -114,7 +114,7 @@
<dependency>
<groupId>it.cavallium</groupId>
<artifactId>dbengine</artifactId>
<version>3.0.172</version>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@ -32,6 +32,7 @@ import it.cavallium.dbengine.database.LLDictionaryResultType;
import it.cavallium.dbengine.database.LLKeyValueDatabase;
import it.cavallium.dbengine.database.UpdateMode;
import it.cavallium.dbengine.database.UpdateReturnMode;
import it.cavallium.dbengine.database.disk.DatabaseOptions;
import it.unimi.dsi.fastutil.booleans.BooleanArrayList;
import java.nio.ByteBuffer;
import java.util.Arrays;
@ -61,13 +62,13 @@ public class DiskCache implements URLsDiskHandler, URLsWriter {
this.diskMetadataSerializer = new DiskMetadataSerializer(db.getAllocator());
}
public static Mono<DiskCache> open(LLDatabaseConnection databaseConnection, String dbName, boolean lowMemory) {
public static Mono<DiskCache> open(LLDatabaseConnection databaseConnection,
String dbName,
DatabaseOptions databaseOptions) {
return databaseConnection
.getDatabase(dbName,
List.of(Column.dictionary("file-content"), Column.dictionary("file-metadata")),
Map.of("enableColumnBug", "true"),
lowMemory,
false
databaseOptions
)
.flatMap(db -> Mono.zip(
Mono.just(db).single(),