Loading bin/syncProtoFromRepoAndBuild.sh +2 −2 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ PROTO_DIR=$BASE_DIR/kinetic-common/src/main/java/com/seagate/kinetic/proto/ PROTO_FILE=$BASE_DIR/kinetic-common/src/main/java/com/seagate/kinetic/proto/kinetic.proto CLONE_DIR=$BASE_DIR/bin/Kinetic-ProtocoL PROTO_COMPILE_DIR=$BASE_DIR/kinetic-common/src/main/java/ PROTO_COMMIT_HASH=9c6b4a180a70f8488c5d8ec8e8a6464c4ff63f84 PROTO_COMMIT_HASH=bdfe223648ca13df2db0dabe328980025b8278e4 function syncFromProtoRepo(){ if [ -d "$CLONE_DIR" ]; then Loading kinetic-client/src/main/java/com/seagate/kinetic/admin/impl/DefaultKineticLog.java +4 −4 Original line number Diff line number Diff line Loading @@ -120,12 +120,12 @@ public class DefaultKineticLog implements KineticLog { Capacity capacInfo = new Capacity(); if (capacity.hasTotal()) { capacInfo.setTotal(capacity.getTotal()); if (capacity.hasNominalCapacityInBytes()) { capacInfo.setTotal(capacity.getNominalCapacityInBytes()); } if (capacity.hasRemaining()) { capacInfo.setRemaining(capacity.getRemaining()); if (capacity.hasPortionFull()) { capacInfo.setRemaining(capacity.getPortionFull()); } return capacInfo; Loading kinetic-client/src/main/java/kinetic/admin/Capacity.java +3 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ public class Capacity { private long total; // remaining capacity of hard disk private long remaining; private float remaining; public long getTotal() { return total; Loading @@ -32,11 +32,11 @@ public class Capacity { this.total = total; } public long getRemaining() { public float getRemaining() { return remaining; } public void setRemaining(long remaining) { public void setRemaining(float remaining) { this.remaining = remaining; } } kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/utility/CapacityUtil.java +13 −13 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ public abstract class CapacityUtil { private final static Logger logger = Logger.getLogger(CapacityUtil.class .getName()); private static DecimalFormat format = new DecimalFormat("########.00"); //private static DecimalFormat format = new DecimalFormat("########.00"); private static long MB = 1000000; //private static long MB = 1000000; public static Capacity getCapacity() { Loading @@ -50,14 +50,14 @@ public abstract class CapacityUtil { try { File file = new File("/"); long total = (long)Double.parseDouble(format.format(file .getTotalSpace() / MB)); long total = file.getTotalSpace(); long remaining = (long) Double.parseDouble(format.format(file .getFreeSpace() / MB)); float remaining = (float) file.getFreeSpace(); capacity = Capacity.newBuilder().setTotal(total) .setRemaining(remaining).build(); float portionFull = (remaining/total); capacity = Capacity.newBuilder().setNominalCapacityInBytes(total) .setPortionFull(portionFull).build(); } catch (Exception e) { Loading @@ -71,16 +71,16 @@ public abstract class CapacityUtil { } class CapacityGenerator { private static final Random random = new Random(); private static final long TB = 1024 * 1024; // Unit: MB //private static final Random random = new Random(); private static final long TB = 1024 * 1024 * 1024 * 1024; // Unit: bytes public static Capacity generate() { long total = 4 * TB; long remaining = total * random.nextLong(); float remaining = (float) 0.5; Capacity capacity = null; capacity = Capacity.newBuilder().setTotal(total) .setRemaining(remaining).build(); capacity = Capacity.newBuilder().setNominalCapacityInBytes((total)) .setPortionFull(remaining).build(); return capacity; } Loading kinetic-test/src/test/java/com/seagate/kinetic/adminAPI/KineticAdminTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -1406,7 +1406,7 @@ public class KineticAdminTest extends IntegrationTestCase { assertTrue(respond1.getCommand().getStatus().getCode() .equals(Status.StatusCode.SUCCESS)); assertTrue(0 <= respond1.getCommand().getBody().getGetLog() .getCapacity().getTotal()); .getCapacity().getNominalCapacityInBytes()); } @Test Loading Loading @@ -1451,7 +1451,7 @@ public class KineticAdminTest extends IntegrationTestCase { assertEquals("EN0", respond3.getCommand().getBody().getGetLog() .getUtilizationList().get(1).getName()); assertTrue(0 <= respond3.getCommand().getBody().getGetLog() .getCapacity().getTotal()); .getCapacity().getNominalCapacityInBytes()); assertTrue(0 < respond3.getCommand().getBody().getGetLog() .getTemperatureList().get(0).getMaximum()); } Loading @@ -1473,7 +1473,7 @@ public class KineticAdminTest extends IntegrationTestCase { assertTrue(respond4.getCommand().getStatus().getCode() .equals(Status.StatusCode.SUCCESS)); assertTrue(0 <= respond4.getCommand().getBody().getGetLog() .getCapacity().getTotal()); .getCapacity().getNominalCapacityInBytes()); assertTrue(0 <= respond4.getCommand().getBody().getGetLog() .getTemperatureList().get(0).getMaximum()); assertTrue(0 <= respond4.getCommand().getBody().getGetLog() Loading Loading @@ -1531,7 +1531,7 @@ public class KineticAdminTest extends IntegrationTestCase { assertEquals("EN0", respond6.getCommand().getBody().getGetLog() .getUtilizationList().get(1).getName()); assertTrue(0 <= respond6.getCommand().getBody().getGetLog() .getCapacity().getTotal()); .getCapacity().getNominalCapacityInBytes()); } /** Loading Loading
bin/syncProtoFromRepoAndBuild.sh +2 −2 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ PROTO_DIR=$BASE_DIR/kinetic-common/src/main/java/com/seagate/kinetic/proto/ PROTO_FILE=$BASE_DIR/kinetic-common/src/main/java/com/seagate/kinetic/proto/kinetic.proto CLONE_DIR=$BASE_DIR/bin/Kinetic-ProtocoL PROTO_COMPILE_DIR=$BASE_DIR/kinetic-common/src/main/java/ PROTO_COMMIT_HASH=9c6b4a180a70f8488c5d8ec8e8a6464c4ff63f84 PROTO_COMMIT_HASH=bdfe223648ca13df2db0dabe328980025b8278e4 function syncFromProtoRepo(){ if [ -d "$CLONE_DIR" ]; then Loading
kinetic-client/src/main/java/com/seagate/kinetic/admin/impl/DefaultKineticLog.java +4 −4 Original line number Diff line number Diff line Loading @@ -120,12 +120,12 @@ public class DefaultKineticLog implements KineticLog { Capacity capacInfo = new Capacity(); if (capacity.hasTotal()) { capacInfo.setTotal(capacity.getTotal()); if (capacity.hasNominalCapacityInBytes()) { capacInfo.setTotal(capacity.getNominalCapacityInBytes()); } if (capacity.hasRemaining()) { capacInfo.setRemaining(capacity.getRemaining()); if (capacity.hasPortionFull()) { capacInfo.setRemaining(capacity.getPortionFull()); } return capacInfo; Loading
kinetic-client/src/main/java/kinetic/admin/Capacity.java +3 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ public class Capacity { private long total; // remaining capacity of hard disk private long remaining; private float remaining; public long getTotal() { return total; Loading @@ -32,11 +32,11 @@ public class Capacity { this.total = total; } public long getRemaining() { public float getRemaining() { return remaining; } public void setRemaining(long remaining) { public void setRemaining(float remaining) { this.remaining = remaining; } }
kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/utility/CapacityUtil.java +13 −13 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ public abstract class CapacityUtil { private final static Logger logger = Logger.getLogger(CapacityUtil.class .getName()); private static DecimalFormat format = new DecimalFormat("########.00"); //private static DecimalFormat format = new DecimalFormat("########.00"); private static long MB = 1000000; //private static long MB = 1000000; public static Capacity getCapacity() { Loading @@ -50,14 +50,14 @@ public abstract class CapacityUtil { try { File file = new File("/"); long total = (long)Double.parseDouble(format.format(file .getTotalSpace() / MB)); long total = file.getTotalSpace(); long remaining = (long) Double.parseDouble(format.format(file .getFreeSpace() / MB)); float remaining = (float) file.getFreeSpace(); capacity = Capacity.newBuilder().setTotal(total) .setRemaining(remaining).build(); float portionFull = (remaining/total); capacity = Capacity.newBuilder().setNominalCapacityInBytes(total) .setPortionFull(portionFull).build(); } catch (Exception e) { Loading @@ -71,16 +71,16 @@ public abstract class CapacityUtil { } class CapacityGenerator { private static final Random random = new Random(); private static final long TB = 1024 * 1024; // Unit: MB //private static final Random random = new Random(); private static final long TB = 1024 * 1024 * 1024 * 1024; // Unit: bytes public static Capacity generate() { long total = 4 * TB; long remaining = total * random.nextLong(); float remaining = (float) 0.5; Capacity capacity = null; capacity = Capacity.newBuilder().setTotal(total) .setRemaining(remaining).build(); capacity = Capacity.newBuilder().setNominalCapacityInBytes((total)) .setPortionFull(remaining).build(); return capacity; } Loading
kinetic-test/src/test/java/com/seagate/kinetic/adminAPI/KineticAdminTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -1406,7 +1406,7 @@ public class KineticAdminTest extends IntegrationTestCase { assertTrue(respond1.getCommand().getStatus().getCode() .equals(Status.StatusCode.SUCCESS)); assertTrue(0 <= respond1.getCommand().getBody().getGetLog() .getCapacity().getTotal()); .getCapacity().getNominalCapacityInBytes()); } @Test Loading Loading @@ -1451,7 +1451,7 @@ public class KineticAdminTest extends IntegrationTestCase { assertEquals("EN0", respond3.getCommand().getBody().getGetLog() .getUtilizationList().get(1).getName()); assertTrue(0 <= respond3.getCommand().getBody().getGetLog() .getCapacity().getTotal()); .getCapacity().getNominalCapacityInBytes()); assertTrue(0 < respond3.getCommand().getBody().getGetLog() .getTemperatureList().get(0).getMaximum()); } Loading @@ -1473,7 +1473,7 @@ public class KineticAdminTest extends IntegrationTestCase { assertTrue(respond4.getCommand().getStatus().getCode() .equals(Status.StatusCode.SUCCESS)); assertTrue(0 <= respond4.getCommand().getBody().getGetLog() .getCapacity().getTotal()); .getCapacity().getNominalCapacityInBytes()); assertTrue(0 <= respond4.getCommand().getBody().getGetLog() .getTemperatureList().get(0).getMaximum()); assertTrue(0 <= respond4.getCommand().getBody().getGetLog() Loading Loading @@ -1531,7 +1531,7 @@ public class KineticAdminTest extends IntegrationTestCase { assertEquals("EN0", respond6.getCommand().getBody().getGetLog() .getUtilizationList().get(1).getName()); assertTrue(0 <= respond6.getCommand().getBody().getGetLog() .getCapacity().getTotal()); .getCapacity().getNominalCapacityInBytes()); } /** Loading