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

Mget options #63

Closed
wants to merge 5 commits into from
Closed

Mget options #63

wants to merge 5 commits into from

Conversation

wision
Copy link
Contributor

@wision wision commented Apr 3, 2014

  • default zookeeper options
  • checkAndPut
  • raw option for mget
  • input check for mput
  • mput ability to store timestamp
  • not fetching region if it's being fetched already

@wision wision mentioned this pull request Apr 3, 2014
@@ -56,6 +56,12 @@ function Client(options) {
this.out = null;
this.socket = null;
this.logger = options.logger || console;
if (typeof options.zookeeperRoot === "undefined" || options.zookeeperRoot === null) {
Copy link
Member

Choose a reason for hiding this comment

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

options.zookeeperRoot = options.zookeeperRoot || '/hbase';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -281,6 +302,11 @@ Client.prototype.processBatch = function (tableName, workingList, useCache, retr
var idx = pair.getFirst();
var result = pair.getSecond();
results[idx] = result;

if (result.name === 'org.apache.hadoop.hbase.NotServingRegionException') {
delete self.cachedRegionLocations[Bytes.mapKey(regionName.split(',')[0])];
Copy link
Member

Choose a reason for hiding this comment

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

When *RegionException throw, processBatch will retry with useCache = false,
and cachedRegionLocations will be cleanup.

So no need to delete cache here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My test shows otherwise.
https://gist.github.com/wision/103e570c5386560c816a

I'm inserting 2k rows every second and after couple of seconds I split the table. Without this delete, hbase-client is not able to recover and it stops all the writes.

Copy link
Member

Choose a reason for hiding this comment

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

I think I had been fix this bug on db52e16 after you're using.

Copy link
Member

Choose a reason for hiding this comment

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

I will merge this manually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you.. I'll run the test once you're done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well.. you kept the delete, so it is going to work. I thought you wanted to remove it.

Copy link
Member

Choose a reason for hiding this comment

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

Err, I forgot to delete this... wait for a moment.

Copy link
Member

Choose a reason for hiding this comment

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

Try now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works.. thank you very much.

Copy link
Member

Choose a reason for hiding this comment

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

Happy to see you're using this module. You're my first user.
:)
💯

@fengmk2
Copy link
Member

fengmk2 commented Apr 3, 2014

land 71c8bc9

@fengmk2 fengmk2 closed this Apr 3, 2014
@wision wision deleted the mget-options branch April 3, 2014 13:23
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.

None yet

2 participants