You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/11/30 16:24:13 UTC

[GitHub] [helix] qqu0127 commented on a diff in pull request #2290: Code cleanup and FederatedZkClient Multi test.

qqu0127 commented on code in PR #2290:
URL: https://github.com/apache/helix/pull/2290#discussion_r1036180115


##########
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/TestFederatedZkClient.java:
##########
@@ -20,13 +20,7 @@
  */
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
+import java.util.*;

Review Comment:
   let's try not to use wildcard import, thanks.



##########
helix-core/src/test/java/org/apache/helix/integration/multizk/TestMultiInMultiZk.java:
##########
@@ -0,0 +1,88 @@
+package org.apache.helix.integration.multizk;
+
+/*
+ * 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 org.apache.helix.zookeeper.api.client.RealmAwareZkClient;
+import org.apache.helix.zookeeper.constant.RoutingDataReaderType;
+import org.apache.helix.zookeeper.datamodel.serializer.ZNRecordSerializer;
+import org.apache.helix.zookeeper.impl.client.FederatedZkClient;
+import org.apache.helix.zookeeper.routing.RoutingDataManager;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.Op;
+import org.apache.zookeeper.ZooDefs;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import java.util.List;
+import java.util.Arrays;
+
+/**
+ * This class test multi implementation in FederatedZkClient. Extends MultiZkTestBase as the test require a multi zk
+ * server setup.
+ */
+public class TestMultiInMultiZk extends MultiZkTestBase {
+
+    @BeforeClass
+    public void beforeClass() throws Exception {
+        super.beforeClass();
+        // Routing data may be set by other tests using the same endpoint; reset() for good measure
+        RoutingDataManager.getInstance().reset();
+        // Create a FederatedZkClient for admin work
+
+        try {
+            _zkClient =
+                    new FederatedZkClient(new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder()
+                            .setRoutingDataSourceEndpoint(_msdsEndpoint + "," + ZK_PREFIX + ZK_START_PORT)
+                            .setRoutingDataSourceType(RoutingDataReaderType.HTTP_ZK_FALLBACK.name()).build(),
+                            new RealmAwareZkClient.RealmAwareZkClientConfig());
+            _zkClient.setZkSerializer(new ZNRecordSerializer());
+        } catch (Exception ex) {
+            for (StackTraceElement elm : ex.getStackTrace()) {
+                System.out.println(elm);
+            }
+        }
+        System.out.println("end start");

Review Comment:
   I don't think this is necessary and meaningful, let's remove it.



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org