Tabnine Logo
PartitionConsumerResult
Code IndexAdd Tabnine to your IDE (free)

How to use
PartitionConsumerResult
in
co.cask.cdap.api.dataset.lib

Best Java code snippets using co.cask.cdap.api.dataset.lib.PartitionConsumerResult (Showing top 5 results out of 315)

origin: cdapio/cdap

 /**
  * @param limit limit to be applied while consuming partitions
  * @param predicate predicate to be applied while consuming partitions
  * @return a list of {@link Partition}s of the underlying {@link PartitionedFileSet} created since the last call
  *         to this method. This excludes partitions created in in-progress transactions including the one in which the
  *         call to this method is made.
  */
 public List<PartitionDetail> consumePartitions(int limit, Predicate<PartitionDetail> predicate) {
  PartitionConsumerResult partitionConsumerResult =
   partitionedFileSet.consumePartitions(partitionConsumerState, limit, predicate);
  partitionConsumerState = partitionConsumerResult.getPartitionConsumerState();
  return partitionConsumerResult.getPartitions();
 }
}
origin: cdapio/cdap

return new PartitionConsumerResult(new PartitionConsumerState(scanUpTo, inProgressBeforeScanEnd),
                  partitions);
origin: co.cask.cdap/cdap-data-fabric

return new PartitionConsumerResult(new PartitionConsumerState(scanUpTo, inProgressBeforeScanEnd),
                  partitions);
origin: co.cask.cdap/cdap-data-fabric

 /**
  * @param limit limit to be applied while consuming partitions
  * @param predicate predicate to be applied while consuming partitions
  * @return a list of {@link Partition}s of the underlying {@link PartitionedFileSet} created since the last call
  *         to this method. This excludes partitions created in in-progress transactions including the one in which the
  *         call to this method is made.
  */
 public List<PartitionDetail> consumePartitions(int limit, Predicate<PartitionDetail> predicate) {
  PartitionConsumerResult partitionConsumerResult =
   partitionedFileSet.consumePartitions(partitionConsumerState, limit, predicate);
  partitionConsumerState = partitionConsumerResult.getPartitionConsumerState();
  return partitionConsumerResult.getPartitions();
 }
}
origin: cdapio/cdap

/**
 * Populates the ConsumerWorkingSet by fetching partitions from the given PartitionedFileSet.
 *
 * @param partitionedFileSet the PartitionedFileSet to fetch partitions from
 * @param configuration the ConsumerConfiguration which defines parameters for consuming
 */
public void populate(PartitionedFileSet partitionedFileSet, ConsumerConfiguration configuration) {
 int numToPopulate = configuration.getMaxWorkingSetSize() - partitions.size();
 Predicate<PartitionDetail> predicate = configuration.getPartitionPredicate();
 co.cask.cdap.api.dataset.lib.PartitionConsumerResult result =
  partitionedFileSet.consumePartitions(partitionConsumerState, numToPopulate, predicate);
 List<PartitionDetail> partitions = result.getPartitions();
 for (PartitionDetail partition : partitions) {
  addPartition(partition.getPartitionKey());
 }
 partitionConsumerState = result.getPartitionConsumerState();
}
co.cask.cdap.api.dataset.libPartitionConsumerResult

Javadoc

Returns access to an iterator of the requested partitions as well as a PartitionConsumerState which can be used to request partitions created after the previous request of partitions.

Most used methods

  • getPartitionConsumerState
  • getPartitions
  • <init>

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JFileChooser (javax.swing)
  • Top plugins for Android Studio
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