public abstract class FileBackedDataStoreBase<K,T extends PersistentBase> extends DataStoreBase<K,T> implements FileBackedDataStore<K,T>
FileBackedDataStore methods.| Modifier and Type | Field and Description |
|---|---|
protected String |
inputPath |
protected long |
inputSize |
protected InputStream |
inputStream |
static org.slf4j.Logger |
LOG |
protected String |
outputPath |
protected OutputStream |
outputStream |
autoCreateSchema, beanFactory, conf, datumReader, datumWriter, fieldMap, keyClass, persistentClass, properties, schema| Constructor and Description |
|---|
FileBackedDataStoreBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the DataStore.
|
protected InputStream |
createInputStream()
Opens an InputStream for the input Hadoop path
|
protected OutputStream |
createOutputStream()
Opens an OutputStream for the output Hadoop path
|
void |
createSchema()
Creates the optional schema or table (or similar) in the datastore
to hold the objects.
|
void |
deleteSchema()
Deletes the underlying schema or table (or similar) in the datastore
that holds the objects.
|
Result<K,T> |
execute(Query<K,T> query)
Executes the given query and returns the results.
|
protected abstract Result<K,T> |
executePartial(FileSplitPartitionQuery<K,T> query)
Executes a PartitialQuery, reading the data between start and end.
|
protected abstract Result<K,T> |
executeQuery(Query<K,T> query)
Executes a normal Query reading the whole data.
|
void |
flush()
Forces the write caches to be flushed.
|
String |
getInputPath() |
InputStream |
getInputStream() |
protected InputStream |
getOrCreateInputStream() |
protected OutputStream |
getOrCreateOutputStream() |
String |
getOutputPath() |
OutputStream |
getOutputStream() |
List<PartitionQuery<K,T>> |
getPartitions(Query<K,T> query)
Partitions the given query and returns a list of
PartitionQuerys,
which will execute on local data. |
void |
initialize(Class<K> keyClass,
Class<T> persistentClass,
Properties properties)
Initializes this DataStore.
|
void |
readFields(DataInput in) |
boolean |
schemaExists()
Returns whether the schema that holds the data exists in the datastore.
|
void |
setInputPath(String inputPath) |
void |
setInputStream(InputStream inputStream) |
void |
setOutputPath(String outputPath) |
void |
setOutputStream(OutputStream outputStream) |
void |
write(DataOutput out) |
equals, get, getBeanFactory, getConf, getFields, getFieldsToQuery, getKeyClass, getOrCreateConf, getPersistentClass, getSchemaName, newKey, newPersistent, setBeanFactory, setConf, setKeyClass, setPersistentClass, truncateSchemaclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdelete, deleteByQuery, get, get, getBeanFactory, getKeyClass, getPersistentClass, getSchemaName, newKey, newPersistent, newQuery, put, setBeanFactory, setKeyClass, setPersistentClass, truncateSchemaprotected long inputSize
protected String inputPath
protected String outputPath
protected InputStream inputStream
protected OutputStream outputStream
public static final org.slf4j.Logger LOG
public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties)
DataStoreinitialize in interface DataStore<K,T extends PersistentBase>initialize in class DataStoreBase<K,T extends PersistentBase>keyClass - the class of the keyspersistentClass - the class of the persistent objectsproperties - extra metadatapublic void setInputPath(String inputPath)
setInputPath in interface FileBackedDataStore<K,T extends PersistentBase>public void setOutputPath(String outputPath)
setOutputPath in interface FileBackedDataStore<K,T extends PersistentBase>public String getInputPath()
getInputPath in interface FileBackedDataStore<K,T extends PersistentBase>public String getOutputPath()
getOutputPath in interface FileBackedDataStore<K,T extends PersistentBase>public void setInputStream(InputStream inputStream)
setInputStream in interface FileBackedDataStore<K,T extends PersistentBase>public void setOutputStream(OutputStream outputStream)
setOutputStream in interface FileBackedDataStore<K,T extends PersistentBase>public InputStream getInputStream()
getInputStream in interface FileBackedDataStore<K,T extends PersistentBase>public OutputStream getOutputStream()
getOutputStream in interface FileBackedDataStore<K,T extends PersistentBase>protected InputStream createInputStream() throws IOException
IOExceptionprotected OutputStream createOutputStream()
protected InputStream getOrCreateInputStream() throws IOException
IOExceptionprotected OutputStream getOrCreateOutputStream() throws IOException
IOExceptionpublic List<PartitionQuery<K,T>> getPartitions(Query<K,T> query)
DataStorePartitionQuerys,
which will execute on local data.getPartitions in interface DataStore<K,T extends PersistentBase>query - the base query to create the partitions for. If the query
is null, then the data store returns the partitions for the default query
(returning every object)public Result<K,T> execute(Query<K,T> query)
DataStoreprotected abstract Result<K,T> executeQuery(Query<K,T> query) throws IOException
IOExceptionprotected abstract Result<K,T> executePartial(FileSplitPartitionQuery<K,T> query) throws IOException
IOExceptionpublic void flush()
DataStoreflush in interface DataStore<K,T extends PersistentBase>public void createSchema()
DataStorecreateSchema in interface DataStore<K,T extends PersistentBase>public void deleteSchema()
DataStoredeleteSchema in interface DataStore<K,T extends PersistentBase>public boolean schemaExists()
DataStoreschemaExists in interface DataStore<K,T extends PersistentBase>public void write(DataOutput out)
write in interface org.apache.hadoop.io.Writablewrite in class DataStoreBase<K,T extends PersistentBase>public void readFields(DataInput in)
readFields in interface org.apache.hadoop.io.WritablereadFields in class DataStoreBase<K,T extends PersistentBase>public void close()
DataStoreclose in interface Closeableclose in interface AutoCloseableclose in interface DataStore<K,T extends PersistentBase>Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.