public class X100ColumnWriter extends Object
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
X100ColumnWriter(String tableName,
int paxIndex,
int jobId,
IX100Connector con)
This constructor will create ColumnWriter
|
X100ColumnWriter(String x100Name,
int i,
int jobID,
IX100Connector conn,
boolean b) |
X100ColumnWriter(String tableName,
int paxIndex,
int jobId,
IX100Connector con,
int vecSize)
This constructor will create ColumnWriter
|
X100ColumnWriter(String tableName,
int paxIndex,
int jobId,
IX100Connector con,
int vecSize,
boolean isMasterClient)
This method will create a writer for a give paxGroup.
|
Modifier and Type | Method and Description |
---|---|
void |
addData(BigDecimal data,
int columnIndex)
Use this method to add data for following data types 1) Numeric Types -
byte, short, int, long, float, dobule & decimal
|
void |
addData(double inData,
int colIndex,
boolean isNull)
This method is used for loading all Numeric Data Types.
|
void |
addData(long inData,
int colIndex,
boolean isNull)
This method is used for loading all Numeric Data Types.
|
void |
addData(long timeSeconds,
int nanos,
int zoneInfo,
int colIndex,
boolean isNull)
Use this method to add data for following data types If the input value
is null and the column is not nullable, a default value (1970 Jan 1st
00:00:00) will be set.
|
void |
addData(String data,
int columnIndex)
Use this method for loading any data type
|
int |
cleanup() |
int |
cleanup(int blockId)
This is a synchronous call to issue Commit and close all connections This
method will 1) Close PaxGroup
This method should be used there are less number of parallel commit
clientIds than there are number of paxGroups in table.
|
void |
cleanup(IPaxCallback callBack)
Deprecated.
This method is deprecated. Use link{
cleanupAndCommit() call. |
int |
cleanupAndCommit()
This method will 1) Flush remaining blocks 2) closesPaxGroup 3) Issue
commit
|
void |
clearBuffers()
This method clears the internal buffers used to store the data.
|
void |
closeWriter()
This method will close the X100Connection it holds.
|
X100AddBlockStatus |
createBlocks()
This method should be called after adding data using addData methods.
|
int |
getPaxId()
Returns the paxID this columnWriter is serving
|
int |
getRemainingRecords()
Deprecated.
|
int |
getTotalBlocks()
returns the number of blocks written by this column writer
|
long |
getTotalRecordsWrittern()
Returns the number of records written by this writer
|
int |
sendX100Blocks(X100AddBlockStatus status,
int blockId)
This method is used for sending X100 blocks to X100 Server
|
public X100ColumnWriter(String tableName, int paxIndex, int jobId, IX100Connector con)
tableName
- columnIndex
- jobId
- con
- public X100ColumnWriter(String tableName, int paxIndex, int jobId, IX100Connector con, int vecSize)
tableName
- columnIndex
- jobId
- con
- public X100ColumnWriter(String tableName, int paxIndex, int jobId, IX100Connector con, int vecSize, boolean isMasterClient)
tableName
- -- Name of the TablepaxIndex
- -- PaxGroup IdjobId
- -- JobID of the transaction this writer is part ofcon
- -- X100Connector to use to sending datavecSize
- -- Number of tuples to store before cooking blocksisMasterClient
- -- If this paxId is the master clientpublic X100ColumnWriter(String x100Name, int i, int jobID, IX100Connector conn, boolean b)
public void addData(String data, int columnIndex) throws ConversionException
data
- -- Input DatacolIndex
- -- Column Id in the paxGroupisNull
- -- If this value is nullConversionException
public void addData(BigDecimal data, int columnIndex) throws InvalidTypeException, ConversionException
data
- -- BigDecimal Representation of Give typecolIndex
- -- Column Id in the paxGroupisNull
- -- If this value is nullInvalidTypeException
ConversionException
public void addData(long timeSeconds, int nanos, int zoneInfo, int colIndex, boolean isNull) throws InvalidTypeException, ConversionException
timeSeconds
- -- Number of seconds since Epoch 1970 Jan 1st Midnight.nanos
- -- Nano seconds precisionzoneInfo
- -- Time Zone information in minutescolIndex
- -- Column Id in the paxGroupisNull
- -- If this value is nullInvalidTypeException
ConversionException
public void addData(double inData, int colIndex, boolean isNull) throws ConversionException, InvalidTypeException
inData
- -- input datacolIndex
- -- column IndexisNull
- -- is the value nullConversionException
InvalidTypeException
public void addData(long inData, int colIndex, boolean isNull) throws ConversionException, InvalidTypeException
inData
- -- input datacolIndex
- -- column IndexisNull
- -- is the value nullConversionException
InvalidTypeException
public X100AddBlockStatus createBlocks() throws X100BlockException
sendX100Blocks(X100AddBlockStatus, int)
method.Exception
X100BlockException
public void clearBuffers()
createBlocks()
method,
these buffers should be reset. This method, simply resets the cursor
position to 0. If not invoked, next addValue method will cause
BufferOverFlow Exceptions.public long getTotalRecordsWrittern()
@Deprecated public int getRemainingRecords()
public int sendX100Blocks(X100AddBlockStatus status, int blockId) throws X100BlockException
status
- -- This is the return object from createBlocks()
method. This object contains the number of blocks available
for sending.blockId
- -- The blockId to be assigned to this block. The caller is
responsible for keeping track of the blockIds for a given
paxGroup. The blockIds could be different for different
paxGroups. The status object will give information about how
many block pointers it contains. After invoking this method,
the caller should increment the blockId by number of
blockPointers.X100BlockException
public void closeWriter()
@Deprecated public void cleanup(IPaxCallback callBack)
cleanupAndCommit()
call.callBack
- -- this interface will be invoked with the commit statuspublic int cleanup(int blockId) throws X100BlockException
X100BlockException
public int cleanup() throws X100BlockException
X100BlockException
public int cleanupAndCommit() throws X100BlockException
X100BlockException
public int getPaxId()
public int getTotalBlocks()
Copyright © 2016 Actian Corporation. All Rights Reserved.