public class LocalStore
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.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(java.lang.String localFile,
java.lang.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 java.lang.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(java.lang.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 java.lang.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 java.lang.StringBuffer pack(SerializedRecord sr)
sr
- the SerializedRecord to be packedpublic void upload()
public static void zipCompress(java.lang.String filename) throws java.io.IOException
filename
- the path to the file to be compressedjava.io.IOException
public static void copyToHDFS(java.lang.String localFile, java.lang.String hdfsFile) throws java.io.IOException
localFile
- the filename of the local filehdfsFile
- the HDFS filename to copy tojava.io.IOException
public void close()
Copyright © 2009 The Apache Software Foundation