@PublicEvolving public final class Utils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> E |
doWithCleanupOnException(Closeable toCleanUp,
org.apache.flink.util.function.SupplierWithException<E,IOException> code)
Runs the given
SupplierWithException (a piece of code producing a result). |
static void |
doWithCleanupOnException(Closeable toCleanUp,
org.apache.flink.util.function.ThrowingRunnable<IOException> code)
Runs the given
Runnable. |
static <T> void |
forEachRemaining(BulkFormat.Reader<T> reader,
java.util.function.Consumer<? super T> action)
Performs the given action for each remaining element in
BulkFormat.Reader until all
elements have been processed or the action throws an exception. |
public static <E> E doWithCleanupOnException(Closeable toCleanUp, org.apache.flink.util.function.SupplierWithException<E,IOException> code) throws IOException
SupplierWithException (a piece of code producing a result). If an
exception happens during that, the given closable is quietly closed.IOExceptionpublic static void doWithCleanupOnException(Closeable toCleanUp, org.apache.flink.util.function.ThrowingRunnable<IOException> code) throws IOException
Runnable. If an exception happens during that, the given closable is
quietly closed.IOExceptionpublic static <T> void forEachRemaining(BulkFormat.Reader<T> reader, java.util.function.Consumer<? super T> action) throws IOException
BulkFormat.Reader until all
elements have been processed or the action throws an exception.IOExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.