@Override public void close() throws IOException { yielder.close(); } };
@Override public void close() throws IOException { rowYielder.close(); }
@Override public void close() throws IOException { yielder.close(); } }
@Override public void close() throws IOException { try (Closeable toClose = yielderYielder) { yielder.close(); } } };
@Override public void close() throws IOException { yielder.close(); } };
@Override public void close() throws IOException { baseYielder.close(); } };
@Override public void close() throws IOException { boolean done = isDone(); Throwable thrown = null; try { baseYielder.close(); } catch (Throwable t) { thrown = t; throw t; } finally { if (done) { if (thrown != null) { try { executor.execute(runnable); } catch (Throwable t) { thrown.addSuppressed(t); } } else { executor.execute(runnable); } } } } }
@Override public void serialize(Yielder yielder, final JsonGenerator jgen, SerializerProvider provider) throws IOException { try { jgen.writeStartArray(); while (!yielder.isDone()) { final Object o = yielder.get(); jgen.writeObject(o); yielder = yielder.next(null); } jgen.writeEndArray(); } finally { yielder.close(); } } }
theYielder.close();
yielderYielder.close();
@Override public void close() throws IOException { boolean isDone; try { isDone = isDone(); baseYielder.close(); } catch (Throwable t) { // Close on failure try { wrapper.after(false, t); } catch (Exception e) { t.addSuppressed(e); } Throwables.propagateIfInstanceOf(t, IOException.class); throw Throwables.propagate(t); } // "Normal" close try { wrapper.after(isDone, null); } catch (Exception e) { Throwables.propagateIfInstanceOf(e, IOException.class); throw Throwables.propagate(e); } } }
@Override public Yielder<T> accumulate(Yielder<T> accumulated, Sequence<T> in) { final Yielder<T> retVal = in.toYielder( null, new YieldingAccumulator<T, T>() { @Override public T accumulate(T accumulated, T in) { yield(); return in; } } ); if (retVal.isDone()) { try { retVal.close(); } catch (IOException e) { throw Throwables.propagate(e); } return null; } else { yield(); } return retVal; } }
} else { try { yielder.close();
if (yielder.isDone()) { try { yielder.close();
OutType nextInit = yielder.get(); try { yielder.close();
public <OutType> Yielder<OutType> makeYielder( Yielder<Sequence<T>> yielderYielder, OutType initValue, YieldingAccumulator<OutType, T> accumulator ) { while (!yielderYielder.isDone()) { Yielder<OutType> yielder = yielderYielder.get().toYielder(initValue, accumulator); if (accumulator.yielded()) { return wrapYielder(yielder, yielderYielder, accumulator); } initValue = yielder.get(); try { yielder.close(); } catch (IOException e) { throw Throwables.propagate(e); } yielderYielder = yielderYielder.next(null); } return Yielders.done(initValue, yielderYielder); }
yielder.close();
yielder.close();
yielder.close(); Assert.assertEquals(2, closedCount[0]);
yielder.close();