本文整理汇总了Java中org.apache.flink.core.memory.DataInputView.readUTF方法的典型用法代码示例。如果您正苦于以下问题:Java DataInputView.readUTF方法的具体用法?Java DataInputView.readUTF怎么用?Java DataInputView.readUTF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.core.memory.DataInputView
的用法示例。
在下文中一共展示了DataInputView.readUTF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
String serializerConfigClassname = in.readUTF();
Class<? extends TypeSerializerConfigSnapshot> serializerConfigSnapshotClass;
try {
serializerConfigSnapshotClass = (Class<? extends TypeSerializerConfigSnapshot>)
Class.forName(serializerConfigClassname, true, userCodeClassLoader);
} catch (ClassNotFoundException e) {
throw new IOException(
"Could not find requested TypeSerializerConfigSnapshot class "
+ serializerConfigClassname + " in classpath.", e);
}
serializerConfigSnapshot = InstantiationUtil.instantiate(serializerConfigSnapshotClass);
serializerConfigSnapshot.setUserCodeClassLoader(userCodeClassLoader);
serializerConfigSnapshot.read(in);
}
示例2: restoreQueuerState
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
protected PriorityQueue<StreamRecord<Tuple2<String, IN>>> restoreQueuerState(DataInputView dataInputView) throws IOException {
int sizeOfQueue = dataInputView.readInt();
PriorityQueue<StreamRecord<Tuple2<String, IN>>> priorityQueue = new PriorityQueue<>(sizeOfQueue);
for (int i = 0; i < sizeOfQueue; i++) {
String streamId = dataInputView.readUTF();
StreamElement streamElement = getStreamRecordSerializer(streamId).deserialize(dataInputView);
priorityQueue.offer(streamElement.<Tuple2<String, IN>>asRecord());
}
return priorityQueue;
}
示例3: deserialize
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public KafkaTransactionState deserialize(DataInputView source) throws IOException {
String transactionalId = null;
if (source.readBoolean()) {
transactionalId = source.readUTF();
}
long producerId = source.readLong();
short epoch = source.readShort();
return new KafkaTransactionState(transactionalId, producerId, epoch, null);
}
示例4: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
String classname = in.readUTF();
try {
typeToInstantiate = (Class<? extends T>) Class.forName(classname, true, getUserCodeClassLoader());
} catch (ClassNotFoundException e) {
throw new IOException("Cannot find requested class " + classname + " in classpath.", e);
}
}
示例5: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
String genericTypeClassname = in.readUTF();
try {
typeClass = (Class<T>) Class.forName(genericTypeClassname, true, getUserCodeClassLoader());
} catch (ClassNotFoundException e) {
throw new IOException("Could not find the requested class " + genericTypeClassname + " in classpath.", e);
}
}
示例6: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
int num = in.readInt();
if (num == 0) {
this.aggNames = NO_STRINGS;
this.aggregates = NO_VALUES;
} else {
if (this.aggNames == null || num > this.aggNames.length) {
this.aggNames = new String[num];
}
if (this.classNames == null || num > this.classNames.length) {
this.classNames = new String[num];
}
if (this.serializedData == null || num > this.serializedData.length) {
this.serializedData = new byte[num][];
}
for (int i = 0; i < num; i++) {
this.aggNames[i] = in.readUTF();
this.classNames[i] = in.readUTF();
int len = in.readInt();
byte[] data = new byte[len];
this.serializedData[i] = data;
in.readFully(data);
}
this.aggregates = null;
}
}
示例7: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
value = in.readUTF();
}
示例8: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
this.coderName = in.readUTF();
}
示例9: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
this.schemaString = in.readUTF();
}
示例10: deserializeGauge
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
private static MetricDump.GaugeDump deserializeGauge(DataInputView dis) throws IOException {
QueryScopeInfo scope = deserializeMetricInfo(dis);
String name = dis.readUTF();
String value = dis.readUTF();
return new MetricDump.GaugeDump(scope, name, value);
}
示例11: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
this.value = in.readUTF();
}
示例12: copy
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
// copy the flags
int flags = source.readByte();
target.writeByte(flags);
if ((flags & IS_NULL) != 0) {
// is a null value, nothing further to copy
return;
}
TypeSerializer<?> subclassSerializer = null;
if ((flags & IS_SUBCLASS) != 0) {
String className = source.readUTF();
target.writeUTF(className);
try {
Class<?> subclass = Class.forName(className, true, Thread.currentThread()
.getContextClassLoader());
subclassSerializer = getSubclassSerializer(subclass);
} catch (ClassNotFoundException e) {
throw new RuntimeException("Cannot instantiate class.", e);
}
} else if ((flags & IS_TAGGED_SUBCLASS) != 0) {
int subclassTag = source.readByte();
target.writeByte(subclassTag);
subclassSerializer = registeredSerializers[subclassTag];
}
if ((flags & NO_SUBCLASS) != 0) {
for (int i = 0; i < numFields; i++) {
boolean isNull = source.readBoolean();
target.writeBoolean(isNull);
if (!isNull) {
fieldSerializers[i].copy(source, target);
}
}
} else {
if (subclassSerializer != null) {
subclassSerializer.copy(source, target);
}
}
}
示例13: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
serializationFormatIdentifier = in.readUTF();
}
示例14: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
this.prefix = in.readUTF();
this.backingConfig.read(in);
}
示例15: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
super.read(in);
val = in.readInt();
msg = in.readUTF();
}