Package io.delta.kernel.internal.util
Class Utils
Object
io.delta.kernel.internal.util.Utils
Various utility methods to help the connectors work with data objects returned by Kernel
- Since:
- 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseCloseables(AutoCloseable... closeables) Close the given one or moreAutoCloseables.static voidcloseCloseablesSilently(AutoCloseable... closeables) Close the given list ofAutoCloseableobjects.static <T> CloseableIterator<T>singletonCloseableIterator(T elem) Utility method to create a singletonCloseableIterator.static <T> CloseableIterator<T>toCloseableIterator(Iterator<T> iter) Convert aIteratortoCloseableIterator.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
singletonCloseableIterator
Utility method to create a singletonCloseableIterator.- Type Parameters:
T- Element type.- Parameters:
elem- Element to create iterator with.- Returns:
- A
CloseableIteratorwith just one element.
-
toCloseableIterator
Convert aIteratortoCloseableIterator. Useful when passing normal iterators for arguments that requireCloseableIteratortype.- Type Parameters:
T- Element type- Parameters:
iter-Iteratorinstance- Returns:
- A
CloseableIteratorwrapping the givenIterator
-
closeCloseables
Close the given one or moreAutoCloseables.AutoCloseable.close()will be called on all given non-null closeables. Will throw uncheckedRuntimeExceptionif an error occurs while closing. If multiple closeables causes exceptions in closing, the exceptions will be added as suppressed to the main exception that is thrown.- Parameters:
closeables-
-
closeCloseablesSilently
Close the given list ofAutoCloseableobjects. Any exception thrown is silently ignored.- Parameters:
closeables-
-