Package org.apache.parquet.util
Class AutoCloseables
- java.lang.Object
-
- org.apache.parquet.util.AutoCloseables
-
public final class AutoCloseables extends Object
Utility class to handleAutoCloseableobjects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAutoCloseables.ParquetCloseResourceException
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose(AutoCloseable... autoCloseables)Invokes theAutoCloseable.close()method of each specified objects in a way that guarantees that all the methods will be invoked even if an exception is occurred before.static voidclose(Iterable<? extends AutoCloseable> autoCloseables)Invokes theAutoCloseable.close()method of each specified objects in a way that guarantees that all the methods will be invoked even if an exception is occurred before.static voiduncheckedClose(AutoCloseable... autoCloseables)Works similarly toclose(Iterable)but it wraps the thrown exception (if any) into aAutoCloseables.ParquetCloseResourceException.static voiduncheckedClose(Iterable<? extends AutoCloseable> autoCloseables)Works similarly toclose(Iterable)but it wraps the thrown exception (if any) into aAutoCloseables.ParquetCloseResourceException.
-
-
-
Method Detail
-
close
public static void close(Iterable<? extends AutoCloseable> autoCloseables) throws Throwable
Invokes theAutoCloseable.close()method of each specified objects in a way that guarantees that all the methods will be invoked even if an exception is occurred before. It also gracefully handlesnullAutoCloseableinstances by skipping them.
-
close
public static void close(AutoCloseable... autoCloseables) throws Throwable
Invokes theAutoCloseable.close()method of each specified objects in a way that guarantees that all the methods will be invoked even if an exception is occurred before. It also gracefully handlesnullAutoCloseableinstances by skipping them.
-
uncheckedClose
public static void uncheckedClose(Iterable<? extends AutoCloseable> autoCloseables) throws AutoCloseables.ParquetCloseResourceException
Works similarly toclose(Iterable)but it wraps the thrown exception (if any) into aAutoCloseables.ParquetCloseResourceException.
-
uncheckedClose
public static void uncheckedClose(AutoCloseable... autoCloseables)
Works similarly toclose(Iterable)but it wraps the thrown exception (if any) into aAutoCloseables.ParquetCloseResourceException.
-
-