@@ -569,7 +569,7 @@ public static void initTableReducerJob(String table, Class<? extends TableReduce
569569 */
570570 public static void initTableReducerJob (String table , Class <? extends TableReducer > reducer ,
571571 Job job , Class partitioner ) throws IOException {
572- initTableReducerJob (table , reducer , job , partitioner , null , null , null );
572+ initTableReducerJob (table , reducer , job , partitioner , null );
573573 }
574574
575575 /**
@@ -589,15 +589,11 @@ public static void initTableReducerJob(String table, Class<? extends TableReduce
589589 * <code> <hbase.zookeeper.quorum>:<
590590 * hbase.zookeeper.client.port>:<zookeeper.znode.parent>
591591 * </code> such as <code>server,server2,server3:2181:/hbase</code>.
592- * @param serverClass redefined hbase.regionserver.class
593- * @param serverImpl redefined hbase.regionserver.impl
594592 * @throws IOException When determining the region count fails.
595593 */
596594 public static void initTableReducerJob (String table , Class <? extends TableReducer > reducer ,
597- Job job , Class partitioner , String quorumAddress , String serverClass , String serverImpl )
598- throws IOException {
599- initTableReducerJob (table , reducer , job , partitioner , quorumAddress , serverClass , serverImpl ,
600- true );
595+ Job job , Class partitioner , String quorumAddress ) throws IOException {
596+ initTableReducerJob (table , reducer , job , partitioner , quorumAddress , true );
601597 }
602598
603599 /**
@@ -617,16 +613,13 @@ public static void initTableReducerJob(String table, Class<? extends TableReduce
617613 * <code> <hbase.zookeeper.quorum>:<
618614 * hbase.zookeeper.client.port>:<zookeeper.znode.parent>
619615 * </code> such as <code>server,server2,server3:2181:/hbase</code>.
620- * @param serverClass redefined hbase.regionserver.class
621- * @param serverImpl redefined hbase.regionserver.impl
622616 * @param addDependencyJars upload HBase jars and jars for any of the configured job classes via
623617 * the distributed cache (tmpjars).
624618 * @throws IOException When determining the region count fails.
625619 */
626620 public static void initTableReducerJob (String table , Class <? extends TableReducer > reducer ,
627- Job job , Class partitioner , String quorumAddress , String serverClass , String serverImpl ,
628- boolean addDependencyJars ) throws IOException {
629-
621+ Job job , Class partitioner , String quorumAddress , boolean addDependencyJars )
622+ throws IOException {
630623 Configuration conf = job .getConfiguration ();
631624 HBaseConfiguration .merge (conf , HBaseConfiguration .create (conf ));
632625 job .setOutputFormatClass (TableOutputFormat .class );
@@ -640,10 +633,6 @@ public static void initTableReducerJob(String table, Class<? extends TableReduce
640633 ZKConfig .validateClusterKey (quorumAddress );
641634 conf .set (TableOutputFormat .QUORUM_ADDRESS , quorumAddress );
642635 }
643- if (serverClass != null && serverImpl != null ) {
644- conf .set (TableOutputFormat .REGION_SERVER_CLASS , serverClass );
645- conf .set (TableOutputFormat .REGION_SERVER_IMPL , serverImpl );
646- }
647636 job .setOutputKeyClass (ImmutableBytesWritable .class );
648637 job .setOutputValueClass (Writable .class );
649638 if (partitioner == HRegionPartitioner .class ) {
@@ -663,6 +652,72 @@ public static void initTableReducerJob(String table, Class<? extends TableReduce
663652 initCredentials (job );
664653 }
665654
655+ /**
656+ * Use this before submitting a TableReduce job. It will appropriately set up the JobConf.
657+ * @param table The output table.
658+ * @param reducer The reducer class to use.
659+ * @param job The current job to adjust. Make sure the passed job is carrying all
660+ * necessary HBase configuration.
661+ * @param partitioner Partitioner to use. Pass <code>null</code> to use default partitioner.
662+ * @param quorumAddress Distant cluster to write to; default is null for output to the cluster
663+ * that is designated in <code>hbase-site.xml</code>. Set this String to the
664+ * zookeeper ensemble of an alternate remote cluster when you would have the
665+ * reduce write a cluster that is other than the default; e.g. copying tables
666+ * between clusters, the source would be designated by
667+ * <code>hbase-site.xml</code> and this param would have the ensemble address
668+ * of the remote cluster. The format to pass is particular. Pass
669+ * <code> <hbase.zookeeper.quorum>:<
670+ * hbase.zookeeper.client.port>:<zookeeper.znode.parent>
671+ * </code> such as <code>server,server2,server3:2181:/hbase</code>.
672+ * @param serverClass redefined hbase.regionserver.class
673+ * @param serverImpl redefined hbase.regionserver.impl
674+ * @throws IOException When determining the region count fails.
675+ * @deprecated Since 2.5.9, 2.6.1, 2.7.0, will be removed in 4.0.0. The {@code serverClass} and
676+ * {@code serverImpl} do not take effect any more, just use
677+ * {@link #initTableReducerJob(String, Class, Job, Class, String)} instead.
678+ * @see #initTableReducerJob(String, Class, Job, Class, String)
679+ */
680+ @ Deprecated
681+ public static void initTableReducerJob (String table , Class <? extends TableReducer > reducer ,
682+ Job job , Class partitioner , String quorumAddress , String serverClass , String serverImpl )
683+ throws IOException {
684+ initTableReducerJob (table , reducer , job , partitioner , quorumAddress );
685+ }
686+
687+ /**
688+ * Use this before submitting a TableReduce job. It will appropriately set up the JobConf.
689+ * @param table The output table.
690+ * @param reducer The reducer class to use.
691+ * @param job The current job to adjust. Make sure the passed job is carrying all
692+ * necessary HBase configuration.
693+ * @param partitioner Partitioner to use. Pass <code>null</code> to use default partitioner.
694+ * @param quorumAddress Distant cluster to write to; default is null for output to the cluster
695+ * that is designated in <code>hbase-site.xml</code>. Set this String to
696+ * the zookeeper ensemble of an alternate remote cluster when you would
697+ * have the reduce write a cluster that is other than the default; e.g.
698+ * copying tables between clusters, the source would be designated by
699+ * <code>hbase-site.xml</code> and this param would have the ensemble
700+ * address of the remote cluster. The format to pass is particular. Pass
701+ * <code> <hbase.zookeeper.quorum>:<
702+ * hbase.zookeeper.client.port>:<zookeeper.znode.parent>
703+ * </code> such as <code>server,server2,server3:2181:/hbase</code>.
704+ * @param serverClass redefined hbase.regionserver.class
705+ * @param serverImpl redefined hbase.regionserver.impl
706+ * @param addDependencyJars upload HBase jars and jars for any of the configured job classes via
707+ * the distributed cache (tmpjars).
708+ * @throws IOException When determining the region count fails.
709+ * @deprecated Since 2.5.9, 2.6.1, 2.7.0, will be removed in 4.0.0. The {@code serverClass} and
710+ * {@code serverImpl} do not take effect any more, just use
711+ * {@link #initTableReducerJob(String, Class, Job, Class, String, boolean)} instead.
712+ * @see #initTableReducerJob(String, Class, Job, Class, String, boolean)
713+ */
714+ @ Deprecated
715+ public static void initTableReducerJob (String table , Class <? extends TableReducer > reducer ,
716+ Job job , Class partitioner , String quorumAddress , String serverClass , String serverImpl ,
717+ boolean addDependencyJars ) throws IOException {
718+ initTableReducerJob (table , reducer , job , partitioner , quorumAddress , addDependencyJars );
719+ }
720+
666721 /**
667722 * Ensures that the given number of reduce tasks for the given job configuration does not exceed
668723 * the number of regions for the given table.
0 commit comments