zoukankan      html  css  js  c++  java
  • just a demo

    <!-- demodemo.xml -->
    <
    dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-core</artifactId> <version>2.7.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-hdfs</artifactId> <version>2.7.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>2.7.0</version> </dependency> <profiles> <profile> <id>id11111</id> <properties> <jar.name>xxxxx</jar.name> <main.class>mainxxxxx</main.class> <java.version>1.8</java.version> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib</classpathPrefix> <!-- main函数 --> <mainClass>${main.class}</mainClass> </manifest> </archive> <includes> <include>com/rs/java/core/*.class</include> <include>**/*.properties</include> </includes> </configuration> </plugin> </plugins> </build> </profile> </profiles>

    java  demo

    Configuration conf = new Configuration();
    String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
    
    Job job = Job.getInstance(conf, "jboname");
    job.setJarByClass(AAA.class);
    job.setOutputValueClass(Text.class);
    job.setOutputKeyClass(Text.class);
    job.setMapperClass(FirstMapper.class); //模式1,数据一天跑一次
    job.setCombinerClass(FirstComb.class);
    job.setReducerClass(FirstReducer.class);
    job.setInputFormatClass(CombineSmallfileInputFormat.class);
    FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
    FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));
    if(!job.waitForCompletion(true)) return ;
  • 相关阅读:
    android打包so文件到apk
    source build/envsetup.sh 之后
    android 应用程序 集合
    dedecms模块支持系统标签
    php中的两个DI解决方案
    yii快速入门与参考
    [ZT] 使用PHPFPM (PHP FastCGI Process Manager)来对phpcgi进程进行管理
    [转]VLD扩展使用指南
    织梦CMS安装路径问题
    php+mysql中存储过程性能简单比较
  • 原文地址:https://www.cnblogs.com/yanghaolie/p/14323121.html
Copyright © 2011-2022 走看看