|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.gora.store.impl.DataStoreBase<K,T>
org.apache.gora.store.impl.FileBackedDataStoreBase<K,T>
public abstract class FileBackedDataStoreBase<K,T extends Persistent>
Base implementations for FileBackedDataStore methods.
| Field Summary | |
|---|---|
protected String |
inputPath
|
protected long |
inputSize
|
protected InputStream |
inputStream
|
protected String |
outputPath
|
protected OutputStream |
outputStream
|
| Fields inherited from class org.apache.gora.store.impl.DataStoreBase |
|---|
autoCreateSchema, beanFactory, conf, datumReader, datumWriter, fieldMap, keyClass, persistentClass, properties, schema |
| Constructor Summary | |
|---|---|
FileBackedDataStoreBase()
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.apache.gora.store.impl.DataStoreBase |
|---|
equals, get, getBeanFactory, getConf, getFieldsToQuery, getKeyClass, getOrCreateConf, getPersistentClass, getSchemaName, newKey, newPersistent, setBeanFactory, setConf, setKeyClass, setPersistentClass, truncateSchema |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.gora.store.DataStore |
|---|
delete, deleteByQuery, get, get, getBeanFactory, getConf, getKeyClass, getPersistentClass, getSchemaName, newKey, newPersistent, newQuery, put, setBeanFactory, setConf, setKeyClass, setPersistentClass, truncateSchema |
| Field Detail |
|---|
protected long inputSize
protected String inputPath
protected String outputPath
protected InputStream inputStream
protected OutputStream outputStream
| Constructor Detail |
|---|
public FileBackedDataStoreBase()
| Method Detail |
|---|
public void initialize(Class<K> keyClass,
Class<T> persistentClass,
Properties properties)
throws IOException
DataStore
initialize in interface DataStore<K,T extends Persistent>initialize in class DataStoreBase<K,T extends Persistent>keyClass - the class of the keyspersistentClass - the class of the persistent objectsproperties - extra metadata
IOExceptionpublic void setInputPath(String inputPath)
setInputPath in interface FileBackedDataStore<K,T extends Persistent>public void setOutputPath(String outputPath)
setOutputPath in interface FileBackedDataStore<K,T extends Persistent>public String getInputPath()
getInputPath in interface FileBackedDataStore<K,T extends Persistent>public String getOutputPath()
getOutputPath in interface FileBackedDataStore<K,T extends Persistent>public void setInputStream(InputStream inputStream)
setInputStream in interface FileBackedDataStore<K,T extends Persistent>public void setOutputStream(OutputStream outputStream)
setOutputStream in interface FileBackedDataStore<K,T extends Persistent>public InputStream getInputStream()
getInputStream in interface FileBackedDataStore<K,T extends Persistent>public OutputStream getOutputStream()
getOutputStream in interface FileBackedDataStore<K,T extends Persistent>
protected InputStream createInputStream()
throws IOException
IOException
protected OutputStream createOutputStream()
throws IOException
IOException
protected InputStream getOrCreateInputStream()
throws IOException
IOException
protected OutputStream getOrCreateOutputStream()
throws IOException
IOException
public List<PartitionQuery<K,T>> getPartitions(Query<K,T> query)
throws IOException
DataStorePartitionQuerys,
which will execute on local data.
getPartitions in interface DataStore<K,T extends Persistent>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)
IOException
public Result<K,T> execute(Query<K,T> query)
throws IOException
DataStore
execute in interface DataStore<K,T extends Persistent>query - the query to execute.
Result object.
IOException
protected abstract Result<K,T> executeQuery(Query<K,T> query)
throws IOException
IOException
protected abstract Result<K,T> executePartial(FileSplitPartitionQuery<K,T> query)
throws IOException
IOException
public void flush()
throws IOException
DataStore
flush in interface DataStore<K,T extends Persistent>IOException
public void createSchema()
throws IOException
DataStore
createSchema in interface DataStore<K,T extends Persistent>IOException
public void deleteSchema()
throws IOException
DataStore
deleteSchema in interface DataStore<K,T extends Persistent>IOException
public boolean schemaExists()
throws IOException
DataStore
schemaExists in interface DataStore<K,T extends Persistent>IOException
public void write(DataOutput out)
throws IOException
write in interface DataStore<K,T extends Persistent>write in interface org.apache.hadoop.io.Writablewrite in class DataStoreBase<K,T extends Persistent>IOException
public void readFields(DataInput in)
throws IOException
readFields in interface DataStore<K,T extends Persistent>readFields in interface org.apache.hadoop.io.WritablereadFields in class DataStoreBase<K,T extends Persistent>IOException
public void close()
throws IOException
DataStore
close in interface Closeableclose in interface DataStore<K,T extends Persistent>IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||