[ 
https://issues.apache.org/jira/browse/SOLR-3192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Linbin Chen updated SOLR-3192:
------------------------------
    Description: 
solr support netty tcp, netty/tcp can handle asynchronous,efficient,keepalive 
...

it's used on solr cloud or solrj

usage:

start netty server:

add netty.properties  in solr_home (sush as: server/solr)

{code}
port=8001
{code}

client
{code:java}
public void use_netty_client_demo() throws IOException, SolrServerException {
  SolrClient solrClient = new NettySolrClient("localhost", 8001);
  SolrQuery query = new SolrQuery("*:*");

  QueryResponse response = solrClient.query("collection1", query);

  System.out.println(response.getResults());

  solrClient.close();
}
{code}

  was:
solr support netty tcp, netty/tcp can handle asynchronous,efficient,keepalive 
...

it's used on solr cloud or solrj


solr.proto maybe

{code:java}
package org.apache.solr.client.solrj.impl.netty.protocol;
option java_package = "org.apache.solr.client.solrj.impl.netty.protocol";
option java_outer_classname = "SolrProtocol";
option optimize_for = SPEED;

message Param {
        required string key = 1;
        // string[]
        repeated string value = 2;
}

message ContentStream {
        optional string name = 1;
        optional string sourceInfo = 2;
        optional string contentType = 3;
        required int64 size = 4;
        required bytes stream = 5;
}

message SolrRequest {
        required int64 rid = 1;
        optional string collection =2;
        required string path = 3;
        // multi param
        repeated Param param = 4;
        // multi content stream
        repeated ContentStream contentStream = 5;
        optional string method = 6;
}

message ResponseBody {
        required string contentType = 1;
        required bytes body = 2;
}

message KeyValue {
        required string key = 1;
        required string value = 2;
}

message ExceptionBody {
        required int32 code = 1;
        optional string message = 2;
        repeated KeyValue metadata = 3;
        optional string trace = 4;
}

message SolrResponse {
        required int64 rid = 1;
        optional ResponseBody responseBody = 2;
        //maybe multi Exception
        repeated ExceptionBody exceptionBody = 3;
}
{code}


> NettySolrClient (supported by netty/protobuf)
> ---------------------------------------------
>
>                 Key: SOLR-3192
>                 URL: https://issues.apache.org/jira/browse/SOLR-3192
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 5.2.1
>            Reporter: Linbin Chen
>              Labels: netty
>             Fix For: Trunk, 5x
>
>         Attachments: SOLR-3192-for-5_2.patch, SOLR-3192-for-5x.patch
>
>
> solr support netty tcp, netty/tcp can handle asynchronous,efficient,keepalive 
> ...
> it's used on solr cloud or solrj
> usage:
> start netty server:
> add netty.properties  in solr_home (sush as: server/solr)
> {code}
> port=8001
> {code}
> client
> {code:java}
> public void use_netty_client_demo() throws IOException, SolrServerException {
>   SolrClient solrClient = new NettySolrClient("localhost", 8001);
>   SolrQuery query = new SolrQuery("*:*");
>   QueryResponse response = solrClient.query("collection1", query);
>   System.out.println(response.getResults());
>   solrClient.close();
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to