stantheman0128 commented on code in PR #10968:
URL: https://github.com/apache/ozone/pull/10968#discussion_r4109202081
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/types/insights.types.ts:
##########
@@ -119,7 +119,16 @@ export interface EcInfo {
minimumNodes: number;
}
-export type ReplicationInfo = RatisInfo | EcInfo;
+// StandaloneReplicationConfig serializes its replicationType as STANDALONE,
+// without the underscore used by the ReplicationType enum name STAND_ALONE
+export interface StandaloneInfo {
+ replicationType: 'STANDALONE' | 'STAND_ALONE';
Review Comment:
Done in b01f531. `StandaloneInfo.replicationType` is now just
`'STANDALONE'`, and I removed the `STAND_ALONE` entry from the label map along
with the test that covered that spelling. The Standalone fixture still uses
`type: 'STAND_ALONE'` for the outer field, since
`DefaultReplicationConfig#getType` returns the `ReplicationType` enum there,
which Jackson writes by name.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/types/bucket.types.ts:
##########
@@ -37,6 +38,14 @@ export const BucketLayoutTypeList = [
export type BucketLayout = typeof BucketLayoutTypeList[number];
+// Corresponds to the serialized
org.apache.hadoop.hdds.client.DefaultReplicationConfig
+// returned by the Recon bucket endpoint
(BucketObjectDBInfo#replicationConfigInfo).
+// The nested config is the same shape the OM DB insights endpoints return.
+export type BucketReplicationConfig = {
+ type: string;
+ replicationConfig?: ReplicationInfo | null;
Review Comment:
`BucketReplicationConfig` reuses the shared `ReplicationInfo`, so the change
in `insights.types.ts` covers this line as well. `bucket.types.ts` has no
`STAND_ALONE` literal of its own.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/buckets/BucketsTable.test.tsx:
##########
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { vi } from 'vitest';
+import { render, screen } from '@testing-library/react';
+
+import BucketsTable from '@/v2/components/tables/bucketsTable';
Review Comment:
Added, same as the other test files.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/types/bucket.types.ts:
##########
@@ -37,6 +37,37 @@ export const BucketLayoutTypeList = [
export type BucketLayout = typeof BucketLayoutTypeList[number];
+// Corresponds to the serialized
org.apache.hadoop.hdds.client.RatisReplicationConfig
+// and StandaloneReplicationConfig. The latter serializes its replicationType
as
+// STANDALONE, while the enum name used elsewhere is STAND_ALONE, so both
spellings
+// can reach the UI.
+type BucketRatisReplicationConfig = {
Review Comment:
Good catch, thanks. Widening the union is what broke it, so I flipped it
here rather than in a follow-up: `om.tsx` now checks for `EC` explicitly, same
as `openKeysTable`. On the previous head, `tsc --noEmit` reported `Property
'codec' does not exist on type 'EcInfo | StandaloneInfo'` on that line, and the
same for `data` and `parity`. Those are gone now. I had to run tsc with
`--types vite/client,vitest/globals` to see them, because `tsconfig.json` lists
`vite-plugin-svgr/client` and that package isn't a dependency, so tsc stops at
TS2688 otherwise.
--
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]