Java Code Examples for org.apache.flink.runtime.io.network.api.serialization.RecordDeserializer#getCurrentBuffer()

The following examples show how to use org.apache.flink.runtime.io.network.api.serialization.RecordDeserializer#getCurrentBuffer() . 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: AbstractRecordReader.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public void clearBuffers() {
	for (RecordDeserializer<?> deserializer : recordDeserializers) {
		Buffer buffer = deserializer.getCurrentBuffer();
		if (buffer != null && !buffer.isRecycled()) {
			buffer.recycleBuffer();
		}
		deserializer.clear();
	}
}
 
Example 2
Source File: StreamInputProcessor.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public void cleanup() throws IOException {
	// clear the buffers first. this part should not ever fail
	for (RecordDeserializer<?> deserializer : recordDeserializers) {
		Buffer buffer = deserializer.getCurrentBuffer();
		if (buffer != null && !buffer.isRecycled()) {
			buffer.recycleBuffer();
		}
		deserializer.clear();
	}

	// cleanup the barrier handler resources
	barrierHandler.cleanup();
}
 
Example 3
Source File: StreamTwoInputProcessor.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public void cleanup() throws IOException {
	// clear the buffers first. this part should not ever fail
	for (RecordDeserializer<?> deserializer : recordDeserializers) {
		Buffer buffer = deserializer.getCurrentBuffer();
		if (buffer != null && !buffer.isRecycled()) {
			buffer.recycleBuffer();
		}
		deserializer.clear();
	}

	// cleanup the barrier handler resources
	barrierHandler.cleanup();
}
 
Example 4
Source File: AbstractRecordReader.java    From flink with Apache License 2.0 5 votes vote down vote up
public void clearBuffers() {
	for (RecordDeserializer<?> deserializer : recordDeserializers) {
		Buffer buffer = deserializer.getCurrentBuffer();
		if (buffer != null && !buffer.isRecycled()) {
			buffer.recycleBuffer();
		}
		deserializer.clear();
	}
}
 
Example 5
Source File: StreamTaskNetworkInput.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void close() throws IOException {
	// clear the buffers. this part should not ever fail
	for (RecordDeserializer<?> deserializer : recordDeserializers) {
		Buffer buffer = deserializer.getCurrentBuffer();
		if (buffer != null && !buffer.isRecycled()) {
			buffer.recycleBuffer();
		}
		deserializer.clear();
	}

	checkpointedInputGate.cleanup();
}
 
Example 6
Source File: StreamTwoInputProcessor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void close() throws IOException {
	// clear the buffers first. this part should not ever fail
	for (RecordDeserializer<?> deserializer : recordDeserializers) {
		Buffer buffer = deserializer.getCurrentBuffer();
		if (buffer != null && !buffer.isRecycled()) {
			buffer.recycleBuffer();
		}
		deserializer.clear();
	}

	// cleanup the barrier handler resources
	barrierHandler.cleanup();
}
 
Example 7
Source File: AbstractRecordReader.java    From flink with Apache License 2.0 5 votes vote down vote up
public void clearBuffers() {
	for (RecordDeserializer<?> deserializer : recordDeserializers.values()) {
		Buffer buffer = deserializer.getCurrentBuffer();
		if (buffer != null && !buffer.isRecycled()) {
			buffer.recycleBuffer();
		}
		deserializer.clear();
	}
}
 
Example 8
Source File: StreamTaskNetworkInput.java    From flink with Apache License 2.0 5 votes vote down vote up
private void releaseDeserializer(int channelIndex) {
	RecordDeserializer<?> deserializer = recordDeserializers[channelIndex];
	if (deserializer != null) {
		// recycle buffers and clear the deserializer.
		Buffer buffer = deserializer.getCurrentBuffer();
		if (buffer != null && !buffer.isRecycled()) {
			buffer.recycleBuffer();
		}
		deserializer.clear();

		recordDeserializers[channelIndex] = null;
	}
}