本文整理汇总了Java中org.apache.flink.core.memory.DataInputView.readShort方法的典型用法代码示例。如果您正苦于以下问题:Java DataInputView.readShort方法的具体用法?Java DataInputView.readShort怎么用?Java DataInputView.readShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.core.memory.DataInputView
的用法示例。
在下文中一共展示了DataInputView.readShort方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public KafkaTransactionState deserialize(DataInputView source) throws IOException {
String transactionalId = null;
if (source.readBoolean()) {
transactionalId = source.readUTF();
}
long producerId = source.readLong();
short epoch = source.readShort();
return new KafkaTransactionState(transactionalId, producerId, epoch, null);
}
示例2: deserialize
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public short[] deserialize(DataInputView source) throws IOException {
final int len = source.readInt();
short[] array = new short[len];
for (int i = 0; i < len; i++) {
array[i] = source.readShort();
}
return array;
}
示例3: compareSerialized
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public int compareSerialized(DataInputView firstSource, DataInputView secondSource) throws IOException {
short s1 = firstSource.readShort();
short s2 = secondSource.readShort();
int comp = (s1 < s2 ? -1 : (s1 == s2 ? 0 : 1));
return ascendingComparison ? comp : -comp;
}
示例4: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
position = in.readInt();
mark = 0;
ensureCapacity(position);
for (int i = 0; i < position; i++) {
data[i] = in.readShort();
}
}
示例5: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
final int readVersion = getReadVersion();
if (readVersion >= 4) {
usingKeyGroupCompression = in.readBoolean();
} else {
usingKeyGroupCompression = false;
}
// only starting from version 3, we have the key serializer and its config snapshot written
if (readVersion >= 3) {
Tuple2<TypeSerializer<?>, TypeSerializerConfigSnapshot> keySerializerAndConfig =
TypeSerializerSerializationUtil.readSerializersAndConfigsWithResilience(in, userCodeClassLoader).get(0);
this.keySerializer = (TypeSerializer<K>) keySerializerAndConfig.f0;
this.keySerializerConfigSnapshot = keySerializerAndConfig.f1;
} else {
this.keySerializer = TypeSerializerSerializationUtil.tryReadSerializer(in, userCodeClassLoader);
this.keySerializerConfigSnapshot = null;
}
int numKvStates = in.readShort();
stateMetaInfoSnapshots = new ArrayList<>(numKvStates);
for (int i = 0; i < numKvStates; i++) {
stateMetaInfoSnapshots.add(
KeyedBackendStateMetaInfoSnapshotReaderWriters
.getReaderForVersion(getReadVersion(), userCodeClassLoader)
.readStateMetaInfo(in));
}
}
示例6: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
int numKvStates = in.readShort();
stateMetaInfoSnapshots = new ArrayList<>(numKvStates);
for (int i = 0; i < numKvStates; i++) {
stateMetaInfoSnapshots.add(
OperatorBackendStateMetaInfoSnapshotReaderWriters
.getReaderForVersion(getReadVersion(), userCodeClassLoader)
.readStateMetaInfo(in));
}
}
示例7: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
this.value = in.readShort();
}