You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gora.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/15 04:58:20 UTC
[jira] [Commented] (GORA-443) Upgrade HBase to 1.2.3
[ https://issues.apache.org/jira/browse/GORA-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15492379#comment-15492379 ]
ASF GitHub Bot commented on GORA-443:
-------------------------------------
Github user lewismc commented on a diff in the pull request:
https://github.com/apache/gora/pull/86#discussion_r78889929
--- 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 --
OK thanks. I've pushed a PR to @renato2099 which I hope he will add to this one. You can see the PR at https://github.com/renato2099/gora/pull/1
@renato2099 can you please merge and push the combined PR to this one?
> Upgrade HBase to 1.2.3
> ----------------------
>
> 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)