System.out.println(client.getSchema());
String key;
GenericRecord value;
Chronos c = new Chronos();
for(int i = 0; i < 10; i++) {
key = "member." + i;
value = client.get(key);
System.out.println("get: " + key + "->" + value);
}
System.out.println(c.getElapsedTime());
System.out.println();
for(int i = 0; i < 10; i++) {
System.out.println("position=" + client.getPosition());
Thread.sleep(100);
}
System.out.println();
for(int i = 0; i < 10; i++) {
System.out.println("position=" + client.getPosition(Clock.ZERO));
Thread.sleep(100);
}
Position position, nextPosition;
Map<String, GenericRecord> map = new HashMap<String, GenericRecord>(1000);
System.out.println();
c.getElapsedTime();
position = client.getPosition();
for(int i = 0; i < 10; i++) {
nextPosition = client.syncUp(position, map);
System.out.printf("syncUp=%d position=%s in %s%n", map.size(), nextPosition.toString(), c.getElapsedTime());
position = nextPosition;
map.clear();
}
System.out.println();
c.getElapsedTime();
position = client.getPosition(Clock.ZERO);
while(true) {
nextPosition = client.syncUp(position, map);
System.out.printf("syncUp=%d position=%s in %s%n", map.size(), nextPosition.toString(), c.getElapsedTime());
if(map.size() == 0) break;
position = nextPosition;
map.clear();
}