|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.farrago.plugin.FarragoAbstractPluginBase
net.sf.farrago.namespace.impl.MedAbstractBase
net.sf.farrago.namespace.impl.MedAbstractDataServer
net.sf.farrago.namespace.flatfile.FlatFileDataServer
class FlatFileDataServer
FlatFileDataServer provides an implementation of the FarragoMedDataServer interface.
| Field Summary | |
|---|---|
private static int |
DESCRIBE_COLUMN_LENGTH
|
private static String |
DESCRIBE_COLUMN_NAME
|
(package private) FlatFileParams |
params
|
private static String |
QUALIFIED_NAME_SEPARATOR
|
private static String |
SQL_QUOTE_CHARACTER
|
private static Logger |
tracer
|
private MedAbstractDataWrapper |
wrapper
|
| Fields inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase |
|---|
BOOLEAN_CHOICES_DEFAULT_FALSE, BOOLEAN_CHOICES_DEFAULT_TRUE, EMPTY_DRIVER_PROPERTIES |
| Fields inherited from interface net.sf.farrago.namespace.FarragoMedDataServer |
|---|
PROP_SERVER_NAME, PROP_SERVER_TYPE, PROP_SERVER_VERSION |
| Constructor Summary | |
|---|---|
FlatFileDataServer(MedAbstractDataWrapper wrapper,
String serverMofId,
Properties props)
|
|
| Method Summary | |
|---|---|
void |
closeAllocation()
Closes this object. |
(package private) RelDataType |
createRowType(FarragoTypeFactory typeFactory,
RelDataType[] types,
String[] names)
|
private RelDataType |
deriveRowType(FarragoTypeFactory typeFactory,
FlatFileParams.SchemaType schemaType,
String[] localName,
String filename,
FlatFileBcpFile bcpFile)
Derives the row type of a table when other type information is not available. |
private String |
getDescribeQuery(String[] localName)
Constructs an internal query to describe the results of sampling |
private List<Integer> |
getFieldSizes(String[] localName)
Returns the sizes of a flat file's fields, based upon an internal describe query. |
FarragoMedNameDirectory |
getNameDirectory()
Gets a FarragoMedNameDirectory corresponding to this server. |
private String |
getQualifiedName(String[] localName)
Constructs a qualified (multi-part) name |
Object |
getRuntimeSupport(Object param)
Gets an object needed for runtime support. |
private String |
getSampleQuery(String[] localName)
Constructs an internal query to sample |
private String |
getSchemaName(String[] localName)
Returns the second to last name of localName. |
private String |
getTableName(String[] localName)
Returns the last name of localName. |
(package private) MedAbstractDataWrapper |
getWrapper()
|
(package private) void |
initialize()
|
FarragoMedColumnSet |
newColumnSet(String[] localName,
Properties tableProps,
FarragoTypeFactory typeFactory,
RelDataType rowType,
Map<String,Properties> columnPropMap)
Creates an instance of a FarragoMedColumnSet corresponding to row data identified by properties rather than container name. |
private String |
quoteName(String name)
Constructs a quoted name |
void |
registerRules(RelOptPlanner planner)
Gives this wrapper a chance to register any special optimization rules. |
long |
sampleAndCreateBcp(String[] localName,
FlatFileBcpFile bcpFile)
Creates the given control file based on an internal sample query. |
private String[] |
setSchemaName(String[] localName,
String schemaName)
Sets the second to last name of localName. |
| Methods inherited from class net.sf.farrago.namespace.impl.MedAbstractDataServer |
|---|
getLoopbackDataSource, getProperties, getServerMofId, registerRelMetadataProviders, releaseResources, setLoopbackDataSource |
| Methods inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase |
|---|
getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getShortProperty, requireProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Logger tracer
private static int DESCRIBE_COLUMN_LENGTH
private static String DESCRIBE_COLUMN_NAME
private static String QUALIFIED_NAME_SEPARATOR
private static String SQL_QUOTE_CHARACTER
private MedAbstractDataWrapper wrapper
FlatFileParams params
| Constructor Detail |
|---|
FlatFileDataServer(MedAbstractDataWrapper wrapper,
String serverMofId,
Properties props)
| Method Detail |
|---|
void initialize()
throws SQLException
SQLException
public FarragoMedNameDirectory getNameDirectory()
throws SQLException
FarragoMedDataServer
getNameDirectory in interface FarragoMedDataServergetNameDirectory in class MedAbstractDataServerSQLException - if directory access is unsuccessful (but not if
directory access is unsupported)
public FarragoMedColumnSet newColumnSet(String[] localName,
Properties tableProps,
FarragoTypeFactory typeFactory,
RelDataType rowType,
Map<String,Properties> columnPropMap)
throws SQLException
FarragoMedDataServer
localName - the qualified name to assign to the column set within
Farrago; this should NOT be used for finding the actual data, since it
can be set arbitrarily by the caller; instead, it should be used to
implement the RelOptTable.getQualifiedName() method, and can be useful
for correlation during debuggingtableProps - properties to use for data location and accesstypeFactory - FarragoTypeFactory to use for defining typesrowType - type to impose on the rows of this column set (including
column names and types), or null to infer row type; if this is non-null,
it must be saved for use by the getRowType() returned from
FarragoMedColumnSetcolumnPropMap - map from column name to column-specific Properties;
this is optional and may only be specified when rowType is also specified
(the field names in rowType are used as the keys for columnPropMap)
SQLException - if data access is unsuccessful
public Object getRuntimeSupport(Object param)
throws SQLException
FarragoMedDataServer
getRuntimeSupport in interface FarragoMedDataServergetRuntimeSupport in class MedAbstractDataServerparam - parameter supplied at runtime
SQLExceptionpublic void registerRules(RelOptPlanner planner)
FarragoMedDataServer
registerRules in interface FarragoMedDataServerregisterRules in class MedAbstractDataServerplanner - the planner in which the rules should be registeredpublic void closeAllocation()
ClosableAllocation
closeAllocation in interface ClosableAllocationcloseAllocation in class MedAbstractDataServerMedAbstractDataWrapper getWrapper()
RelDataType createRowType(FarragoTypeFactory typeFactory,
RelDataType[] types,
String[] names)
private RelDataType deriveRowType(FarragoTypeFactory typeFactory,
FlatFileParams.SchemaType schemaType,
String[] localName,
String filename,
FlatFileBcpFile bcpFile)
throws SQLException
SQLException
private List<Integer> getFieldSizes(String[] localName)
throws SQLException
SQLException
public long sampleAndCreateBcp(String[] localName,
FlatFileBcpFile bcpFile)
throws SQLException
SQLExceptionprivate String getDescribeQuery(String[] localName)
private String getSampleQuery(String[] localName)
private String getQualifiedName(String[] localName)
private String quoteName(String name)
private String getTableName(String[] localName)
private String getSchemaName(String[] localName)
private String[] setSchemaName(String[] localName,
String schemaName)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||