Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GORA-443 Upgrade HBase to 1.2.0 #86

Merged
merged 3 commits into from
Feb 3, 2017
Merged

Conversation

renato2099
Copy link
Contributor

Work in progress for updating gora to 1.2.2. I also looked at @lewismc 's work ;)
All of tests pass when run individually, but when run as a whole some of them fail. I think this is because of the BufferedMutator and taking longer than it should. The usage of the BufferedMutator is like setting autoFlush=False which then makes sense to actually use our Flush method.
The weird thing is that if we use the regular Table and do the operations synchronously all tests pass always. This would be like setting autoFlush=True. The problem with using this option is that Gora wouldn't be batching any operations and just passing them down.
Maybe someone has an idea on how to check for BufferedMutator to be done (?)

import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you import individual classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure, I will do it for the final patch. There is still some clean up to be done ;)
what I'd like to fix is this weird behaviour of BufferedMutator and our tests.

@lewismc
Copy link
Member

lewismc commented Sep 2, 2016

I notice that we never .close() Admin. According to @enis we should http://www.slideshare.net/enissoz/meet-hbase-10/38?src=clipshare

@tedyu
Copy link

tedyu commented Sep 11, 2016

After using admin, .close() method should be called.

for (ConcurrentLinkedQueue<Mutation> buffer : bPool) {
for (Mutation m: buffer) {
bufMutator.mutate(m);
bufMutator.flush();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be lifted outside the for loop.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tedyu are you referring specifically to bufMutator.flush();?
The code would therefore be

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();
+    bufMutator.close();
+  }

Can you please clarify?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This would do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks. I've pushed a PR to @renato2099 which I hope he will add to this one. You can see the PR at renato2099#1

@renato2099 can you please merge and push the combined PR to this one?

@lewismc
Copy link
Member

lewismc commented Jan 27, 2017

@renato2099 can you please merge and push renato2099#1

@asfgit asfgit merged commit 163d91b into apache:master Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants