jiajunwang commented on a change in pull request #1070: URL: https://github.com/apache/helix/pull/1070#discussion_r436324929
########## File path: zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/ZkTestHelper.java ########## @@ -0,0 +1,447 @@ +package org.apache.helix.zookeeper.impl; + +/* + * 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 java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.Socket; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.apache.helix.zookeeper.api.client.HelixZkClient; +import org.apache.helix.zookeeper.api.client.RealmAwareZkClient; +import org.apache.helix.zookeeper.zkclient.IZkChildListener; +import org.apache.helix.zookeeper.zkclient.IZkDataListener; +import org.apache.helix.zookeeper.zkclient.IZkStateListener; +import org.apache.helix.zookeeper.zkclient.ZkClient; +import org.apache.helix.zookeeper.zkclient.ZkConnection; +import org.apache.zookeeper.WatchedEvent; +import org.apache.zookeeper.Watcher; +import org.apache.zookeeper.Watcher.Event.EventType; +import org.apache.zookeeper.Watcher.Event.KeeperState; +import org.apache.zookeeper.ZooKeeper; +import org.apache.zookeeper.ZooKeeper.States; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.Assert; + + +public class ZkTestHelper { Review comment: Can we merge 2 helpers? Maybe not a good idea. But when we have both TestHelper and ZkTestHelper in the Zookeeper module, they are kind of confusing. Maybe a pair of better names would help. ########## File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java ########## @@ -2223,7 +2223,7 @@ private void validateCurrentThread() { * * @return String representation of session id in hexadecimal notation. */ - private static String toHexSessionId(long sessionId) { + public static String toHexSessionId(long sessionId) { Review comment: I think in the test we can just call Long.toHexString(sessionId). Otherwise, my concern is that this public API will be with the ZkClient forever... And it seems to an overkill to have such a public method in the ZkClient class. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
