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

The following examples show how to use org.apache.flink.core.memory.DataOutputView#writeDouble() . 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
Source File: CoordVector.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeInt(this.coordinates.length);
	for (int i = 0; i < this.coordinates.length; i++) {
		out.writeDouble(this.coordinates[i]);
	}
}
 
Example 2
Source File: DoubleValueArray.java    From flink with 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.writeDouble(data[i]);
	}
}
 
Example 3
Source File: DanglingPageRankITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeDouble(diff);
	out.writeDouble(rank);
	out.writeDouble(danglingRank);
	out.writeLong(numDanglingVertices);
	out.writeLong(numVertices);
	out.writeLong(edges);
}
 
Example 4
Source File: DoublePrimitiveArraySerializer.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(double[] 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.writeDouble(record[i]);
	}
}
 
Example 5
Source File: DoubleValueArray.java    From Flink-CEPplus with 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.writeDouble(data[i]);
	}
}
 
Example 6
Source File: DanglingPageRankITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeDouble(diff);
	out.writeDouble(rank);
	out.writeDouble(danglingRank);
	out.writeLong(numDanglingVertices);
	out.writeLong(numVertices);
	out.writeLong(edges);
}
 
Example 7
Source File: CoordVector.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeInt(this.coordinates.length);
	for (int i = 0; i < this.coordinates.length; i++) {
		out.writeDouble(this.coordinates[i]);
	}
}
 
Example 8
Source File: DoublePrimitiveArraySerializer.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void serialize(double[] 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.writeDouble(record[i]);
	}
}
 
Example 9
Source File: TestTaskEvent.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeDouble(val0);
	out.writeLong(val1);
}
 
Example 10
Source File: DoubleValue.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeDouble(this.value);
}
 
Example 11
Source File: DoubleValue.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeDouble(this.value);
}
 
Example 12
Source File: DoubleSerializer.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeDouble(source.readDouble());
}
 
Example 13
Source File: DoubleSerializer.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(Double record, DataOutputView target) throws IOException {
	target.writeDouble(record);
}
 
Example 14
Source File: DoubleType.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeDouble(this.value);
}
 
Example 15
Source File: TestTaskEvent.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeDouble(val0);
	out.writeLong(val1);
}
 
Example 16
Source File: DoubleValueSerializer.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeDouble(source.readDouble());
}
 
Example 17
Source File: Configuration.java    From Flink-CEPplus with 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 18
Source File: DoubleValue.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public void write(DataOutputView out) throws IOException {
	out.writeDouble(this.value);
}
 
Example 19
Source File: DoubleSerializer.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(Double record, DataOutputView target) throws IOException {
	target.writeDouble(record);
}
 
Example 20
Source File: DoubleValueSerializer.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeDouble(source.readDouble());
}