Package com.streambase.sb.unittest
Interface Dequeuer
public interface Dequeuer
A Dequeuer is used for dequeueing tuples from a specific stream.
- Since:
- 6.6
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
The default timeout value: 3static final TimeUnit
The default timeout units:TimeUnit.SECONDS
-
Method Summary
Modifier and TypeMethodDescriptiondequeue
(int numTuples) Try to dequeue tuples with theDEFAULT_TIMEOUT
andDEFAULT_TIMEOUT_UNIT
if numTuples == 0 will return immediately if numTuples < 0 will wait the maximum timeout before returningTry to dequeue tuples within a provided timeout.void
drain()
Drain any tuples that are currently in flight in the server.Get theStreamProperties
for the associated stream.
-
Field Details
-
DEFAULT_TIMEOUT
static final long DEFAULT_TIMEOUTThe default timeout value: 3- See Also:
-
DEFAULT_TIMEOUT_UNIT
The default timeout units:TimeUnit.SECONDS
-
-
Method Details
-
getStreamProperties
StreamProperties getStreamProperties()Get theStreamProperties
for the associated stream.- Returns:
- Stream properties
-
getSchema
Schema getSchema()- Returns:
- Schema
-
dequeue
Try to dequeue tuples with theDEFAULT_TIMEOUT
andDEFAULT_TIMEOUT_UNIT
- if numTuples == 0 will return immediately
- if numTuples < 0 will wait the maximum timeout before returning
- Parameters:
numTuples
- the number of tuples to dequeue- Returns:
- all of the tuples dequeued before the timeout, possibly an empty list
- Throws:
StreamBaseException
- Dequeue failed
-
dequeue
Try to dequeue tuples within a provided timeout.- if numTuples == 0 will return immediately
- if numTuples < 0 will wait the maximum timeout before returning
- Parameters:
numTuples
- the number of tuples to dequeuetimeout
- the maximum time to waittimeUnit
- the time unit of timeout argument- Returns:
- all of the tuples dequeued before the timeout, possibly an empty list
- Throws:
StreamBaseException
- Dequeue failed
-
drain
Drain any tuples that are currently in flight in the server. This method should not normally be called, but is provided to speed up things that expect no output.- Throws:
StreamBaseException
- Drain failed
-