mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
update zkclient to 0.10
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
<artifactId>zookeeper</artifactId>
|
<artifactId>zookeeper</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.sgroschupf</groupId>
|
<groupId>com.101tec</groupId>
|
||||||
<artifactId>zkclient</artifactId>
|
<artifactId>zkclient</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- external -->
|
<!-- external -->
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import java.util.List;
|
|||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import org.I0Itec.zkclient.IZkConnection;
|
import org.I0Itec.zkclient.ZkConnection;
|
||||||
import org.I0Itec.zkclient.exception.ZkException;
|
import org.I0Itec.zkclient.exception.ZkException;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.zookeeper.ClientCnxn;
|
import org.apache.zookeeper.ClientCnxn;
|
||||||
@@ -32,7 +32,7 @@ import org.springframework.util.ReflectionUtils;
|
|||||||
* @author jianghang 2012-7-10 下午02:31:42
|
* @author jianghang 2012-7-10 下午02:31:42
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
public class ZooKeeperx implements IZkConnection {
|
public class ZooKeeperx extends ZkConnection {
|
||||||
|
|
||||||
private static final String SERVER_COMMA = ";";
|
private static final String SERVER_COMMA = ";";
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ZooKeeperx.class);
|
private static final Logger logger = LoggerFactory.getLogger(ZooKeeperx.class);
|
||||||
@@ -53,6 +53,7 @@ public class ZooKeeperx implements IZkConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ZooKeeperx(String zkServers, int sessionTimeOut){
|
public ZooKeeperx(String zkServers, int sessionTimeOut){
|
||||||
|
super(zkServers, sessionTimeOut);
|
||||||
_servers = Arrays.asList(StringUtils.split(zkServers, SERVER_COMMA));
|
_servers = Arrays.asList(StringUtils.split(zkServers, SERVER_COMMA));
|
||||||
_sessionTimeOut = sessionTimeOut;
|
_sessionTimeOut = sessionTimeOut;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,6 +149,11 @@ public class CanalController {
|
|||||||
public void handleNewSession() throws Exception {
|
public void handleNewSession() throws Exception {
|
||||||
initCid(path);
|
initCid(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleSessionEstablishmentError(Throwable error) throws Exception {
|
||||||
|
logger.error("failed to connect to zookeeper", error);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -383,6 +388,11 @@ public class CanalController {
|
|||||||
public void handleNewSession() throws Exception {
|
public void handleNewSession() throws Exception {
|
||||||
initCid(path);
|
initCid(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleSessionEstablishmentError(Throwable error) throws Exception {
|
||||||
|
logger.error("failed to connect to zookeeper", error);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 优先启动embeded服务
|
// 优先启动embeded服务
|
||||||
|
|||||||
4
pom.xml
4
pom.xml
@@ -170,9 +170,9 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.sgroschupf</groupId>
|
<groupId>com.101tec</groupId>
|
||||||
<artifactId>zkclient</artifactId>
|
<artifactId>zkclient</artifactId>
|
||||||
<version>0.1</version>
|
<version>0.10</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
|
|||||||
Reference in New Issue
Block a user