- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用 hadoop 框架在 Java 中编写一个应用程序,它应该给我 3 列定义为 Size 的月,定义为 iteam_size 的项目和总值。我正在实现我自己的名为 My code 的可写类,但它给了我不同的输出请谁能告诉我出了什么问题?这是我的代码:-
Mycode(自定义可写)
package com.some.writable;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable;
public class Mycode implements WritableComparable<Mycode> {
Text first;
Text second;
public Mycode(Text first, Text second) {
set(first, second);
}
public Mycode() {
set(new Text(), new Text());
}
public Mycode(String first, String second) {
set(new Text(first), new Text(second));
}
public Text getFirst() {
return first;
}
public Text getSecond() {
return second;
}
public void set(Text first, Text second) {
this.first = first;
this.second = second;
}
@Override
public void readFields(DataInput in) throws IOException {
first.readFields(in);
second.readFields(in);
}
@Override
public void write(DataOutput out) throws IOException {
first.write(out);
second.write(out);
}
@Override
public int compareTo(Mycode tp) {
int cmp = first.compareTo(tp.first);
if (cmp != 0) {
return cmp;
}
return second.compareTo(tp.second);
}
@Override
public int hashCode(){
return first.hashCode() + second.hashCode();
}
@Override
public boolean equals(Object o)
{
if(o instanceof Mycode)
{
Mycode tp = (Mycode) o;
return first.equals(tp.first) && second.equals(tp.second);
}
return false;
}
}
mywritablemapper.java(映射器类)
package com.some.writable;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
public class mywritablemapper extends
Mapper<LongWritable, Text, Mycode, IntWritable>{
static int i=-1;
static int j=-1;
Mycode n=new Mycode();
@Override
public void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException, NumberFormatException {
String[] iteam= {"NIVEA","CHICKEN","BURGER","JEANS","SHIRT","T-SHIRT","BOOKS","JACKETS","SHOES","MOBILES","PEPSI","PEN"};
String[] months = {"JAN", "FEB", "MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"};
String iteam_size= iteam[j+1];
String size= months[i+1];
String line = value.toString();
StringTokenizer st=new StringTokenizer(line," ");
String agg = new String();
while(st.hasMoreTokens())
{
agg=st.nextToken();
IntWritable a = new IntWritable(Integer.parseInt(agg));
Text z= new Text(size);
Text x =new Text(iteam_size);
n.set(z,x);
context.write(n,a);
System.out.println(n+" "+a);
}
j++;
i++;
}
}
reducer 类:-
package com.some.writable;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
public class mywritablereducer extends Reducer<Mycode, IntWritable, Text, IntWritable>{
Text ab = new Text();
public void reduce(Mycode key, Iterable<IntWritable> values, Context context)
throws IOException, InterruptedException {
int count=0;
for(IntWritable value: values)
{
count += value.get();
}
ab.set(key.toString());
context.write(ab, new IntWritable(count));
System.out.println(ab+""+count);
}
}
驱动类
package com.some.writable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;
//import com.some.iteams.Iteamreducer;
import com.some.writable.mywritablemapper;
import com.some.writable.mywritablereducer;
public class mywritabledriver {
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
String[] programArgs =
new GenericOptionsParser(conf, args).getRemainingArgs();
/*if (programArgs.length != 2) {
System.err.println("Usage: MaxTemp <in> <out>");
System.exit(2);
}*/
Job job = new Job(conf, "MycodeWritable");
job.setJarByClass(mywritabledriver.class);
job.setMapperClass(mywritablemapper.class);
job.setReducerClass(mywritablereducer.class);
job.setMapOutputKeyClass(Mycode.class);
job.setMapOutputValueClass(IntWritable.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
FileInputFormat.addInputPath(job, new Path("/home/biadmin/Record.txt"));
FileOutputFormat.setOutputPath(job, new Path("/home/biadmin/dead"));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
输出(输出应该像月份列,项目列,然后是总值)
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.job.name is deprecated. Instead, use mapreduce.job.name
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.mapoutput.key.class is deprecated. Instead, use mapreduce.map.output.key.class
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.mapoutput.value.class is deprecated. Instead, use mapreduce.map.output.value.class
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.output.key.class is deprecated. Instead, use mapreduce.job.output.key.class
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.output.value.class is deprecated. Instead, use mapreduce.job.output.value.class
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.input.dir is deprecated. Instead, use mapreduce.input.fileinputformat.inputdir
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.output.dir is deprecated. Instead, use mapreduce.output.fileoutputformat.outputdir
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
16/12/25 04:04:31 INFO Configuration.deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.job.queue.name is deprecated. Instead, use mapreduce.job.queuename
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.submit.replication is deprecated. Instead, use mapreduce.client.submit.file.replication
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.used.genericoptionsparser is deprecated. Instead, use mapreduce.client.genericoptionsparser.used
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.cache.archives is deprecated. Instead, use mapreduce.job.cache.archives
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.cache.files is deprecated. Instead, use mapreduce.job.cache.files
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
16/12/25 04:04:31 WARN mapred.JobClient: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.working.dir is deprecated. Instead, use mapreduce.job.working.dir
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.input.pathFilter.class is deprecated. Instead, use mapreduce.input.pathFilter.class
16/12/25 04:04:31 INFO input.FileInputFormat: Total input paths to process : 1
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.job.queue.name is deprecated. Instead, use mapreduce.job.queuename
16/12/25 04:04:31 INFO Configuration.deprecation: mapreduce.map.class is deprecated. Instead, use mapreduce.job.map.class
16/12/25 04:04:31 INFO Configuration.deprecation: mapreduce.reduce.class is deprecated. Instead, use mapreduce.job.reduce.class
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.local.dir is deprecated. Instead, use mapreduce.cluster.local.dir
16/12/25 04:04:31 INFO Configuration.deprecation: local.cache.size is deprecated. Instead, use mapreduce.tasktracker.cache.local.size
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.cache.files.timestamps is deprecated. Instead, use mapreduce.job.cache.files.timestamps
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.job.classpath.files is deprecated. Instead, use mapreduce.job.classpath.files
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.cache.archives.timestamps is deprecated. Instead, use mapreduce.job.cache.archives.timestamps
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.job.classpath.archives is deprecated. Instead, use mapreduce.job.classpath.archives
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.cache.localFiles is deprecated. Instead, use mapreduce.job.cache.local.files
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.cache.localArchives is deprecated. Instead, use mapreduce.job.cache.local.archives
16/12/25 04:04:31 WARN mapred.LocalJobRunner: LocalJobRunner does not support symlinking into current working dir.
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.child.tmp is deprecated. Instead, use mapreduce.task.tmp.dir
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
16/12/25 04:04:31 INFO Configuration.deprecation: user.name is deprecated. Instead, use mapreduce.job.user.name
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.job.name is deprecated. Instead, use mapreduce.job.name
16/12/25 04:04:31 INFO Configuration.deprecation: jobclient.output.filter is deprecated. Instead, use mapreduce.client.output.filter
16/12/25 04:04:31 INFO mapred.JobClient: Running job: job_local_0001
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.task.profile is deprecated. Instead, use mapreduce.task.profile
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.task.profile.maps is deprecated. Instead, use mapreduce.task.profile.maps
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.task.profile.reduces is deprecated. Instead, use mapreduce.task.profile.reduces
16/12/25 04:04:31 INFO mapred.LocalJobRunner: OutputCommitter set in config null
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.output.dir is deprecated. Instead, use mapreduce.output.fileoutputformat.outputdir
16/12/25 04:04:31 INFO mapred.LocalJobRunner: OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
16/12/25 04:04:31 INFO Counters.deprecation: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.local.dir is deprecated. Instead, use mapreduce.cluster.local.dir
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.tip.id is deprecated. Instead, use mapreduce.task.id
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.task.id is deprecated. Instead, use mapreduce.task.attempt.id
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.task.is.map is deprecated. Instead, use mapreduce.task.ismap
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.task.partition is deprecated. Instead, use mapreduce.task.partition
16/12/25 04:04:31 INFO Configuration.deprecation: mapred.job.id is deprecated. Instead, use mapreduce.job.id
16/12/25 04:04:31 INFO Configuration.deprecation: hadoop.net.static.resolutions is deprecated. Instead, use mapreduce.tasktracker.net.static.resolutions
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.working.dir is deprecated. Instead, use mapreduce.job.working.dir
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.work.output.dir is deprecated. Instead, use mapreduce.task.output.dir
16/12/25 04:04:32 INFO util.ProcessTree: setsid exited with exit code 0
16/12/25 04:04:32 INFO mapred.Task: Using ResourceCalculatorPlugin : org.apache.hadoop.util.LinuxResourceCalculatorPlugin@d935de01
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.skip.on is deprecated. Instead, use mapreduce.job.skiprecords
16/12/25 04:04:32 INFO Configuration.deprecation: io.sort.spill.percent is deprecated. Instead, use mapreduce.map.sort.spill.percent
16/12/25 04:04:32 INFO Configuration.deprecation: io.sort.mb is deprecated. Instead, use mapreduce.task.io.sort.mb
16/12/25 04:04:32 INFO mapred.MapTask: io.sort.mb = 100
16/12/25 04:04:32 INFO mapred.MapTask: data buffer = 79691776/99614720
16/12/25 04:04:32 INFO mapred.MapTask: record buffer = 262144/327680
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.output.key.comparator.class is deprecated. Instead, use mapreduce.job.output.key.comparator.class
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.mapoutput.key.class is deprecated. Instead, use mapreduce.map.output.key.class
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.mapoutput.value.class is deprecated. Instead, use mapreduce.map.output.value.class
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.compress.map.output is deprecated. Instead, use mapreduce.map.output.compress
16/12/25 04:04:32 INFO Configuration.deprecation: min.num.spills.for.combine is deprecated. Instead, use mapreduce.map.combine.minspills
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.linerecordreader.maxlength is deprecated. Instead, use mapreduce.input.linerecordreader.line.maxlength
com.some.writable.Mycode@6240ecc 92
com.some.writable.Mycode@6240ecc 34
com.some.writable.Mycode@6240ecc 100
com.some.writable.Mycode@6240ecc 100
com.some.writable.Mycode@6240ecc 11
com.some.writable.Mycode@6240ecc 399
com.some.writable.Mycode@6240ecc 200
com.some.writable.Mycode@6240ecc 100
com.some.writable.Mycode@6240ecc 23
com.some.writable.Mycode@6240ecc 45
com.some.writable.Mycode@6240ecc 12
com.some.writable.Mycode@6240ecc 89
com.some.writable.Mycode@6240ecc 200
com.some.writable.Mycode@6240ecc 100
com.some.writable.Mycode@bf256a36 200
com.some.writable.Mycode@bf256a36 293
com.some.writable.Mycode@bf256a36 12
com.some.writable.Mycode@bf256a36 200
com.some.writable.Mycode@bf256a36 214
com.some.writable.Mycode@bf256a36 34
com.some.writable.Mycode@bf256a36 45
com.some.writable.Mycode@bf256a36 12
com.some.writable.Mycode@bf256a36 65
com.some.writable.Mycode@bf256a36 29
com.some.writable.Mycode@bf256a36 11
com.some.writable.Mycode@bf256a36 53
com.some.writable.Mycode@bf256a36 39
com.some.writable.Mycode@bf256a36 50
com.some.writable.Mycode@aa5bd953 11
com.some.writable.Mycode@aa5bd953 39
com.some.writable.Mycode@aa5bd953 65
com.some.writable.Mycode@aa5bd953 54
com.some.writable.Mycode@aa5bd953 53
com.some.writable.Mycode@aa5bd953 400
com.some.writable.Mycode@aa5bd953 200
com.some.writable.Mycode@aa5bd953 300
com.some.writable.Mycode@aa5bd953 14
com.some.writable.Mycode@aa5bd953 33
com.some.writable.Mycode@aa5bd953 34
com.some.writable.Mycode@aa5bd953 11
com.some.writable.Mycode@aa5bd953 89
com.some.writable.Mycode@aa5bd953 100
com.some.writable.Mycode@5e971ac 14
com.some.writable.Mycode@5e971ac 15
com.some.writable.Mycode@5e971ac 83
com.some.writable.Mycode@5e971ac 11
com.some.writable.Mycode@5e971ac 512
com.some.writable.Mycode@5e971ac 499
com.some.writable.Mycode@5e971ac 200
com.some.writable.Mycode@5e971ac 100
com.some.writable.Mycode@5e971ac 32
com.some.writable.Mycode@5e971ac 65
com.some.writable.Mycode@5e971ac 48
com.some.writable.Mycode@5e971ac 22
com.some.writable.Mycode@5e971ac 100
com.some.writable.Mycode@5e971ac 240
com.some.writable.Mycode@669ec19 45
com.some.writable.Mycode@669ec19 32
com.some.writable.Mycode@669ec19 12
com.some.writable.Mycode@669ec19 25
com.some.writable.Mycode@669ec19 21
com.some.writable.Mycode@669ec19 65
com.some.writable.Mycode@669ec19 300
com.some.writable.Mycode@669ec19 200
com.some.writable.Mycode@669ec19 100
com.some.writable.Mycode@669ec19 65
com.some.writable.Mycode@669ec19 89
com.some.writable.Mycode@669ec19 200
com.some.writable.Mycode@669ec19 189
com.some.writable.Mycode@669ec19 0
com.some.writable.Mycode@14ebbcbe 51
com.some.writable.Mycode@14ebbcbe 23
com.some.writable.Mycode@14ebbcbe 65
com.some.writable.Mycode@14ebbcbe 98
com.some.writable.Mycode@14ebbcbe 0
com.some.writable.Mycode@14ebbcbe 24
com.some.writable.Mycode@14ebbcbe 45
com.some.writable.Mycode@14ebbcbe 12
com.some.writable.Mycode@14ebbcbe 599
com.some.writable.Mycode@14ebbcbe 52
com.some.writable.Mycode@14ebbcbe 13
com.some.writable.Mycode@14ebbcbe 53
com.some.writable.Mycode@14ebbcbe 92
com.some.writable.Mycode@14ebbcbe 1
com.some.writable.Mycode@57d97e9 143
com.some.writable.Mycode@57d97e9 41
com.some.writable.Mycode@57d97e9 244
com.some.writable.Mycode@57d97e9 43
com.some.writable.Mycode@57d97e9 50
com.some.writable.Mycode@57d97e9 25
com.some.writable.Mycode@57d97e9 100
com.some.writable.Mycode@57d97e9 56
com.some.writable.Mycode@57d97e9 192
com.some.writable.Mycode@57d97e9 52
com.some.writable.Mycode@57d97e9 22
com.some.writable.Mycode@57d97e9 100
com.some.writable.Mycode@57d97e9 41
com.some.writable.Mycode@57d97e9 41
com.some.writable.Mycode@252e0d16 53
com.some.writable.Mycode@252e0d16 55
com.some.writable.Mycode@252e0d16 100
com.some.writable.Mycode@252e0d16 41
com.some.writable.Mycode@252e0d16 21
com.some.writable.Mycode@252e0d16 289
com.some.writable.Mycode@252e0d16 33
com.some.writable.Mycode@252e0d16 15
com.some.writable.Mycode@252e0d16 35
com.some.writable.Mycode@252e0d16 395
com.some.writable.Mycode@252e0d16 11
com.some.writable.Mycode@252e0d16 400
com.some.writable.Mycode@252e0d16 0
com.some.writable.Mycode@252e0d16 14
com.some.writable.Mycode@66a1804 100
com.some.writable.Mycode@66a1804 433
com.some.writable.Mycode@66a1804 200
com.some.writable.Mycode@66a1804 100
com.some.writable.Mycode@66a1804 100
com.some.writable.Mycode@66a1804 100
com.some.writable.Mycode@66a1804 32
com.some.writable.Mycode@66a1804 22
com.some.writable.Mycode@66a1804 0
com.some.writable.Mycode@66a1804 22
com.some.writable.Mycode@66a1804 22
com.some.writable.Mycode@66a1804 11
com.some.writable.Mycode@66a1804 104
com.some.writable.Mycode@66a1804 45
com.some.writable.Mycode@dbb5e22f 11
com.some.writable.Mycode@dbb5e22f 51
com.some.writable.Mycode@dbb5e22f 22
com.some.writable.Mycode@dbb5e22f 150
com.some.writable.Mycode@dbb5e22f 31
com.some.writable.Mycode@dbb5e22f 15
com.some.writable.Mycode@dbb5e22f 24
com.some.writable.Mycode@dbb5e22f 500
com.some.writable.Mycode@dbb5e22f 200
com.some.writable.Mycode@dbb5e22f 53
com.some.writable.Mycode@dbb5e22f 192
com.some.writable.Mycode@dbb5e22f 67
com.some.writable.Mycode@dbb5e22f 240
com.some.writable.Mycode@dbb5e22f 0
com.some.writable.Mycode@63e6844 100
com.some.writable.Mycode@63e6844 0
com.some.writable.Mycode@63e6844 150
com.some.writable.Mycode@63e6844 29
com.some.writable.Mycode@63e6844 40
com.some.writable.Mycode@63e6844 70
com.some.writable.Mycode@63e6844 0
com.some.writable.Mycode@63e6844 0
com.some.writable.Mycode@63e6844 50
com.some.writable.Mycode@63e6844 200
com.some.writable.Mycode@63e6844 0
com.some.writable.Mycode@63e6844 0
com.some.writable.Mycode@63e6844 0
com.some.writable.Mycode@63e6844 205
com.some.writable.Mycode@32599 0
com.some.writable.Mycode@32599 100
com.some.writable.Mycode@32599 200
com.some.writable.Mycode@32599 300
com.some.writable.Mycode@32599 0
com.some.writable.Mycode@32599 323
com.some.writable.Mycode@32599 50
com.some.writable.Mycode@32599 0
com.some.writable.Mycode@32599 50
com.some.writable.Mycode@32599 200
com.some.writable.Mycode@32599 100
com.some.writable.Mycode@32599 0
com.some.writable.Mycode@32599 100
com.some.writable.Mycode@32599 23
16/12/25 04:04:32 INFO mapred.MapTask: Starting flush of map output
16/12/25 04:04:32 INFO mapred.MapTask: Finished spill 0
16/12/25 04:04:32 INFO mapred.Task: Task:attempt_local_0001_m_000000_0 is done. And is in the process of commiting
16/12/25 04:04:32 INFO Counters.deprecation: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
16/12/25 04:04:32 INFO mapred.LocalJobRunner:
16/12/25 04:04:32 INFO mapred.Task: Task 'attempt_local_0001_m_000000_0' done.
16/12/25 04:04:32 INFO Counters.deprecation: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
16/12/25 04:04:32 INFO mapred.Task: Using ResourceCalculatorPlugin : org.apache.hadoop.util.LinuxResourceCalculatorPlugin@77c604f7
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
16/12/25 04:04:32 INFO mapred.LocalJobRunner:
16/12/25 04:04:32 INFO Configuration.deprecation: keep.failed.task.files is deprecated. Instead, use mapreduce.task.files.preserve.failedtasks
16/12/25 04:04:32 INFO Configuration.deprecation: io.sort.factor is deprecated. Instead, use mapreduce.task.io.sort.factor
16/12/25 04:04:32 INFO mapred.Merger: Merging 1 sorted segments
16/12/25 04:04:32 INFO mapred.Merger: Down to the last merge-pass, with 1 segments left of total size: 2788 bytes
16/12/25 04:04:32 INFO mapred.LocalJobRunner:
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.output.value.groupfn.class is deprecated. Instead, use mapreduce.job.output.group.comparator.class
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.output.compress is deprecated. Instead, use mapreduce.output.fileoutputformat.compress
16/12/25 04:04:32 INFO Configuration.deprecation: mapred.textoutputformat.separator is deprecated. Instead, use mapreduce.output.textoutputformat.separator
com.some.writable.Mycode@5e971ac1941
com.some.writable.Mycode@252e0d161462
com.some.writable.Mycode@325991446
com.some.writable.Mycode@bf256a361257
com.some.writable.Mycode@6240ecc1505
com.some.writable.Mycode@57d97e91150
com.some.writable.Mycode@14ebbcbe1128
com.some.writable.Mycode@aa5bd9531403
com.some.writable.Mycode@669ec191343
com.some.writable.Mycode@63e6844844
com.some.writable.Mycode@dbb5e22f1556
com.some.writable.Mycode@66a18041291
16/12/25 04:04:32 INFO mapred.Task: Task:attempt_local_0001_r_000000_0 is done. And is in the process of commiting
16/12/25 04:04:32 INFO Counters.deprecation: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
16/12/25 04:04:32 INFO mapred.LocalJobRunner:
16/12/25 04:04:32 INFO mapred.Task: Task attempt_local_0001_r_000000_0 is allowed to commit now
16/12/25 04:04:32 INFO output.FileOutputCommitter: Saved output of task 'attempt_local_0001_r_000000_0' to file:/home/biadmin/dead
16/12/25 04:04:32 INFO mapred.LocalJobRunner: reduce > reduce
16/12/25 04:04:32 INFO mapred.Task: Task 'attempt_local_0001_r_000000_0' done.
16/12/25 04:04:32 INFO Configuration.deprecation: job.end.notification.url is deprecated. Instead, use mapreduce.job.end-notification.url
16/12/25 04:04:32 INFO mapred.JobClient: map 100% reduce 100%
16/12/25 04:04:32 INFO mapred.JobClient: Job complete: job_local_0001
16/12/25 04:04:32 INFO mapred.JobClient: Counters: 20
16/12/25 04:04:32 INFO mapred.JobClient: File System Counters
16/12/25 04:04:32 INFO mapred.JobClient: FILE: BYTES_READ=4452
16/12/25 04:04:32 INFO mapred.JobClient: FILE: BYTES_WRITTEN=198006
16/12/25 04:04:32 INFO mapred.JobClient: org.apache.hadoop.mapreduce.TaskCounter
16/12/25 04:04:32 INFO mapred.JobClient: MAP_INPUT_RECORDS=12
16/12/25 04:04:32 INFO mapred.JobClient: MAP_OUTPUT_RECORDS=168
16/12/25 04:04:32 INFO mapred.JobClient: MAP_OUTPUT_BYTES=2450
16/12/25 04:04:32 INFO mapred.JobClient: MAP_OUTPUT_MATERIALIZED_BYTES=2792
16/12/25 04:04:32 INFO mapred.JobClient: SPLIT_RAW_BYTES=94
16/12/25 04:04:32 INFO mapred.JobClient: COMBINE_INPUT_RECORDS=0
16/12/25 04:04:32 INFO mapred.JobClient: COMBINE_OUTPUT_RECORDS=0
16/12/25 04:04:32 INFO mapred.JobClient: REDUCE_INPUT_GROUPS=12
16/12/25 04:04:32 INFO mapred.JobClient: REDUCE_SHUFFLE_BYTES=0
16/12/25 04:04:32 INFO mapred.JobClient: REDUCE_INPUT_RECORDS=168
16/12/25 04:04:32 INFO mapred.JobClient: REDUCE_OUTPUT_RECORDS=12
16/12/25 04:04:32 INFO mapred.JobClient: SPILLED_RECORDS=336
16/12/25 04:04:32 INFO mapred.JobClient: CPU_MILLISECONDS=0
16/12/25 04:04:32 INFO mapred.JobClient: PHYSICAL_MEMORY_BYTES=0
16/12/25 04:04:32 INFO mapred.JobClient: VIRTUAL_MEMORY_BYTES=0
16/12/25 04:04:32 INFO mapred.JobClient: COMMITTED_HEAP_BYTES=299237376
16/12/25 04:04:32 INFO mapred.JobClient: File Input Format Counters
16/12/25 04:04:32 INFO mapred.JobClient: Bytes Read=680
16/12/25 04:04:32 INFO mapred.JobClient: org.apache.hadoop.mapreduce.lib.output.FileOutputFormat$Counter
16/12/25 04:04:32 INFO mapred.JobClient: BYTES_WRITTEN=470
我不知道我哪里做错了请查收
最佳答案
你没有在你的类中提供 toString 方法,这就是你看到的原因
com.some.writable.Mycode@63e6844 205
代替
NIVEA JAN 205
例子:
@Override
public String toString() {
return first.toString() + " " + second.toString();
}
还有一些注意事项:
31 * first.hashCode() + second.hashCode();
map
方法移动到类字段关于java - 使用 Hadoop 框架在 Java 中遇到不同的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41320000/
我们有数据(此时未分配)要转换/聚合/透视到 wazoo。 我在 www 上看了看,我问的所有答案都指向 hadoop 可扩展、运行便宜(没有 SQL 服务器机器和许可证)、快速(如果你有足够的数据)
这很明显,我们都同意我们可以将 HDFS + YARN + MapReduce 称为 Hadoop。但是,Hadoop 生态系统中的其他不同组合和其他产品会怎样? 例如,HDFS + YARN + S
如果 es-hadoop 只是连接到 HDFS 的 Hadoop 连接器,它如何支持 Hadoop 分析? 最佳答案 我假设您指的是 this project .在这种情况下,ES Hadoop 项目
看完this和 this论文,我决定我想在 MapReduce 上为大型数据集实现分布式体积渲染设置作为我的本科论文工作。 Hadoop 是一个合理的选择吗? Java 不会扼杀一些性能提升或使与 C
我一直在尝试查找有关如何通过命令行提交 hadoop 作业的信息。 我知道命令 - hadoop jar jar-file 主类输入输出 还有另一个命令,我正在尝试查找有关它的信息,但未能找到 - h
Hadoop 服务器在 Kubernetes 中。而Hadoop客户端位于外网。所以我尝试使用 kubernetes-service 来使用 Hadoop 服务器。但是 hadoop fs -put
有没有人遇到奇怪的环境问题,在调用 hadoop 命令时被迫使用 SU 而不是 SUDO? sudo su -c 'hadoop fs -ls /' hdfs Found 4 itemsdrwxr-x
在更改 mapred-site.xml 中的属性后,我给出了一个 tar.bz2 文件、.gz 和 tar.gz 文件作为输入。以上似乎都没有奏效。我假设这里发生的是 hadoop 作为输入读取的记录
如何在 Hadoop Pipes 中获取正在 hadoop 映射器 中执行的输入文件 名称? 我可以很容易地在基于 java 的 map reducer 中获取文件名,比如 FileSplit fil
我想使用 MapReduce 方法分析连续的数据流(通过 HTTP 访问),因此我一直在研究 Apache Hadoop。不幸的是,Hadoop 似乎期望以固定大小的输入文件开始作业,而不是能够在新数
名称节点可以执行任务吗?默认情况下,任务在集群的数据节点上执行。 最佳答案 假设您正在询问MapReduce ... 使用YARN,MapReduce任务在应用程序主数据库中执行,而不是在nameno
我有一个关系A包含 (zip-code). 我还有另一个关系B包含 (name:gender:zip-code) (x:m:1234) (y:f:1234) (z:m:1245) (s:f:1235)
我是hadoop地区的新手。您能帮我负责(k2,list[v2,v2,v2...])形式的输出(意味着将键及其所有关联值组合在一起)的责任是吗? 谢谢。 最佳答案 这是Hadoop的MapReduce
因此,我一直在尝试编写一个hadoop程序,该程序将输入作为一个包含许多文件的文件,并且我希望hadoop程序的输出仅是输入文件的一行。但是我还没有做到这一点。我也不想去 reducer 课。如果有人
我使用的输入文本文件的内容是 1 "Come 1 "Defects," 1 "I 1 "Information 1 "J" 2 "Plain 5 "Project 1
谁能告诉我以下grep命令的作用: $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+' 最佳答案 http:/
我不了解mapreducer的基本功能,mapreducer是否有助于将文件放入HDFS 或mapreducer仅有助于分析HDFS中现有文件中的内容 我对hadoop非常陌生,任何人都可以指导我理解
CopyFromLocal将从本地文件系统上载数据。 不要放会从任何文件上传数据,例如。本地FS,亚马逊S3 或仅来自本地fs ??? 最佳答案 请找到两个命令的用法。 put ======= Usa
我开始研究hadoop mapreduce。 我是Java和hadoop的初学者,并且了解hadoop mapreduce的编码,但是有兴趣了解它在云中的内部工作方式。 您能否分享一些很好的链接来说明
我一直在寻找Hadoop mapreduce类的类路径。我正在使用Hortonworks 2.2.4版沙箱。我需要这样的类路径来运行我的javac编译器: javac -cp (CLASS_PATH)
我是一名优秀的程序员,十分优秀!