abstract class AbstractSplit extends Object implements Callable<Integer>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractSplit.CountingWriter
Counting writer.
|
| Modifier and Type | Field and Description |
|---|---|
protected long |
bytes
Split the input path at the next record after each n bytes, if any.
|
protected Path |
inputPath
Input path, if any.
|
protected long |
records
Split the input path after each n records, if any.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSplit(Path inputPath,
Long bytes,
Long records,
String prefix,
int leftPad,
String suffix)
Abstract split callable.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeWriters()
Attempt to close writers created by createCountingWriter.
|
protected AbstractSplit.CountingWriter |
createCountingWriter(int n)
Create and return a new CountingWriter for a file name consisting
of
prefix + n + suffix. |
(package private) static String |
getFileExtension(Path path) |
(package private) static String |
getNameWithoutExtension(Path path) |
protected String |
leftPad(int n)
Left pad the specified split index.
|
(package private) static long |
toBytes(String b)
Parse the specified byte string (e.g.
|
protected final Path inputPath
protected final long bytes
protected final long records
protected AbstractSplit(Path inputPath, Long bytes, Long records, String prefix, int leftPad, String suffix)
inputPath - input path, if anybytes - split the input path at next record after each n bytes, if anyrecords - split the input path after each n records, if anyprefix - output file prefix, must not be nullleftPad - left pad split index in output file namesuffix - output file suffix, must not be nullprotected final void closeWriters()
protected final String leftPad(int n)
n - split index to left padprotected final AbstractSplit.CountingWriter createCountingWriter(int n)
prefix + n + suffix.n - nprefix + n + suffixstatic long toBytes(String b)
100gb) into a
long number of bytes.b - byte string to parse, must not be null or emptyCopyright (c) 2013-2023 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).