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

Vladimir Rodionov commented on HBASE-12090:
-------------------------------------------

This code does actual Get in my test:
{code}
  class WorkThreadForGet extends Thread
  {
      private HRegion region;
      private RegionScanner scanner;  
      private int totalOps;
      private Random rnd;
      public WorkThreadForGet (HRegion region, int totalOps, int num)
      {
          super ("WorkThreadForGet #"+num);
          this.region = region;
          this.totalOps = totalOps;
          rnd = new Random(num);          
      }
           
      public void run(){
          LOG.info(getName()+": started");
          List<Cell> result = new ArrayList<Cell>();
          
          int i = 0;
          
          while( i++ < totalOps){
              
              try {
                  scanner = nextScanner();
                  while(scanner.next(result)){
                      result.clear();
                  }
                  scanner.close();  
              } catch (IOException e) {
                  LOG.error(getName()+" failed", e);
              }
          }   
          
          LOG.info(getName()+": finished");          
      }


    private RegionScanner nextScanner() throws IOException {
        
        Scan scan = new Scan();
        scan.addFamily(FAMILIES[0]);
        scan.setMaxVersions();
        scan.setCaching(1000);
        int i = rnd.nextInt(N);
        byte[] row = getRow(i);
        scan.setStartRow(row);
        scan.setStopRow (row);       
        RegionScanner scanner = region.getScanner(scan);        
        return scanner;
    }          
  }
{code}

> Bytes: more Unsafe, more Faster 
> --------------------------------
>
>                 Key: HBASE-12090
>                 URL: https://issues.apache.org/jira/browse/HBASE-12090
>             Project: HBase
>          Issue Type: Improvement
>          Components: Performance
>    Affects Versions: 0.94.23, 0.98.6
>            Reporter: Vladimir Rodionov
>            Assignee: Vladimir Rodionov
>             Fix For: 2.0.0, 0.98.7, 0.94.24, 0.99.1
>
>         Attachments: 12090-v1.1.txt, HBASE-12090.2.patch, HBASE-12090.patch
>
>
> Additional optimizations to *org.apache.hadoop.hbase.util.Bytes*:
> * New version of compareTo method.
> * New versions for primitive converters  : putXXX/toXXX.



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

Reply via email to