.entrySet())
{
StringBuilder output = new StringBuilder(64);
output.append(mkPair.getKey());
output.append(delim);
Checkpoint cp = mkPair.getValue();
if (cp == null)
{
output.append(-1);
output.append(delim);
output.append(-1);
}
else
{
if (cp.getConsumptionMode() == DbusClientMode.ONLINE_CONSUMPTION)
{
output.append(cp.getWindowScn());
output.append(delim);
output.append(cp.getWindowOffset());
}
else if (cp.getConsumptionMode() == DbusClientMode.BOOTSTRAP_CATCHUP)
{
output.append(cp.getWindowScn());
output.append(delim);
output.append(cp.getWindowOffset());
}
else if (cp.getConsumptionMode() == DbusClientMode.BOOTSTRAP_SNAPSHOT)
{
output.append(cp.getBootstrapSinceScn());
output.append(delim);
output.append(-1);
}
}
System.out.println(output.toString());
}
}
else
{
throw new DatabusClusterUtilException(
"readSCN: please specify non-empty sources");
}
}
else if (function.equals("checkpoint"))
{
List<String> sources = getSources(arg1);
if ((sources != null) && !sources.isEmpty())
{
DatabusClusterCkptManager ckptMgr = new DatabusClusterCkptManager(
zkServer, clusterName, sources, partitions,
isLegacyChkptLocation);
Map<Integer, Checkpoint> ckpts = ckptMgr
.readCheckpoint();
char delim = '\t';
for (Map.Entry<Integer, Checkpoint> mkPair : ckpts
.entrySet())
{
StringBuilder output = new StringBuilder(64);
output.append(mkPair.getKey());
output.append(delim);
Checkpoint cp = mkPair.getValue();
if (cp == null)
{
output.append("null");
}
else
{
output.append(cp.toString());
}
System.out.println(output.toString());
}
}
else