|
@@ -55,15 +55,25 @@ public class FsServerDefaults implements Writable {
|
|
|
private long trashInterval;
|
|
|
private DataChecksum.Type checksumType;
|
|
|
private String keyProviderUri;
|
|
|
+ private byte storagepolicyId;
|
|
|
|
|
|
public FsServerDefaults() {
|
|
|
}
|
|
|
|
|
|
+ public FsServerDefaults(long blockSize, int bytesPerChecksum,
|
|
|
+ int writePacketSize, short replication, int fileBufferSize,
|
|
|
+ boolean encryptDataTransfer, long trashInterval,
|
|
|
+ DataChecksum.Type checksumType, String keyProviderUri) {
|
|
|
+ this(blockSize, bytesPerChecksum, writePacketSize, replication,
|
|
|
+ fileBufferSize, encryptDataTransfer, trashInterval, checksumType,
|
|
|
+ keyProviderUri, (byte) 0);
|
|
|
+ }
|
|
|
+
|
|
|
public FsServerDefaults(long blockSize, int bytesPerChecksum,
|
|
|
int writePacketSize, short replication, int fileBufferSize,
|
|
|
boolean encryptDataTransfer, long trashInterval,
|
|
|
DataChecksum.Type checksumType,
|
|
|
- String keyProviderUri) {
|
|
|
+ String keyProviderUri, byte storagepolicy) {
|
|
|
this.blockSize = blockSize;
|
|
|
this.bytesPerChecksum = bytesPerChecksum;
|
|
|
this.writePacketSize = writePacketSize;
|
|
@@ -73,6 +83,7 @@ public class FsServerDefaults implements Writable {
|
|
|
this.trashInterval = trashInterval;
|
|
|
this.checksumType = checksumType;
|
|
|
this.keyProviderUri = keyProviderUri;
|
|
|
+ this.storagepolicyId = storagepolicy;
|
|
|
}
|
|
|
|
|
|
public long getBlockSize() {
|
|
@@ -115,6 +126,10 @@ public class FsServerDefaults implements Writable {
|
|
|
return keyProviderUri;
|
|
|
}
|
|
|
|
|
|
+ public byte getDefaultStoragePolicyId() {
|
|
|
+ return storagepolicyId;
|
|
|
+ }
|
|
|
+
|
|
|
// /////////////////////////////////////////
|
|
|
// Writable
|
|
|
// /////////////////////////////////////////
|
|
@@ -127,6 +142,7 @@ public class FsServerDefaults implements Writable {
|
|
|
out.writeShort(replication);
|
|
|
out.writeInt(fileBufferSize);
|
|
|
WritableUtils.writeEnum(out, checksumType);
|
|
|
+ out.writeByte(storagepolicyId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -138,5 +154,6 @@ public class FsServerDefaults implements Writable {
|
|
|
replication = in.readShort();
|
|
|
fileBufferSize = in.readInt();
|
|
|
checksumType = WritableUtils.readEnum(in, DataChecksum.Type.class);
|
|
|
+ storagepolicyId = in.readByte();
|
|
|
}
|
|
|
}
|