public abstract class Tablespace extends Object
| Modifier and Type | Field and Description |
|---|---|
protected TajoConf |
conf |
protected net.minidev.json.JSONObject |
config |
protected String |
name |
protected URI |
uri |
protected boolean |
visible
this space is visible or not.
|
| Constructor and Description |
|---|
Tablespace(String name,
URI uri,
net.minidev.json.JSONObject config) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Release storage manager resource
|
abstract org.apache.hadoop.fs.Path |
commitTable(OverridableConf queryContext,
ExecutionBlockId finalEbId,
LogicalPlan plan,
Schema schema,
TableDesc tableDesc)
Finalizes result data.
|
abstract void |
createTable(TableDesc tableDesc,
boolean ifNotExists)
This method is called after executing "CREATE TABLE" statement.
|
boolean |
equals(Object obj) |
Appender |
getAppender(OverridableConf queryContext,
TaskAttemptId taskAttemptId,
TableMeta meta,
Schema schema,
org.apache.hadoop.fs.Path workDir)
Returns Appender instance.
|
Appender |
getAppenderForInsertRow(OverridableConf queryContext,
TaskAttemptId taskAttemptId,
TableMeta meta,
Schema schema,
org.apache.hadoop.fs.Path workDir) |
net.minidev.json.JSONObject |
getConfig() |
Set<String> |
getDependencies() |
abstract FormatProperty |
getFormatProperty(TableMeta meta) |
abstract TupleRange[] |
getInsertSortRanges(OverridableConf queryContext,
TableDesc tableDesc,
Schema inputSchema,
SortSpec[] sortSpecs,
TupleRange dataRange)
It is called by a Repartitioner for range shuffling when the SortRangeType of SortNode is USING_STORAGE_MANAGER.
|
MetadataProvider |
getMetadataProvider() |
String |
getName() |
abstract StorageProperty |
getProperty()
It returns the storage property.
|
URI |
getRootUri()
if
StorageProperty.isArbitraryPathAllowed() is true,
the storage allows arbitrary path accesses. |
Scanner |
getScanner(TableMeta meta,
Schema schema,
Fragment fragment,
Schema target)
Returns Scanner instance.
|
Class<? extends Scanner> |
getScannerClass(String dataFormat)
Return the Scanner class for the DataFormat that is defined in storage-default.xml.
|
SeekableScanner |
getSeekableScanner(TableMeta meta,
Schema schema,
CatalogProtos.FragmentProto fragment,
Schema target)
Returns Scanner instance.
|
abstract List<Fragment> |
getSplits(String inputSourceId,
TableDesc tableDesc,
EvalNode filterCondition)
Returns the splits that will serve as input for the scan tasks.
|
abstract URI |
getStagingUri(OverridableConf context,
String queryId,
TableMeta meta) |
abstract URI |
getTableUri(String databaseName,
String tableName)
Get Table URI
|
abstract long |
getTableVolume(TableDesc table,
com.google.common.base.Optional<EvalNode> filter) |
URI |
getUri() |
void |
init(TajoConf tajoConf)
Initialize Tablespace instance.
|
boolean |
isVisible() |
int |
markAccetablePlanPart(LogicalPlan plan) |
URI |
prepareStagingSpace(TajoConf conf,
String queryId,
OverridableConf context,
TableMeta meta) |
abstract void |
prepareTable(LogicalNode node)
This method is called before executing 'INSERT' or 'CREATE TABLE as SELECT'.
|
abstract void |
purgeTable(TableDesc tableDesc)
This method is called after executing "DROP TABLE" statement with the 'PURGE' option
which is the option to delete all the data.
|
void |
rewritePlan(OverridableConf context,
LogicalPlan plan)
Rewrite the logical plan.
|
abstract void |
rollbackTable(LogicalNode node) |
void |
setVisible(boolean visible) |
protected abstract void |
storageInit()
Initialize storage manager.
|
String |
toString() |
abstract void |
verifySchemaToWrite(TableDesc tableDesc,
Schema outSchema)
It is called after making logical plan.
|
protected final String name
protected final URI uri
protected final net.minidev.json.JSONObject config
protected boolean visible
protected TajoConf conf
public net.minidev.json.JSONObject getConfig()
public void setVisible(boolean visible)
protected abstract void storageInit()
throws IOException
IOExceptionpublic String getName()
public URI getUri()
public boolean isVisible()
public abstract long getTableVolume(TableDesc table, com.google.common.base.Optional<EvalNode> filter) throws UnsupportedException
UnsupportedExceptionpublic URI getRootUri()
StorageProperty.isArbitraryPathAllowed() is true,
the storage allows arbitrary path accesses. In this case, the storage must provide the root URI.StorageProperty#isArbitraryPathAllowed}public abstract URI getTableUri(String databaseName, String tableName)
databaseName - Database nametableName - Table namepublic abstract List<Fragment> getSplits(String inputSourceId, TableDesc tableDesc, @Nullable EvalNode filterCondition) throws IOException, TajoException
inputSourceId - Input source identifier, which can be either relation name or execution block idtableDesc - The table description for the target data.filterCondition - filter condition which can prune splits if possibleIOExceptionTajoExceptionpublic abstract StorageProperty getProperty()
public abstract FormatProperty getFormatProperty(TableMeta meta)
public abstract void close()
public abstract TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc, Schema inputSchema, SortSpec[] sortSpecs, TupleRange dataRange) throws IOException
queryContext - The current query context which contains query properties.tableDesc - The table description for the target data.inputSchema - The input schemasortSpecs - The sort specification that contains the sort column and sort order.IOExceptionpublic void init(TajoConf tajoConf) throws IOException
tajoConf - IOExceptionpublic Scanner getScanner(TableMeta meta, Schema schema, Fragment fragment, @Nullable Schema target) throws IOException
meta - The table metaschema - The input schemafragment - The fragment for scanningtarget - The output schemaIOExceptionpublic Appender getAppenderForInsertRow(OverridableConf queryContext, TaskAttemptId taskAttemptId, TableMeta meta, Schema schema, org.apache.hadoop.fs.Path workDir) throws IOException
IOExceptionpublic SeekableScanner getSeekableScanner(TableMeta meta, Schema schema, CatalogProtos.FragmentProto fragment, Schema target) throws IOException
meta - The table metaschema - The input schemafragment - The fragment for scanningtarget - The output schemaIOExceptionpublic Appender getAppender(OverridableConf queryContext, TaskAttemptId taskAttemptId, TableMeta meta, Schema schema, org.apache.hadoop.fs.Path workDir) throws IOException
queryContext - Query property.taskAttemptId - Task id.meta - Table meta data.schema - Output schema.workDir - Working directoryIOExceptionpublic Class<? extends Scanner> getScannerClass(String dataFormat) throws IOException
dataFormat - store typeIOExceptionpublic abstract void verifySchemaToWrite(TableDesc tableDesc, Schema outSchema) throws TajoException
tableDesc - The table description of insert target.outSchema - The output schema of select query for inserting.IOExceptionTajoExceptionpublic void rewritePlan(OverridableConf context, LogicalPlan plan) throws TajoException
TajoExceptionpublic abstract void createTable(TableDesc tableDesc, boolean ifNotExists) throws TajoException, IOException
tableDesc - Table description which is created.ifNotExists - Creates the table only when the table does not exist.IOExceptionTajoExceptionpublic abstract void purgeTable(TableDesc tableDesc) throws IOException, TajoException
tableDesc - IOExceptionTajoExceptionpublic abstract void prepareTable(LogicalNode node) throws IOException, TajoException
node - The child node of the root node.IOExceptionTajoExceptionpublic abstract org.apache.hadoop.fs.Path commitTable(OverridableConf queryContext, ExecutionBlockId finalEbId, LogicalPlan plan, Schema schema, TableDesc tableDesc) throws IOException
queryContext - The query propertyfinalEbId - The final execution block idplan - The query planschema - The final output schematableDesc - The description of the target tableIOExceptionpublic abstract void rollbackTable(LogicalNode node) throws IOException, TajoException
IOExceptionTajoExceptionpublic abstract URI getStagingUri(OverridableConf context, String queryId, TableMeta meta) throws IOException
IOExceptionpublic URI prepareStagingSpace(TajoConf conf, String queryId, OverridableConf context, TableMeta meta) throws IOException
IOExceptionpublic MetadataProvider getMetadataProvider()
public int markAccetablePlanPart(LogicalPlan plan)
Copyright © 2016 Apache Software Foundation. All Rights Reserved.