Skip to content

Commit 5b911ba

Browse files
HDDS-14611. Rename committed bytes to finalized key bytes and align committed space terminology
1 parent 4a2c8db commit 5b911ba

10 files changed

Lines changed: 39 additions & 39 deletions

File tree

hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpoint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private boolean verifyStorageDistributionAfterKeyCreation() {
252252
assertEquals(60, storageResponse.getUsedSpaceBreakDown().getOpenKeyBytes().getTotalOpenKeyBytes());
253253
assertEquals(30, storageResponse.getUsedSpaceBreakDown().getOpenKeyBytes().getMultipartOpenKeyBytes());
254254
assertEquals(30, storageResponse.getUsedSpaceBreakDown().getOpenKeyBytes().getOpenKeyAndFileBytes());
255-
assertEquals(60, storageResponse.getUsedSpaceBreakDown().getCommittedKeyBytes());
255+
assertEquals(60, storageResponse.getUsedSpaceBreakDown().getFinalizedKeyBytes());
256256
assertEquals(3, storageResponse.getDataNodeUsage().size());
257257
List<DatanodeStorageReport> reports = storageResponse.getDataNodeUsage();
258258
List<HddsProtos.DatanodeUsageInfoProto> scmReports =
@@ -289,7 +289,7 @@ private boolean verifyStorageDistributionAfterKeyCreation() {
289289
}
290290
assertEquals(totalReserved, storageResponse.getGlobalStorage().getTotalReservedSpace());
291291
assertEquals(totalMinFreeSpace, storageResponse.getGlobalStorage().getTotalMinimumFreeSpace());
292-
assertEquals(totalPreAllocated, storageResponse.getGlobalStorage().getTotalOzonePreAllocatedContainerSpace());
292+
assertEquals(totalPreAllocated, storageResponse.getGlobalStorage().getTotalOzoneCommittedSpace());
293293
assertEquals(totalOzoneCapacity, storageResponse.getGlobalStorage().getTotalOzoneCapacity());
294294
assertEquals(totalOzoneUsedSpace, storageResponse.getGlobalStorage().getTotalOzoneUsedSpace());
295295
assertEquals(totalFileSystemCapacity, storageResponse.getGlobalStorage().getTotalFileSystemCapacity());

hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/StorageDistributionEndpoint.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public Response getStorageDistribution() {
113113
LOG.error("Error calculating namespace metrics", e);
114114
// Initialize with default values
115115
namespaceMetrics.put("totalUsedNamespace", 0L);
116-
namespaceMetrics.put("totalCommittedSize", 0L);
116+
namespaceMetrics.put("totalFinalizedKeyBytes", 0L);
117117
namespaceMetrics.put("pendingDirectorySize", 0L);
118118
namespaceMetrics.put("pendingKeySize", 0L);
119119
namespaceMetrics.put("totalKeys", 0L);
@@ -235,7 +235,7 @@ private GlobalStorageReport calculateGlobalStorageReport() {
235235
.setTotalReservedSpace(stats.getReserved() != null ? stats.getReserved().get() : 0L)
236236
.setTotalOzoneFreeSpace(stats.getRemaining() != null ? stats.getRemaining().get() : 0L)
237237
.setTotalOzoneUsedSpace(stats.getScmUsed() != null ? stats.getScmUsed().get() : 0L)
238-
.setTotalOzonePreAllocatedContainerSpace(stats.getCommitted() != null ? stats.getCommitted().get() : 0L)
238+
.setTotalOzoneCommittedSpace(stats.getCommitted() != null ? stats.getCommitted().get() : 0L)
239239
.setTotalMinimumFreeSpace(stats.getFreeSpaceToSpare() != null ? stats.getFreeSpaceToSpare().get() : 0L)
240240
.build();
241241

@@ -248,11 +248,11 @@ private GlobalStorageReport calculateGlobalStorageReport() {
248248
private Map<String, Long> calculateNamespaceMetrics(OpenKeyBytesInfo totalOpenKeySize) throws IOException {
249249
Map<String, Long> metrics = new HashMap<>();
250250
Map<String, Long> totalPendingAtOmSide = reconGlobalMetricsService.calculatePendingSizes();
251-
long totalCommittedSize = calculateCommittedSize();
251+
long totalFinalizedKeyBytes = calculateFinalizedKeyBytesSize();
252252
long pendingDirectorySize = totalPendingAtOmSide.getOrDefault("pendingDirectorySize", 0L);
253253
long pendingKeySize = totalPendingAtOmSide.getOrDefault("pendingKeySize", 0L);
254254
long totalUsedNamespace = pendingDirectorySize + pendingKeySize +
255-
totalOpenKeySize.getTotalOpenKeyBytes() + totalCommittedSize;
255+
totalOpenKeySize.getTotalOpenKeyBytes() + totalFinalizedKeyBytes;
256256

257257
long totalKeys = 0L;
258258
// Keys from OBJECT_STORE buckets.
@@ -267,7 +267,7 @@ private Map<String, Long> calculateNamespaceMetrics(OpenKeyBytesInfo totalOpenKe
267267
if (fileRecord != null) {
268268
totalKeys += fileRecord.getValue();
269269
}
270-
metrics.put("totalCommittedSize", totalCommittedSize);
270+
metrics.put("totalFinalizedKeyBytes", totalFinalizedKeyBytes);
271271
metrics.put("totalUsedNamespace", totalUsedNamespace);
272272
metrics.put("totalKeys", totalKeys);
273273
return metrics;
@@ -281,7 +281,7 @@ private StorageCapacityDistributionResponse buildStorageDistributionResponse(
281281

282282
// Safely get values from namespaceMetrics with null checks
283283
Long totalUsedNamespace = namespaceMetrics.get("totalUsedNamespace");
284-
Long totalCommittedSize = namespaceMetrics.get("totalCommittedSize");
284+
Long totalFinalizedKeyBytes = namespaceMetrics.get("totalFinalizedKeyBytes");
285285
Long totalKeys = namespaceMetrics.get("totalKeys");
286286

287287
return StorageCapacityDistributionResponse.newBuilder()
@@ -291,7 +291,7 @@ private StorageCapacityDistributionResponse buildStorageDistributionResponse(
291291
totalUsedNamespace != null ? totalUsedNamespace : 0L,
292292
totalKeys != null ? totalKeys : 0L))
293293
.setUsedSpaceBreakDown(new UsedSpaceBreakDown(
294-
totalOpenKeySize, totalCommittedSize != null ? totalCommittedSize : 0L))
294+
totalOpenKeySize, totalFinalizedKeyBytes != null ? totalFinalizedKeyBytes : 0L))
295295
.build();
296296
}
297297

@@ -310,7 +310,7 @@ private OpenKeyBytesInfo calculateOpenKeySizes() {
310310
return new OpenKeyBytesInfo(openKeyDataSize, totalMPUKeySize);
311311
}
312312

313-
private long calculateCommittedSize() {
313+
private long calculateFinalizedKeyBytesSize() {
314314
try {
315315
Response rootResponse = nsSummaryEndpoint.getDiskUsage("/", false, true, false);
316316
if (rootResponse.getStatus() != Response.Status.OK.getStatusCode()) {
@@ -320,7 +320,7 @@ private long calculateCommittedSize() {
320320
DUResponse duRootRes = (DUResponse) rootResponse.getEntity();
321321
return duRootRes != null ? duRootRes.getSizeWithReplica() : 0L;
322322
} catch (IOException e) {
323-
LOG.error("IOException while calculating committed size", e);
323+
LOG.error("IOException while calculating finalized keys size", e);
324324
return 0L;
325325
}
326326
}

hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/GlobalStorageReport.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
* <li><b>totalOzoneFreeSpace</b>:
6565
* Remaining allocatable space within Ozone capacity.</li>
6666
*
67-
* <li><b>totalOzonePreAllocatedContainerSpace</b>:
67+
* <li><b>totalOzoneCommittedSpace</b>:
6868
* Space pre-allocated for containers but not yet fully utilized.</li>
6969
*
7070
* <li><b>totalMinimumFreeSpace</b>:
@@ -92,8 +92,8 @@ public class GlobalStorageReport {
9292
@JsonProperty("totalOzoneFreeSpace")
9393
private long totalOzoneFreeSpace;
9494

95-
@JsonProperty("totalOzonePreAllocatedContainerSpace")
96-
private long totalOzonePreAllocatedContainerSpace;
95+
@JsonProperty("totalOzoneCommittedSpace")
96+
private long totalOzoneCommittedSpace;
9797

9898
@JsonProperty("totalMinimumFreeSpace")
9999
private long totalMinimumFreeSpace;
@@ -118,8 +118,8 @@ public long getTotalOzoneFreeSpace() {
118118
return totalOzoneFreeSpace;
119119
}
120120

121-
public long getTotalOzonePreAllocatedContainerSpace() {
122-
return totalOzonePreAllocatedContainerSpace;
121+
public long getTotalOzoneCommittedSpace() {
122+
return totalOzoneCommittedSpace;
123123
}
124124

125125
public long getTotalMinimumFreeSpace() {
@@ -135,7 +135,7 @@ public GlobalStorageReport(Builder builder) {
135135
this.totalOzoneCapacity = builder.totalOzoneCapacity;
136136
this.totalOzoneUsedSpace = builder.totalOzoneUsedSpace;
137137
this.totalOzoneFreeSpace = builder.totalOzoneFreeSpace;
138-
this.totalOzonePreAllocatedContainerSpace = builder.totalOzonePreAllocatedContainerSpace;
138+
this.totalOzoneCommittedSpace = builder.totalOzoneCommittedSpace;
139139
this.totalMinimumFreeSpace = builder.totalMinimumFreeSpace;
140140
}
141141

@@ -152,15 +152,15 @@ public static final class Builder {
152152
private long totalOzoneCapacity;
153153
private long totalOzoneUsedSpace;
154154
private long totalOzoneFreeSpace;
155-
private long totalOzonePreAllocatedContainerSpace;
155+
private long totalOzoneCommittedSpace;
156156
private long totalMinimumFreeSpace;
157157

158158
public Builder() {
159159
totalReservedSpace = 0;
160160
totalOzoneCapacity = 0;
161161
totalOzoneUsedSpace = 0;
162162
totalOzoneFreeSpace = 0;
163-
totalOzonePreAllocatedContainerSpace = 0;
163+
totalOzoneCommittedSpace = 0;
164164
totalMinimumFreeSpace = 0;
165165
}
166166

@@ -184,8 +184,8 @@ public Builder setTotalOzoneFreeSpace(long totalOzoneFreeSpace) {
184184
return this;
185185
}
186186

187-
public Builder setTotalOzonePreAllocatedContainerSpace(long totalOzonePreAllocatedContainerSpace) {
188-
this.totalOzonePreAllocatedContainerSpace = totalOzonePreAllocatedContainerSpace;
187+
public Builder setTotalOzoneCommittedSpace(long totalOzoneCommittedSpace) {
188+
this.totalOzoneCommittedSpace = totalOzoneCommittedSpace;
189189
return this;
190190
}
191191

hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/UsedSpaceBreakDown.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@ public class UsedSpaceBreakDown {
4747
@JsonProperty("openKeyBytes")
4848
private OpenKeyBytesInfo openKeyBytes;
4949

50-
@JsonProperty("committedKeyBytes")
51-
private long committedKeyBytes;
50+
@JsonProperty("finalizedKeyBytes")
51+
private long finalizedKeyBytes;
5252

5353
public UsedSpaceBreakDown() {
5454
}
5555

56-
public UsedSpaceBreakDown(OpenKeyBytesInfo openKeyBytes, long committedKeyBytes) {
56+
public UsedSpaceBreakDown(OpenKeyBytesInfo openKeyBytes, long finalizedKeyBytes) {
5757
this.openKeyBytes = openKeyBytes;
58-
this.committedKeyBytes = committedKeyBytes;
58+
this.finalizedKeyBytes = finalizedKeyBytes;
5959
}
6060

6161
public OpenKeyBytesInfo getOpenKeyBytes() {
6262
return openKeyBytes;
6363
}
6464

65-
public long getCommittedKeyBytes() {
66-
return committedKeyBytes;
65+
public long getFinalizedKeyBytes() {
66+
return finalizedKeyBytes;
6767
}
6868
}

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6874,7 +6874,7 @@
68746874
"totalOzoneCapacity": 879519597390,
68756875
"totalOzoneFreeSpace": 539776978944,
68766876
"totalOzoneUsedSpace": 30679040,
6877-
"totalOzonePreAllocatedContainerSpace":1022024
6877+
"totalOzoneCommittedSpace":1022024
68786878
},
68796879
"globalNamespace": {
68806880
"totalUsedSpace": 12349932,
@@ -6886,7 +6886,7 @@
68866886
"openKeyAndFileBytes": 19255266,
68876887
"multipartOpenKeyBytes": 0
68886888
},
6889-
"committedKeyBytes": 1249923
6889+
"finalizedKeyBytes": 1249923
68906890
},
68916891
"dataNodeUsage": [
68926892
{

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/mocks/capacityMocks/capacityResponseMocks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const StorageDistribution = {
2323
totalOzoneFreeSpace: 4096,
2424
totalOzoneCapacity: 10240,
2525
totalReservedSpace: 1024,
26-
totalOzonePreAllocatedContainerSpace: 1024
26+
totalOzoneCommittedSpace: 1024
2727
},
2828
globalNamespace: {
2929
totalUsedSpace: 4096,
@@ -35,7 +35,7 @@ export const StorageDistribution = {
3535
openKeyAndFileBytes: 512,
3636
multipartOpenKeyBytes: 512
3737
},
38-
committedKeyBytes: 2048
38+
finalizedKeyBytes: 2048
3939
},
4040
dataNodeUsage: [
4141
{

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/constants/capacity.constants.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const DEFAULT_CAPACITY_UTILIZATION: UtilizationResponse = {
2525
totalOzoneCapacity: 0,
2626
totalOzoneFreeSpace: 0,
2727
totalOzoneUsedSpace: 0,
28-
totalOzonePreAllocatedContainerSpace: 0,
28+
totalOzoneCommittedSpace: 0,
2929
totalMinimumFreeSpace: 0
3030
},
3131
globalNamespace: {
@@ -38,7 +38,7 @@ export const DEFAULT_CAPACITY_UTILIZATION: UtilizationResponse = {
3838
openKeyAndFileBytes: 0,
3939
multipartOpenKeyBytes: 0
4040
},
41-
committedKeyBytes: 0
41+
finalizedKeyBytes: 0
4242
},
4343
dataNodeUsage: []
4444
};

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/capacity/capacity.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ const Capacity: React.FC<object> = () => {
340340
color: '#11073a'
341341
}, {
342342
title: 'CONTAINER PRE-ALLOCATED',
343-
value: storageDistribution.data.globalStorage.totalOzonePreAllocatedContainerSpace,
343+
value: storageDistribution.data.globalStorage.totalOzoneCommittedSpace,
344344
color: '#f47b2d'
345345
}, {
346346
title: 'REMAINING SPACE',
@@ -366,7 +366,7 @@ const Capacity: React.FC<object> = () => {
366366
color: '#f47c2d'
367367
}, {
368368
title: 'COMMITTED KEYS',
369-
value: storageDistribution.data.usedSpaceBreakdown.committedKeyBytes,
369+
value: storageDistribution.data.usedSpaceBreakdown.finalizedKeyBytes,
370370
color: '#f4a233'
371371
}, {
372372
title: (

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/types/capacity.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type GlobalStorage = {
2222
totalOzoneCapacity: number;
2323
totalOzoneUsedSpace: number;
2424
totalOzoneFreeSpace: number;
25-
totalOzonePreAllocatedContainerSpace: number;
25+
totalOzoneCommittedSpace: number;
2626
totalMinimumFreeSpace: number;
2727
};
2828

@@ -33,7 +33,7 @@ type GlobalNamespace = {
3333

3434
type UsedSpaceBreakdown = {
3535
openKeyBytes: OpenKeyBytesInfo;
36-
committedKeyBytes: number;
36+
finalizedKeyBytes: number;
3737
};
3838

3939
type OpenKeyBytesInfo = {

hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestStorageDistributionEndpoint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ public void testStorageDistributionApiReturnsSuccess() throws Exception {
138138
assertEquals(OPEN_KEY_BYTES + OPEN_MPU_KEY_BYTES,
139139
distributionResponse.getUsedSpaceBreakDown().getOpenKeyBytes().getTotalOpenKeyBytes());
140140
assertEquals(EXPECTED_COMMITTED_KEY_BYTES,
141-
distributionResponse.getUsedSpaceBreakDown().getCommittedKeyBytes());
141+
distributionResponse.getUsedSpaceBreakDown().getFinalizedKeyBytes());
142142
assertEquals(COMMITTED * 3,
143-
distributionResponse.getGlobalStorage().getTotalOzonePreAllocatedContainerSpace());
143+
distributionResponse.getGlobalStorage().getTotalOzoneCommittedSpace());
144144
for (int i = 0; i < 3; i++) {
145145
DatanodeStorageReport report = distributionResponse.getDataNodeUsage().get(i);
146146
assertEquals(OZONE_CAPACITY, report.getCapacity());

0 commit comments

Comments
 (0)