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


Java DataOutputView.writeLong方法代码示例

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


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

示例1: serialize

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void serialize(
		State<TXN, CONTEXT> record,
		DataOutputView target) throws IOException {
	final TransactionHolder<TXN> pendingTransaction = record.getPendingTransaction();
	transactionSerializer.serialize(pendingTransaction.handle, target);
	target.writeLong(pendingTransaction.transactionStartTime);

	final List<TransactionHolder<TXN>> pendingCommitTransactions = record.getPendingCommitTransactions();
	target.writeInt(pendingCommitTransactions.size());
	for (TransactionHolder<TXN> pendingTxn : pendingCommitTransactions) {
		transactionSerializer.serialize(pendingTxn.handle, target);
		target.writeLong(pendingTxn.transactionStartTime);
	}

	Optional<CONTEXT> context = record.getContext();
	if (context.isPresent()) {
		target.writeBoolean(true);
		contextSerializer.serialize(context.get(), target);
	} else {
		target.writeBoolean(false);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:24,代码来源:TwoPhaseCommitSinkFunction.java

示例2: copy

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void copy(
		DataInputView source, DataOutputView target) throws IOException {
	TXN pendingTxnHandle = transactionSerializer.deserialize(source);
	transactionSerializer.serialize(pendingTxnHandle, target);
	final long pendingTxnStartTime = source.readLong();
	target.writeLong(pendingTxnStartTime);

	int numPendingCommitTxns = source.readInt();
	target.writeInt(numPendingCommitTxns);
	for (int i = 0; i < numPendingCommitTxns; i++) {
		TXN pendingCommitTxnHandle = transactionSerializer.deserialize(source);
		transactionSerializer.serialize(pendingCommitTxnHandle, target);
		final long pendingCommitTxnStartTime = source.readLong();
		target.writeLong(pendingCommitTxnStartTime);
	}

	boolean hasContext = source.readBoolean();
	target.writeBoolean(hasContext);
	if (hasContext) {
		CONTEXT context = contextSerializer.deserialize(source);
		contextSerializer.serialize(context, target);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:25,代码来源:TwoPhaseCommitSinkFunction.java

示例3: serialize

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void serialize(
		KafkaTransactionState record,
		DataOutputView target) throws IOException {
	if (record.transactionalId == null) {
		target.writeBoolean(false);
	} else {
		target.writeBoolean(true);
		target.writeUTF(record.transactionalId);
	}
	target.writeLong(record.producerId);
	target.writeShort(record.epoch);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:14,代码来源:FlinkKafkaProducer011.java

示例4: write

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void write(DataOutputView out) throws IOException {
	out.writeInt(len);
	for (int i = 0; i < len / 8; i++) {
		out.writeLong(i);
	}
	for (int i = 0; i < len % 8; i++) {
		out.write(i);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:LargeObjectType.java

示例5: write

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@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);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:10,代码来源:DanglingPageRankITCase.java

示例6: serialize

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void serialize(StreamElement value, DataOutputView target) throws IOException {
	if (value.isRecord()) {
		StreamRecord<T> record = value.asRecord();
		
		if (record.hasTimestamp()) {
			target.write(TAG_REC_WITH_TIMESTAMP);
			target.writeLong(record.getTimestamp());
		} else {
			target.write(TAG_REC_WITHOUT_TIMESTAMP);
		}
		typeSerializer.serialize(record.getValue(), target);
	}
	else if (value.isWatermark()) {
		target.write(TAG_WATERMARK);
		target.writeLong(value.asWatermark().getTimestamp());
	}
	else if (value.isLatencyMarker()) {
		target.write(TAG_LATENCY_MARKER);
		target.writeLong(value.asLatencyMarker().getMarkedTime());
		target.writeInt(value.asLatencyMarker().getVertexID());
		target.writeInt(value.asLatencyMarker().getSubtaskIndex());
	}
	else {
		throw new RuntimeException();
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:MultiplexingStreamRecordSerializer.java

示例7: write

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void write(DataOutputView out) throws IOException {
	out.writeInt(position);

	for (int i = 0; i < position; i++) {
		out.writeLong(data[i]);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:9,代码来源:LongValueArray.java

示例8: serialize

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void serialize(NFA<T> record, DataOutputView target) throws IOException {
	serializeStates(record.states, target);
	target.writeLong(record.windowTime);
	target.writeBoolean(record.handleTimeout);

	sharedBufferSerializer.serialize(record.eventSharedBuffer, target);

	target.writeInt(record.computationStates.size());

	StringSerializer stateNameSerializer = StringSerializer.INSTANCE;
	LongSerializer timestampSerializer = LongSerializer.INSTANCE;
	DeweyNumber.DeweyNumberSerializer versionSerializer = new DeweyNumber.DeweyNumberSerializer();

	for (ComputationState<T> computationState: record.computationStates) {
		stateNameSerializer.serialize(computationState.getState().getName(), target);
		stateNameSerializer.serialize(computationState.getPreviousState() == null
				? null : computationState.getPreviousState().getName(), target);

		timestampSerializer.serialize(computationState.getTimestamp(), target);
		versionSerializer.serialize(computationState.getVersion(), target);
		timestampSerializer.serialize(computationState.getStartTimestamp(), target);
		target.writeInt(computationState.getCounter());

		if (computationState.getEvent() == null) {
			target.writeBoolean(false);
		} else {
			target.writeBoolean(true);
			eventSerializer.serialize(computationState.getEvent(), target);
		}
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:33,代码来源:NFA.java

示例9: serialize

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void serialize(Timestamp record, DataOutputView target) throws IOException {
	if (record == null) {
		target.writeLong(Long.MIN_VALUE);
		target.writeInt(0);
	} else {
		target.writeLong(record.getTime());
		target.writeInt(record.getNanos());
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:SqlTimestampSerializer.java

示例10: write

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

示例11: write

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void write(DataOutputView out) throws IOException {
	out.writeInt(aInt);
	out.writeLong(aLong);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:InstantiationUtilTest.java

示例12: serialize

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void serialize(Long record, DataOutputView target) throws IOException {
	target.writeLong(record.longValue());
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:5,代码来源:LongSerializer.java

示例13: copy

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeLong(source.readLong());
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:5,代码来源:SqlDateSerializer.java

示例14: copy

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	target.writeLong(source.readLong());
	target.writeInt(source.readInt());
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:SqlTimestampSerializer.java

示例15: write

import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void write(DataOutputView out) throws IOException {
	out.writeLong(this.recordCount);
	out.writeLong(this.accumulatedRecordCount);
	out.writeLong(this.firstRecordStart);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:7,代码来源:BlockInfo.java


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