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

Andrew Purtell resolved HBASE-8677.
-----------------------------------

    Resolution: Invalid

If multiple hosts are specified, then RemoteHTable will round robin requests. 
This won't work with scanners, because scanners are stateful. (Yes, technically 
not RESTful...) When scanning, connect only to a single REST gateway.
                
> Problems of fetching results by scanner interface(startup multi REST servers)
> -----------------------------------------------------------------------------
>
>                 Key: HBASE-8677
>                 URL: https://issues.apache.org/jira/browse/HBASE-8677
>             Project: HBase
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 0.94.5, 0.95.0
>         Environment: CentOS 5.5/hadoop0.20.2/hbase0.94.5/zookeeper3.4.3
>            Reporter: Eric Huang
>
> These days, I test one of available clients REST. When I startup two REST 
> servers and put these servers into Cluster instance using the REST client 
> classes, I get the wrong results by getScanner interface. 
> Code like this(37, 38 are two rest servers):
>         Cluster cluster = new Cluster();
>         cluster.add("10.28.171.37", 8080);
>         cluster.add("10.28.171.38", 8080);
>         Client client = new Client(cluster);
>         RemoteHTable table = new RemoteHTable(client, "demotime");
>         
>         ResultScanner resultScanner = table.getScanner(new Scan());
>         for (Result result: resultScanner) {
>             System.out.println("Scan row["+        
> Bytes.toString(result.getRow())+"]:"+result);
>         }
> I find server-side codes of REST maybe the cause. They use "static final 
> Map<String, ScannerInstanceResource> scanners" to cache the last scanner 
> context, so if there are multi REST servers, client may navigate to the other 
> server, which has not scanner conext of it and return the wrong results.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to