public class LocalStore extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPRESSION_SUFFIX |
static char |
FIELD_SEPARATOR |
static char |
RECORD_SEPARATOR |
static int |
UPLOAD_INTERVAL |
| Constructor and Description |
|---|
LocalStore()
Create an instance of the class and read the configuration
file to determine some output parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the temporary local file
|
static void |
copyToHDFS(String localFile,
String hdfsFile)
Copy a local file to HDFS
|
void |
insert(EventRecord er)
Insert an EventRecord to the local storage, after it
gets serialized and anonymized.
|
void |
insert(EventRecord[] ers)
Insert an array of EventRecords to the local storage, after they
get serialized and anonymized.
|
static StringBuffer |
pack(SerializedRecord sr)
Pack a SerializedRecord into an array of bytes
|
void |
upload()
Upload the local file store into HDFS, after it
compressing it.
|
static void |
zipCompress(String filename)
Compress a text file using the ZIP compressing algorithm.
|
public static final char FIELD_SEPARATOR
public static final char RECORD_SEPARATOR
public static final String COMPRESSION_SUFFIX
public static final int UPLOAD_INTERVAL
public LocalStore()
public void insert(EventRecord er)
er - the EventRecord to be insertedpublic void insert(EventRecord[] ers)
ers - the array of EventRecords to be insertedpublic static StringBuffer pack(SerializedRecord sr)
sr - the SerializedRecord to be packedpublic void upload()
public static void zipCompress(String filename) throws IOException
filename - the path to the file to be compressedIOExceptionpublic static void copyToHDFS(String localFile, String hdfsFile) throws IOException
localFile - the filename of the local filehdfsFile - the HDFS filename to copy toIOExceptionpublic void close()
Copyright © 2009 The Apache Software Foundation