ElectraDatabase database = DatabaseFactory.createDatabase(Paths.get("./"));
From the above code it becomes unclear how to get access to the Storage Engine to perform any operation.
I am purely looking at this from a Embedded usage standpoint.
Some modifications we tried to achieve the same are included below, if you like this approach I can go forward with a pull-request.
public interface ElectraDatabase extends AutoCloseable {
public StorageEngine getEngine();
}
public class ElectraDatabaseImpl implements ElectraDatabase {
private final StorageEngine storageEngine;
ElectraDatabaseImpl(Path databaseFolder) throws EngineInitializationException {
Path indexPath = databaseFolder.resolve("index.lctr");
Path dataPath = databaseFolder.resolve("data.lctr");
storageEngine = new SimpleStorageEngine(dataPath, indexPath);
}
@OverRide
public void close() throws IOException {
storageEngine.close();
}
@OverRide
public StorageEngine getEngine() {
return storageEngine;
}
}