Skip to content

Commit

Permalink
fix(java-binding): use table committed epoch in demo query (#18937)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenym1 authored Oct 16, 2024
1 parent b7f9da4 commit e2a04af
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,19 @@ public static void main(String[] args) {
vnodeList.add(i);
}

long epoch = 0;

if (version.getStateTableInfo().containsKey(tableCatalog.getId())) {
epoch = version.getStateTableInfo().get(tableCatalog.getId()).getCommittedEpoch();
}

ReadPlan readPlan =
ReadPlan.newBuilder()
.setDataDir(dataDir)
.setObjectStoreUrl(objectStore)
.setKeyRange(keyRange)
.setTableId(tableCatalog.getId())
.setEpoch(version.getMaxCommittedEpoch())
.setEpoch(epoch)
.setVersion(version)
.setTableCatalog(tableCatalog)
.addAllVnodeIds(vnodeList)
Expand All @@ -87,13 +93,12 @@ public static void main(String[] args) {
throw new RuntimeException(
String.format("row count is %s, should be %s", count, expectedCount));
}
} finally {
metaClient.unpinVersion(version);
heartbeatFuture.cancel(true);
}

metaClient.unpinVersion(version);

heartbeatFuture.cancel(false);
} finally {
scheduledThreadPool.shutdown();
}

scheduledThreadPool.shutdown();
}
}

0 comments on commit e2a04af

Please sign in to comment.