Search in sources :

Example 6 with ZKHelper

use of io.pravega.cli.admin.utils.ZKHelper in project pravega by pravega.

the class GetSegmentStoreByContainerCommand method execute.

@Override
public void execute() {
    ensureArgCount(1);
    try {
        @Cleanup ZKHelper zkStoreHelper = ZKHelper.create(getServiceConfig().getZkURL(), getServiceConfig().getClusterName());
        Optional<Host> host = zkStoreHelper.getHostForContainer(getIntArg(0));
        prettyJSONOutput("owner_segment_store", host.get());
    } catch (ZKConnectionFailedException e) {
        System.err.println("Exception accessing to Zookeeper cluster metadata.");
    }
}
Also used : ZKHelper(io.pravega.cli.admin.utils.ZKHelper) ZKConnectionFailedException(io.pravega.cli.admin.utils.ZKConnectionFailedException) Host(io.pravega.common.cluster.Host) Cleanup(lombok.Cleanup)

Aggregations

ZKHelper (io.pravega.cli.admin.utils.ZKHelper)6 Cleanup (lombok.Cleanup)3 ZKConnectionFailedException (io.pravega.cli.admin.utils.ZKConnectionFailedException)2 CheckpointStore (io.pravega.controller.store.checkpoint.CheckpointStore)2 Test (org.junit.Test)2 Position (io.pravega.client.stream.Position)1 PositionImpl (io.pravega.client.stream.impl.PositionImpl)1 SegmentWithRange (io.pravega.client.stream.impl.SegmentWithRange)1 Host (io.pravega.common.cluster.Host)1