Tabnine Logo
Tuple.getField0
Code IndexAdd Tabnine to your IDE (free)

How to use
getField0
method
in
org.qcri.rheem.core.util.Tuple

Best Java code snippets using org.qcri.rheem.core.util.Tuple.getField0 (Showing top 15 results out of 315)

origin: org.qcri.rheem/rheem-core

  @Override
  public Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> aggregate(
      Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> accumulator,
      ExecutionLineageNode node) {
    accumulator.getField0().add(node);
    return accumulator;
  }
}
origin: org.qcri.rheem/rheem-core

public static <K, V> Map<K, V> createMap(Tuple<K, V>... keyValuePairs) {
  Map<K, V> result = new HashMap<>(keyValuePairs.length);
  for (Tuple<K, V> keyValuePair : keyValuePairs) {
    result.put(keyValuePair.getField0(), keyValuePair.getField1());
  }
  return result;
}
origin: org.qcri.rheem/rheem-core

/**
 * Searches for a compatible {@link Class} in the given {@link List} (subclass or equal) for the given parameter
 * {@link Class}. If a match is found, the corresponding {@link Supplier} is used to create a default parameter.
 *
 * @param parameterClass            {@link Class} of a parameter
 * @param defaultParameterSuppliers supply default values for various parameter {@link Class}es
 * @return the first match's {@link Supplier} value or {@code null} if no match was found
 */
private static Object getDefaultParameter(Class<?> parameterClass, List<Tuple<Class<?>, Supplier<?>>> defaultParameterSuppliers) {
  for (Tuple<Class<?>, Supplier<?>> defaultParameterSupplier : defaultParameterSuppliers) {
    if (parameterClass.isAssignableFrom(defaultParameterSupplier.getField0())) {
      return defaultParameterSupplier.getField1().get();
    }
  }
  return null;
}
origin: org.qcri.rheem/rheem-core

/**
 * Calculates the number of open {@link Slot}s in the concatenated {@link PlanEnumeration}. Can be used
 * as {@link #concatenationPriorityFunction}.
 *
 * @return the number of open {@link Slot}s
 */
private double countNumOfOpenSlots() {
  // We use the number of open slots in the concatenated PlanEnumeration.
  Set<Slot<?>> openSlots = new HashSet<>();
  // Add all the slots from the baseEnumeration.
  openSlots.addAll(this.baseEnumeration.getRequestedInputSlots());
  for (Tuple<OutputSlot<?>, InputSlot<?>> outputInput : this.baseEnumeration.getServingOutputSlots()) {
    openSlots.add(outputInput.getField0());
  }
  // Add all the slots from the successor enumerations.
  for (PlanEnumeration successorEnumeration : this.activationCollector.values()) {
    openSlots.addAll(successorEnumeration.getRequestedInputSlots());
    for (Tuple<OutputSlot<?>, InputSlot<?>> outputInput : successorEnumeration.getServingOutputSlots()) {
      openSlots.add(outputInput.getField0());
    }
  }
  // Remove all the slots that are being connected.
  openSlots.remove(this.outputSlot);
  openSlots.removeAll(this.activationCollector.keySet());
  return openSlots.size();
}
origin: org.qcri.rheem/rheem-core

private ConcatenationActivator getOrCreateConcatenationActivator(OutputSlot<?> output,
                                 OptimizationContext optimizationCtx) {
  Tuple<OutputSlot<?>, OptimizationContext> concatKey = createConcatenationKey(output, optimizationCtx);
  return this.concatenationActivators.computeIfAbsent(
      concatKey, key -> new ConcatenationActivator(key.getField0(), key.getField1()));
}
origin: org.qcri.rheem/rheem-core

@Override
protected void doExecute() {
  TaskActivator readyActivator;
  while ((readyActivator = this.readyActivators.poll()) != null) {
    // Execute the ExecutionTask.
    final ExecutionTask task = readyActivator.getTask();
    final Tuple<List<ChannelInstance>, PartialExecution> executionResult = this.execute(readyActivator, task);
    readyActivator.dispose();
    // Register the outputChannelInstances (to obtain cardinality measurements and for further stages).
    final List<ChannelInstance> outputChannelInstances = executionResult.getField0();
    outputChannelInstances.stream().filter(Objects::nonNull).forEach(this::store);
    // Log executions.
    final PartialExecution partialExecution = executionResult.getField1();
    if (partialExecution != null) {
      this.executionState.add(partialExecution);
    }
    // Activate successor ExecutionTasks.
    this.activateSuccessorTasks(task, outputChannelInstances);
    outputChannelInstances.stream().filter(Objects::nonNull).forEach(ChannelInstance::disposeIfUnreferenced);
  }
}
origin: org.qcri.rheem/rheem-core

Tuple<Operator, OptimizationContext> enumerationKey = EnumerationActivator.createKey(servedOperator, optimizationCtx);
EnumerationActivator enumerationActivator = this.enumerationActivators.computeIfAbsent(
    enumerationKey, key -> new EnumerationActivator(key.getField0(), key.getField1())
);
  this.logger.trace("Registering {} for enumeration of {}.", processedEnumeration, enumerationKey.getField0());
origin: org.qcri.rheem/rheem-core

    channelsToIndicesChange.getField0(),
    key -> new Bitmask(this.destChannelDescriptorSets.size())
).orInPlace(channelsToIndicesChange.getField1());
origin: org.qcri.rheem/rheem-core

result.servingOutputSlots.removeIf(slotService -> slotService.getField0().equals(openOutputSlot));
origin: org.qcri.rheem/rheem-core

/**
 * Models eager execution by marking all {@link LazyExecutionLineageNode}s as executed and collecting all marked ones.
 *
 * @param inputs          the input {@link ChannelInstance}s
 * @param outputs         the output {@link ChannelInstance}s
 * @param operatorContext the executed {@link OptimizationContext.OperatorContext}
 * @return the executed {@link OptimizationContext.OperatorContext} and produced {@link ChannelInstance}s
 */
static Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> modelEagerExecution(
    ChannelInstance[] inputs,
    ChannelInstance[] outputs,
    OptimizationContext.OperatorContext operatorContext) {
  final ExecutionLineageNode executionLineageNode = new ExecutionLineageNode(operatorContext);
  executionLineageNode.addAtomicExecutionFromOperatorContext();
  LazyExecutionLineageNode.connectAll(inputs, executionLineageNode, outputs);
  final Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> collectors;
  if (outputs.length == 0) {
    collectors = executionLineageNode.collectAndMark();
  } else {
    collectors = new Tuple<>(new LinkedList<>(), new LinkedList<>());
    for (ChannelInstance output : outputs) {
      output.getLineage().collectAndMark(collectors.getField0(), collectors.getField1());
    }
  }
  return collectors;
}
origin: org.qcri.rheem/rheem-core

/**
 * Groups all {@link #planImplementations} by their {@link ExecutionOperator}s' {@link OutputSlot}s for the
 * {@code output}. Additionally preserves the very (nested) {@link PlanImplementation} in that {@code output} resides.
 *
 * @param output a (possibly top-level) {@link OutputSlot} that should be connected
 * @return a mapping that represents each element {@link #planImplementations} by a key value pair
 * {@code (implementing OutputSlots -> (PlanImplementation, nested PlanImplementation)}
 */
private MultiMap<OutputSlot<?>, Tuple<PlanImplementation, PlanImplementation>>
groupImplementationsByOutput(OutputSlot<?> output) {
  // Sort the PlanEnumerations by their respective open InputSlot or OutputSlot.
  final MultiMap<OutputSlot<?>, Tuple<PlanImplementation, PlanImplementation>> basePlanGroups =
      new MultiMap<>();
  // Find and validate implementing OutputSlots.
  for (PlanImplementation basePlanImplementation : this.getPlanImplementations()) {
    final Collection<Tuple<OutputSlot<?>, PlanImplementation>> execOpOutputsWithContext =
        basePlanImplementation.findExecutionOperatorOutputWithContext(output);
    final Tuple<OutputSlot<?>, PlanImplementation> execOpOutputWithCtx =
        RheemCollections.getSingleOrNull(execOpOutputsWithContext);
    assert execOpOutputsWithContext != null && !execOpOutputsWithContext.isEmpty()
        : String.format("No outputs found for %s.", output);
    basePlanGroups.putSingle(
        execOpOutputWithCtx.getField0(),
        new Tuple<>(basePlanImplementation, execOpOutputWithCtx.getField1())
    );
  }
  return basePlanGroups;
}
origin: org.qcri.rheem/rheem-core

/**
 * Perform downstream activations for the {@code processedEnumeration}. This means activating downstream
 * {@link EnumerationActivator}s and updating the {@link ConcatenationActivator}s for its {@link OutputSlot}s.
 *
 * @return the number of activated {@link EnumerationActivator}s.
 */
private int activateDownstream(PlanEnumeration processedEnumeration, OptimizationContext optimizationCtx) {
  // Activate all successive operators for enumeration.
  int numDownstreamActivations = 0;
  for (Tuple<OutputSlot<?>, InputSlot<?>> inputService : processedEnumeration.getServingOutputSlots()) {
    final OutputSlot<?> output = inputService.getField0();
    final InputSlot<?> servedInput = inputService.getField1();
    if (!deemsRelevant(servedInput)) continue;
    // Activate downstream EnumerationActivators.
    if (this.activateDownstreamEnumeration(servedInput, processedEnumeration, optimizationCtx)) {
      numDownstreamActivations++;
    }
    // Update the ConcatenationActivator for this OutputSlot.
    if (servedInput != null) {
      final ConcatenationActivator concatenationActivator = this.getOrCreateConcatenationActivator(output, optimizationCtx);
      concatenationActivator.updateBaseEnumeration(processedEnumeration);
    }
  }
  return numDownstreamActivations;
}
origin: org.qcri.rheem/rheem-java

      );
  executionLineageNodes = results.getField0();
  producedChannelInstances = results.getField1();
} catch (Exception e) {
origin: org.qcri.rheem/rheem-graphchi

/**
 * Brings the given {@code task} into execution.
 */
private void execute(ExecutionTask task, OptimizationContext optimizationContext, ExecutionState executionState) {
  final GraphChiExecutionOperator graphChiExecutionOperator = (GraphChiExecutionOperator) task.getOperator();
  ChannelInstance[] inputChannelInstances = new ChannelInstance[task.getNumInputChannels()];
  for (int i = 0; i < inputChannelInstances.length; i++) {
    inputChannelInstances[i] = executionState.getChannelInstance(task.getInputChannel(i));
  }
  final OptimizationContext.OperatorContext operatorContext = optimizationContext.getOperatorContext(graphChiExecutionOperator);
  ChannelInstance[] outputChannelInstances = new ChannelInstance[task.getNumOuputChannels()];
  for (int i = 0; i < outputChannelInstances.length; i++) {
    outputChannelInstances[i] = task.getOutputChannel(i).createInstance(this, operatorContext, i);
  }
  long startTime = System.currentTimeMillis();
  final Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> results =
      graphChiExecutionOperator.execute(inputChannelInstances, outputChannelInstances, operatorContext);
  long endTime = System.currentTimeMillis();
  final Collection<ExecutionLineageNode> executionLineageNodes = results.getField0();
  final Collection<ChannelInstance> producedChannelInstances = results.getField1();
  for (ChannelInstance outputChannelInstance : outputChannelInstances) {
    if (outputChannelInstance != null) {
      executionState.register(outputChannelInstance);
    }
  }
  final PartialExecution partialExecution = this.createPartialExecution(executionLineageNodes, endTime - startTime);
  executionState.add(partialExecution);
  this.registerMeasuredCardinalities(producedChannelInstances);
}
origin: org.qcri.rheem/rheem-spark

      );
  executionLineageNodes = results.getField0();
  producedChannelInstances = results.getField1();
} catch (Exception e) {
org.qcri.rheem.core.utilTuplegetField0

Popular methods of Tuple

  • getField1
  • <init>

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JFileChooser (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now