Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
fix travis; fix comments; fix zk client handle not close bug (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinzuoyan authored and neverchanje committed Sep 24, 2019
1 parent 2a8e6ff commit 62a9d62
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
18 changes: 5 additions & 13 deletions scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public int batchSet2(String tableName, List<SetItem> items, List<PException> 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 <sortkey,value> pairs to be set, should not be null or empty.
* @param values all {@literal <sortkey,value>} 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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface PegasusScannerInterface {
/**
* Get the next item.
*
* @return item like <<hashKey, sortKey>, value>; null returned if scan completed.
* @return item like {@literal <<hashKey, sortKey>, value>}; null returned if scan completed.
* @throws PException
*/
public Pair<Pair<byte[], byte[]>, byte[]> next() throws PException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* <p>A synchronous example: <code>
* PegasusTableInterface table;
* ....
* Future<Boolean> future = table.asyncExist(hashKey, sortKey, 0);
* Future{@literal <Boolean>} future = table.asyncExist(hashKey, sortKey, 0);
* future.await();
* if (future.isSuccess()) {
* Boolean result = future.getNow();
Expand All @@ -31,7 +31,7 @@
* ....
* table.asyncExist(hashKey, sortKey, 0).addListener(
* new ExistListener() {
* public void operationComplete(Future<Boolean> future) throws Exception {
* public void operationComplete(Future{@literal <Boolean>} future) throws Exception {
* if (future.isSuccess()) {
* Boolean result = future.getNow();
* }
Expand Down

0 comments on commit 62a9d62

Please sign in to comment.