org.axiondb.engine.tables

Class BaseFlatfileTable

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

Author: Ahimanikya Satapathy Jonathan Giron

Nested Class Summary
protected abstract classBaseFlatfileTable.BaseFlatfileTableOrganizationContext
Field Summary
protected String_fileName
protected boolean_isFirstLineHeader
protected String_lineSep
protected long_maxFaults
protected int_rowsToSkip
protected TableOrganizationContextcontext
protected static intEOF
protected static charFILLER
static StringPROP_FILENAME
protected static StringPROP_ISFIRSTLINEHEADER
protected static StringPROP_MAXFAULTS
protected static StringPROP_RECORDDELIMITER
protected static StringPROP_ROWSTOSKIP
Constructor Summary
BaseFlatfileTable(String name, Database db, TableFactory factory)
Method Summary
voidaddColumn(Column col, boolean metaUpdateNeeded)
static StringaddEscapeSequence(String srcString)
protected voidcreateOrLoadDataFile()
protected voidcreateOrLoadDataFile(boolean createNewDataFile)
protected StringevaluateForNull(String colValue, DataType datatype)
static StringfixEscapeSequence(String srcString)
protected FilegetDataFile()
protected StringgetDefaultDataFileExtension()
protected FilegetLobDir()
protected longignoreRowsToSkip()
protected voidinitializeTable()
protected abstract booleanisEndOfRecord(int recLength, int nextChar, BufferedDataInputStream data)
protected booleanisEOF(int nextChar)
protected booleanisNullString(String str)
booleanloadExternalTable(Properties props)
Loads external data using the given properties table - should be called only once by the table factory.
protected intnextLineLength(long fileOffset)
protected voidreloadFilesAfterTruncate()
voidremount()
protected voidrenameTableFiles(String oldName, String name)
protected RowtrySettingColumn(int idToAssign, Row row, int i, String colValue)
protected abstract voidwriteHeader(BufferedDataOutputStream data2)

Field Detail

_fileName

protected String _fileName

_isFirstLineHeader

protected boolean _isFirstLineHeader

_lineSep

protected String _lineSep

_maxFaults

protected long _maxFaults

_rowsToSkip

protected int _rowsToSkip

context

protected TableOrganizationContext context

EOF

protected static final int EOF

FILLER

protected static final char FILLER

PROP_FILENAME

public static final String PROP_FILENAME

PROP_ISFIRSTLINEHEADER

protected static final String PROP_ISFIRSTLINEHEADER

PROP_MAXFAULTS

protected static final String PROP_MAXFAULTS

PROP_RECORDDELIMITER

protected static final String PROP_RECORDDELIMITER

PROP_ROWSTOSKIP

protected static final String PROP_ROWSTOSKIP

Constructor Detail

BaseFlatfileTable

public BaseFlatfileTable(String name, Database db, TableFactory factory)

Method Detail

addColumn

public void addColumn(Column col, boolean metaUpdateNeeded)

addEscapeSequence

public static String addEscapeSequence(String srcString)

createOrLoadDataFile

protected void createOrLoadDataFile()

createOrLoadDataFile

protected void createOrLoadDataFile(boolean createNewDataFile)

evaluateForNull

protected String evaluateForNull(String colValue, DataType datatype)

fixEscapeSequence

public static String fixEscapeSequence(String srcString)

getDataFile

protected File getDataFile()

getDefaultDataFileExtension

protected String getDefaultDataFileExtension()

getLobDir

protected File getLobDir()

ignoreRowsToSkip

protected long ignoreRowsToSkip()

initializeTable

protected void initializeTable()

isEndOfRecord

protected abstract boolean isEndOfRecord(int recLength, int nextChar, BufferedDataInputStream data)

isEOF

protected boolean isEOF(int nextChar)

isNullString

protected boolean isNullString(String str)

loadExternalTable

public boolean loadExternalTable(Properties props)
Loads external data using the given properties table - should be called only once by the table factory.

Parameters: table Table to be set props Properties for Table

Throws: AxionException thrown while setting Properties

nextLineLength

protected int nextLineLength(long fileOffset)

reloadFilesAfterTruncate

protected void reloadFilesAfterTruncate()

remount

public void remount()

renameTableFiles

protected void renameTableFiles(String oldName, String name)

trySettingColumn

protected Row trySettingColumn(int idToAssign, Row row, int i, String colValue)

writeHeader

protected abstract void writeHeader(BufferedDataOutputStream data2)