Codota Logo
Tuple.getField0
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
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

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JTable (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now