public class HDFSStorage extends Object implements Storage, org.apache.flume.conf.Configurable, com.datatorrent.api.Component<com.datatorrent.api.Context>
| Modifier and Type | Field and Description |
|---|---|
static String |
BASE_DIR_KEY |
static String |
BLOCK_SIZE_MULTIPLE |
static String |
BLOCKSIZE |
static int |
DEFAULT_BLOCK_SIZE |
static String |
NUMBER_RETRY |
static String |
RESTORE_KEY |
| Constructor and Description |
|---|
HDFSStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
clean(byte[] identifier)
This is used to clean up the files identified by identifier
|
void |
configure(org.apache.flume.Context ctx)
This stores the Identifier information identified in the last store function call
|
void |
flush()
This flushes the data from stream
|
String |
getBaseDir() |
long |
getBlockSize() |
int |
getBlockSizeMultiple() |
String |
getId() |
boolean |
isRestore() |
byte[] |
retrieve(byte[] identifier)
This returns the data bytes for the current identifier and the identifier for next data bytes.
|
byte[] |
retrieveNext()
This returns data bytes and the identifier for the next data bytes.
|
void |
setBaseDir(String baseDir) |
void |
setBlockSize(long blockSize) |
void |
setBlockSizeMultiple(int blockSizeMultiple) |
void |
setId(String id) |
void |
setRestore(boolean restore) |
void |
setup(com.datatorrent.api.Context context) |
byte[] |
store(com.datatorrent.netlet.util.Slice slice)
This stores the bytes and returns the unique identifier to retrieve these bytes
|
void |
teardown() |
public static final int DEFAULT_BLOCK_SIZE
public static final String BASE_DIR_KEY
public static final String RESTORE_KEY
public static final String BLOCKSIZE
public static final String BLOCK_SIZE_MULTIPLE
public static final String NUMBER_RETRY
public void configure(org.apache.flume.Context ctx)
configure in interface org.apache.flume.conf.Configurablectx - public byte[] store(com.datatorrent.netlet.util.Slice slice)
Storagepublic byte[] retrieve(byte[] identifier)
Storagepublic byte[] retrieveNext()
StorageretrieveNext in interface Storagepublic void clean(byte[] identifier)
Storagepublic void flush()
Storagepublic int getBlockSizeMultiple()
public void setBlockSizeMultiple(int blockSizeMultiple)
public String getBaseDir()
public void setBaseDir(String baseDir)
baseDir - the baseDir to setpublic String getId()
public void setId(String id)
id - the id to setpublic long getBlockSize()
public void setBlockSize(long blockSize)
blockSize - the blockSize to setpublic boolean isRestore()
public void setRestore(boolean restore)
restore - the restore to setpublic void setup(com.datatorrent.api.Context context)
setup in interface com.datatorrent.api.Component<com.datatorrent.api.Context>public void teardown()
teardown in interface com.datatorrent.api.Component<com.datatorrent.api.Context>Copyright © 2015-2017 Apache Software Foundation. All Rights Reserved.