本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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();
}
}
示例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]);
}
}
示例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);
}
}
}
示例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());
}
}
示例10: write
import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void write(DataOutputView out) throws IOException {
out.writeLong(this.value);
}
示例11: write
import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void write(DataOutputView out) throws IOException {
out.writeInt(aInt);
out.writeLong(aLong);
}
示例12: serialize
import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void serialize(Long record, DataOutputView target) throws IOException {
target.writeLong(record.longValue());
}
示例13: copy
import org.apache.flink.core.memory.DataOutputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
target.writeLong(source.readLong());
}
示例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());
}
示例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);
}