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

fix travis; fix comments; fix zk client usage #46

Merged
merged 3 commits into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段代码是怎么发现有问题的?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是业务方发现zk连接泄露,然后报给我的

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