@Override public String getValue() { if (scale == 0) return current.toString(); else return "" + (new BigDecimal(current.get()).divide(scalePower)); }
@Override public void reduce(LongWritable key, Iterator<NullWritable> values, OutputCollector<NullWritable, Text> output, Reporter reporter) throws IOException { output.collect(NullWritable.get(), new Text(key.toString())); } }
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { context.write(new Text(key.toString()), value); } }
@Override public String getValue() { if (scale == 0) return current.toString(); else return "" + (new BigDecimal(current.get()).divide(scalePower)); }
public void logStats() { for (Enum<?> e : statsMap.keySet()) { LOG.info(e.toString() + ":" + statsMap.get(e).toString()); } }
public void logStats() { if (isLogInfoEnabled) { for (String e : statsMap.keySet()) { LOG.info(e.toString() + ":" + statsMap.get(e).toString()); } } }
@Override public String apply(LongWritable input) { return input.toString(); } };
@Override public String apply(LongWritable input) { return input.toString(); } };
@Override public String toString() { return "(" + this.node.toString() + ", " + this.count.toString() + ")"; }
public void map(LongWritable key, Text value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { output.collect(new Text(key.toString()), value); }
@Override public String apply(LongWritable input) { return input.toString(); } };
@Override public String apply(LongWritable input) { return input.toString(); } };
@Override public String toString() { return "(" + this.node.toString() + ", " + this.count.toString() + ")"; }
@Override protected Text convertVertexToLine( Vertex<LongWritable, KMeansVertexValue, NullWritable> vertex) throws IOException { StringBuffer sb = new StringBuffer(vertex.getId().toString()); sb.append(delimiter); sb.append(vertex.getValue().getClusterId().toString()); return new Text(sb.toString()); }
@Override public Text convertVertexToLine(Vertex<LongWritable, IntWritable, MBMEdgeValue> vertex) throws IOException { StringBuffer sb = new StringBuffer(vertex.getId().toString()); sb.append(delimiter); sb.append(vertex.getValue()); for (Edge<LongWritable, MBMEdgeValue> edge : vertex.getEdges()) { sb.append(delimiter).append(edge.getTargetVertexId()); sb.append(delimiter).append(edge.getValue().getWeight()); // skip the state, which is always INCLUDED } return new Text(sb.toString()); } }
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { context.write(new Text(key.toString()), value); } }
@Override public void writeVertex(Vertex<LongWritable, IntWritable, FloatWritable> vertex) throws IOException, InterruptedException { getRecordWriter().write( new Text(vertex.getId().toString()), new Text(vertex.getValue().toString())); } }
@Override public void writeVertex( Vertex<LongWritable, IntWritable, FloatWritable> vertex) throws IOException, InterruptedException { getRecordWriter().write( new Text(vertex.getId().toString()), new Text(vertex.getValue().toString())); } }
public void map(LongWritable key, Text value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { output.collect(new Text(key.toString()), value); }
@Override public void writeVertex( Vertex<LongWritable, DoubleWritable, FloatWritable> vertex) throws IOException, InterruptedException { getRecordWriter().write( new Text(vertex.getId().toString()), new Text(vertex.getValue().toString())); } }