gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GORA-443) Upgrade HBase to 1.2.1
Date Sun, 11 Sep 2016 18:17:20 GMT

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

ASF GitHub Bot commented on GORA-443:
-------------------------------------

Github user tedyu commented on a diff in the pull request:

    https://github.com/apache/gora/pull/86#discussion_r78299720
  
    --- Diff: gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java
---
    @@ -83,288 +87,129 @@
       public HBaseTableConnection(Configuration conf, String tableName, boolean autoflush)
           throws IOException {
         this.conf = conf;
    +
         this.tables = new ThreadLocal<>();
    +    this.buffers = new ThreadLocal<>();
    +    this.connection = ConnectionFactory.createConnection(conf);
         this.tableName = TableName.valueOf(tableName);
    +    this.regionLocator = this.connection.getRegionLocator(this.tableName);
    +
         this.autoFlush = autoflush;
       }
    -  
    -  private HTable getTable() throws IOException {
    -    HTable table = tables.get();
    +
    +  private Table getTable() throws IOException {
    +    Table table = tables.get();
         if (table == null) {
    -      table = new HTable(conf, tableName) {
    -        @Override
    -        public synchronized void flushCommits() throws RetriesExhaustedWithDetailsException,
InterruptedIOException {
    -          super.flushCommits();
    -        }
    -      };
    -      table.setAutoFlushTo(autoFlush);
    -      pool.add(table); //keep track
    +      table = connection.getTable(tableName);
    +//      table.setAutoFlushTo(autoFlush);
    +      tPool.add(table); //keep track
           tables.set(table);
         }
         return table;
       }
    -  
    -  @Override
    +
    +  private ConcurrentLinkedQueue<Mutation> getBuffer() throws IOException {
    +    ConcurrentLinkedQueue<Mutation> buffer = buffers.get();
    +    if (buffer == null) {
    +//      BufferedMutatorParams params = new BufferedMutatorParams(this.tableName).listener(listener);
    +//      buffer = connection.getBufferedMutator(this.tableName);
    +      buffer = new ConcurrentLinkedQueue<>();
    +      bPool.add(buffer);
    +      buffers.set(buffer);
    +    }
    +    return buffer;
    +  }
    +
    +  public void flushCommits() throws IOException {
    +    BufferedMutator bufMutator = connection.getBufferedMutator(this.tableName);
    +    for (ConcurrentLinkedQueue<Mutation> buffer : bPool) {
    +      for (Mutation m: buffer) {
    +        bufMutator.mutate(m);
    +        bufMutator.flush();
    --- End diff --
    
    This can be lifted outside the for loop.


> Upgrade HBase to 1.2.1
> ----------------------
>
>                 Key: GORA-443
>                 URL: https://issues.apache.org/jira/browse/GORA-443
>             Project: Apache Gora
>          Issue Type: Improvement
>          Components: gora-hbase
>            Reporter: Ted Yu
>            Assignee: Lewis John McGibbney
>             Fix For: 0.7
>
>
> HBase 1.1.2 release is the current stable release.
> Gora should be built based on HBase 1.1.2
> Currently I got the following compilation error:
> {code}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
(default-compile) on project gora-hbase: Compilation failure
> [ERROR] /home/hbase/gora/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java:[59,7]
error: HBaseTableConnection is not abstract and does not override abstract method checkAndDelete(byte[],byte[],byte[],CompareOp,byte[],Delete)
in Table
> {code}



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

Mime
View raw message