Java Code Examples for org.apache.flink.core.memory.DataOutputView#writeFloat()

The following examples show how to use org.apache.flink.core.memory.DataOutputView#writeFloat() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public void serialize(float[] record, DataOutputView target) throws IOException {
	if (record == null) {
		throw new IllegalArgumentException("The record must not be null.");
	}
	
	final int len = record.length;
	target.writeInt(len);
	for (int i = 0; i < len; i++) {
		target.writeFloat(record[i]);
	}
}
 
Example 2
Source Project: flink   File: FloatValueArray.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeInt(position);

	for (int i = 0; i < position; i++) {
		out.writeFloat(data[i]);
	}
}
 
Example 3
Source Project: Flink-CEPplus   File: FloatValueArray.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeInt(position);

	for (int i = 0; i < position; i++) {
		out.writeFloat(data[i]);
	}
}
 
Example 4
@Override
public void serialize(float[] record, DataOutputView target) throws IOException {
	if (record == null) {
		throw new IllegalArgumentException("The record must not be null.");
	}
	
	final int len = record.length;
	target.writeInt(len);
	for (int i = 0; i < len; i++) {
		target.writeFloat(record[i]);
	}
}
 
Example 5
Source Project: flink   File: FloatValueArray.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeInt(position);

	for (int i = 0; i < position; i++) {
		out.writeFloat(data[i]);
	}
}
 
Example 6
Source Project: Flink-CEPplus   File: FloatSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(Float record, DataOutputView target) throws IOException {
	target.writeFloat(record);
}
 
Example 7
Source Project: Flink-CEPplus   File: FloatSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeFloat(source.readFloat());
}
 
Example 8
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeFloat(source.readFloat());
}
 
Example 9
Source Project: Flink-CEPplus   File: FloatValue.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeFloat(this.value);
}
 
Example 10
Source Project: Flink-CEPplus   File: FloatType.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeFloat(this.value);
}
 
Example 11
Source Project: flink   File: FloatSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(Float record, DataOutputView target) throws IOException {
	target.writeFloat(record);
}
 
Example 12
Source Project: flink   File: FloatSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeFloat(source.readFloat());
}
 
Example 13
Source Project: flink   File: FloatValueSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeFloat(source.readFloat());
}
 
Example 14
Source Project: flink   File: FloatValue.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeFloat(this.value);
}
 
Example 15
Source Project: flink   File: Configuration.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void write(final DataOutputView out) throws IOException {
	synchronized (this.confData) {
		out.writeInt(this.confData.size());

		for (Map.Entry<String, Object> entry : this.confData.entrySet()) {
			String key = entry.getKey();
			Object val = entry.getValue();

			StringValue.writeString(key, out);
			Class<?> clazz = val.getClass();

			if (clazz == String.class) {
				out.write(TYPE_STRING);
				StringValue.writeString((String) val, out);
			}
			else if (clazz == Integer.class) {
				out.write(TYPE_INT);
				out.writeInt((Integer) val);
			}
			else if (clazz == Long.class) {
				out.write(TYPE_LONG);
				out.writeLong((Long) val);
			}
			else if (clazz == Float.class) {
				out.write(TYPE_FLOAT);
				out.writeFloat((Float) val);
			}
			else if (clazz == Double.class) {
				out.write(TYPE_DOUBLE);
				out.writeDouble((Double) val);
			}
			else if (clazz == byte[].class) {
				out.write(TYPE_BYTES);
				byte[] bytes = (byte[]) val;
				out.writeInt(bytes.length);
				out.write(bytes);
			}
			else if (clazz == Boolean.class) {
				out.write(TYPE_BOOLEAN);
				out.writeBoolean((Boolean) val);
			}
			else {
				throw new IllegalArgumentException("Unrecognized type");
			}
		}
	}
}
 
Example 16
Source Project: flink   File: FloatType.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeFloat(this.value);
}
 
Example 17
Source Project: flink   File: FloatType.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeFloat(this.value);
}
 
Example 18
Source Project: flink   File: FloatSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(Float record, DataOutputView target) throws IOException {
	target.writeFloat(record);
}
 
Example 19
Source Project: flink   File: FloatSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeFloat(source.readFloat());
}
 
Example 20
Source Project: flink   File: FloatValueSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeFloat(source.readFloat());
}