Loading sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/cache/PathTree.java +2 −2 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public final class PathTree { return; } try { if (status == status.RELEASE) { if (status == PathStatus.RELEASE) { LOGGER.debug("loading status:{}", status); this.setStatus(PathStatus.CHANGING); Loading Loading @@ -339,7 +339,7 @@ public final class PathTree { LOGGER.debug("cache put:{},value:{}", path, value); PathUtils.validatePath(path); LOGGER.debug("put status:{}", status); if (status == status.RELEASE) { if (status == PathStatus.RELEASE) { if (path.equals(rootNode.get().getKey())) { rootNode.set(new PathNode(rootNode.get().getKey(), value.getBytes(Constants.UTF_8))); return; Loading sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/zookeeper/section/Callable.java→sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/retry/Callable.java +2 −5 Original line number Diff line number Diff line Loading @@ -15,11 +15,10 @@ * </p> */ package io.shardingsphere.jdbc.orchestration.reg.newzk.client.zookeeper.section; package io.shardingsphere.jdbc.orchestration.reg.newzk.client.retry; import io.shardingsphere.jdbc.orchestration.reg.newzk.client.action.IProvider; import io.shardingsphere.jdbc.orchestration.reg.newzk.client.retry.DelayPolicyExecutor; import io.shardingsphere.jdbc.orchestration.reg.newzk.client.retry.DelayRetryPolicy; import io.shardingsphere.jdbc.orchestration.reg.newzk.client.zookeeper.section.Connection; import lombok.Setter; import org.apache.zookeeper.KeeperException; import org.slf4j.Logger; Loading Loading @@ -81,8 +80,6 @@ public abstract class Callable<T> { delayPolicyExecutor.next(); if (Connection.needReset(e)) { provider.resetConnection(); } else { throw e; } execDelay(); } catch (InterruptedException e) { Loading sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/zookeeper/UsualClient.java +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public class UsualClient extends BaseClient { private final boolean watched = true; @Getter private io.shardingsphere.jdbc.orchestration.reg.newzk.client.action.IExecStrategy strategy; private IExecStrategy strategy; UsualClient(final BaseContext context) { super(context); Loading sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java +1 −3 Original line number Diff line number Diff line Loading @@ -80,10 +80,8 @@ public abstract class BaseOperation implements Delayed { } catch (KeeperException e) { if (Connection.needReset(e)) { provider.resetConnection(); result = false; } else { throw e; } result = false; } if (!result && delayPolicyExecutor.hasNext()) { delayPolicyExecutor.next(); Loading sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/zookeeper/section/Connection.java +11 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,17 @@ public class Connection { EXCEPTION_RESETS.put(KeeperException.Code.OPERATIONTIMEOUT.intValue(), false); } /** * need retry. * * @param e e * @return need retry * @throws KeeperException Zookeeper Exception */ public static boolean needRetry(final KeeperException e) throws KeeperException { return EXCEPTION_RESETS.containsKey(e.code().intValue()); } /** * need reset. * Loading Loading
sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/cache/PathTree.java +2 −2 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public final class PathTree { return; } try { if (status == status.RELEASE) { if (status == PathStatus.RELEASE) { LOGGER.debug("loading status:{}", status); this.setStatus(PathStatus.CHANGING); Loading Loading @@ -339,7 +339,7 @@ public final class PathTree { LOGGER.debug("cache put:{},value:{}", path, value); PathUtils.validatePath(path); LOGGER.debug("put status:{}", status); if (status == status.RELEASE) { if (status == PathStatus.RELEASE) { if (path.equals(rootNode.get().getKey())) { rootNode.set(new PathNode(rootNode.get().getKey(), value.getBytes(Constants.UTF_8))); return; Loading
sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/zookeeper/section/Callable.java→sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/retry/Callable.java +2 −5 Original line number Diff line number Diff line Loading @@ -15,11 +15,10 @@ * </p> */ package io.shardingsphere.jdbc.orchestration.reg.newzk.client.zookeeper.section; package io.shardingsphere.jdbc.orchestration.reg.newzk.client.retry; import io.shardingsphere.jdbc.orchestration.reg.newzk.client.action.IProvider; import io.shardingsphere.jdbc.orchestration.reg.newzk.client.retry.DelayPolicyExecutor; import io.shardingsphere.jdbc.orchestration.reg.newzk.client.retry.DelayRetryPolicy; import io.shardingsphere.jdbc.orchestration.reg.newzk.client.zookeeper.section.Connection; import lombok.Setter; import org.apache.zookeeper.KeeperException; import org.slf4j.Logger; Loading Loading @@ -81,8 +80,6 @@ public abstract class Callable<T> { delayPolicyExecutor.next(); if (Connection.needReset(e)) { provider.resetConnection(); } else { throw e; } execDelay(); } catch (InterruptedException e) { Loading
sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/zookeeper/UsualClient.java +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public class UsualClient extends BaseClient { private final boolean watched = true; @Getter private io.shardingsphere.jdbc.orchestration.reg.newzk.client.action.IExecStrategy strategy; private IExecStrategy strategy; UsualClient(final BaseContext context) { super(context); Loading
sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java +1 −3 Original line number Diff line number Diff line Loading @@ -80,10 +80,8 @@ public abstract class BaseOperation implements Delayed { } catch (KeeperException e) { if (Connection.needReset(e)) { provider.resetConnection(); result = false; } else { throw e; } result = false; } if (!result && delayPolicyExecutor.hasNext()) { delayPolicyExecutor.next(); Loading
sharding-jdbc-orchestration/src/main/java/io/shardingsphere/jdbc/orchestration/reg/newzk/client/zookeeper/section/Connection.java +11 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,17 @@ public class Connection { EXCEPTION_RESETS.put(KeeperException.Code.OPERATIONTIMEOUT.intValue(), false); } /** * need retry. * * @param e e * @return need retry * @throws KeeperException Zookeeper Exception */ public static boolean needRetry(final KeeperException e) throws KeeperException { return EXCEPTION_RESETS.containsKey(e.code().intValue()); } /** * need reset. * Loading