navinko commented on code in PR #10177:
URL: https://github.com/apache/ozone/pull/10177#discussion_r3182059562
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/StorageDistributionEndpoint.java:
##########
@@ -190,35 +198,49 @@ public Response downloadDataNodeStorageDistribution() {
List<String> headers = Arrays.asList(
"HostName",
"Datanode UUID",
- "Filesystem Capacity",
- "Filesystem Used Space",
- "Filesystem Remaining Space",
- "Ozone Capacity",
- "Ozone Used Space",
- "Ozone Remaining Space",
- "PreAllocated Container Space",
- "Reserved Space",
- "Minimum Free Space",
- "Pending Block Size"
+ "Filesystem Capacity (GB)",
+ "Filesystem Used Space (GB)",
+ "Filesystem Remaining Space (GB)",
+ "Ozone Capacity (GB)",
+ "Ozone Used Space (GB)",
+ "Ozone Remaining Space (GB)",
+ "PreAllocated Container Space (GB)",
+ "Reserved Space (GB)",
+ "Minimum Free Space (GB)",
+ "Pending Block Size (GB)"
);
List<Function<DataNodeStoragePendingDeletionView, Object>> columns =
Arrays.asList(
v -> v.getMetric() != null ? v.getMetric().getHostName() :
"Unknown",
v -> v.getMetric() != null ? v.getMetric().getDatanodeUuid() :
"Unknown",
- v -> v.getReport() != null ? v.getReport().getFilesystemCapacity()
: -1,
- v -> v.getReport() != null ? v.getReport().getFilesystemUsed() :
-1,
- v -> v.getReport() != null ?
v.getReport().getFilesystemAvailable() : -1,
- v -> v.getReport() != null ? v.getReport().getCapacity() : -1,
- v -> v.getReport() != null ? v.getReport().getUsed() : -1,
- v -> v.getReport() != null ? v.getReport().getRemaining() : -1,
- v -> v.getReport() != null ? v.getReport().getCommitted() : -1,
- v -> v.getReport() != null ? v.getReport().getReserved() : -1,
- v -> v.getReport() != null ? v.getReport().getMinimumFreeSpace() :
-1,
- v -> v.getReport() != null ? v.getMetric().getPendingBlockSize() :
-1
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getFilesystemCapacity()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getFilesystemUsed()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getFilesystemAvailable()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getCapacity()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getUsed()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getRemaining()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getCommitted()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getReserved()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getMinimumFreeSpace()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getMetric().getPendingBlockSize()) : -1
);
- return
ReconUtils.downloadCsv("datanode_storage_and_pending_deletion_stats.csv",
headers, data, columns);
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd_HHmm");
+ String timestamp = LocalDateTime.now().format(formatter);
+
+ // Retrieve clusterId from ReconContext
+ String clusterName = "UnknownCluster";
Review Comment:
Done , used clusterID instead of ClusterID bcz checkstyle validations warns
for non camel case.
"Name 'ClusterID' must match pattern '^[a-z][a-zA-Z0-9]*$'.""
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/StorageDistributionEndpoint.java:
##########
@@ -190,35 +198,49 @@ public Response downloadDataNodeStorageDistribution() {
List<String> headers = Arrays.asList(
"HostName",
"Datanode UUID",
- "Filesystem Capacity",
- "Filesystem Used Space",
- "Filesystem Remaining Space",
- "Ozone Capacity",
- "Ozone Used Space",
- "Ozone Remaining Space",
- "PreAllocated Container Space",
- "Reserved Space",
- "Minimum Free Space",
- "Pending Block Size"
+ "Filesystem Capacity (GB)",
+ "Filesystem Used Space (GB)",
+ "Filesystem Remaining Space (GB)",
+ "Ozone Capacity (GB)",
+ "Ozone Used Space (GB)",
+ "Ozone Remaining Space (GB)",
+ "PreAllocated Container Space (GB)",
+ "Reserved Space (GB)",
+ "Minimum Free Space (GB)",
+ "Pending Block Size (GB)"
);
List<Function<DataNodeStoragePendingDeletionView, Object>> columns =
Arrays.asList(
v -> v.getMetric() != null ? v.getMetric().getHostName() :
"Unknown",
v -> v.getMetric() != null ? v.getMetric().getDatanodeUuid() :
"Unknown",
- v -> v.getReport() != null ? v.getReport().getFilesystemCapacity()
: -1,
- v -> v.getReport() != null ? v.getReport().getFilesystemUsed() :
-1,
- v -> v.getReport() != null ?
v.getReport().getFilesystemAvailable() : -1,
- v -> v.getReport() != null ? v.getReport().getCapacity() : -1,
- v -> v.getReport() != null ? v.getReport().getUsed() : -1,
- v -> v.getReport() != null ? v.getReport().getRemaining() : -1,
- v -> v.getReport() != null ? v.getReport().getCommitted() : -1,
- v -> v.getReport() != null ? v.getReport().getReserved() : -1,
- v -> v.getReport() != null ? v.getReport().getMinimumFreeSpace() :
-1,
- v -> v.getReport() != null ? v.getMetric().getPendingBlockSize() :
-1
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getFilesystemCapacity()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getFilesystemUsed()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getFilesystemAvailable()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getCapacity()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getUsed()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getRemaining()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getCommitted()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getReserved()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getReport().getMinimumFreeSpace()) : -1,
+ v -> v.getReport() != null ?
formatBytesToGB(v.getMetric().getPendingBlockSize()) : -1
);
- return
ReconUtils.downloadCsv("datanode_storage_and_pending_deletion_stats.csv",
headers, data, columns);
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd_HHmm");
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]