Package org.apache.parquet.util
Class AutoCloseables
java.lang.Object
org.apache.parquet.util.AutoCloseables
Utility class to handle
AutoCloseable objects.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
close
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
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
Works similarly toclose(Iterable)but it wraps the thrown exception (if any) into aAutoCloseables.ParquetCloseResourceException.
-