当前位置: 首页>>代码示例>>Java>>正文


Java DataInputView.readByte方法代码示例

本文整理汇总了Java中org.apache.flink.core.memory.DataInputView.readByte方法的典型用法代码示例。如果您正苦于以下问题:Java DataInputView.readByte方法的具体用法?Java DataInputView.readByte怎么用?Java DataInputView.readByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.flink.core.memory.DataInputView的用法示例。


在下文中一共展示了DataInputView.readByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public StreamElement deserialize(DataInputView source) throws IOException {
	int tag = source.readByte();
	if (tag == TAG_REC_WITH_TIMESTAMP) {
		long timestamp = source.readLong();
		return new StreamRecord<T>(typeSerializer.deserialize(source), timestamp);
	}
	else if (tag == TAG_REC_WITHOUT_TIMESTAMP) {
		return new StreamRecord<T>(typeSerializer.deserialize(source));
	}
	else if (tag == TAG_WATERMARK) {
		return new Watermark(source.readLong());
	}
	else {
		throw new IOException("Corrupt stream, found tag: " + tag);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:18,代码来源:MultiplexingStreamRecordSerializer.java

示例2: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public StreamElement deserialize(DataInputView source) throws IOException {
	int tag = source.readByte();
	if (tag == TAG_REC_WITH_TIMESTAMP) {
		long timestamp = source.readLong();
		return new StreamRecord<T>(typeSerializer.deserialize(source), timestamp);
	}
	else if (tag == TAG_REC_WITHOUT_TIMESTAMP) {
		return new StreamRecord<T>(typeSerializer.deserialize(source));
	}
	else if (tag == TAG_WATERMARK) {
		return new Watermark(source.readLong());
	}
	else if (tag == TAG_LATENCY_MARKER) {
		return new LatencyMarker(source.readLong(), source.readInt(), source.readInt());
	}
	else {
		throw new IOException("Corrupt stream, found tag: " + tag);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:21,代码来源:MultiplexingStreamRecordSerializer.java

示例3: copy

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	int tag = source.readByte();
	target.write(tag);

	if (tag == TAG_REC_WITH_TIMESTAMP) {
		// move timestamp
		target.writeLong(source.readLong());
		typeSerializer.copy(source, target);
	}
	else if (tag == TAG_REC_WITHOUT_TIMESTAMP) {
		typeSerializer.copy(source, target);
	}
	else if (tag == TAG_WATERMARK) {
		target.writeLong(source.readLong());
	}
	else if (tag == TAG_LATENCY_MARKER) {
		target.writeLong(source.readLong());
		target.writeInt(source.readInt());
		target.writeInt(source.readInt());
	} else {
		throw new IOException("Corrupt stream, found tag: " + tag);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:25,代码来源:MultiplexingStreamRecordSerializer.java

示例4: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public StreamElement deserialize(DataInputView source) throws IOException {
	int tag = source.readByte();
	if (tag == TAG_REC_WITH_TIMESTAMP) {
		long timestamp = source.readLong();
		return new StreamRecord<T>(typeSerializer.deserialize(source), timestamp);
	}
	else if (tag == TAG_REC_WITHOUT_TIMESTAMP) {
		return new StreamRecord<T>(typeSerializer.deserialize(source));
	}
	else if (tag == TAG_WATERMARK) {
		return new Watermark(source.readLong());
	}
	else if (tag == TAG_STREAM_STATUS) {
		return new StreamStatus(source.readInt());
	}
	else if (tag == TAG_LATENCY_MARKER) {
		return new LatencyMarker(source.readLong(), source.readInt(), source.readInt());
	}
	else {
		throw new IOException("Corrupt stream, found tag: " + tag);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:24,代码来源:StreamElementSerializer.java

示例5: readKeyGroup

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
private int readKeyGroup(DataInputView inputView) throws IOException {
	int keyGroup = 0;
	for (int i = 0; i < backend.getKeyGroupPrefixBytes(); ++i) {
		keyGroup <<= 8;
		keyGroup |= (inputView.readByte() & 0xFF);
	}
	return keyGroup;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:9,代码来源:AbstractRocksDBState.java

示例6: compareSerialized

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public int compareSerialized(DataInputView firstSource, DataInputView secondSource) throws IOException {
	byte b1 = firstSource.readByte();
	byte b2 = secondSource.readByte();
	int comp = (b1 < b2 ? -1 : (b1 == b2 ? 0 : 1)); 
	return ascendingComparison ? comp : -comp; 
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:8,代码来源:ByteComparator.java

示例7: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public TaggedUnion<T1, T2> deserialize(TaggedUnion<T1, T2> reuse,
		DataInputView source) throws IOException {
	byte tag = source.readByte();
	if (tag == 1) {
		return TaggedUnion.one(oneSerializer.deserialize(source));
	} else {
		return TaggedUnion.two(twoSerializer.deserialize(source));
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:CoGroupedStreams.java

示例8: copy

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	int tag = source.readByte();
	target.write(tag);

	if (tag == TAG_REC_WITH_TIMESTAMP) {
		// move timestamp
		target.writeLong(source.readLong());
		typeSerializer.copy(source, target);
	}
	else if (tag == TAG_REC_WITHOUT_TIMESTAMP) {
		typeSerializer.copy(source, target);
	}
	else if (tag == TAG_WATERMARK) {
		target.writeLong(source.readLong());
	}
	else if (tag == TAG_STREAM_STATUS) {
		target.writeInt(source.readInt());
	}
	else if (tag == TAG_LATENCY_MARKER) {
		target.writeLong(source.readLong());
		target.writeInt(source.readInt());
		target.writeInt(source.readInt());
	} else {
		throw new IOException("Corrupt stream, found tag: " + tag);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:StreamElementSerializer.java

示例9: read

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
	val = in.readInt();
	isLong = in.readBoolean();
	
	if (isLong) {
		for (int i = 0; i < BUFFER.length; i++) {
			byte b = in.readByte();
			assertEquals(BUFFER[i], b);
		}
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:13,代码来源:ExternalSortLargeRecordsITCase.java

示例10: readVariableIntBytes

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
private void readVariableIntBytes(DataInputView inputView, int value) throws IOException {
	do {
		inputView.readByte();
		value >>>= 8;
	} while (value != 0);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:7,代码来源:AbstractRocksDBState.java

示例11: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public Tuple0 deserialize(Tuple0 reuse, DataInputView source) throws IOException {
	source.readByte();
	return reuse;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:Tuple0Serializer.java

示例12: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public GlobalWindow deserialize(GlobalWindow reuse,
		DataInputView source) throws IOException {
	source.readByte();
	return GlobalWindow.INSTANCE;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:7,代码来源:GlobalWindow.java

示例13: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public Void deserialize(Void reuse, DataInputView source) throws IOException {
	source.readByte();
	return null;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:VoidSerializer.java

示例14: read

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
	this.value = in.readByte();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:5,代码来源:ByteValue.java

示例15: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public VoidNamespace deserialize(VoidNamespace reuse, DataInputView source) throws IOException {
	source.readByte();
	return VoidNamespace.get();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:VoidNamespaceSerializer.java


注:本文中的org.apache.flink.core.memory.DataInputView.readByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。