public DataBlockEngine(StoreSerializer serializer, StoreConfig storeConfig) { this.serializer = serializer; this.storeConfig = storeConfig; this.dataPath = storeConfig.getDataPath(); }
@Override public void close() throws FailStoreException { db.close(); }
public DBBuilder<K, V> setPath(File path) { this.storeConfig.setDbPath(path); return this; }
public DB<K, V> create() { if (serializer == null) { this.serializer = new JsonStoreSerializer(); } if (storeConfig.getDbPath() == null) { storeConfig.setDbPath(new File(Constants.USER_HOME)); } storeConfig.setDataPath(new File(storeConfig.getDbPath(), "data")); storeConfig.setLogPath(new File(storeConfig.getDbPath(), "logs")); storeConfig.setIndexPath(new File(storeConfig.getDbPath(), "index")); return new DBImpl<K, V>(serializer, storeConfig); }
public DBBuilder() { storeConfig = new StoreConfig(); }
@Override public void open() throws FailStoreException { try { db.init(); } catch (Exception e) { throw new FailStoreException(e); } }
public StoreTxLogEngine(StoreSerializer serializer, StoreConfig storeConfig) { this.logPath = storeConfig.getLogPath(); this.storeConfig = storeConfig; this.serializer = serializer; this.storeTxLogs = new CopyOnWriteArrayList<StoreTxLog>(); }
@Override public void delete(String key) throws FailStoreException { try { db.remove(key); } catch (Exception e) { throw new FailStoreException(e); } }
public DB<K, V> create() { if (serializer == null) { this.serializer = new JsonStoreSerializer(); } if (storeConfig.getDbPath() == null) { storeConfig.setDbPath(new File(Constants.USER_HOME)); } storeConfig.setDataPath(new File(storeConfig.getDbPath(), "data")); storeConfig.setLogPath(new File(storeConfig.getDbPath(), "logs")); storeConfig.setIndexPath(new File(storeConfig.getDbPath(), "index")); return new DBImpl<K, V>(serializer, storeConfig); }
public DataBlockEngine(StoreSerializer serializer, StoreConfig storeConfig) { this.serializer = serializer; this.storeConfig = storeConfig; this.dataPath = storeConfig.getDataPath(); }
@Override public void close() throws FailStoreException { db.close(); }
public DBBuilder<K, V> setPath(File path) { this.storeConfig.setDbPath(path); return this; }
public DBBuilder() { storeConfig = new StoreConfig(); }
@Override public void open() throws FailStoreException { try { db.init(); } catch (Exception e) { throw new FailStoreException(e); } }
public StoreTxLogEngine(StoreSerializer serializer, StoreConfig storeConfig) { this.logPath = storeConfig.getLogPath(); this.storeConfig = storeConfig; this.serializer = serializer; this.storeTxLogs = new CopyOnWriteArrayList<StoreTxLog>(); }
@Override public void delete(String key) throws FailStoreException { try { db.remove(key); } catch (Exception e) { throw new FailStoreException(e); } }