/** * Add contents of an iterable (a collection or a DataBag) * * @param iterable a Collection or DataBag to add contents of */ public void addAll(Iterable<Tuple> iterable) { synchronized (mContents) { for (Tuple t : iterable) { add(t); } } }
/** * Read a bag from disk. * @param in DataInput to read data from. * @throws IOException (passes it on from underlying calls). */ @Override public void readFields(DataInput in) throws IOException { long size = in.readLong(); for (long i = 0; i < size; i++) { try { Object o = sedes.readDatum(in); add((Tuple)o); } catch (ExecException ee) { throw ee; } } }