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


Java DeltaIterationBase类代码示例

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


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

示例1: WorksetIterationNode

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
/**
 * Creates a new node with a single input for the optimizer plan.
 * 
 * @param iteration The iteration operator that the node represents.
 */
public WorksetIterationNode(DeltaIterationBase<?, ?> iteration) {
	super(iteration);
	
	final int[] ssKeys = iteration.getSolutionSetKeyFields();
	if (ssKeys == null || ssKeys.length == 0) {
		throw new CompilerException("Invalid WorksetIteration: No key fields defined for the solution set.");
	}
	this.solutionSetKeyFields = new FieldList(ssKeys);
	this.partitionedProperties = new GlobalProperties();
	this.partitionedProperties.setHashPartitioned(this.solutionSetKeyFields);
	
	int weight = iteration.getMaximumNumberOfIterations() > 0 ? 
		iteration.getMaximumNumberOfIterations() : DEFAULT_COST_WEIGHT;
		
	if (weight > OptimizerNode.MAX_DYNAMIC_PATH_COST_WEIGHT) {
		weight = OptimizerNode.MAX_DYNAMIC_PATH_COST_WEIGHT;
	}
	this.costWeight = weight; 
	
	this.dataProperties = Collections.<OperatorDescriptorDual>singletonList(new WorksetOpDescriptor(this.solutionSetKeyFields));
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:27,代码来源:WorksetIterationNode.java

示例2: preVisit

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
@Override
public boolean preVisit(Operator<?> visitable) {
	if (this.seen.add(visitable)) {
		// add to  the map
		final String name = visitable.getName();
		List<Operator<?>> list = this.map.get(name);
		if (list == null) {
			list = new ArrayList<Operator<?>>(2);
			this.map.put(name, list);
		}
		list.add(visitable);
		
		// recurse into bulk iterations
		if (visitable instanceof BulkIterationBase) {
			((BulkIterationBase) visitable).getNextPartialSolution().accept(this);
		} else if (visitable instanceof DeltaIterationBase) {
			((DeltaIterationBase) visitable).getSolutionSetDelta().accept(this);
			((DeltaIterationBase) visitable).getNextWorkset().accept(this);
		}
		
		return true;
	} else {
		return false;
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:26,代码来源:OperatorResolver.java

示例3: translateDeltaIteration

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
private <D, W> DeltaIterationBase<D, W> translateDeltaIteration(DeltaIterationResultSet<?, ?> untypedIterationEnd) {
	@SuppressWarnings("unchecked")
	DeltaIterationResultSet<D, W> iterationEnd = (DeltaIterationResultSet<D, W>) untypedIterationEnd;
	DeltaIteration<D, W> iterationHead = iterationEnd.getIterationHead();

	String name = iterationHead.getName() == null ? "Unnamed Delta Iteration" : iterationHead.getName();

	DeltaIterationBase<D, W> iterationOperator = new DeltaIterationBase<>(new BinaryOperatorInformation<>(iterationEnd.getType(), iterationEnd.getWorksetType(), iterationEnd.getType()),
			iterationEnd.getKeyPositions(), name);

	iterationOperator.setMaximumNumberOfIterations(iterationEnd.getMaxIterations());

	if (iterationHead.getParallelism() > 0) {
		iterationOperator.setParallelism(iterationHead.getParallelism());
	}

	DeltaIteration.SolutionSetPlaceHolder<D> solutionSetPlaceHolder = iterationHead.getSolutionSet();
	DeltaIteration.WorksetPlaceHolder<W> worksetPlaceHolder = iterationHead.getWorkset();

	translated.put(solutionSetPlaceHolder, iterationOperator.getSolutionSet());
	translated.put(worksetPlaceHolder, iterationOperator.getWorkset());

	Operator<D> translatedSolutionSet = translate(iterationEnd.getNextSolutionSet());
	Operator<W> translatedWorkset = translate(iterationEnd.getNextWorkset());

	iterationOperator.setNextWorkset(translatedWorkset);
	iterationOperator.setSolutionSetDelta(translatedSolutionSet);

	iterationOperator.setInitialSolutionSet(translate(iterationHead.getInitialSolutionSet()));
	iterationOperator.setInitialWorkset(translate(iterationHead.getInitialWorkset()));

	// register all aggregators
	iterationOperator.getAggregators().addAll(iterationHead.getAggregators());

	iterationOperator.setSolutionSetUnManaged(iterationHead.isSolutionSetUnManaged());

	return iterationOperator;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:39,代码来源:OperatorTranslation.java

示例4: execute

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
private List<?> execute(Operator<?> operator, int superStep) throws Exception {
	List<?> result = this.intermediateResults.get(operator);
	
	// if it has already been computed, use the cached variant
	if (result != null) {
		return result;
	}
	
	if (operator instanceof BulkIterationBase) {
		result = executeBulkIteration((BulkIterationBase<?>) operator);
	}
	else if (operator instanceof DeltaIterationBase) {
		result = executeDeltaIteration((DeltaIterationBase<?, ?>) operator);
	}
	else if (operator instanceof SingleInputOperator) {
		result = executeUnaryOperator((SingleInputOperator<?, ?, ?>) operator, superStep);
	}
	else if (operator instanceof DualInputOperator) {
		result = executeBinaryOperator((DualInputOperator<?, ?, ?, ?>) operator, superStep);
	}
	else if (operator instanceof GenericDataSourceBase) {
		result = executeDataSource((GenericDataSourceBase<?, ?>) operator, superStep);
	}
	else if (operator instanceof GenericDataSinkBase) {
		executeDataSink((GenericDataSinkBase<?>) operator, superStep);
		result = Collections.emptyList();
	}
	else {
		throw new RuntimeException("Cannot execute operator " + operator.getClass().getName());
	}
	
	this.intermediateResults.put(operator, result);
	
	return result;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:36,代码来源:CollectionExecutor.java

示例5: preVisit

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
@Override
public boolean preVisit(Operator<?> visitable) {
	if (visitable instanceof DeltaIterationBase.WorksetPlaceHolder) {
		foundWorkset = true;
	}

	return (!foundWorkset) && seenBefore.add(visitable);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:9,代码来源:StepFunctionValidator.java

示例6: translateDeltaIteration

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
private <D, W> DeltaIterationBase<D, W> translateDeltaIteration(DeltaIterationResultSet<?, ?> untypedIterationEnd) {
	@SuppressWarnings("unchecked")
	DeltaIterationResultSet<D, W> iterationEnd = (DeltaIterationResultSet<D, W>) untypedIterationEnd;
	DeltaIteration<D, W> iterationHead = iterationEnd.getIterationHead();
	
	String name = iterationHead.getName() == null ? "Unnamed Delta Iteration" : iterationHead.getName();
	
	DeltaIterationBase<D, W> iterationOperator = new DeltaIterationBase<D, W>(new BinaryOperatorInformation<D, W, D>(iterationEnd.getType(), iterationEnd.getWorksetType(), iterationEnd.getType()),
			iterationEnd.getKeyPositions(), name);
	
	iterationOperator.setMaximumNumberOfIterations(iterationEnd.getMaxIterations());
	
	if (iterationHead.getParallelism() > 0) {
		iterationOperator.setDegreeOfParallelism(iterationHead.getParallelism());
	}

	DeltaIteration.SolutionSetPlaceHolder<D> solutionSetPlaceHolder = iterationHead.getSolutionSet();
	DeltaIteration.WorksetPlaceHolder<W> worksetPlaceHolder = iterationHead.getWorkset();

	translated.put(solutionSetPlaceHolder, iterationOperator.getSolutionSet());
	translated.put(worksetPlaceHolder, iterationOperator.getWorkset());

	Operator<D> translatedSolutionSet = translate(iterationEnd.getNextSolutionSet());
	Operator<W> translatedWorkset = translate(iterationEnd.getNextWorkset());
	
	iterationOperator.setNextWorkset(translatedWorkset);
	iterationOperator.setSolutionSetDelta(translatedSolutionSet);

	iterationOperator.setInitialSolutionSet(translate(iterationHead.getInitialSolutionSet()));
	iterationOperator.setInitialWorkset(translate(iterationHead.getInitialWorkset()));
	
	// register all aggregators
	iterationOperator.getAggregators().addAll(iterationHead.getAggregators());
	
	iterationOperator.setSolutionSetUnManaged(iterationHead.isSolutionSetUnManaged());
	
	return iterationOperator;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:39,代码来源:OperatorTranslation.java

示例7: execute

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
private List<?> execute(Operator<?> operator, int superStep) throws Exception {
	List<?> result = this.intermediateResults.get(operator);
	
	// if it has already been computed, use the cached variant
	if (result != null) {
		return result;
	}
	
	if (operator instanceof BulkIterationBase) {
		result = executeBulkIteration((BulkIterationBase<?>) operator);
	}
	else if (operator instanceof DeltaIterationBase) {
		result = executeDeltaIteration((DeltaIterationBase<?, ?>) operator);
	}
	else if (operator instanceof SingleInputOperator) {
		result = executeUnaryOperator((SingleInputOperator<?, ?, ?>) operator, superStep);
	}
	else if (operator instanceof DualInputOperator) {
		result = executeBinaryOperator((DualInputOperator<?, ?, ?, ?>) operator, superStep);
	}
	else if (operator instanceof GenericDataSourceBase) {
		result = executeDataSource((GenericDataSourceBase<?, ?>) operator);
	}
	else if (operator instanceof GenericDataSinkBase) {
		executeDataSink((GenericDataSinkBase<?>) operator);
		result = Collections.emptyList();
	}
	else {
		throw new RuntimeException("Cannot execute operator " + operator.getClass().getName());
	}
	
	this.intermediateResults.put(operator, result);
	
	return result;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:36,代码来源:CollectionExecutor.java

示例8: getIterationContract

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
public DeltaIterationBase<?, ?> getIterationContract() {
	return (DeltaIterationBase<?, ?>) getOperator();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:4,代码来源:WorksetIterationNode.java

示例9: getIterationContract

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
public DeltaIterationBase<?, ?> getIterationContract() {
	return (DeltaIterationBase<?, ?>) getPactContract();
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:4,代码来源:WorksetIterationNode.java

示例10: WorksetPlaceHolder

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
public WorksetPlaceHolder(DeltaIterationBase<?, Record> container) {
	super(container, new OperatorInformation<Record>(new RecordTypeInfo()));
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:4,代码来源:DeltaIteration.java

示例11: SolutionSetPlaceHolder

import org.apache.flink.api.common.operators.base.DeltaIterationBase; //导入依赖的package包/类
public SolutionSetPlaceHolder(DeltaIterationBase<Record, ?> container) {
	super(container, new OperatorInformation<Record>(new RecordTypeInfo()));
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:4,代码来源:DeltaIteration.java


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