use of org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.StorageTypeProto in project ozone by apache.
the class HddsTestUtils method createMetadataStorageReport.
/**
* Creates metadata storage report with the given information.
*
* @param path storage dir
* @param capacity storage size
* @param used space used
* @param remaining space remaining
* @param type type of storage
*
* @return StorageReportProto
*/
public static MetadataStorageReportProto createMetadataStorageReport(String path, long capacity, long used, long remaining, StorageTypeProto type, boolean failed) {
Preconditions.checkNotNull(path);
MetadataStorageReportProto.Builder srb = MetadataStorageReportProto.newBuilder();
srb.setStorageLocation(path).setCapacity(capacity).setScmUsed(used).setFailed(failed).setRemaining(remaining);
StorageTypeProto storageTypeProto = type == null ? StorageTypeProto.DISK : type;
srb.setStorageType(storageTypeProto);
return srb.build();
}
use of org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.StorageTypeProto in project ozone by apache.
the class HddsTestUtils method createStorageReport.
/**
* Creates storage report with the given information.
*
* @param nodeId datanode id
* @param path storage dir
* @param capacity storage size
* @param used space used
* @param remaining space remaining
* @param type type of storage
*
* @return StorageReportProto
*/
public static StorageReportProto createStorageReport(UUID nodeId, String path, long capacity, long used, long remaining, StorageTypeProto type, boolean failed) {
Preconditions.checkNotNull(nodeId);
Preconditions.checkNotNull(path);
StorageReportProto.Builder srb = StorageReportProto.newBuilder();
srb.setStorageUuid(nodeId.toString()).setStorageLocation(path).setCapacity(capacity).setScmUsed(used).setFailed(failed).setRemaining(remaining);
StorageTypeProto storageTypeProto = type == null ? StorageTypeProto.DISK : type;
srb.setStorageType(storageTypeProto);
return srb.build();
}
Aggregations