The zookeeper URL and collection name can be obtained using the rb( ResponseBuilder) parameter passed to each of the component methods:
CoreDescriptor coreDescriptor = rb.req.getCore().getCoreDescriptor();
String collectionName = coreDescriptor.getCloudDescriptor().getCollectionName();
ZkController zkController = coreDescriptor.getCoreContainer().getZkController();
String zookeeperUrl = zkController.getZkServerAddress();
Assuming that the user component class expands SearchComponent, the parameter rbis transmitted to each of the public methods of the component: prepare, process, distributedProcess, modifyRequest, handleResponsesand finishStage.
source
share