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


Java DataInputView.readUTF方法代码示例

本文整理汇总了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);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:21,代码来源:TypeSerializerUtil.java

示例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;
}
 
开发者ID:haoch,项目名称:flink-siddhi,代码行数:12,代码来源:SiddhiStreamOperator.java

示例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);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:FlinkKafkaProducer011.java

示例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);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:13,代码来源:AvroSerializer.java

示例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);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:13,代码来源:GenericTypeSerializerConfigSnapshot.java

示例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;
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:32,代码来源:IterationEventWithAggregators.java

示例7: read

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

示例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();
}
 
开发者ID:apache,项目名称:beam,代码行数:6,代码来源:CoderTypeSerializer.java

示例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();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:AvroSerializer.java

示例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);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:7,代码来源:MetricDumpSerialization.java

示例11: read

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

示例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);
		}
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:43,代码来源:PojoSerializer.java

示例13: read

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
	super.read(in);
	serializationFormatIdentifier = in.readUTF();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:ParameterlessTypeSerializerConfig.java

示例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);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:DelegatingConfiguration.java

示例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();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:7,代码来源:TypeSerializerConfigSnapshotTest.java


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