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


Java DataInputView.readFloat方法代码示例

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


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

示例1: compareSerialized

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

示例2: deserialize

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public float[] deserialize(DataInputView source) throws IOException {
	final int len = source.readInt();
	float[] result = new float[len];
	
	for (int i = 0; i < len; i++) {
		result[i] = source.readFloat();
	}
	
	return result;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:12,代码来源:FloatPrimitiveArraySerializer.java

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

示例4: read

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

示例5: read

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
	synchronized (this.confData) {
		final int numberOfProperties = in.readInt();

		for (int i = 0; i < numberOfProperties; i++) {
			String key = StringValue.readString(in);
			Object value;

			byte type = in.readByte();
			switch (type) {
				case TYPE_STRING:
					value = StringValue.readString(in);
					break;
				case TYPE_INT:
					value = in.readInt();
					break;
				case TYPE_LONG:
					value = in.readLong();
					break;
				case TYPE_FLOAT:
					value = in.readFloat();
					break;
				case TYPE_DOUBLE:
					value = in.readDouble();
					break;
				case TYPE_BOOLEAN:
					value = in.readBoolean();
					break;
				case TYPE_BYTES:
					byte[] bytes = new byte[in.readInt()];
					in.readFully(bytes);
					value = bytes;
					break;
				default:
					throw new IOException("Unrecognized type: " + type);
			}

			this.confData.put(key, value);
		}
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:43,代码来源:Configuration.java


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