private void cleanPullLogAndCheckpoint() {
final Table<String, String, PullLog> pullLogs = storage.allPullLogs();
if (pullLogs == null || pullLogs.size() == 0) return;
for (final String groupAndSubject : pullLogs.columnKeySet()) {
final GroupAndSubject gs = GroupAndSubject.parse(groupAndSubject);
final long maxPulledMessageSequence = storage.getMaxPulledMessageSequence(gs.getSubject(), gs.getGroup());
if (maxPulledMessageSequence == -1) {
for (final Map.Entry<String, PullLog> entry : pullLogs.column(groupAndSubject).entrySet()) {
final String consumerId = entry.getKey();
LOG.info("remove pull log. subject: {}, group: {}, consumerId: {}", gs.getSubject(), gs.getGroup(), consumerId);
storage.destroyPullLog(gs.getSubject(), gs.getGroup(), consumerId);
}
}
}
}