public class InternalUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean isValid)
Precondition-style validation that throws
IllegalArgumentException. |
static void |
checkArgument(boolean isValid,
java.lang.String message)
Precondition-style validation that throws
IllegalArgumentException. |
static Row |
getScanFileRow(FileStatus fileStatus) |
static <T> java.util.Optional<T> |
getSingularElement(CloseableIterator<T> iter)
Utility method to read at most one element from a
CloseableIterator. |
static java.util.Optional<Row> |
getSingularRow(CloseableIterator<FileDataReadResult> dataIter)
Utility method to read at most one row from the given data
FileDataReadResult iterator. |
public static Row getScanFileRow(FileStatus fileStatus)
public static java.util.Optional<Row> getSingularRow(CloseableIterator<FileDataReadResult> dataIter) throws java.io.IOException
FileDataReadResult iterator.
If there is more than one row, an exception will be thrown.dataIter - java.io.IOExceptionpublic static <T> java.util.Optional<T> getSingularElement(CloseableIterator<T> iter) throws java.io.IOException
CloseableIterator.
If there is more than element row, an exception will be thrown.java.io.IOExceptionpublic static void checkArgument(boolean isValid)
throws java.lang.IllegalArgumentException
IllegalArgumentException.isValid - true if valid, false if an exception should be thrownjava.lang.IllegalArgumentException - if isValid is falsepublic static void checkArgument(boolean isValid,
java.lang.String message)
throws java.lang.IllegalArgumentException
IllegalArgumentException.isValid - true if valid, false if an exception should be thrownmessage - A String message for the exception.java.lang.IllegalArgumentException - if isValid is false