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 ;
  • 相关阅读:
    转 GFlags 使用详解
    printf 格式输出
    XCODE unknown type name __declspec 错误的解决方法
    Boost提示'cl' 不是内部或外部命令,也不是可运行的程序 或批处理文件
    DOLServer
    游戏AI的开发框架组件 behaviac
    mongodb 数据导入和导出
    Makefile经典教程
    g++ 编译动态链接库和静态链接库
    excel 公式
  • 原文地址:https://www.cnblogs.com/yanghaolie/p/14323121.html
Copyright © 2011-2022 走看看