PHOENIX-2533 Phoenix compilation fails as ZKUtil.applyClusterKeyToConf method is removed (Ravi Kishore Valeti)
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/a2b40de6 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a2b40de6 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a2b40de6 Branch: refs/heads/4.x-HBase-1.0 Commit: a2b40de63b8ca8fe33a7b7d09d7535fd4689b895 Parents: 356b73f Author: James Taylor <[email protected]> Authored: Wed Dec 16 09:22:25 2015 -0800 Committer: James Taylor <[email protected]> Committed: Wed Dec 16 09:24:51 2015 -0800 ---------------------------------------------------------------------- .../mapreduce/index/DirectHTableWriter.java | 38 ++------------------ 1 file changed, 2 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/a2b40de6/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/DirectHTableWriter.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/DirectHTableWriter.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/DirectHTableWriter.java index d18fde9..59b26b2 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/DirectHTableWriter.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/DirectHTableWriter.java @@ -22,10 +22,9 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Mutation; -import org.apache.hadoop.hbase.zookeeper.ZKUtil; +import org.apache.hadoop.hbase.mapreduce.TableOutputFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,25 +38,6 @@ public class DirectHTableWriter { private HTable table; - /** Job parameter that specifies the output table. */ - public static final String OUTPUT_TABLE = "hbase.mapred.outputtable"; - - /** - * Optional job parameter to specify a peer cluster. Used specifying remote cluster when copying - * between hbase clusters (the source is picked up from <code>hbase-site.xml</code>). - * @see TableMapReduceUtil#initTableReducerJob(String, Class, org.apache.hadoop.mapreduce.Job, - * Class, String, String, String) - */ - public static final String QUORUM_ADDRESS = "hbase.mapred.output.quorum"; - - /** Optional job parameter to specify peer cluster's ZK client port */ - public static final String QUORUM_PORT = "hbase.mapred.output.quorum.port"; - - /** Optional specification of the rs class name of the peer cluster */ - public static final String REGION_SERVER_CLASS = "hbase.mapred.output.rs.class"; - /** Optional specification of the rs impl name of the peer cluster */ - public static final String REGION_SERVER_IMPL = "hbase.mapred.output.rs.impl"; - public DirectHTableWriter(Configuration otherConf) { setConf(otherConf); } @@ -65,26 +45,12 @@ public class DirectHTableWriter { protected void setConf(Configuration otherConf) { this.conf = HBaseConfiguration.create(otherConf); - String tableName = this.conf.get(OUTPUT_TABLE); + String tableName = this.conf.get(TableOutputFormat.OUTPUT_TABLE); if (tableName == null || tableName.length() <= 0) { throw new IllegalArgumentException("Must specify table name"); } - String address = this.conf.get(QUORUM_ADDRESS); - int zkClientPort = this.conf.getInt(QUORUM_PORT, 0); - String serverClass = this.conf.get(REGION_SERVER_CLASS); - String serverImpl = this.conf.get(REGION_SERVER_IMPL); - try { - if (address != null) { - ZKUtil.applyClusterKeyToConf(this.conf, address); - } - if (serverClass != null) { - this.conf.set(HConstants.REGION_SERVER_IMPL, serverImpl); - } - if (zkClientPort != 0) { - this.conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkClientPort); - } this.table = new HTable(this.conf, tableName); this.table.setAutoFlush(false, true); LOG.info("Created table instance for " + tableName);
