@Override public Store compute(Transaction txn) { return env.openStore(storeName, StoreConfig.WITHOUT_DUPLICATES, txn); } });
private Store initStore( final LocalDB.DB db, final Transaction txn ) { return environment.openStore( db.toString(), StoreConfig.WITHOUT_DUPLICATES, txn ); }
@NotNull private Store getUniqueKeyIndex(@NotNull final PersistentStoreTransaction txn, @NotNull final Index index) { return persistentStore.getEnvironment().openStore(getUniqueKeyIndexName(index), StoreConfig.WITHOUT_DUPLICATES_WITH_PREFIXING, txn.getEnvironmentTransaction()); }
boolean success = false; try { this.store = env.openStore(storeName, keyPrefixing ? StoreConfig.WITHOUT_DUPLICATES_WITH_PREFIXING : StoreConfig.WITHOUT_DUPLICATES, this.tx); success = true;
@Override public void truncate( final LocalDB.DB db ) throws LocalDBException { checkStatus( true ); { final long finalSize = this.size( db ); LOGGER.trace( () -> "begin truncate of " + db.toString() + ", size=" + finalSize ); } final Instant startDate = Instant.now(); environment.executeInTransaction( transaction -> { environment.truncateStore( db.toString(), transaction ); final Store newStoreReference = environment.openStore( db.toString(), StoreConfig.USE_EXISTING, transaction ); cachedStoreObjects.put( db, newStoreReference ); } ); { final long finalSize = this.size( db ); LOGGER.trace( () -> "completed truncate of " + db.toString() + " (" + TimeDuration.fromCurrent( startDate ).asCompactString() + ")" + ", size=" + finalSize ); } }