/** * Creates a new instance. * * @param measuredExecutionTime the time measured for the partial execution * @param lowerCost the lower possible costs for the new instance (excluding fix costs) * @param upperCost the upper possible costs for the new instance (excluding fix costs) * @param executionLineageNodes for all executed {@link ExecutionOperator}s * @param configuration the {@link Configuration} to re-estimate execution statistics */ public PartialExecution(long measuredExecutionTime, double lowerCost, double upperCost, Collection<ExecutionLineageNode> executionLineageNodes, Configuration configuration) { this.measuredExecutionTime = measuredExecutionTime; this.atomicExecutionGroups = executionLineageNodes.stream() .map(node -> new AtomicExecutionGroup( node.getOperatorContext(), ((ExecutionOperator) node.getOperatorContext().getOperator()).getPlatform(), configuration, node.getAtomicExecutions() )) .collect(Collectors.toList()); this.lowerCost = lowerCost; this.upperCost = upperCost; }
@Override public AtomicExecutionGroup deserialize(JSONObject json, Class<? extends AtomicExecutionGroup> cls) { return new AtomicExecutionGroup( JsonSerializables.deserialize( json.getJSONObject("ctx"), SimpleEstimationContext.jsonSerializer, SimpleEstimationContext.class ), JsonSerializables.deserialize( json.getJSONObject("platform"), Platform.jsonSerializer ), this.configuration, JsonSerializables.deserializeAllAsList( json.getJSONArray("executions"), new AtomicExecution.KeyOrLoadSerializer(this.configuration, null), AtomicExecution.class ) ); } }