T
- SourceData that this factory makespublic abstract class SourceDataFactory<T extends SourceData>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int[] |
columnNumbers
Column numbers to pass when creating new SourceDatas.
|
protected FreeQueue<SourceWorkUnit<T>> |
freeWorkUnits |
protected boolean |
setsRowtime |
protected boolean |
singleDatumPerWorkUnit |
protected java.lang.Object[] |
startupPositionKey
Position at which to start reading the source data
|
Modifier | Constructor and Description |
---|---|
protected |
SourceDataFactory(java.lang.String[] supportedColumnNames,
EcdaReaderContext context,
int numBuffers)
Create new Factory.
|
protected |
SourceDataFactory(java.lang.String[] supportedColumnNames,
EcdaReaderContext context,
int numWorkUnits,
int workSize,
boolean sharedBuffer)
Create new Factory.
|
protected |
SourceDataFactory(java.lang.String[] supportedColumnNames,
EcdaReaderContext context,
int numWorkUnits,
int maxConnections,
int workSize,
boolean sharedBuffer,
boolean singleDatumPerWorkUnit)
Create new Factory.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
freeBuffer(SourceWorkUnit<?> bufferInfo)
Return a SourceData to free queue.
|
java.lang.Object[] |
getStartupPositionKey()
Retrieve the startup position key.
|
SourceWorkUnit<T> |
getWorkUnit()
Get a SourceWorkUnit from free queue.
|
SourceWorkUnit<T> |
getWorkUnit(long maxMillis)
Deprecated.
|
boolean |
hasAvailableBuffer()
Check if there is a SourceData available without waiting.
|
protected abstract T |
newBufferInfo()
Override to create the appropriate SourceData.
|
void |
setStartupPositionKey(java.lang.Object[] positionKey)
Initialize the startup position key.
|
protected final int[] columnNumbers
protected final FreeQueue<SourceWorkUnit<T extends SourceData>> freeWorkUnits
protected java.lang.Object[] startupPositionKey
protected final boolean setsRowtime
protected final boolean singleDatumPerWorkUnit
protected SourceDataFactory(java.lang.String[] supportedColumnNames, EcdaReaderContext context, int numWorkUnits, int workSize, boolean sharedBuffer) throws java.sql.SQLException
SourceData.buffer
will be set and positioned for each call
to BuffersInputStream.Connection.getCurrentWithSize(int)
.
Use BuffersInputStream.Connection.getCurrentWithSize(int)
and BuffersInputStream.Connection.submit()
for each message. Call BuffersInputStream.Connection.flush()
after
each work unit.supportedColumnNames
- Supported metadata Column namescontext
- context of DataInputSourcenumWorkUnits
- number of work units to allow queuing in BuffersInputStreamworkSize
- Maximum number of bytes per work unitsharedBuffer
- Use shared buffer for SourceDatas within work unitjava.sql.SQLException
protected SourceDataFactory(java.lang.String[] supportedColumnNames, EcdaReaderContext context, int numBuffers) throws java.sql.SQLException
BuffersInputStream.Connection.getCurrent()
and BuffersInputStream.Connection.submit()
for each work unit.supportedColumnNames
- Supported metadata Column namescontext
- context of DataInputSourcenumBuffers
- number of buffers to allow queuing in BuffersInputStreamjava.sql.SQLException
protected SourceDataFactory(java.lang.String[] supportedColumnNames, EcdaReaderContext context, int numWorkUnits, int maxConnections, int workSize, boolean sharedBuffer, boolean singleDatumPerWorkUnit) throws java.sql.SQLException
supportedColumnNames
- Supported metadata Column namescontext
- context of DataInputSourcenumWorkUnits
- number of work units to allow queuing in BuffersInputStreammaxConnections
- Maximum number of simultaneous connectionsworkSize
- Maximum number of bytes per work unitsharedBuffer
- Use shared buffer for SourceDatas within work unitsingleDatumPerWorkUnit
- Use single SourceData per work unitjava.sql.SQLException
protected abstract T newBufferInfo()
public void setStartupPositionKey(java.lang.Object[] positionKey)
positionKey
- The place where we want to resume reading source data.public java.lang.Object[] getStartupPositionKey()
public SourceWorkUnit<T> getWorkUnit() throws java.lang.InterruptedException
BuffersInputStream.Connection
.java.lang.InterruptedException
@Deprecated public SourceWorkUnit<T> getWorkUnit(long maxMillis) throws java.lang.InterruptedException
BuffersInputStream.Connection
.
(Now only returns early if factory is closed - same as getWorkUnit())maxMillis
- number of milliseconds to waitjava.lang.InterruptedException
public void freeBuffer(SourceWorkUnit<?> bufferInfo)
BuffersInputStream.Connection
.bufferInfo
- SourceData to freepublic boolean hasAvailableBuffer()
public void close()
Copyright (C) 2003-2021 SQLstream, Inc.