Skip to content

Commit 9450ac9

Browse files
author
chengyitian
committed
AJ-674: delete no use after-try tryReconnect;
1 parent 0eb9dc0 commit 9450ac9

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/com/xxdb/streaming/client/AbstractClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public boolean tryReconnect(String topic) {
321321
// log.info("Successfully switched to node: " + sites[currentSiteIndexMap.get(topic)].host + ":" + sites[currentSiteIndexMap.get(topic)].port);
322322

323323
if (!reconnected) {
324-
waitReconnectTopic.add(topic);
324+
// waitReconnectTopic.add(topic);
325325
return false;
326326
} else {
327327
log.info("Successfully switched to node: " + sites[currentSiteIndexMap.get(topic)].host + ":" + sites[currentSiteIndexMap.get(topic)].port);

src/com/xxdb/streaming/client/Daemon.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,20 @@ public void run() {
195195
}
196196
}
197197

198-
Set<String> waitReconnectTopic = dispatcher.getAllReconnectTopic();
199-
synchronized (waitReconnectTopic) {
200-
for (String topic : waitReconnectTopic) {
201-
// reconnect every info.resubTimeout ms
202-
if (System.currentTimeMillis() - AbstractClient.lastExceptionTopicTimeMap.get(topic) <= AbstractClient.resubTimeout)
203-
continue;
204-
dispatcher.tryReconnect(topic);
205-
}
206-
}
198+
// not need to put and get from waitReconnectTopic.
199+
// Set<String> waitReconnectTopic = dispatcher.getAllReconnectTopic();
200+
// synchronized (waitReconnectTopic) {
201+
// for (String topic : waitReconnectTopic) {
202+
// // reconnect every info.resubTimeout ms
203+
//// if (System.currentTimeMillis() - AbstractClient.lastExceptionTopicTimeMap.get(topic) <= AbstractClient.resubTimeout)
204+
//// continue;
205+
// long subTime = System.currentTimeMillis() - AbstractClient.lastExceptionTopicTimeMap.get(topic);
206+
// System.out.println("flag3 subTime: " + subTime);
207+
// if (subTime <= AbstractClient.resubTimeout)
208+
// continue;
209+
// dispatcher.tryReconnect(topic);
210+
// }
211+
// }
207212

208213
try {
209214
// check reconnected interval time

0 commit comments

Comments
 (0)