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 ;
  • 相关阅读:
    桂电在线-转变成bootstrap版
    PHP开发APP接口---返回数据的封装类
    angularjs入门整理
    桂电在线_微信公众平台开发之-运用angularjs显示学校公告新闻列表和详情页面
    AngularJS学习-初识
    Nonsense Alphabet
    Even and Odd Functions
    研究生应该怎么学习?
    王菲观点
    Paul and Joyce are going to a movie(More listening of Unit 2)
  • 原文地址:https://www.cnblogs.com/yanghaolie/p/14323121.html
Copyright © 2011-2022 走看看