public class VectorDataTransfer extends Object
connect
to connect to the X100 server handling this particular transfer. Note
that the vector size used specifies the number of rows that can be sent per data block (called an
IOB or I/O buffer within X100net).initializeTransfer
to specify which columns are being loaded and which columns
are excluded from the load. This call returns an array of column identifiers in the same order as the
list of included column names. These identifiers are needed on calls to set data per column.set[Type]
method for each included
column to push data values into the IOB through the JNI layear. Direct buffers should be used to
allow much more efficient movement of the data. Only non-null values should be pushed to the
data buffer.pushVector
method to push the current vector of data values to the X100
server. If more data is available to load, use the data data[Type]
set methods to
push more data. Ensure to call pushBlock
on the last, possibly incomplete set of data.
close
to send an end of data signal to the X100 server and to free
up all resources on the JNI side. Once close is called, the connection cannot be used again.Constructor and Description |
---|
VectorDataTransfer() |
Modifier and Type | Method and Description |
---|---|
void |
close(int connectionID)
Close the connection with the given connection ID.
|
int |
connect(String host,
String port,
String user,
String password,
String table,
int vectorSize)
Connect to the X100 transfer agent at the given address.
|
int[] |
initializeTransfer(int connectionID,
String[] includedColumns,
String[] excludedColumns)
Initialize the transfer specifying the set of columns to load and the columns excluded
from the load.
|
static boolean |
isWindows()
Verify if OS is windows
|
int |
pushVector(int connectionID,
int validRowCount)
Push the vectors of data set using the
set[Type] function(s) to the connected X100 server. |
int |
set128Bit(int connectionID,
int columnIdx,
ByteBuffer values,
ByteBuffer nullMarkers)
Set a vector of 16-byte integral values for the specified column.
|
int |
setByte(int connectionID,
int columnIdx,
ByteBuffer values,
ByteBuffer nullMarkers)
Set a vector of 1-byte integral values for the specified column.
|
int |
setDouble(int connectionID,
int columnIdx,
ByteBuffer values,
ByteBuffer nullMarkers)
Set a vector of 8-byte floating point values for the specified column.
|
int |
setFloat(int connectionID,
int columnIdx,
ByteBuffer values,
ByteBuffer nullMarkers)
Set a vector of 4-byte floating point values for the specified column.
|
int |
setInt(int connectionID,
int columnIdx,
ByteBuffer values,
ByteBuffer nullMarkers)
Set a vector of 4-byte values for the specified column.
|
int |
setLong(int connectionID,
int columnIdx,
ByteBuffer values,
ByteBuffer nullMarkers)
Set a vector of 8-byte integral values for the specified column.
|
int |
setShort(int connectionID,
int columnIdx,
ByteBuffer values,
ByteBuffer nullMarkers)
Set a vector of 2-byte integral values for the specified column.
|
int |
setString(int connectionID,
int columnIdx,
ByteBuffer values,
ByteBuffer nullMarkers)
Set string data for the specified column.
|
public static boolean isWindows()
public int connect(String host, String port, String user, String password, String table, int vectorSize) throws IllegalArgumentException, IOException
host
- name of the Vector server handling this transferport
- IP port of the transfer connectionuser
- data transfer user name (generated by Vector)password
- data transfer password (generated by Vector)table
- name of the target tablevectorSize
- cardinality of vectors to use for sending data (defaults to 1024)IllegalArgumentException
- thrown if any of the given arguments are invalid (i.e. null)IOException
- thrown for errors interfacing with X100public int[] initializeTransfer(int connectionID, String[] includedColumns, String[] excludedColumns) throws IllegalArgumentException, IOException
connectionID
- connection identifierincludedColumns
- list of the names of columns to load (should never be empty)excludedColumns
- list of the names of columns not being loaded (may be empty)IllegalArgumentException
IOException
public int setByte(int connectionID, int columnIdx, ByteBuffer values, ByteBuffer nullMarkers) throws IOException
connectionID
- connection identifiercolumnIdx
- identifier of the column to loadvalues
- buffer of non-null data valuesnullMarkers
- buffer of null indicators (optional, null for no markers)IOException
- thrown for any I/O errors that may occurpublic int setShort(int connectionID, int columnIdx, ByteBuffer values, ByteBuffer nullMarkers) throws IOException
connectionID
- connection identifiercolumnIdx
- identifier of the column to loadvalues
- buffer of non-null data valuesnullMarkers
- buffer of null indicators (optional, null for no markers)IOException
- thrown for any I/O errors that may occurpublic int setInt(int connectionID, int columnIdx, ByteBuffer values, ByteBuffer nullMarkers) throws IOException
connectionID
- connection identifiercolumnIdx
- identifier of the column to loadvalues
- buffer of non-null data valuesnullMarkers
- buffer of null indicators (optional, null for no markers)IOException
- thrown for any I/O errors that may occurpublic int setLong(int connectionID, int columnIdx, ByteBuffer values, ByteBuffer nullMarkers) throws IOException
connectionID
- connection identifiercolumnIdx
- identifier of the column to loadvalues
- buffer of non-null data valuesnullMarkers
- buffer of null indicators (optional, null for no markers)IOException
- thrown for any I/O errors that may occurpublic int set128Bit(int connectionID, int columnIdx, ByteBuffer values, ByteBuffer nullMarkers) throws IOException
connectionID
- connection identifiercolumnIdx
- identifier of the column to loadvalues
- buffer of non-null data valuesnullMarkers
- buffer of null indicators (optional, null for no markers)IOException
- thrown for any I/O errors that may occurpublic int setDouble(int connectionID, int columnIdx, ByteBuffer values, ByteBuffer nullMarkers) throws IOException
connectionID
- connection identifiercolumnIdx
- identifier of the column to loadvalues
- buffer of non-null data valuesnullMarkers
- buffer of null indicators (optional, null for no markers)IOException
- thrown for any I/O errors that may occurpublic int setFloat(int connectionID, int columnIdx, ByteBuffer values, ByteBuffer nullMarkers) throws IOException
connectionID
- connection identifiercolumnIdx
- identifier of the column to loadvalues
- buffer of non-null data valuesnullMarkers
- buffer of null indicators (optional, null for no markers)IOException
- thrown for any I/O errors that may occurpublic int setString(int connectionID, int columnIdx, ByteBuffer values, ByteBuffer nullMarkers) throws IOException
connectionID
- connection identifiercolumnIdx
- identifier of the column to loadvalues
- buffer of non-null string data valuesnullMarkers
- buffer of null indicators (optional)IOException
- thrown for any I/O errors that may occurpublic int pushVector(int connectionID, int validRowCount) throws IOException
set[Type]
function(s) to the connected X100 server.
Specify the number of rows with valid data within the current vector buffer. The row count should be constrained
by the vector size specified during creation of the connection. Each column
should have pushed the same number of values.connectionID
- connection identifiervalidRowCount
- the number of rows with valid data to push to X100IOException
- thrown for any I/O error sending the data to X100public void close(int connectionID) throws IOException
connectionID
- identifier of the connectionIOException
Copyright © 2016 Actian Corporation. All Rights Reserved.