|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.contrib.failmon.LocalStore
public class LocalStore
This class takes care of the temporary local storage of gathered metrics before they get uploaded into HDFS. It writes Serialized Records as lines in a temporary file and then compresses and uploads it into HDFS.
| Field Summary | |
|---|---|
static String |
COMPRESSION_SUFFIX
|
static char |
FIELD_SEPARATOR
|
static char |
RECORD_SEPARATOR
|
static int |
UPLOAD_INTERVAL
|
| Constructor Summary | |
|---|---|
LocalStore()
Create an instance of the class and read the configuration file to determine some output parameters. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char FIELD_SEPARATOR
public static final char RECORD_SEPARATOR
public static final String COMPRESSION_SUFFIX
public static final int UPLOAD_INTERVAL
| Constructor Detail |
|---|
public LocalStore()
| Method Detail |
|---|
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 compressed
IOException
public static void copyToHDFS(String localFile,
String hdfsFile)
throws IOException
localFile - the filename of the local filehdfsFile - the HDFS filename to copy to
IOExceptionpublic void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||