Package com.streambase.sb.unittest
Interface Dequeuer
-
public interface DequeuerA Dequeuer is used for dequeueing tuples from a specific stream.- Since:
- 6.6
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_TIMEOUTThe default timeout value: 3static TimeUnitDEFAULT_TIMEOUT_UNITThe default timeout units:TimeUnit.SECONDS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Tuple>dequeue(int numTuples)Try to dequeue tuples with theDEFAULT_TIMEOUTandDEFAULT_TIMEOUT_UNITif numTuples == 0 will return immediately if numTuples < 0 will wait the maximum timeout before returningList<Tuple>dequeue(int numTuples, long timeout, TimeUnit timeUnit)Try to dequeue tuples within a provided timeout.voiddrain()Drain any tuples that are currently in flight in the server.SchemagetSchema()StreamPropertiesgetStreamProperties()Get theStreamPropertiesfor the associated stream.
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
static final long DEFAULT_TIMEOUT
The default timeout value: 3- See Also:
- Constant Field Values
-
DEFAULT_TIMEOUT_UNIT
static final TimeUnit DEFAULT_TIMEOUT_UNIT
The default timeout units:TimeUnit.SECONDS
-
-
Method Detail
-
getStreamProperties
StreamProperties getStreamProperties()
Get theStreamPropertiesfor the associated stream.- Returns:
- Stream properties
-
getSchema
Schema getSchema()
- Returns:
- Schema
-
dequeue
List<Tuple> dequeue(int numTuples) throws StreamBaseException
Try to dequeue tuples with theDEFAULT_TIMEOUTandDEFAULT_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
List<Tuple> dequeue(int numTuples, long timeout, TimeUnit timeUnit) throws StreamBaseException
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
void drain() throws StreamBaseExceptionDrain 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
-
-