Skip to content

Commit e29de44

Browse files
author
Baoyi Chen
committed
test
1 parent 3b9e9a8 commit e29de44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test/java/com/moilioncircle/redis/replicator/online/PsyncTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,22 @@ public void psync() throws IOException {
8383
@Override
8484
public void onEvent(Replicator replicator, Event event) {
8585
if (event instanceof PreRdbSyncEvent) {
86+
r.getLogger().info("id:{}, offset:{}", configuration.getReplId(), configuration.getReplOffset());
8687
acc1.incrementAndGet();
8788
}
8889

8990
if (event instanceof KeyValuePair) {
9091
if (flag1.compareAndSet(false, true)) {
9192
// will trigger full sync at this time
93+
r.getLogger().info("psync close 1");
9294
close(replicator);
9395
}
9496
}
9597

9698
if (event instanceof PostRdbSyncEvent) {
9799
if (flag.compareAndSet(false, true)) {
98100
// will trigger full sync at this time
101+
r.getLogger().info("psync close 2");
99102
close(replicator);
100103
Thread thread = new Thread(new JRun());
101104
thread.setDaemon(true);
@@ -108,13 +111,15 @@ public void onEvent(Replicator replicator, Event event) {
108111
if (acc.get() == 500) {
109112
//close current process port;
110113
//that will auto trigger psync command
114+
r.getLogger().info("psync close 3");
111115
r.getLogger().info("id:{}, offset:{}", configuration.getReplId(), configuration.getReplOffset());
112116
close(replicator);
113117
}
114118

115119
if (acc.get() == 1010) {
116120
//close current process port;
117121
//that will auto trigger psync command
122+
r.getLogger().info("psync close 4");
118123
r.getLogger().info("id:{}, offset:{}", configuration.getReplId(), configuration.getReplOffset());
119124
close(replicator);
120125
}

0 commit comments

Comments
 (0)