Interface DataImportChannelItem
- All Superinterfaces:
com.fishlib.base.log.LogOutputAppendable
- All Known Subinterfaces:
IdDataImportChannelItem
- All Known Implementing Classes:
AckMessage
,AckRescanMessage
,AckTruncateMessage
,FilePosition
,FilePosition.Legacy
,PayloadDataImportChannelItem
,RescanDataItem
,TableIdentifierDataItem
,TruncatePartitionDataItem
public interface DataImportChannelItem
extends com.fishlib.base.log.LogOutputAppendable
Interface for all message types exchanged via the data import protocol.
-
Field Summary
Fields Modifier and Type Field Description static int
HEADER_SIZE
static int
MAX_DATA_BODY_SIZE
static int
MAX_NON_DATA_BODY_SIZE
static int
VERSION_SIZE
-
Method Summary
Modifier and Type Method Description DataImportChannelType[]
getAlternateTypes()
Get all alternate types that this item can process as input.int
getCurrentVersion()
Get the latest version supported by this DataImportChannelItem.DataImportChannelType
getPrimaryType()
Get the item type.int
getVersion()
Get the version of this DataImportChannelItem.void
read(ByteBuffer buffer, byte wireDataType)
Fill this item's contents from the supplied buffer.void
send(com.fishlib.io.sched.IOJob job)
Send this item's contents over the supplied I/O job.
-
Field Details
-
HEADER_SIZE
static final int HEADER_SIZE- See Also:
- Constant Field Values
-
VERSION_SIZE
static final int VERSION_SIZE- See Also:
- Constant Field Values
-
MAX_NON_DATA_BODY_SIZE
static final int MAX_NON_DATA_BODY_SIZE- See Also:
- Constant Field Values
-
MAX_DATA_BODY_SIZE
static final int MAX_DATA_BODY_SIZE
-
-
Method Details
-
getPrimaryType
DataImportChannelType getPrimaryType()Get the item type.- Returns:
- The item type
-
getAlternateTypes
DataImportChannelType[] getAlternateTypes()Get all alternate types that this item can process as input.- Returns:
- The alternate Types
-
send
Send this item's contents over the supplied I/O job.
The header format is:
- 1 byte :
DataImportChannelType.getWireValue()
- 4 bytes : int length of implementation data following the type and length
This is followed by a type-specific body representing the item's contents
- Parameters:
job
- The job to send over- Throws:
IOException
- 1 byte :
-
read
Fill this item's contents from the supplied buffer.
Header data as described in
send(IOJob)
will already have been consumed.- Parameters:
buffer
- The buffer to read data fromwireDataType
- the data type from the stream.
-
getVersion
int getVersion()Get the version of this DataImportChannelItem.- Returns:
- the version of the DataImportChannelItem.
-
getCurrentVersion
int getCurrentVersion()Get the latest version supported by this DataImportChannelItem. This is used by abstract implementations to verify the version read off the wire.- Returns:
- the latest version supported by this DataImportChannelItem
-