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

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

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

origin: org.qcri.rheem/rheem-core

@Override
public Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> aggregate(
    Tuple<Collection<ExecutionLineageNode>, Collection<ChannelInstance>> accumulator,
    ChannelLineageNode node) {
  accumulator.getField1().add(node.getChannelInstance());
  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

/**
 * @return whether the {@code enumeration} cannot be expanded anymore (i.e., all {@link PlanEnumeration#getServingOutputSlots()} and
 * {@link PlanEnumeration#getRequestedInputSlots()} are not connected to an adjacent {@link Slot})
 */
public boolean deemsComprehensive(PlanEnumeration enumeration) {
  return enumeration.getServingOutputSlots().stream().allMatch(
      outputService -> !deemsRelevant(outputService.getField1())
  ) && enumeration.getRequestedInputSlots().stream().allMatch(
      input -> !deemsRelevant(input)
  );
}
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

    channelsToIndicesChange.getField0(),
    key -> new Bitmask(this.destChannelDescriptorSets.size())
).orInPlace(channelsToIndicesChange.getField1());
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

Tuple<Operator, OptimizationContext> enumerationKey = EnumerationActivator.createKey(servedOperator, optimizationCtx);
EnumerationActivator enumerationActivator = this.enumerationActivators.computeIfAbsent(
    enumerationKey, key -> new EnumerationActivator(key.getField0(), key.getField1())
);
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

  producedChannelInstances = results.getField1();
} catch (Exception e) {
  throw new RheemException(String.format("Executing %s failed.", task), 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

  producedChannelInstances = results.getField1();
} catch (Exception e) {
  throw new RheemException(String.format("Executing %s failed.", task), e);
org.qcri.rheem.core.utilTuplegetField1

Popular methods of Tuple

  • getField0
  • <init>

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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