Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
We should have a standard mechanism to make a request to the right replica/node across solr code.
This RPC mechanism assumes that
- The RPC mechanism is HTTP
- It is aware of all collections,shards & their topology etc
- it knows how to route a request to the correct core
This is agnostic of wire level formats ,Solr documents etc. That is a layer above this.
Anyone can use their own JSON parser or any other RPC wire level format on top of this
for example a code like this
private void invokeOverseerOp(String electionNode, String op) { ModifiableSolrParams params = new ModifiableSolrParams(); ShardHandler shardHandler = shardHandlerFactory.getShardHandler(); params.set(CoreAdminParams.ACTION, CoreAdminAction.OVERSEEROP.toString()); params.set("op", op); params.set("qt", adminPath); params.set("electionNode", electionNode); ShardRequest sreq = new ShardRequest(); sreq.purpose = 1; String replica = zkStateReader.getBaseUrlForNodeName(LeaderElector.getNodeName(electionNode)); sreq.shards = new String[]\{replica}; sreq.actualShards = sreq.shards; sreq.params = params; shardHandler.submit(sreq, replica, sreq.params); shardHandler.takeCompletedOrError(); }
will be replaced with
private void invokeOverseerOp(String electionNode, String op) { RpcFactory factory = null; factory.createCallRouter() .toNode(electionNode) .createHttpRpc() .withMethod(SolrRequest.METHOD.GET) .addParam(CoreAdminParams.ACTION, CoreAdminAction.OVERSEEROP.toString()) .addParam("op", op) .addParam("electionNode", electionNode) .addParam(ShardParams.SHARDS_PURPOSE, 1) .withV1Path(adminPath) .invoke(); }
Attachments
Issue Links
- links to