hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Dimiduk (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-13252) Get rid of managed connections and connection caching
Date Fri, 27 Mar 2015 16:46:53 GMT

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

Nick Dimiduk commented on HBASE-13252:
--------------------------------------

Looking good [~mantonov]!

nit: throughout you can use the more concise try-with-resource syntax.

{noformat}
@@ -545,9 +568,13 @@ class ConnectionImplementation implements ClusterConnection, Closeable
{
         LOG.debug("Table " + tableName + " not enabled");
         return false;
       }
-      ClusterConnection connection = ConnectionManager.getConnectionInternal(getConfiguration());
-      List<Pair<HRegionInfo, ServerName>> locations = MetaTableAccessor
-          .getTableRegionsAndLocations(connection, tableName, true);
+      Connection connection = ConnectionFactory.createConnection(getConfiguration());
+      List<Pair<HRegionInfo, ServerName>> locations;
+      try {
+         locations = MetaTableAccessor.getTableRegionsAndLocations(connection, tableName,
true);
+      } finally {
+        connection.close();
+      }
       int notDeployed = 0;
       int regionCount = 0;
       for (Pair<HRegionInfo, ServerName> pair : locations) {
{noformat}

Must create a new connection instance here? There's not one that can be provided?

bq. AFAIS this property isn't visible to client (ClusterConnection is private interface),
so technically this would not even be backward-incompatible change, and no release note needed?

Can you elaborate on this idea? The semantics are backwards-incompatible though, right? Can't
put this in 1.1, can we? I think a release note is warranted, warning folks of the semantic
change.

> Get rid of managed connections and connection caching
> -----------------------------------------------------
>
>                 Key: HBASE-13252
>                 URL: https://issues.apache.org/jira/browse/HBASE-13252
>             Project: HBase
>          Issue Type: Sub-task
>          Components: API
>    Affects Versions: 2.0.0
>            Reporter: Mikhail Antonov
>            Assignee: Mikhail Antonov
>         Attachments: HBASE-13252-v0.patch, HBASE-13252-v1.patch, HBASE-13252-v1.patch,
HBASE-13252-v2.patch, HBASE-13252-v2.patch
>
>
> (Need to):
>  - Remove CONNECTION_INSTANCES from ConnectionManager
>  - Remove HConnectionKey
>  - Remove 'managed' property from ClusterConnection, HCI and places where it's used now
>  - AFAIS this property isn't visible to client (ClusterConnection is private interface),
so technically this would not even be backward-incompatible change, and no release note needed?
>  - In fact, ConnectionManager can be removed, too.



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

Mime
View raw message