stantheman0128 commented on code in PR #10968:
URL: https://github.com/apache/ozone/pull/10968#discussion_r3775459967


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/tables/bucketsTable.tsx:
##########
@@ -78,6 +79,30 @@ function renderBucketLayout(bucketLayout: BucketLayout) {
   return <Tag color={color}>{bucketLayout}</Tag>;
 };
 
+// StandaloneReplicationConfig serializes replicationType as STANDALONE, while 
the
+// ReplicationType enum name is STAND_ALONE, so both spellings are mapped here
+const REPLICATION_TYPE_LABELS: Record<string, string> = {
+  RATIS: 'Ratis',
+  STAND_ALONE: 'Standalone',
+  STANDALONE: 'Standalone'
+};
+
+// Mirrors the replication strings Ozone uses elsewhere, e.g. Ratis-3 and 
RS-6-3-1024k
+function formatReplicationType(replicationConfigInfo?: BucketReplicationConfig 
| null) {
+  const replicationConfig = replicationConfigInfo?.replicationConfig;
+  if (replicationConfig?.replicationType === 'EC') {
+    const { codec, data, parity, ecChunkSize } = replicationConfig;
+    return `${codec}-${data}-${parity}-${Math.floor(ecChunkSize / 1024)}k`;

Review Comment:
   Agreed, and the source backs it up: `ECReplicationConfig`'s own error 
message gives the canonical form as `rs-3-2-1024k, rs-6-3-1024k; or 
rs-10-4-1024k`, and `EcCodec.toString()` lowercases. The JSON carries `RS` only 
because Jackson serializes the enum by `name()`. Switched to 
`codec.toLowerCase()`, and the tests now expect `rs-6-3-1024k`.



-- 
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]

Reply via email to