[ 
https://issues.apache.org/jira/browse/HBASE-7503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13557736#comment-13557736
 ] 

Sergey Shelukhin commented on HBASE-7503:
-----------------------------------------

It's still not clear if closestRowBefore is needed. And if yes, why is it not 
in RequestConverter?
Otherwise (and assuming a working patch :)) +1.
Wrt structures and lists, the pseudocode of what I had in mind.
First loop can be optimized by sorting gets by rowkey first and traversing in 
parallel with startEndKeys, that improves O over both this and the patch, but 
may not necessarily be important.

Input: List<Get> gets; List<KeyPair> startEndKeys = ...;

List<Request> requests = [];
List<int[]> getIndexesPerRequest = [];

for {s,e} in startEndKeys {
  Request request = null
  for i in [0, gets.length) {
    if (gets[i] != null and gets[i].rowKey is in [s,e)) {
      if (request == null) {
        request = new Request()
        requests.add(request)
        getIndexesPerRequest.add(new int[])
      }
      request.addGet(gets[i]);
      getIndexesPerRequest[requests.length - 1] = i;
      gets[i] = null;
    }
  }
}
optionally check that gets are all nulls
send and wait for requests (or could be sent inline after internal for-loop 
above).
List<blah> results = new List<blah>(gets.length)
for i in [0, responses.length) {
  if error do error stuff, otherwise {
    assert response[i].results.length == getIndexesPerRequest[i].length;
    for j in [0, response[i].results.length) {
      results[getIndexesPerRequest[i][j]] = response.results[j]
   }
}
return results;


                
> Add exists(List) in HTableInterface to allow multiple parallel exists at one 
> time
> ---------------------------------------------------------------------------------
>
>                 Key: HBASE-7503
>                 URL: https://issues.apache.org/jira/browse/HBASE-7503
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Jean-Marc Spaggiari
>            Assignee: Jean-Marc Spaggiari
>            Priority: Minor
>             Fix For: 0.96.0
>
>         Attachments: HBASE-7503-v0-trunk.patch, HBASE-7503-v10-trunk.patch, 
> HBASE-7503-v11-trunk.patch, HBASE-7503-v1-trunk.patch, 
> HBASE-7503-v2-trunk.patch, HBASE-7503-v2-trunk.patch, 
> HBASE-7503-v3-trunk.patch, HBASE-7503-v4-trunk.patch, 
> HBASE-7503-v5-trunk.patch, HBASE-7503-v7-trunk.patch, 
> HBASE-7503-v8-trunk.patch, HBASE-7503-v9-trunk.patch
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> We need to have a Boolean[] exists(List<Get> gets) throws IOException method 
> implemented in HTableInterface.

--
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