public void writeVLong(VLongWritable vlw) throws IOException { out.writeLong(vlw.get()); }
return ((VLongWritable) writable).get();
VLongWritable vlong = new VLongWritable(); vlong.readFields(in); return vlong.get();
generator.writeNumber(((VLongWritable) writable).get());
public long getCount() { return count.get(); }
public void writeVLong(VLongWritable vlw) throws IOException { out.writeLong(vlw.get()); }
public void writeVLong(VLongWritable vlw) throws IOException { out.writeLong(vlw.get()); }
public void writeVLong(VLongWritable vlw) throws IOException { out.writeLong(vlw.get()); }
public void writeVLong(VLongWritable vlw) throws IOException { out.writeLong(vlw.get()); }
public void writeVLong(VLongWritable vlw) throws IOException { out.writeLong(vlw.get()); }
public void writeVLong(VLongWritable vlw) throws IOException { out.writeLong(vlw.get()); }
@Override public void reduce(LongWritable key, Iterable<VLongWritable> values, Context context) throws IOException, InterruptedException { int defCount = 0; refs.clear(); for (VLongWritable type : values) { if (type.get() == -1) { defCount++; } else { refs.add(type.get()); } } if (defCount == 0 && refs.size() > 0) { StringBuilder sb = new StringBuilder(); String comma = ""; for (Long ref : refs) { sb.append(comma); comma = ","; sb.append(new String(ContinuousIngest.genRow(ref), UTF_8)); } context.write(new Text(ContinuousIngest.genRow(key.get())), new Text(sb.toString())); context.getCounter(Counts.UNDEFINED).increment(1l); } else if (defCount > 0 && refs.size() == 0) { context.getCounter(Counts.UNREFERENCED).increment(1l); } else { context.getCounter(Counts.REFERENCED).increment(1l); } } }
public LinkedList<FieldStat> scanResults(Iterable<Entry<Key,Value>> data) { LinkedList<FieldStat> stats = new LinkedList<>(); IndexStatsRecord tuple = new IndexStatsRecord(); for (Entry<Key,Value> kv : data) { if (log.isDebugEnabled()) { log.debug("Received key " + kv.getKey().toStringNoTime()); } String field = kv.getKey().getRow().toString(); long unique, total; double selectivity; try { tuple.readFields(new DataInputStream(new ByteArrayInputStream(kv.getValue().get()))); } catch (IOException e) { log.error("Could not parse value for " + field, e); continue; } unique = tuple.getNumberOfUniqueWords().get(); total = tuple.getWordCount().get(); selectivity = ((double) unique) / ((double) total); FieldStat fs = new FieldStat(); fs.field = field; fs.unique = unique; fs.observed = total; fs.selectivity = selectivity; stats.add(fs); } return stats; }
@Override public void readFields(DataInput in) throws IOException { areDurationsReady = false; fileName = in.readUTF(); VLongWritable eventCount = new VLongWritable(); eventCount.readFields(in); this.eventCount = eventCount.get(); ArrayWritable phases = new ArrayWritable(Phase.class); phases.readFields(in); this.phases = makeList(phases.get()); }
return ValueFactory.newValue(valueType, ((VIntWritable)value).get()); } else if (value instanceof VLongWritable) { return ValueFactory.newValue(valueType, ((VLongWritable)value).get()); } else if (value instanceof BooleanWritable) { return ValueFactory.newValue(valueType, ((BooleanWritable)value).get());
@Override public void readFields(DataInput in) throws IOException { VLongWritable count = new VLongWritable(); count.readFields(in); this.count = count.get(); VIntWritable nUidsReader = new VIntWritable(); nUidsReader.readFields(in); final int nUids = nUidsReader.get(); ImmutableSortedSet.Builder<IndexMatch> setBuilder = ImmutableSortedSet.naturalOrder(); for (int i = 0; i < nUids; ++i) { IndexMatch index = new IndexMatch(); index.readFields(in); setBuilder.add(index); } this.uids = setBuilder.build(); }