Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Dogpiledays hbase1 #156

Merged

Conversation

jrottinghuis
Copy link
Contributor

Refactoring services to become light-weight objects receiving a long-lived connection.
Table objects are now short-lived, created as needed and closed when done.
put#add is moved to put#addColumn where needed.
Byte representations of table names are replaced by TableName references to the Strings.

RestJSONSource hosts a constant SLASH which is used in the client. The JVM will inline such string references, but that is living on the edge. Most of the functionality is moved to RestSource so that it can create a long-lived Connection. We don't want clients to cause this class to be loaded at which time static variables get initialized and cause clients to have a connection to HBase.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 2.15% when pulling 93ff064 on jrottinghuis:dogpiledays_hbase1 into 4f5c229 on twitter:dogpiledays_hbase1.

@vrushalivc vrushalivc merged commit 37b0750 into twitter:dogpiledays_hbase1 Oct 26, 2016
@vrushalivc
Copy link
Contributor

Thanks Joep! This improves the hbase connections being created when the rest api calls are called. There now should be one static connection for the entire class in the JVM (modulo weirdness with classloaders). Each thread creates its own service instance each time, but that should be light weight, using the one single multi-threaded / shared connection. It does not tackle the closing of connections upon jvm termination (which is an existing thing anyways).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants