private class ImportWorker.DataFileReader extends FileStream
Stream.PrintMode
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
dateFormat
The date format as it was set when the table was dumped.
|
private char |
decimalSeparator
The decimal separator character for decimal numbers.
|
private java.lang.String |
encoding
The code-page encoding for this file or
null if not present. |
private char |
groupSeparator
The group separator character for numbers.
|
private java.lang.String |
ldbname
The name of the table that was exported to this file.
|
private java.util.Map<java.lang.String,java.lang.String> |
pscHeader
The map with read key/values pairs form PSC footer.
|
private long |
recordCount
The number of records that were saved to this file.
|
private java.lang.String |
timestamp
The timestamp when this file was created.
|
private int |
windowingYear
The windowing year for date as it was set when the table was dumped.
|
file
binary, convert, CR, DELIM, doneIn, doneOut, EOF, increment, LF, MODE_EXPORT, MODE_PUT_CONTROL, MODE_PUT_NORMAL, MODE_PUT_UNFORMATTED, NEWLINE, NEWLINE_LEN, PAGED_DEFAULT, PIPE_BROKEN_MESSAGE, SET_PAGED_DEFAULT, sourceCp, targetCp
Constructor and Description |
---|
DataFileReader(java.lang.String filename)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMetadata(java.lang.String key)
Return the metadata value associated with this key.
|
long |
getRecordCount()
Obtain the expected record count in this file.
|
private void |
processPscHeader()
Processes PSC footer values of this stream previously read in metadata map.
|
private int |
readPscHeader()
Reads the PSC footer, storing the key/values pairs in private map pscHeader.
|
protected boolean |
skipLoneHyphenInput()
Don't skip a lone hyphen read from an export file.
|
assign, available, close, closeIn, closeOut, flushData, getLen, getPos, isIn, isOut, map, peekCh, readCh, readLn, setLen, setPos, write, write, writeByte, writeCh
advancePage, afterWrite, cleanup, deleted, deregisterFooter, deregisterHeader, endOutput, endOutput, export, finished, flush, flushControlled, forcePageBreak, forcePageBreak, generateStringFormat, getAvailableLines, getControl, getConvert, getDelimiter, getDisplayMode, getEcho, getEffectivePageSize, getLength, getName, getNextLineNum, getPageNum, getPageSize, getPendingRowCount, getPosition, getUnformatted, hasPageHeadersFooters, indexOfNewLine, isContiguous, isFreshPage, isSilent, isSuppressFormFeed, isTerm, isUnbuffered, isUnnamed, isValid, iterate, needsHeadersOutput, processFooters, processHeaders, processHeadersInt, processHeadersUncond, protectReads, protectWrites, pulseOutput, put, putControl, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putField, putLineEnd, putLineEnd, putNull, putNull, putSpace, putSpace, putUnformatted, putWorker, rawNextLineNum, rawPageSize, readBlock, readChar, readChar, readChunk, readField, readField, readField, readField, readFieldWorker, readLine, readLineCleanup, registerAdvanceListener, registerCloseListener, registerFlushListener, registerFooter, registerHeader, registerPageBreakListener, resetCurrentLine, retry, setAppend, setBinary, setContiguous, setControl, setConvert, setConvertSource, setConvertSource, setConvertTarget, setConvertTarget, setDelimiter, setDelimiter, setEcho, setLandscape, setName, setPageSize, setPageSize, setPageSize, setPendingRowCount, setPortrait, setPosition, setPosition, setUnbuffered, setUnformatted, setUnnamed, skipField, startOutput, writeBlock, writeControlled, writeControlledSpecial, writeField, writeField, writeField, writeField, writeField
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initFailure
private java.util.Map<java.lang.String,java.lang.String> pscHeader
private java.lang.String encoding
null
if not present.private long recordCount
private java.lang.String ldbname
private java.lang.String timestamp
private char groupSeparator
private char decimalSeparator
private int windowingYear
private java.lang.String dateFormat
public DataFileReader(java.lang.String filename) throws ErrorConditionException
filename
- File to be read.ErrorConditionException
- if there is an error finding or reading the file.public java.lang.String getMetadata(java.lang.String key)
key
- The key for the entry to be queried.null
.public long getRecordCount()
protected boolean skipLoneHyphenInput()
skipLoneHyphenInput
in class Stream
false
.private int readPscHeader()
private void processPscHeader()