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


Java OperatorStateBackend类代码示例

本文整理汇总了Java中org.apache.flink.runtime.state.OperatorStateBackend的典型用法代码示例。如果您正苦于以下问题:Java OperatorStateBackend类的具体用法?Java OperatorStateBackend怎么用?Java OperatorStateBackend使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AbstractBroadcastState

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
AbstractBroadcastState(
    OperatorStateBackend flinkStateBackend,
    String name,
    StateNamespace namespace,
    Coder<T> coder) {
  this.name = name;

  this.namespace = namespace;
  this.flinkStateBackend = flinkStateBackend;

  CoderTypeInformation<Map<String, T>> typeInfo =
      new CoderTypeInformation<>(MapCoder.of(StringUtf8Coder.of(), coder));

  flinkStateDescriptor = new ListStateDescriptor<>(name,
      typeInfo.createSerializer(new ExecutionConfig()));
}
 
开发者ID:apache,项目名称:beam,代码行数:17,代码来源:FlinkBroadcastStateInternals.java

示例2: FlinkCombiningStateWithContext

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
FlinkCombiningStateWithContext(
    OperatorStateBackend flinkStateBackend,
    StateTag<CombiningState<InputT, AccumT, OutputT>> address,
    CombineWithContext.CombineFnWithContext<InputT, AccumT, OutputT> combineFn,
    StateNamespace namespace,
    Coder<AccumT> accumCoder,
    FlinkBroadcastStateInternals<K> flinkStateInternals,
    CombineWithContext.Context context) {
  super(flinkStateBackend, address.getId(), namespace, accumCoder);

  this.namespace = namespace;
  this.address = address;
  this.combineFn = combineFn;
  this.flinkStateInternals = flinkStateInternals;
  this.context = context;

}
 
开发者ID:apache,项目名称:beam,代码行数:18,代码来源:FlinkBroadcastStateInternals.java

示例3: snapshotFunctionState

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
public static void snapshotFunctionState(
		StateSnapshotContext context,
		OperatorStateBackend backend,
		Function userFunction) throws Exception {

	Preconditions.checkNotNull(context);
	Preconditions.checkNotNull(backend);

	while (true) {

		if (trySnapshotFunctionState(context, backend, userFunction)) {
			break;
		}

		// inspect if the user function is wrapped, then unwrap and try again if we can snapshot the inner function
		if (userFunction instanceof WrappingFunction) {
			userFunction = ((WrappingFunction<?>) userFunction).getWrappedFunction();
		} else {
			break;
		}
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:23,代码来源:StreamingFunctionUtils.java

示例4: createOperatorStateBackend

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
public OperatorStateBackend createOperatorStateBackend(
		StreamOperator<?> op, Collection<OperatorStateHandle> restoreStateHandles) throws Exception {

	Environment env = getEnvironment();
	String opId = createOperatorIdentifier(op, getConfiguration().getVertexID());

	OperatorStateBackend operatorStateBackend = stateBackend.createOperatorStateBackend(env, opId);

	// let operator state backend participate in the operator lifecycle, i.e. make it responsive to cancelation
	cancelables.registerCloseable(operatorStateBackend);

	// restore if we have some old state
	if (null != restoreStateHandles) {
		operatorStateBackend.restore(restoreStateHandles);
	}

	return operatorStateBackend;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:19,代码来源:StreamTask.java

示例5: createOperatorStateBackend

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
@Override
public OperatorStateBackend createOperatorStateBackend(Environment env, String operatorIdentifier) throws Exception {
	return new DefaultOperatorStateBackend(
		env.getUserClassLoader(),
		env.getExecutionConfig(),
		true) {
		@Override
		public RunnableFuture<OperatorStateHandle> snapshot(
			long checkpointId,
			long timestamp,
			CheckpointStreamFactory streamFactory,
			CheckpointOptions checkpointOptions) throws Exception {

			throw new Exception("Sync part snapshot exception.");
		}
	};
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:18,代码来源:TaskCheckpointingBehaviourTest.java

示例6: FlinkSplitBagState

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
FlinkSplitBagState(
    OperatorStateBackend flinkStateBackend,
    StateTag<BagState<T>> address,
    StateNamespace namespace,
    Coder<T> coder) {
  this.flinkStateBackend = flinkStateBackend;
  this.namespace = namespace;
  this.address = address;

  CoderTypeInformation<T> typeInfo =
      new CoderTypeInformation<>(coder);

  descriptor = new ListStateDescriptor<>(address.getId(),
      typeInfo.createSerializer(new ExecutionConfig()));
}
 
开发者ID:apache,项目名称:beam,代码行数:16,代码来源:FlinkSplitStateInternals.java

示例7: FlinkBroadcastStateInternals

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
public FlinkBroadcastStateInternals(int indexInSubtaskGroup, OperatorStateBackend stateBackend) {
  this.stateBackend = stateBackend;
  this.indexInSubtaskGroup = indexInSubtaskGroup;
  if (indexInSubtaskGroup != 0) {
    stateForNonZeroOperator = new HashMap<>();
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:8,代码来源:FlinkBroadcastStateInternals.java

示例8: FlinkBroadcastValueState

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
FlinkBroadcastValueState(
    OperatorStateBackend flinkStateBackend,
    StateTag<ValueState<T>> address,
    StateNamespace namespace,
    Coder<T> coder) {
  super(flinkStateBackend, address.getId(), namespace, coder);

  this.namespace = namespace;
  this.address = address;

}
 
开发者ID:apache,项目名称:beam,代码行数:12,代码来源:FlinkBroadcastStateInternals.java

示例9: FlinkBroadcastBagState

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
FlinkBroadcastBagState(
    OperatorStateBackend flinkStateBackend,
    StateTag<BagState<T>> address,
    StateNamespace namespace,
    Coder<T> coder) {
  super(flinkStateBackend, address.getId(), namespace, ListCoder.of(coder));

  this.namespace = namespace;
  this.address = address;
}
 
开发者ID:apache,项目名称:beam,代码行数:11,代码来源:FlinkBroadcastStateInternals.java

示例10: FlinkCombiningState

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
FlinkCombiningState(
    OperatorStateBackend flinkStateBackend,
    StateTag<CombiningState<InputT, AccumT, OutputT>> address,
    Combine.CombineFn<InputT, AccumT, OutputT> combineFn,
    StateNamespace namespace,
    Coder<AccumT> accumCoder) {
  super(flinkStateBackend, address.getId(), namespace, accumCoder);

  this.namespace = namespace;
  this.address = address;
  this.combineFn = combineFn;
}
 
开发者ID:apache,项目名称:beam,代码行数:13,代码来源:FlinkBroadcastStateInternals.java

示例11: FlinkKeyedCombiningState

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
FlinkKeyedCombiningState(
    OperatorStateBackend flinkStateBackend,
    StateTag<CombiningState<InputT, AccumT, OutputT>> address,
    Combine.CombineFn<InputT, AccumT, OutputT> combineFn,
    StateNamespace namespace,
    Coder<AccumT> accumCoder,
    FlinkBroadcastStateInternals<K> flinkStateInternals) {
  super(flinkStateBackend, address.getId(), namespace, accumCoder);

  this.namespace = namespace;
  this.address = address;
  this.combineFn = combineFn;
  this.flinkStateInternals = flinkStateInternals;

}
 
开发者ID:apache,项目名称:beam,代码行数:16,代码来源:FlinkBroadcastStateInternals.java

示例12: createStateInternals

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
@Override
protected StateInternals createStateInternals() {
  MemoryStateBackend backend = new MemoryStateBackend();
  try {
    OperatorStateBackend operatorStateBackend =
        backend.createOperatorStateBackend(new DummyEnvironment("test", 1, 0), "");
    return new FlinkSplitStateInternals<>(operatorStateBackend);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:12,代码来源:FlinkSplitStateInternalsTest.java

示例13: createStateInternals

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
@Override
protected StateInternals createStateInternals() {
  MemoryStateBackend backend = new MemoryStateBackend();
  try {
    OperatorStateBackend operatorStateBackend =
        backend.createOperatorStateBackend(new DummyEnvironment("test", 1, 0), "");
    return new FlinkBroadcastStateInternals<>(1, operatorStateBackend);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:12,代码来源:FlinkBroadcastStateInternalsTest.java

示例14: createOperatorStateBackend

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
@Override
public OperatorStateBackend createOperatorStateBackend(
	Environment env,
	String operatorIdentifier) throws Exception {

	throw new UnsupportedOperationException();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:8,代码来源:StateBackendITCase.java

示例15: createOperatorStateBackend

import org.apache.flink.runtime.state.OperatorStateBackend; //导入依赖的package包/类
@Override
public OperatorStateBackend createOperatorStateBackend(
		Environment env,
		String operatorIdentifier) throws Exception {

	//the default for RocksDB; eventually there can be a operator state backend based on RocksDB, too.
	final boolean asyncSnapshots = true;
	return new DefaultOperatorStateBackend(
			env.getUserClassLoader(),
			env.getExecutionConfig(),
			asyncSnapshots);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:13,代码来源:RocksDBStateBackend.java


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