Package org.pentaho.di.core
Class BlockingBatchingRowSet
java.lang.Object
org.pentaho.di.core.BlockingBatchingRowSet
- All Implemented Interfaces:
Comparable<RowSet>
,RowSet
Contains a buffer of rows. Instead of passing rows along the chain immediately we will batch them up to lower locking
overhead. The row set will start in accepting mode (accepting = true) It will remain there until the buffer is full.
Then it will switch to delivering mode (accepting = false) It will remain there until the buffer is empty.
When the row set is done and no more rows will be entering the row set we will switch to delivering mode.
- Since:
- 04-05-2011
- Author:
- Matt
-
Field Summary
Modifier and TypeFieldDescriptionprotected AtomicInteger
protected String
protected AtomicBoolean
protected AtomicInteger
protected String
protected String
protected RowMetaInterface
-
Constructor Summary
ConstructorDescriptionBlockingBatchingRowSet
(int maxSize) Create new non-blocking-queue with maxSize capacity. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear this rowset: remove all rows and remove the "done" flag.int
Compares using the target steps and copy, not the source.boolean
equals
(org.pentaho.di.core.BaseRowSet rowSet) int
getName()
int
Object[]
getRow()
Get a row from the input buffer, it blocks for a short period until a new row becomes available.Object[]
Get the first row in the list immediately.Object[]
getRowWait
(long timeout, TimeUnit tu) get the first row in the list immediately if it is available or wait until timeoutboolean
By default we don't report blocking, only for monitored transformations.boolean
isDone()
boolean
putRow
(RowMetaInterface rowMeta, Object[] rowData) Offer a row of data to this rowset providing for the description (metadata) of the row.boolean
putRowWait
(RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu) We need to wait untilvoid
setDone()
void
setRemoteSlaveServerName
(String remoteSlaveServerName) void
setRowMeta
(RowMetaInterface rowMeta) void
setThreadNameFromToCopy
(String from, int fromCopy, String to, int toCopy) This method is used only in Trans.java when created RowSet at line 333.int
size()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.pentaho.di.core.RowSet
getDestinationStepCopy, getDestinationStepName, getName, getOriginStepCopy, getOriginStepName, getRemoteSlaveServerName, getRowMeta, isBlocking, isDone, setRemoteSlaveServerName, setRowMeta, setThreadNameFromToCopy
-
Field Details
-
rowMeta
-
done
-
originStepName
-
originStepCopy
-
destinationStepName
-
destinationStepCopy
-
remoteSlaveServerName
-
-
Constructor Details
-
BlockingBatchingRowSet
public BlockingBatchingRowSet(int maxSize) Create new non-blocking-queue with maxSize capacity.- Parameters:
maxSize
-
-
-
Method Details
-
putRow
Description copied from interface:RowSet
Offer a row of data to this rowset providing for the description (metadata) of the row. If the buffer is full, wait (block) for a small period of time. -
putRowWait
We need to wait until- Specified by:
putRowWait
in interfaceRowSet
- Parameters:
rowMeta
- The description of the row datarowData
- the row of datatime
- The number of units of timetu
- The unit of time to use- Returns:
- true if the row was successfully added to the rowset and false if this buffer was full.
-
getRow
Description copied from interface:RowSet
Get a row from the input buffer, it blocks for a short period until a new row becomes available. Otherwise, it returns null. -
getRowImmediate
Description copied from interface:RowSet
Get the first row in the list immediately.- Specified by:
getRowImmediate
in interfaceRowSet
- Returns:
- a row of data or null if no row is available.
-
getRowWait
Description copied from interface:RowSet
get the first row in the list immediately if it is available or wait until timeout- Specified by:
getRowWait
in interfaceRowSet
- Returns:
- a row of data or null if no row is available.
-
size
public int size() -
setDone
public void setDone() -
clear
public void clear()Description copied from interface:RowSet
Clear this rowset: remove all rows and remove the "done" flag. -
compareTo
Compares using the target steps and copy, not the source. That way, re-partitioning is always done in the same way.- Specified by:
compareTo
in interfaceComparable<RowSet>
-
equals
public boolean equals(org.pentaho.di.core.BaseRowSet rowSet) -
isDone
public boolean isDone() -
getOriginStepName
- Specified by:
getOriginStepName
in interfaceRowSet
- Returns:
- Returns the originStepName.
-
getOriginStepCopy
public int getOriginStepCopy()- Specified by:
getOriginStepCopy
in interfaceRowSet
- Returns:
- Returns the originStepCopy.
-
getDestinationStepName
- Specified by:
getDestinationStepName
in interfaceRowSet
- Returns:
- Returns the destinationStepName.
-
getDestinationStepCopy
public int getDestinationStepCopy()- Specified by:
getDestinationStepCopy
in interfaceRowSet
- Returns:
- Returns the destinationStepCopy.
-
getName
-
setThreadNameFromToCopy
Description copied from interface:RowSet
This method is used only in Trans.java when created RowSet at line 333. Don't need any synchronization on this method- Specified by:
setThreadNameFromToCopy
in interfaceRowSet
-
toString
-
getRowMeta
- Specified by:
getRowMeta
in interfaceRowSet
- Returns:
- the rowMeta
-
setRowMeta
- Specified by:
setRowMeta
in interfaceRowSet
- Parameters:
rowMeta
- the rowMeta to set
-
getRemoteSlaveServerName
- Specified by:
getRemoteSlaveServerName
in interfaceRowSet
- Returns:
- the targetSlaveServer
-
setRemoteSlaveServerName
- Specified by:
setRemoteSlaveServerName
in interfaceRowSet
- Parameters:
remoteSlaveServerName
- the remote slave server to set
-
isBlocking
public boolean isBlocking()By default we don't report blocking, only for monitored transformations.- Specified by:
isBlocking
in interfaceRowSet
- Returns:
- true if this row set is blocking on reading or writing.
-