本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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));
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例11: deserialize
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public Tuple0 deserialize(Tuple0 reuse, DataInputView source) throws IOException {
source.readByte();
return reuse;
}
示例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;
}
示例13: deserialize
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public Void deserialize(Void reuse, DataInputView source) throws IOException {
source.readByte();
return null;
}
示例14: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
this.value = in.readByte();
}
示例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();
}