Skip to content

Commit

Permalink
Increase the 'segment store path' in the 'Initializing stream cluster…
Browse files Browse the repository at this point in the history
…' log

Increase the 'segment store path' in the 'Initializing stream cluster' log

Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Sijie Guo <None>

This closes #2238 from SunDapeng1/branch-2238
  • Loading branch information
SunDapeng1 authored and sijie committed Jan 22, 2020
1 parent 0098999 commit 8889efa
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -32,6 +32,7 @@
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.zookeeper.KeeperException;
import static org.apache.bookkeeper.stream.storage.StorageConstants.getSegmentsRootPath;

/**
* ZooKeeper Based Cluster Initializer.
Expand Down Expand Up @@ -73,8 +74,6 @@ public boolean initializeCluster(URI metadataServiceUri, int numStorageContainer
return false;
} catch (StorageRuntimeException sre) {
if (sre.getCause() instanceof KeeperException.NoNodeException) {
log.info("Initializing the stream cluster with {} storage containers with segment store path {}.",
numStorageContainers);

String ledgersPath = metadataServiceUri.getPath();
Optional<String> segmentStorePath;
Expand All @@ -84,6 +83,9 @@ public boolean initializeCluster(URI metadataServiceUri, int numStorageContainer
segmentStorePath = Optional.of(ledgersPath);
}

log.info("Initializing the stream cluster with {} storage containers with segment store path {}.",
numStorageContainers, segmentStorePath.orElse(getSegmentsRootPath(ZK_METADATA_ROOT_PATH)));

boolean initialized = store.initializeCluster(numStorageContainers, segmentStorePath);
log.info("Successfully initialized the stream cluster : \n{}", store.getClusterMetadata());
return initialized;
Expand Down

0 comments on commit 8889efa

Please sign in to comment.