ivankelly commented on a change in pull request #1642: Utility to rebuild
interleaved storage index files
URL: https://github.com/apache/bookkeeper/pull/1642#discussion_r215206596
##########
File path:
tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestBookieShellCluster.java
##########
@@ -83,4 +93,98 @@ public void test002_ListROBookies() throws Exception {
public void test003_ListRWBookies() throws Exception {
super.test003_ListRWBookies();
}
+
+ /**
+ * These tests on being able to access cluster internals, so can't be put
in test base.
+ */
+ @Test
+ public void test101_RegenerateIndex() throws Exception {
+ String zookeeper = String.format("zk+hierarchical://%s/ledgers",
+
BookKeeperClusterUtils.zookeeperConnectString(docker));
+ int numEntries = 100;
+
+ long ledgerId = 0;
+
+
+ try (BookKeeper bk = BookKeeper.newBuilder(
+ new
ClientConfiguration().setMetadataServiceUri(zookeeper)).build()) {
+ log.info("Writing entries");
+ try (WriteHandle writer =
bk.newCreateLedgerOp().withEnsembleSize(1)
+ .withWriteQuorumSize(1).withAckQuorumSize(1)
+ .withPassword("".getBytes()).execute().get()) {
+ int i = 0;
+ for (; i < numEntries - 1; i++) {
+ writer.appendAsync(("entry" + i).getBytes());
+ }
+ writer.append(("entry" + i).getBytes());
+
+ ledgerId = ledgerId;
Review comment:
Changed. I guess it worked because first ledger was getting id 0 anyhow.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services