HBASE-3734 HBaseAdmin creates new configurations in getCatalogTracker
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1090061 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2ce5c385d7
commit
3dd353aedb
|
@ -178,6 +178,7 @@ Release 0.90.3 - Unreleased
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
HBASE-3746 Clean up CompressionTest to not directly reference
|
HBASE-3746 Clean up CompressionTest to not directly reference
|
||||||
DistributedFileSystem (todd)
|
DistributedFileSystem (todd)
|
||||||
|
HBASE-3734 HBaseAdmin creates new configurations in getCatalogTracker
|
||||||
|
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
|
|
|
@ -75,17 +75,17 @@ public class HBaseAdmin implements Abortable {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param conf Configuration object
|
* @param c Configuration object
|
||||||
* @throws MasterNotRunningException if the master is not running
|
* @throws MasterNotRunningException if the master is not running
|
||||||
* @throws ZooKeeperConnectionException if unable to connect to zookeeper
|
* @throws ZooKeeperConnectionException if unable to connect to zookeeper
|
||||||
*/
|
*/
|
||||||
public HBaseAdmin(Configuration conf)
|
public HBaseAdmin(Configuration c)
|
||||||
throws MasterNotRunningException, ZooKeeperConnectionException {
|
throws MasterNotRunningException, ZooKeeperConnectionException {
|
||||||
this.connection = HConnectionManager.getConnection(conf);
|
this.conf = HBaseConfiguration.create(c);
|
||||||
this.conf = conf;
|
this.connection = HConnectionManager.getConnection(this.conf);
|
||||||
this.pause = conf.getLong("hbase.client.pause", 1000);
|
this.pause = this.conf.getLong("hbase.client.pause", 1000);
|
||||||
this.numRetries = conf.getInt("hbase.client.retries.number", 10);
|
this.numRetries = this.conf.getInt("hbase.client.retries.number", 10);
|
||||||
this.retryLongerMultiplier = conf.getInt("hbase.client.retries.longer.multiplier", 10);
|
this.retryLongerMultiplier = this.conf.getInt("hbase.client.retries.longer.multiplier", 10);
|
||||||
this.connection.getMaster();
|
this.connection.getMaster();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class HBaseAdmin implements Abortable {
|
||||||
CatalogTracker ct = null;
|
CatalogTracker ct = null;
|
||||||
try {
|
try {
|
||||||
HConnection connection =
|
HConnection connection =
|
||||||
HConnectionManager.getConnection(new Configuration(this.conf));
|
HConnectionManager.getConnection(this.conf);
|
||||||
ct = new CatalogTracker(connection);
|
ct = new CatalogTracker(connection);
|
||||||
ct.start();
|
ct.start();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
@ -114,7 +114,6 @@ public class HBaseAdmin implements Abortable {
|
||||||
|
|
||||||
private void cleanupCatalogTracker(final CatalogTracker ct) {
|
private void cleanupCatalogTracker(final CatalogTracker ct) {
|
||||||
ct.stop();
|
ct.stop();
|
||||||
HConnectionManager.deleteConnection(ct.getConnection().getConfiguration(), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -822,7 +821,7 @@ public class HBaseAdmin implements Abortable {
|
||||||
try {
|
try {
|
||||||
if (isRegionName) {
|
if (isRegionName) {
|
||||||
Pair<HRegionInfo, HServerAddress> pair =
|
Pair<HRegionInfo, HServerAddress> pair =
|
||||||
MetaReader.getRegion(getCatalogTracker(), tableNameOrRegionName);
|
MetaReader.getRegion(ct, tableNameOrRegionName);
|
||||||
if (pair == null || pair.getSecond() == null) {
|
if (pair == null || pair.getSecond() == null) {
|
||||||
LOG.info("No server in .META. for " +
|
LOG.info("No server in .META. for " +
|
||||||
Bytes.toString(tableNameOrRegionName) + "; pair=" + pair);
|
Bytes.toString(tableNameOrRegionName) + "; pair=" + pair);
|
||||||
|
@ -831,7 +830,7 @@ public class HBaseAdmin implements Abortable {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<Pair<HRegionInfo, HServerAddress>> pairs =
|
List<Pair<HRegionInfo, HServerAddress>> pairs =
|
||||||
MetaReader.getTableRegionsAndLocations(getCatalogTracker(),
|
MetaReader.getTableRegionsAndLocations(ct,
|
||||||
Bytes.toString(tableNameOrRegionName));
|
Bytes.toString(tableNameOrRegionName));
|
||||||
for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
|
for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
|
||||||
if (pair.getFirst().isOffline()) continue;
|
if (pair.getFirst().isOffline()) continue;
|
||||||
|
@ -1079,7 +1078,7 @@ public class HBaseAdmin implements Abortable {
|
||||||
if (isRegionName(tableNameOrRegionName)) {
|
if (isRegionName(tableNameOrRegionName)) {
|
||||||
// Its a possible region name.
|
// Its a possible region name.
|
||||||
Pair<HRegionInfo, HServerAddress> pair =
|
Pair<HRegionInfo, HServerAddress> pair =
|
||||||
MetaReader.getRegion(getCatalogTracker(), tableNameOrRegionName);
|
MetaReader.getRegion(ct, tableNameOrRegionName);
|
||||||
if (pair == null || pair.getSecond() == null) {
|
if (pair == null || pair.getSecond() == null) {
|
||||||
LOG.info("No server in .META. for " +
|
LOG.info("No server in .META. for " +
|
||||||
Bytes.toString(tableNameOrRegionName) + "; pair=" + pair);
|
Bytes.toString(tableNameOrRegionName) + "; pair=" + pair);
|
||||||
|
@ -1088,7 +1087,7 @@ public class HBaseAdmin implements Abortable {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<Pair<HRegionInfo, HServerAddress>> pairs =
|
List<Pair<HRegionInfo, HServerAddress>> pairs =
|
||||||
MetaReader.getTableRegionsAndLocations(getCatalogTracker(),
|
MetaReader.getTableRegionsAndLocations(ct,
|
||||||
Bytes.toString(tableNameOrRegionName));
|
Bytes.toString(tableNameOrRegionName));
|
||||||
for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
|
for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
|
||||||
// May not be a server for a particular row
|
// May not be a server for a particular row
|
||||||
|
|
Loading…
Reference in New Issue