5960616263646566
@Override public void close() { try { out.close() ; } catch (IOException e) { new AtlasException(e) ; } }
82838485868788
this.comparator = comparator; } protected void checkClosed() { if (closed) throw new AtlasException("SortedDataBag is closed, no operations can be performed on it.") ; }
102103104105106107108109110111112
@Override public void add(E item) { checkClosed(); if (finishedAdding) throw new AtlasException("SortedDataBag: Cannot add any more items after the writing phase is complete."); if (policy.isThresholdExceeded()) { spill(); }
129130131132133134135136137138139
{ out = getSpillStream(); } catch (IOException e) { throw new AtlasException(e); } // Sort the tuples // Collections.sort() will copy to an array, sort, and then copy back. Avoid that // extra copy by copying to an array and using Arrays.sort(). Also it lets us use
230231232233234235236237238239240
for (Iterator<E> it : inputs) { Iter.close(it); } throw new AtlasException("Cannot find one of the spill files", e); } } SpillSortIterator<E> ssi = new SpillSortIterator<E>(inputs, comparator); registerCloseableIterator(ssi);
293294295296297298299300
memory = new ArrayList<E>() ; } } catch (IOException e) { throw new AtlasException(e) ; } }
132133134135136137138
public static PeekReader open(String filename) { try { InputStream in = new FileInputStream(filename) ; return makeUTF8(in) ; } catch (FileNotFoundException ex){ throw new AtlasException("File not found: "+filename) ; } }
137138139140141142143144145146147
{ in.close(); } catch (IOException e) { uncaughtException = new AtlasException("Error closing input stream", e); } } } }); readThread.start();
68697071727374757677
if ( i == off ) return -1 ; return (i-off) ; } if ( x > 128 ) throw new AtlasException("Illegal ASCII character : "+x) ; cbuf[i] = (char)x ; } return len ; }
73747576777879
this.serializationFactory = serializerFactory; } private void checkClosed() { if (closed) throw new AtlasException("DefaultDataBag is closed, no operations can be performed on it.") ; }