public final class FileLoader
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <any> |
openFilePart(java.lang.String fileName,
long startOffSet,
int maxSize,
MessageType keyType,
MessageType dataType,
KryoSerializer deserializer) |
static OpenFilePart |
openPart(java.lang.String fileName,
long startOffSet,
long maxSize,
MessageType keyType,
MessageType dataType,
KryoSerializer deserializer)
Reads a file part upto max size from start offset
|
static OpenFile |
openSavedPart(java.lang.String fileName)
Open a saved part and load it as a memory mapped file
|
static OpenFile |
openSavedPart(java.lang.String fileName,
long position,
long length)
Open a saved part and load it as a memory mapped file
|
static java.util.List<java.lang.Object> |
readFile(java.lang.String fileName,
MessageType dataType,
KryoSerializer deserializer) |
static java.util.List<Tuple> |
readFile(java.lang.String fileName,
MessageType keyType,
MessageType dataType,
KryoSerializer deserializer) |
static long |
saveKeyValues(java.util.List<Tuple> records,
java.util.List<java.lang.Integer> sizes,
long size,
java.lang.String outFileName,
MessageType keyType)
Save the list of records to the file system
|
static long |
saveKeyValues(java.util.List<Tuple> records,
long size,
java.lang.String outFileName,
MessageType keyType)
This method accepts a Array of lists instead of a list of tuples
|
static void |
saveObjects(java.util.List<byte[]> records,
java.util.List<java.lang.Integer> sizes,
long size,
java.lang.String outFileName)
Save the list of records to the file system
|
static void |
saveSizes(java.util.List<java.lang.Integer> sizes,
java.lang.String outFileName)
Save the list of records to the file system
|
public static void saveObjects(java.util.List<byte[]> records, java.util.List<java.lang.Integer> sizes, long size, java.lang.String outFileName)
records
- records to be writtensize
- total size of the recordsoutFileName
- out file namepublic static long saveKeyValues(java.util.List<Tuple> records, java.util.List<java.lang.Integer> sizes, long size, java.lang.String outFileName, MessageType keyType)
records
- records to be writtensize
- total size of the recordsoutFileName
- out file namepublic static long saveKeyValues(java.util.List<Tuple> records, long size, java.lang.String outFileName, MessageType keyType)
public static java.util.List<Tuple> readFile(java.lang.String fileName, MessageType keyType, MessageType dataType, KryoSerializer deserializer)
public static java.util.List<java.lang.Object> readFile(java.lang.String fileName, MessageType dataType, KryoSerializer deserializer)
public static <any> openFilePart(java.lang.String fileName, long startOffSet, int maxSize, MessageType keyType, MessageType dataType, KryoSerializer deserializer)
public static OpenFilePart openPart(java.lang.String fileName, long startOffSet, long maxSize, MessageType keyType, MessageType dataType, KryoSerializer deserializer)
fileName
- namestartOffSet
- start offset in bytesmaxSize
- max size to readkeyType
- key typedataType
- data typedeserializer
- the deserializerpublic static void saveSizes(java.util.List<java.lang.Integer> sizes, java.lang.String outFileName)
outFileName
- out file namepublic static OpenFile openSavedPart(java.lang.String fileName)
fileName
- name of the filepublic static OpenFile openSavedPart(java.lang.String fileName, long position, long length)
fileName
- name of the fileposition
- the position to start readinglength
- length of the bytes to read