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


Java DataInputView.readShort方法代码示例

本文整理汇总了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);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:FlinkKafkaProducer011.java

示例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;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:12,代码来源:ShortPrimitiveArraySerializer.java

示例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;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:8,代码来源:ShortComparator.java

示例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();
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:12,代码来源:ShortValueArray.java

示例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));
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:34,代码来源:KeyedBackendSerializationProxy.java

示例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));
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:14,代码来源:OperatorBackendSerializationProxy.java

示例7: read

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


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