Java Code Examples for org.apache.hadoop.io.LongWritable#compareTo()
The following examples show how to use
org.apache.hadoop.io.LongWritable#compareTo() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestOldCombinerGrouping.java From hadoop with Apache License 2.0 | 5 votes |
@Override public void reduce(Text key, Iterator<LongWritable> values, OutputCollector<Text, LongWritable> output, Reporter reporter) throws IOException { LongWritable maxValue = null; while (values.hasNext()) { LongWritable value = values.next(); if (maxValue == null) { maxValue = value; } else if (value.compareTo(maxValue) > 0) { maxValue = value; } } output.collect(key, maxValue); }
Example 2
Source File: TestNewCombinerGrouping.java From hadoop with Apache License 2.0 | 5 votes |
@Override protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException { LongWritable maxValue = null; for (LongWritable value : values) { if (maxValue == null) { maxValue = value; } else if (value.compareTo(maxValue) > 0) { maxValue = value; } } context.write(key, maxValue); }
Example 3
Source File: TestOldCombinerGrouping.java From big-c with Apache License 2.0 | 5 votes |
@Override public void reduce(Text key, Iterator<LongWritable> values, OutputCollector<Text, LongWritable> output, Reporter reporter) throws IOException { LongWritable maxValue = null; while (values.hasNext()) { LongWritable value = values.next(); if (maxValue == null) { maxValue = value; } else if (value.compareTo(maxValue) > 0) { maxValue = value; } } output.collect(key, maxValue); }
Example 4
Source File: TestNewCombinerGrouping.java From big-c with Apache License 2.0 | 5 votes |
@Override protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException { LongWritable maxValue = null; for (LongWritable value : values) { if (maxValue == null) { maxValue = value; } else if (value.compareTo(maxValue) > 0) { maxValue = value; } } context.write(key, maxValue); }
Example 5
Source File: find_nth_mapper.java From MLHadoop with Apache License 2.0 | 5 votes |
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { String[] input = value.toString().split("\\t"); if (!input[0].contains(",")) { LongWritable rowKey = new LongWritable(Long.valueOf(input[0])); if (rowKey.compareTo(this.nthKey) == 0) { this.nthValue = new Text(input[1]); } } }