Repository: incubator-atlas Updated Branches: refs/heads/master 94a8db33a -> 5ab199511
ATLAS-885 optimize HBaseStoreManager to avoid expensive HTable instantiation every 5 seconds (madhan.neethiraj via yhemanth) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/5ab19951 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/5ab19951 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/5ab19951 Branch: refs/heads/master Commit: 5ab199511898ab195892152e00679ebe560dae17 Parents: 94a8db3 Author: Hemanth Yamijala <[email protected]> Authored: Thu Jun 9 16:39:44 2016 +0530 Committer: Hemanth Yamijala <[email protected]> Committed: Thu Jun 9 16:39:44 2016 +0530 ---------------------------------------------------------------------- release-log.txt | 1 + .../titan/diskstorage/hbase/HBaseStoreManager.java | 15 ++++++++++++--- .../titan/diskstorage/hbase/HTable0_98.java | 5 +++++ .../titan/diskstorage/hbase/HTable1_0.java | 5 +++++ .../titan/diskstorage/hbase/TableMask.java | 1 + 5 files changed, 24 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5ab19951/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index e3554ee..a43ac40 100644 --- a/release-log.txt +++ b/release-log.txt @@ -22,6 +22,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags) ALL CHANGES: +ATLAS-885 optimize HBaseStoreManager to avoid expensive HTable instantiation every 5 seconds (madhan.neethiraj via yhemanth) ATLAS-878 UI: Not showing details of SD, DB and COLUMNS (saqeeb.s via shwethags) ATLAS-853 User's name to be mentioned in the top user drop down (saqeeb.s via shwethags) ATLAS-867 Excessive logs: default log level should be set to 'info'; currently it is 'debug' (svimal2106 via sumasai ) http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5ab19951/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HBaseStoreManager.java ---------------------------------------------------------------------- diff --git a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HBaseStoreManager.java b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HBaseStoreManager.java index 52f28af..a94a7e4 100644 --- a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HBaseStoreManager.java +++ b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HBaseStoreManager.java @@ -347,6 +347,11 @@ public class HBaseStoreManager extends DistributedStoreManager implements KeyCol @Override public Deployment getDeployment() { + return Deployment.REMOTE; + + /* If just one of the regions for titan table is in the localhost, + * this method returns Deployment.LOCAL - which does not sound right. + * List<KeyRange> local; try { local = getLocalKeyPartition(); @@ -355,6 +360,8 @@ public class HBaseStoreManager extends DistributedStoreManager implements KeyCol // propagating StorageException might be a better approach throw new RuntimeException(e); } + * + */ } @Override @@ -506,14 +513,16 @@ public class HBaseStoreManager extends DistributedStoreManager implements KeyCol List<KeyRange> result = new LinkedList<KeyRange>(); - HTable table = null; + TableMask table = null; try { ensureTableExists(tableName, getCfNameForStoreName(GraphDatabaseConfiguration.SYSTEM_PROPERTIES_STORE_NAME), 0); - table = new HTable(hconf, tableName); + table = cnx.getTable(tableName); + + HTable hTable = (HTable)table.getTableObject(); Map<KeyRange, ServerName> normed = - normalizeKeyBounds(table.getRegionLocations()); + normalizeKeyBounds(hTable.getRegionLocations()); for (Map.Entry<KeyRange, ServerName> e : normed.entrySet()) { if (NetworkUtil.isLocalConnection(e.getValue().getHostname())) { http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5ab19951/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable0_98.java ---------------------------------------------------------------------- diff --git a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable0_98.java b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable0_98.java index 4ddb2f0..b11532a 100644 --- a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable0_98.java +++ b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable0_98.java @@ -57,4 +57,9 @@ public class HTable0_98 implements TableMask { table.close(); } + + @Override + public Object getTableObject() { + return table; + } } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5ab19951/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable1_0.java ---------------------------------------------------------------------- diff --git a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable1_0.java b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable1_0.java index 5085abb..5c90617 100644 --- a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable1_0.java +++ b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HTable1_0.java @@ -57,4 +57,9 @@ public class HTable1_0 implements TableMask { table.close(); } + + @Override + public Object getTableObject() { + return table; + } } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5ab19951/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/TableMask.java ---------------------------------------------------------------------- diff --git a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/TableMask.java b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/TableMask.java index dd3d61e..54f8743 100644 --- a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/TableMask.java +++ b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/TableMask.java @@ -37,4 +37,5 @@ public interface TableMask extends Closeable void batch(List<Row> writes, Object[] results) throws IOException, InterruptedException; + Object getTableObject(); }
