|
@@ -40,7 +40,7 @@ import static org.apache.hadoop.ozone.OzoneConsts.CHECKSUM;
|
|
|
import static org.apache.hadoop.ozone.OzoneConsts.CONTAINER_ID;
|
|
|
import static org.apache.hadoop.ozone.OzoneConsts.CONTAINER_TYPE;
|
|
|
import static org.apache.hadoop.ozone.OzoneConsts.LAYOUTVERSION;
|
|
|
-import static org.apache.hadoop.ozone.OzoneConsts.MAX_SIZE_GB;
|
|
|
+import static org.apache.hadoop.ozone.OzoneConsts.MAX_SIZE;
|
|
|
import static org.apache.hadoop.ozone.OzoneConsts.METADATA;
|
|
|
import static org.apache.hadoop.ozone.OzoneConsts.STATE;
|
|
|
|
|
@@ -67,7 +67,7 @@ public abstract class ContainerData {
|
|
|
// State of the Container
|
|
|
private ContainerLifeCycleState state;
|
|
|
|
|
|
- private final int maxSizeGB;
|
|
|
+ private final long maxSize;
|
|
|
|
|
|
/** parameters for read/write statistics on the container. **/
|
|
|
private final AtomicLong readBytes;
|
|
@@ -92,16 +92,16 @@ public abstract class ContainerData {
|
|
|
LAYOUTVERSION,
|
|
|
STATE,
|
|
|
METADATA,
|
|
|
- MAX_SIZE_GB,
|
|
|
+ MAX_SIZE,
|
|
|
CHECKSUM));
|
|
|
|
|
|
/**
|
|
|
* Creates a ContainerData Object, which holds metadata of the container.
|
|
|
* @param type - ContainerType
|
|
|
* @param containerId - ContainerId
|
|
|
- * @param size - container maximum size
|
|
|
+ * @param size - container maximum size in bytes
|
|
|
*/
|
|
|
- protected ContainerData(ContainerType type, long containerId, int size) {
|
|
|
+ protected ContainerData(ContainerType type, long containerId, long size) {
|
|
|
this(type, containerId,
|
|
|
ChunkLayOutVersion.getLatestVersion().getVersion(), size);
|
|
|
}
|
|
@@ -111,10 +111,10 @@ public abstract class ContainerData {
|
|
|
* @param type - ContainerType
|
|
|
* @param containerId - ContainerId
|
|
|
* @param layOutVersion - Container layOutVersion
|
|
|
- * @param size - Container maximum size in GB
|
|
|
+ * @param size - Container maximum size in bytes
|
|
|
*/
|
|
|
protected ContainerData(ContainerType type, long containerId,
|
|
|
- int layOutVersion, int size) {
|
|
|
+ int layOutVersion, long size) {
|
|
|
Preconditions.checkNotNull(type);
|
|
|
|
|
|
this.containerType = type;
|
|
@@ -128,7 +128,7 @@ public abstract class ContainerData {
|
|
|
this.writeBytes = new AtomicLong(0L);
|
|
|
this.bytesUsed = new AtomicLong(0L);
|
|
|
this.keyCount = new AtomicLong(0L);
|
|
|
- this.maxSizeGB = size;
|
|
|
+ this.maxSize = size;
|
|
|
setChecksumTo0ByteArray();
|
|
|
}
|
|
|
|
|
@@ -171,11 +171,11 @@ public abstract class ContainerData {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Return's maximum size of the container in GB.
|
|
|
- * @return maxSizeGB
|
|
|
+ * Return's maximum size of the container in bytes.
|
|
|
+ * @return maxSize in bytes
|
|
|
*/
|
|
|
- public int getMaxSizeGB() {
|
|
|
- return maxSizeGB;
|
|
|
+ public long getMaxSize() {
|
|
|
+ return maxSize;
|
|
|
}
|
|
|
|
|
|
/**
|