Refine search
@Override public LongWritable add(LongWritable t1, LongWritable t2) { if (t1 == null && t2 == null) return null; return new LongWritable((t1 == null ? 0 : t1.get()) + (t2 == null ? 0 : t2.get())); }
public void addToStat(String statType, long amount) { LongWritable currentValue = statsMap.get(statType); if (currentValue == null) { statsMap.put(statType, new LongWritable(amount)); } else { currentValue.set(currentValue.get() + amount); } }
@Override public LongWritable minus(LongWritable t1, LongWritable t2) { if (t1 == null && t2 == null) return null; return new LongWritable((t1 == null ? 0 : t1.get()) - (t2 == null ? 0 : t2.get())); }
public void addToStat(String statType, long amount) { LongWritable currentValue = statsMap.get(statType); if (currentValue == null) { statsMap.put(statType, new LongWritable(amount)); } else { currentValue.set(currentValue.get() + amount); } }
@Override public LongWritable add(LongWritable t1, LongWritable t2) { if (t1 == null && t2 == null) return null; return new LongWritable((t1 == null ? 0 : t1.get()) + (t2 == null ? 0 : t2.get())); }
/** * Increment the State object with o as the key, and i as the count. */ private static void increment(State s, LongWritable o, long i) { if (s.counts == null) { s.counts = new HashMap<LongWritable, LongWritable>(); } LongWritable count = s.counts.get(o); if (count == null) { // We have to create a new object, because the object o belongs // to the code that creates it and may get its value changed. LongWritable key = new LongWritable(); key.set(o.get()); s.counts.put(key, new LongWritable(i)); } else { count.set(count.get() + i); } }
@Override public LongWritable minus(LongWritable t1, LongWritable t2) { if (t1 == null && t2 == null) return null; return new LongWritable((t1 == null ? 0 : t1.get()) - (t2 == null ? 0 : t2.get())); }
/** * Increment the State object with o as the key, and i as the count. */ private static void increment(State s, LongWritable o, long i) { if (s.counts == null) { s.counts = new HashMap<LongWritable, LongWritable>(); } LongWritable count = s.counts.get(o); if (count == null) { // We have to create a new object, because the object o belongs // to the code that creates it and may get its value changed. LongWritable key = new LongWritable(); key.set(o.get()); s.counts.put(key, new LongWritable(i)); } else { count.set(count.get() + i); } }
LazyBinaryLong(LazyBinaryLong copy) { super(copy); data = new LongWritable(copy.data.get()); }
LongWritable val = sizes.get(host); if (val == null) { val = new LongWritable(); sizes.put(host, val); val.set(val.get() + overlap); maxSize = Math.max(maxSize, val.get()); for(String host: block.getHosts()) { if (sizes.containsKey(host)) { if (sizes.get(host).get() >= threshold) { hostList.add(host);
@Override public Object copyObject(Object o) { return o == null ? null : new LongWritable(((LongWritable) o).get()); }
LongWritable val = sizes.get(host); if (val == null) { val = new LongWritable(); sizes.put(host, val); val.set(val.get() + overlap); maxSize = Math.max(maxSize, val.get()); for(String host: block.getHosts()) { if (sizes.containsKey(host)) { if (sizes.get(host).get() >= threshold) { hostList.add(host);
public LazyLong(LazyLong copy) { super(copy); data = new LongWritable(copy.data.get()); }