HBASE-18698 MapreduceDependencyClasspathTool does not include hbase-server as a dependency

Move Driver to be the main-class in hbase-mapreduce jar rather than
in the hbase-server jar.

Reference the hbase-server and shaded protobuf so they get bundled
when you do 'hbase mapredcp'.
This commit is contained in:
Michael Stack 2017-08-28 22:14:49 -07:00 committed by Michael Stack
parent 72bb96076e
commit 74c517a8bc
5 changed files with 19 additions and 10 deletions

View File

@ -52,6 +52,20 @@
<skipAssembly>true</skipAssembly> <skipAssembly>true</skipAssembly>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<!--Include the Driver class as the 'main'.
Executing the jar will then show a list of the basic MR jobs.
-->
<mainClass>org/apache/hadoop/hbase/mapreduce/Driver</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<!-- Testing plugins --> <!-- Testing plugins -->
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -362,8 +362,6 @@ public class TableMapReduceUtil {
org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil.addHBaseDependencyJars(job); org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil.addHBaseDependencyJars(job);
org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil.addDependencyJarsForClasses( org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil.addDependencyJarsForClasses(
job, job,
// when making changes here, consider also mapreduce.TableMapReduceUtil
// pull job classes
job.getMapOutputKeyClass(), job.getMapOutputKeyClass(),
job.getMapOutputValueClass(), job.getMapOutputValueClass(),
job.getOutputKeyClass(), job.getOutputKeyClass(),

View File

@ -51,9 +51,9 @@ public class Driver {
pgd.addClass(CopyTable.NAME, CopyTable.class, pgd.addClass(CopyTable.NAME, CopyTable.class,
"Export a table from local cluster to peer cluster."); "Export a table from local cluster to peer cluster.");
pgd.addClass(VerifyReplication.NAME, VerifyReplication.class, "Compare" + pgd.addClass(VerifyReplication.NAME, VerifyReplication.class, "Compare" +
" the data from tables in two different clusters. WARNING: It" + " data from tables in two different clusters. It" +
" doesn't work for incrementColumnValues'd cells since the" + " doesn't work for incrementColumnValues'd cells since" +
" timestamp is changed after being appended to the log."); " timestamp is changed after appending to WAL.");
pgd.addClass(WALPlayer.NAME, WALPlayer.class, "Replay WAL files."); pgd.addClass(WALPlayer.NAME, WALPlayer.class, "Replay WAL files.");
pgd.addClass(ExportSnapshot.NAME, ExportSnapshot.class, "Export" + pgd.addClass(ExportSnapshot.NAME, ExportSnapshot.class, "Export" +
" the specific snapshot to a given FileSystem."); " the specific snapshot to a given FileSystem.");

View File

@ -784,6 +784,7 @@ public class TableMapReduceUtil {
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.class, // hbase-protocol org.apache.hadoop.hbase.protobuf.generated.ClientProtos.class, // hbase-protocol
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.class, // hbase-protocol-shaded org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.class, // hbase-protocol-shaded
org.apache.hadoop.hbase.client.Put.class, // hbase-client org.apache.hadoop.hbase.client.Put.class, // hbase-client
org.apache.hadoop.hbase.ipc.RpcServer.class, // hbase-server
org.apache.hadoop.hbase.CompatibilityFactory.class, // hbase-hadoop-compat org.apache.hadoop.hbase.CompatibilityFactory.class, // hbase-hadoop-compat
org.apache.hadoop.hbase.mapreduce.JobUtil.class, // hbase-hadoop2-compat org.apache.hadoop.hbase.mapreduce.JobUtil.class, // hbase-hadoop2-compat
org.apache.hadoop.hbase.mapreduce.TableMapper.class, // hbase-server org.apache.hadoop.hbase.mapreduce.TableMapper.class, // hbase-server
@ -794,6 +795,7 @@ public class TableMapReduceUtil {
org.apache.zookeeper.ZooKeeper.class, org.apache.zookeeper.ZooKeeper.class,
org.apache.hadoop.hbase.shaded.io.netty.channel.Channel.class, org.apache.hadoop.hbase.shaded.io.netty.channel.Channel.class,
com.google.protobuf.Message.class, com.google.protobuf.Message.class,
org.apache.hadoop.hbase.shaded.com.google.protobuf.UnsafeByteOperations.class,
org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists.class, org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists.class,
org.apache.htrace.Trace.class, org.apache.htrace.Trace.class,
com.codahale.metrics.MetricRegistry.class); com.codahale.metrics.MetricRegistry.class);

View File

@ -117,11 +117,6 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<configuration> <configuration>
<archive>
<manifest>
<mainClass>org/apache/hadoop/hbase/mapreduce/Driver</mainClass>
</manifest>
</archive>
<!-- Exclude these 2 packages, because their dependency _binary_ files <!-- Exclude these 2 packages, because their dependency _binary_ files
include the sources, and Maven 2.2 appears to add them to the sources to compile, include the sources, and Maven 2.2 appears to add them to the sources to compile,
weird --> weird -->