Java Code Examples for org.apache.flink.runtime.io.network.partition.ResultSubpartition.BufferAndBacklog#nextBufferIsEvent()

The following examples show how to use org.apache.flink.runtime.io.network.partition.ResultSubpartition.BufferAndBacklog#nextBufferIsEvent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PartitionRequestQueueTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public BufferAndBacklog getNextBuffer() {
	BufferAndBacklog nextBuffer = super.getNextBuffer();
	return new BufferAndBacklog(
		nextBuffer.buffer().readOnlySlice(),
		nextBuffer.isMoreAvailable(),
		nextBuffer.buffersInBacklog(),
		nextBuffer.nextBufferIsEvent());
}
 
Example 2
Source File: PartitionRequestQueueTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public BufferAndBacklog getNextBuffer() {
	BufferAndBacklog nextBuffer = super.getNextBuffer();
	return new BufferAndBacklog(
		nextBuffer.buffer().readOnlySlice(),
		nextBuffer.isMoreAvailable(),
		nextBuffer.buffersInBacklog(),
		nextBuffer.nextBufferIsEvent());
}
 
Example 3
Source File: CreditBasedSequenceNumberingViewReader.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Check whether this reader is available or not (internal use, in sync with
 * {@link #isAvailable()}, but slightly faster).
 *
 * <p>Returns true only if the next buffer is an event or the reader has both available
 * credits and buffers.
 *
 * @param bufferAndBacklog
 * 		current buffer and backlog including information about the next buffer
 */
private boolean isAvailable(BufferAndBacklog bufferAndBacklog) {
	// BEWARE: this must be in sync with #isAvailable()!
	return bufferAndBacklog.isMoreAvailable() &&
		(numCreditsAvailable > 0 || bufferAndBacklog.nextBufferIsEvent());
}
 
Example 4
Source File: CreditBasedSequenceNumberingViewReader.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Check whether this reader is available or not (internal use, in sync with
 * {@link #isAvailable()}, but slightly faster).
 *
 * <p>Returns true only if the next buffer is an event or the reader has both available
 * credits and buffers.
 *
 * @param bufferAndBacklog
 * 		current buffer and backlog including information about the next buffer
 */
private boolean isAvailable(BufferAndBacklog bufferAndBacklog) {
	// BEWARE: this must be in sync with #isAvailable()!
	return bufferAndBacklog.isMoreAvailable() &&
		(numCreditsAvailable > 0 || bufferAndBacklog.nextBufferIsEvent());
}