Loading kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/internal/GetLogHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class GetLogHandler { switch (type) { case CAPACITIES: Capacity capacity = CapacityUtil.getCapacity(); Capacity capacity = CapacityUtil.getCapacity(engine); getLog.setCapacity(capacity); break; case UTILIZATIONS: Loading kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/internal/SimulatorEngine.java +19 −0 Original line number Diff line number Diff line Loading @@ -905,4 +905,23 @@ public class SimulatorEngine implements MessageService { return this.deviceLocked; } /** * Get the absolute path of the persist store. * * @return the absolute path of the persist store * */ public String getPersistStorePath() { String path = "/"; try { path = this.store.getPersistStorePath(); } catch (KVStoreException e) { logger.log(Level.WARNING, e.getMessage(), e); } return path; } } kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/persist/Store.java +16 −4 Original line number Diff line number Diff line Loading @@ -29,10 +29,13 @@ import com.seagate.kinetic.simulator.internal.KVStoreException; /** * * DB Application (Raw) Interface. * Kinetic persist store (Raw) Interface. * * @see StoreFactory * * @author James Hughes. * @author Chenchong Li * @author Chiaming Yang */ public interface Store<K, O, V> { Loading Loading @@ -257,4 +260,13 @@ public interface Store<K, O, V> { * if null then compaction ends at the last key */ public void compactRange(K startKey, K endKey) throws KVStoreException; /** * Get the absolute path of the persist store. * * @return the absolute path of the persist store * * @throws KVStoreException if any internal error occurred. */ public String getPersistStorePath() throws KVStoreException; } kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/persist/bdb/BdbStore.java +6 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import com.seagate.kinetic.simulator.persist.PersistOption; import com.seagate.kinetic.simulator.persist.Store; /** * implement store * Implement Kinetic Store interface. * * XXX chiaming 12/24/2013: support PersistOption * Loading Loading @@ -163,4 +163,9 @@ public class BdbStore implements Store<ByteString, ByteString, KVValue> { logger.warning("method is not implemented for bdb"); } @Override public String getPersistStorePath() throws KVStoreException { return this.kvStore.getPersistStorePath(); } } kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/persist/bdb/KVStore.java +14 −1 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ public final class KVStore { private final DatabaseConfig dbConfig = new DatabaseConfig(); private String kineticDbName = null; private String persistFolder = null; static DatabaseEntry dbe(String s) { ByteString bs = ByteString.copyFromUtf8(s); DatabaseEntry dbe = new DatabaseEntry(); Loading Loading @@ -98,7 +100,7 @@ public final class KVStore { + ", created=" + created); } String persistFolder = kineticHome persistFolder = kineticHome + File.separator + config.getProperty(SimulatorConfiguration.PERSIST_HOME, "bdb"); Loading Loading @@ -354,4 +356,15 @@ public final class KVStore { } } /** * Get persist store path. * * @return persist store path. * @throws KVStoreException * if any internal error occurred. */ public String getPersistStorePath() throws KVStoreException { return this.persistFolder; } } Loading
kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/internal/GetLogHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class GetLogHandler { switch (type) { case CAPACITIES: Capacity capacity = CapacityUtil.getCapacity(); Capacity capacity = CapacityUtil.getCapacity(engine); getLog.setCapacity(capacity); break; case UTILIZATIONS: Loading
kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/internal/SimulatorEngine.java +19 −0 Original line number Diff line number Diff line Loading @@ -905,4 +905,23 @@ public class SimulatorEngine implements MessageService { return this.deviceLocked; } /** * Get the absolute path of the persist store. * * @return the absolute path of the persist store * */ public String getPersistStorePath() { String path = "/"; try { path = this.store.getPersistStorePath(); } catch (KVStoreException e) { logger.log(Level.WARNING, e.getMessage(), e); } return path; } }
kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/persist/Store.java +16 −4 Original line number Diff line number Diff line Loading @@ -29,10 +29,13 @@ import com.seagate.kinetic.simulator.internal.KVStoreException; /** * * DB Application (Raw) Interface. * Kinetic persist store (Raw) Interface. * * @see StoreFactory * * @author James Hughes. * @author Chenchong Li * @author Chiaming Yang */ public interface Store<K, O, V> { Loading Loading @@ -257,4 +260,13 @@ public interface Store<K, O, V> { * if null then compaction ends at the last key */ public void compactRange(K startKey, K endKey) throws KVStoreException; /** * Get the absolute path of the persist store. * * @return the absolute path of the persist store * * @throws KVStoreException if any internal error occurred. */ public String getPersistStorePath() throws KVStoreException; }
kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/persist/bdb/BdbStore.java +6 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import com.seagate.kinetic.simulator.persist.PersistOption; import com.seagate.kinetic.simulator.persist.Store; /** * implement store * Implement Kinetic Store interface. * * XXX chiaming 12/24/2013: support PersistOption * Loading Loading @@ -163,4 +163,9 @@ public class BdbStore implements Store<ByteString, ByteString, KVValue> { logger.warning("method is not implemented for bdb"); } @Override public String getPersistStorePath() throws KVStoreException { return this.kvStore.getPersistStorePath(); } }
kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/persist/bdb/KVStore.java +14 −1 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ public final class KVStore { private final DatabaseConfig dbConfig = new DatabaseConfig(); private String kineticDbName = null; private String persistFolder = null; static DatabaseEntry dbe(String s) { ByteString bs = ByteString.copyFromUtf8(s); DatabaseEntry dbe = new DatabaseEntry(); Loading Loading @@ -98,7 +100,7 @@ public final class KVStore { + ", created=" + created); } String persistFolder = kineticHome persistFolder = kineticHome + File.separator + config.getProperty(SimulatorConfiguration.PERSIST_HOME, "bdb"); Loading Loading @@ -354,4 +356,15 @@ public final class KVStore { } } /** * Get persist store path. * * @return persist store path. * @throws KVStoreException * if any internal error occurred. */ public String getPersistStorePath() throws KVStoreException { return this.persistFolder; } }