public abstract class BasicSource extends Object implements Source
| Modifier | Constructor and Description |
|---|---|
protected |
BasicSource() |
protected |
BasicSource(org.json.JSONObject config) |
protected |
BasicSource(String defaultPipelineName) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected long[] |
getBackoffTimes() |
MessageAndRouting |
getNextMessage(StreamProcessingContext spc,
long timeUnit,
TimeUnit units)
This basic implementation polls the internalGetNextMessage call periodically until it returns a message, or
the operation time limit is reached.
|
protected abstract MessageAndRouting |
internalGetNextMessage(StreamProcessingContext spc)
Get the next pending message, if any.
|
boolean |
isEof()
Is the source at EOF? Not all sources are bounded, so they may
always return false.
|
protected MessageAndRouting |
makeDefRoutingMessage(Message msg) |
void |
markComplete(StreamProcessingContext spc,
MessageAndRouting mr)
Called by the processing engine when processing for a given message is complete.
|
protected void |
noteEndOfStream() |
void |
requeue(MessageAndRouting msgAndRoute)
Requeue a message for delivery into the given pipeline
|
protected BasicSource(String defaultPipelineName)
protected BasicSource(org.json.JSONObject config)
protected BasicSource()
public boolean isEof()
Sourcepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void requeue(MessageAndRouting msgAndRoute)
Sourcepublic final MessageAndRouting getNextMessage(StreamProcessingContext spc, long timeUnit, TimeUnit units) throws IOException, InterruptedException
getNextMessage in interface SourceIOExceptionInterruptedExceptionpublic void markComplete(StreamProcessingContext spc, MessageAndRouting mr)
SourcemarkComplete in interface Sourceprotected abstract MessageAndRouting internalGetNextMessage(StreamProcessingContext spc) throws IOException, InterruptedException
spc - IOExceptionInterruptedExceptionprotected long[] getBackoffTimes()
protected MessageAndRouting makeDefRoutingMessage(Message msg)
protected void noteEndOfStream()
Copyright © 2021 continual.io. All rights reserved.