org.axiondb.engine.tables
Class BaseFlatfileTable
java.lang.Object
org.axiondb.event.BaseTableModificationPublisher
org.axiondb.engine.tables.AbstractBaseTable
org.axiondb.engine.tables.BaseTable
org.axiondb.engine.tables.BaseDiskTable
org.axiondb.engine.tables.BaseFlatfileTable
- All Implemented Interfaces:
- ExternalTable, RowSource, Table
- Direct Known Subclasses:
- DelimitedFlatfileTable, FixedWidthFlatfileTable, TaggedEBCDICTable
public abstract class BaseFlatfileTable
- extends BaseDiskTable
- implements ExternalTable
Base Flatfile Table
TODO: Support for decimal and thousand separator, trailing/leading minus sign
TODO: Support for multiple record delimiter
Fields inherited from class org.axiondb.engine.tables.BaseDiskTable |
_dataFile, _dbdir, _freeIds, _readOnly, _rowCount, CURRENT_META_VERSION, FRID_FILE_EXT, FS, INDICES_DIR_NAME, INVALID_OFFSET, META_FILE_EXT, PIDX_FILE_EXT, SEQ_FILE_EXT, TYPE_FILE_EXT |
Fields inherited from interface org.axiondb.ExternalTable |
COLUMNS_ARE_CASE_SENSITIVE, DELIMITED_TABLE_TYPE, EXTERNAL_DB_TABLE_TYPE, FW_TABLE_TYPE, PROP_CATALOG, PROP_CREATE_IF_NOT_EXIST, PROP_DB, PROP_LOADTYPE, PROP_ORDERBY, PROP_REMOTETABLE, PROP_SCHEMA, PROP_VENDOR, PROP_WHERE, TAGGED_EBCDIC_TABLE_TYPE |
Methods inherited from class org.axiondb.engine.tables.BaseDiskTable |
addColumn, addConstraint, applyDeletes, applyInserts, applyUpdates, checkpoint, clearDataFileReference, closeFiles, createOrLoadFreeIdsFile, drop, freeRowId, getInputStream, getNextRowId, getOutputStream, getPidxList, getRootDir, getRow, getRowByOffset, getRowCount, getRowIterator, getTableFile, initFiles, initializeRowCount, isReadOnly, loadOrMigrateMetaFile, migrate, parsePidxFile, parseTableProperties, populateIndex, remount, removeIndex, rename, resetLobColumns, saveIndicesAfterTruncate, setSequence, shutdown, truncate, tryToRemove, writeFridFile, writeMetaFile, writeNameToFile, writeRow, writeTableProperties |
Methods inherited from class org.axiondb.engine.tables.BaseTable |
addIndex, addRow, applyDeletesToIndices, applyInsertsToIndices, applyUpdatesToIndices, clearCache, deleteRow, getColumn, getColumn, getColumnCount, getColumnIdentifiers, getColumnIndex, getConstraint, getConstraints, getIndexedRows, getIndexedRows, getIndexForColumn, getIndices, getName, getRowIterator, getSequence, getType, hasColumn, hasIndex, isColumnIndexed, isPrimaryKeyConstraintExists, isUniqueConstraintExists, makeRowDecorator, makeTransactableTable, notifyColumnsOfNewLobDir, readColumns, readConstraints, recreateIndices, removeConstraint, setName, setType, toString, truncateIndices, updateRow, writeColumns, writeConstraints |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.axiondb.Table |
addColumn, addConstraint, addIndex, addRow, addTableModificationListener, applyDeletes, applyInserts, applyUpdates, checkpoint, deleteRow, drop, freeRowId, getColumn, getColumn, getColumnCount, getColumnIdentifiers, getColumnIndex, getConstraint, getConstraints, getIndexedRows, getIndexedRows, getIndexForColumn, getIndices, getMatchingRows, getName, getNextRowId, getRowCount, getRowIterator, getSequence, getTableModificationListeners, getType, hasColumn, hasIndex, isColumnIndexed, isPrimaryKeyConstraintExists, isUniqueConstraintExists, makeRowDecorator, makeTransactableTable, migrate, populateIndex, remount, removeConstraint, removeIndex, removeTableModificationListener, rename, setDeferAllConstraints, setSequence, shutdown, truncate, updateRow |
EOF
protected static final int EOF
- See Also:
- Constant Field Values
FILLER
protected static final char FILLER
- See Also:
- Constant Field Values
PROP_FILENAME
public static final java.lang.String PROP_FILENAME
- See Also:
- Constant Field Values
PROP_ISFIRSTLINEHEADER
protected static final java.lang.String PROP_ISFIRSTLINEHEADER
- See Also:
- Constant Field Values
PROP_RECORDDELIMITER
protected static final java.lang.String PROP_RECORDDELIMITER
- See Also:
- Constant Field Values
PROP_ROWSTOSKIP
protected static final java.lang.String PROP_ROWSTOSKIP
- See Also:
- Constant Field Values
PROP_MAXFAULTS
protected static final java.lang.String PROP_MAXFAULTS
- See Also:
- Constant Field Values
context
protected TableOrganizationContext context
_fileName
protected java.lang.String _fileName
_isFirstLineHeader
protected boolean _isFirstLineHeader
_rowsToSkip
protected int _rowsToSkip
_maxFaults
protected long _maxFaults
_lineSep
protected java.lang.String _lineSep
BaseFlatfileTable
public BaseFlatfileTable(java.lang.String name,
Database db,
TableFactory factory)
throws AxionException
- Throws:
AxionException
addColumn
public void addColumn(Column col,
boolean metaUpdateNeeded)
throws AxionException
- Overrides:
addColumn
in class BaseDiskTable
- Throws:
AxionException
loadExternalTable
public boolean loadExternalTable(java.util.Properties props)
throws AxionException
- Loads external data using the given properties table - should be called only once
by the table factory.
- Specified by:
loadExternalTable
in interface ExternalTable
- Parameters:
table
- Table to be setprops
- Properties for Table
- Throws:
AxionException
- thrown while setting Properties
remount
public void remount()
throws AxionException
- Specified by:
remount
in interface ExternalTable
- Throws:
AxionException
addEscapeSequence
public static java.lang.String addEscapeSequence(java.lang.String srcString)
createOrLoadDataFile
protected void createOrLoadDataFile()
throws AxionException
- Overrides:
createOrLoadDataFile
in class BaseDiskTable
- Throws:
AxionException
createOrLoadDataFile
protected void createOrLoadDataFile(boolean createNewDataFile)
throws AxionException
- Throws:
AxionException
fixEscapeSequence
public static java.lang.String fixEscapeSequence(java.lang.String srcString)
getDataFile
protected java.io.File getDataFile()
- Specified by:
getDataFile
in class BaseDiskTable
renameTableFiles
protected void renameTableFiles(java.lang.String oldName,
java.lang.String name)
- Overrides:
renameTableFiles
in class BaseDiskTable
getLobDir
protected java.io.File getLobDir()
- Specified by:
getLobDir
in class BaseDiskTable
ignoreRowsToSkip
protected long ignoreRowsToSkip()
throws AxionException
- Throws:
AxionException
initializeTable
protected void initializeTable()
throws AxionException
- Throws:
AxionException
isEndOfRecord
protected abstract boolean isEndOfRecord(int recLength,
int nextChar,
BufferedDataInputStream data)
throws java.io.IOException
- Throws:
java.io.IOException
isEOF
protected boolean isEOF(int nextChar)
isNullString
protected boolean isNullString(java.lang.String str)
getDefaultDataFileExtension
protected java.lang.String getDefaultDataFileExtension()
- Overrides:
getDefaultDataFileExtension
in class BaseDiskTable
reloadFilesAfterTruncate
protected void reloadFilesAfterTruncate()
throws AxionException
- Specified by:
reloadFilesAfterTruncate
in class BaseDiskTable
- Throws:
AxionException
trySettingColumn
protected Row trySettingColumn(int idToAssign,
Row row,
int i,
java.lang.String colValue)
throws AxionException
- Throws:
AxionException
evaluateForNull
protected java.lang.String evaluateForNull(java.lang.String colValue,
DataType datatype)
writeHeader
protected abstract void writeHeader(BufferedDataOutputStream data2)
throws AxionException
- Throws:
AxionException
nextLineLength
protected int nextLineLength(long fileOffset)
throws AxionException
- Throws:
AxionException