diff --git a/scripts/travis.sh b/scripts/travis.sh index b6bc7ef9..7197c5c2 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh @@ -27,24 +27,16 @@ if [[ $(git status -s) ]]; then fi # start pegasus onebox environment -wget https://github.com/XiaoMi/pegasus/releases/download/v1.11.2/pegasus-tools-1.11.2-a186d38-ubuntu-18.04-release.tar.gz -tar xvf pegasus-tools-1.11.2-a186d38-ubuntu-18.04-release.tar.gz -cd pegasus-tools-1.11.2-a186d38-ubuntu-release +wget https://github.com/XiaoMi/pegasus/releases/download/v1.11.3/pegasus-1.11.3-b45cb06-linux-x86_64-release.zip +unzip pegasus-1.11.3-b45cb06-linux-x86_64-release.zip +cd pegasus-1.11.3-b45cb06-linux-x86_64-release -# download zookeeper -# TODO(wutao1): remove this when upgrading the server to latest version -mkdir -p .zk_install && cd .zk_install -wget "https://github.com/xiaomi/pegasus-common/raw/master/zookeeper-3.4.6.tar.gz" -cd .. - -./run.sh start_onebox -sleep 4 -./run.sh list_onebox +./run.sh start_onebox -w cd ../ if ! mvn clean test then - cd pegasus-tools-1.11.2-a186d38-ubuntu-release + cd pegasus-1.11.3-b45cb06-linux-x86_64-release ./run.sh list_onebox exit 1 fi diff --git a/src/main/java/com/xiaomi/infra/pegasus/client/PConfigUtil.java b/src/main/java/com/xiaomi/infra/pegasus/client/PConfigUtil.java index 0ea28502..22011da8 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/client/PConfigUtil.java +++ b/src/main/java/com/xiaomi/infra/pegasus/client/PConfigUtil.java @@ -95,7 +95,13 @@ public static byte[] loadConfigFromZK(String zkUri) throws PException { ZkClient client = new ZkClient( server, ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT, new BytesPushThroughSerializer()); - return client.readData(path); + try { + return client.readData(path); + } catch (Exception e) { + throw new PException(e); + } finally { + client.close(); + } } protected static String getBusinessConfigZkPath(String businessName) { diff --git a/src/main/java/com/xiaomi/infra/pegasus/client/PegasusClientInterface.java b/src/main/java/com/xiaomi/infra/pegasus/client/PegasusClientInterface.java index 7ef39b91..8450f33b 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/client/PegasusClientInterface.java +++ b/src/main/java/com/xiaomi/infra/pegasus/client/PegasusClientInterface.java @@ -279,7 +279,7 @@ public int batchSet2(String tableName, List items, List res * * @param tableName table name * @param hashKey used to decide which partition to put this k-v, should not be null or empty. - * @param values all pairs to be set, should not be null or empty. + * @param values all {@literal } pairs to be set, should not be null or empty. * @param ttlSeconds time to live in seconds, 0 means no ttl. default value is 0. * @throws PException throws exception if any error occurs. */ diff --git a/src/main/java/com/xiaomi/infra/pegasus/client/PegasusScannerInterface.java b/src/main/java/com/xiaomi/infra/pegasus/client/PegasusScannerInterface.java index 7fba1033..d8f0d0a4 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/client/PegasusScannerInterface.java +++ b/src/main/java/com/xiaomi/infra/pegasus/client/PegasusScannerInterface.java @@ -14,7 +14,7 @@ public interface PegasusScannerInterface { /** * Get the next item. * - * @return item like <, value>; null returned if scan completed. + * @return item like {@literal <, value>}; null returned if scan completed. * @throws PException */ public Pair, byte[]> next() throws PException; diff --git a/src/main/java/com/xiaomi/infra/pegasus/client/PegasusTableInterface.java b/src/main/java/com/xiaomi/infra/pegasus/client/PegasusTableInterface.java index f74ea249..92018d03 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/client/PegasusTableInterface.java +++ b/src/main/java/com/xiaomi/infra/pegasus/client/PegasusTableInterface.java @@ -18,7 +18,7 @@ *

A synchronous example: * PegasusTableInterface table; * .... - * Future future = table.asyncExist(hashKey, sortKey, 0); + * Future{@literal } future = table.asyncExist(hashKey, sortKey, 0); * future.await(); * if (future.isSuccess()) { * Boolean result = future.getNow(); @@ -31,7 +31,7 @@ * .... * table.asyncExist(hashKey, sortKey, 0).addListener( * new ExistListener() { - * public void operationComplete(Future future) throws Exception { + * public void operationComplete(Future{@literal } future) throws Exception { * if (future.isSuccess()) { * Boolean result = future.getNow(); * }