org.axiondb.engine.tables
Class FixedWidthFlatfileTable

java.lang.Object
  extended by org.axiondb.event.BaseTableModificationPublisher
      extended by org.axiondb.engine.tables.AbstractBaseTable
          extended by org.axiondb.engine.tables.BaseTable
              extended by org.axiondb.engine.tables.BaseDiskTable
                  extended by org.axiondb.engine.tables.BaseFlatfileTable
                      extended by org.axiondb.engine.tables.FixedWidthFlatfileTable
All Implemented Interfaces:
ExternalTable, RowSource, Table

public final class FixedWidthFlatfileTable
extends BaseFlatfileTable

A disk-resident Fixed Width Flatfile Table.

Version:
$Revision: 1.16 $ $Date: 2005/12/20 18:32:28 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.axiondb.engine.tables.BaseFlatfileTable
BaseFlatfileTable.BaseFlatfileTableOrganizationContext
 
Field Summary
static java.lang.String PROP_HEADERBYTESOFFSET
           
 
Fields inherited from class org.axiondb.engine.tables.BaseFlatfileTable
_fileName, _isFirstLineHeader, _lineSep, _maxFaults, _rowsToSkip, context, EOF, FILLER, PROP_FILENAME, PROP_ISFIRSTLINEHEADER, PROP_MAXFAULTS, PROP_RECORDDELIMITER, PROP_ROWSTOSKIP
 
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
 
Fields inherited from interface org.axiondb.Table
REGULAR_TABLE_TYPE, SYSTEM_TABLE_TYPE
 
Constructor Summary
FixedWidthFlatfileTable(java.lang.String name, Database db)
           
 
Method Summary
 void addColumn(Column col, boolean metaUpdateNeeded)
           
protected  Row getRowByOffset(int idToAssign, long ptr)
           
 java.util.Properties getTableProperties()
          Gets Organization Property.
protected  long ignoreRowsToSkip()
           
protected  void initializeTable()
           
protected  boolean isEndOfRecord(int recLength, int nextChar, BufferedDataInputStream data)
           
 boolean loadExternalTable(java.util.Properties props)
          Loads external data using the given properties table - should be called only once by the table factory.
protected  int nextLineLength(long fileOffset)
           
protected  void parseTableProperties(java.io.ObjectInputStream in)
           
protected  void renameTableFiles(java.lang.String oldName, java.lang.String name)
           
protected  void writeHeader(BufferedDataOutputStream dataFile)
           
protected  void writeRow(BufferedDataOutputStream out, Row row)
           
protected  void writeTableProperties(java.io.ObjectOutputStream out)
           
 
Methods inherited from class org.axiondb.engine.tables.BaseFlatfileTable
addEscapeSequence, createOrLoadDataFile, createOrLoadDataFile, evaluateForNull, fixEscapeSequence, getDataFile, getDefaultDataFileExtension, getLobDir, isEOF, isNullString, reloadFilesAfterTruncate, remount, trySettingColumn
 
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, getRowCount, getRowIterator, getTableFile, initFiles, initializeRowCount, isReadOnly, loadOrMigrateMetaFile, migrate, parsePidxFile, populateIndex, remount, removeIndex, rename, resetLobColumns, saveIndicesAfterTruncate, setSequence, shutdown, truncate, tryToRemove, writeFridFile, writeMetaFile, writeNameToFile
 
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 org.axiondb.engine.tables.AbstractBaseTable
checkConstraints, checkConstraints, checkConstraints, getMatchingRows, hasDeferredConstraint, isDeferAll, migrate
 
Methods inherited from class org.axiondb.event.BaseTableModificationPublisher
addTableModificationListener, getTableModificationListeners, publishEvent, removeTableModificationListener, setDeferAllConstraints
 
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
 
Methods inherited from interface org.axiondb.RowSource
getRow
 

Field Detail

PROP_HEADERBYTESOFFSET

public static final java.lang.String PROP_HEADERBYTESOFFSET
See Also:
Constant Field Values
Constructor Detail

FixedWidthFlatfileTable

public FixedWidthFlatfileTable(java.lang.String name,
                               Database db)
                        throws AxionException
Throws:
AxionException
Method Detail

addColumn

public void addColumn(Column col,
                      boolean metaUpdateNeeded)
               throws AxionException
Overrides:
addColumn in class BaseFlatfileTable
Throws:
AxionException

getRowByOffset

protected Row getRowByOffset(int idToAssign,
                             long ptr)
                      throws AxionException
Specified by:
getRowByOffset in class BaseDiskTable
Throws:
AxionException

nextLineLength

protected int nextLineLength(long fileOffset)
                      throws AxionException
Overrides:
nextLineLength in class BaseFlatfileTable
Throws:
AxionException

ignoreRowsToSkip

protected long ignoreRowsToSkip()
                         throws AxionException
Overrides:
ignoreRowsToSkip in class BaseFlatfileTable
Throws:
AxionException

initializeTable

protected void initializeTable()
                        throws AxionException
Overrides:
initializeTable in class BaseFlatfileTable
Throws:
AxionException

isEndOfRecord

protected boolean isEndOfRecord(int recLength,
                                int nextChar,
                                BufferedDataInputStream data)
                         throws java.io.IOException
Specified by:
isEndOfRecord in class BaseFlatfileTable
Throws:
java.io.IOException

loadExternalTable

public boolean loadExternalTable(java.util.Properties props)
                          throws AxionException
Description copied from class: BaseFlatfileTable
Loads external data using the given properties table - should be called only once by the table factory.

Specified by:
loadExternalTable in interface ExternalTable
Overrides:
loadExternalTable in class BaseFlatfileTable
Parameters:
props - Properties for Table
Throws:
AxionException - thrown while setting Properties

getTableProperties

public java.util.Properties getTableProperties()
Description copied from interface: ExternalTable
Gets Organization Property.

Returns:
Set of organization property key names;

parseTableProperties

protected void parseTableProperties(java.io.ObjectInputStream in)
                             throws AxionException
Overrides:
parseTableProperties in class BaseDiskTable
Throws:
AxionException

renameTableFiles

protected void renameTableFiles(java.lang.String oldName,
                                java.lang.String name)
Overrides:
renameTableFiles in class BaseFlatfileTable

writeHeader

protected void writeHeader(BufferedDataOutputStream dataFile)
                    throws AxionException
Specified by:
writeHeader in class BaseFlatfileTable
Throws:
AxionException

writeRow

protected void writeRow(BufferedDataOutputStream out,
                        Row row)
                 throws AxionException
Specified by:
writeRow in class BaseDiskTable
Throws:
AxionException

writeTableProperties

protected void writeTableProperties(java.io.ObjectOutputStream out)
                             throws AxionException
Overrides:
writeTableProperties in class BaseDiskTable
Throws:
AxionException