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

How to use
PartitionedLookupSourceFactory
in
io.prestosql.operator

Best Java code snippets using io.prestosql.operator.PartitionedLookupSourceFactory (Showing top 20 results out of 315)

origin: prestosql/presto

private void freePartitions()
{
  // Let the HashBuilderOperators reduce their accounted memory
  partitionsNoLongerNeeded.set(null);
  lock.writeLock().lock();
  try {
    // Remove out references to partitions to actually free memory
    Arrays.fill(partitions, null);
    lookupSourceSupplier = null;
    closeCachedLookupSources();
  }
  finally {
    lock.writeLock().unlock();
  }
}
origin: prestosql/presto

@Override
public ListenableFuture<?> whenBuildFinishes()
{
  return transform(
      this.createLookupSourceProvider(),
      lookupSourceProvider -> {
        // Close the lookupSourceProvider we just created.
        // The only reason we created it is to wait until lookup source is ready.
        lookupSourceProvider.close();
        return null;
      },
      directExecutor());
}
origin: io.prestosql/presto-main

@Override
public void destroy()
{
  lock.writeLock().lock();
  try {
    freePartitions();
    spilledPartitions.values().forEach(SpilledLookupSourceHandle::dispose);
    // Setting destroyed must be last because it's a part of the state exposed by isDestroyed() without synchronization.
    destroyed.set(null);
  }
  finally {
    lock.writeLock().unlock();
  }
}
origin: io.prestosql/presto-main

this.localRevocableMemoryContext = operatorContext.localRevocableMemoryContext();
this.index = pagesIndexFactory.newPagesIndex(lookupSourceFactory.getTypes(), expectedPositions);
this.lookupSourceFactory = lookupSourceFactory;
lookupSourceFactoryDestroyed = lookupSourceFactory.isDestroyed();
origin: io.prestosql/presto-main

  verify(partitions.length > 1, "Spill occurred when only one partition");
  lookupSourceSupplier = createPartitionedLookupSourceSupplier(ImmutableList.copyOf(partitions), hashChannelTypes, outer);
  closeCachedLookupSources();
supplyLookupSources();
origin: prestosql/presto

private ListenableFuture<Supplier<LookupSource>> loadSpilledLookupSource(int partitionNumber)
{
  return getSpilledLookupSourceHandle(partitionNumber).getLookupSource();
}
origin: io.prestosql/presto-main

@VisibleForTesting
public static JoinBridgeManager<PartitionedLookupSourceFactory> lookupAllAtOnce(PartitionedLookupSourceFactory factory)
{
  return new JoinBridgeManager<>(
      false,
      UNGROUPED_EXECUTION,
      UNGROUPED_EXECUTION,
      ignored -> factory,
      factory.getOutputTypes());
}
origin: io.prestosql/presto-main

private void finishInput()
{
  checkState(state == State.CONSUMING_INPUT);
  if (lookupSourceFactoryDestroyed.isDone()) {
    close();
    return;
  }
  LookupSourceSupplier partition = buildLookupSource();
  if (spillEnabled) {
    localRevocableMemoryContext.setBytes(partition.get().getInMemorySizeInBytes());
  }
  else {
    localUserMemoryContext.setBytes(partition.get().getInMemorySizeInBytes());
  }
  lookupSourceNotNeeded = Optional.of(lookupSourceFactory.lendPartitionLookupSource(partitionIndex, partition));
  state = State.LOOKUP_SOURCE_BUILT;
}
origin: prestosql/presto

@Override
public HashBuilderOperator createOperator(DriverContext driverContext)
{
  checkState(!closed, "Factory is already closed");
  OperatorContext operatorContext = driverContext.addOperatorContext(operatorId, planNodeId, HashBuilderOperator.class.getSimpleName());
  PartitionedLookupSourceFactory lookupSourceFactory = this.lookupSourceFactoryManager.getJoinBridge(driverContext.getLifespan());
  int partitionIndex = getAndIncrementPartitionIndex(driverContext.getLifespan());
  verify(partitionIndex < lookupSourceFactory.partitions());
  return new HashBuilderOperator(
      operatorContext,
      lookupSourceFactory,
      partitionIndex,
      outputChannels,
      hashChannels,
      preComputedHashChannel,
      filterFunctionFactory,
      sortChannel,
      searchFunctionFactories,
      expectedPositions,
      pagesIndexFactory,
      spillEnabled,
      singleStreamSpillerFactory);
}
origin: prestosql/presto

JoinBridgeManager<PartitionedLookupSourceFactory> lookupSourceFactoryManager = JoinBridgeManager.lookupAllAtOnce(new PartitionedLookupSourceFactory(
    buildPages.getTypes(),
    rangeList(buildPages.getTypes().size()).stream()
origin: prestosql/presto

this.localRevocableMemoryContext = operatorContext.localRevocableMemoryContext();
this.index = pagesIndexFactory.newPagesIndex(lookupSourceFactory.getTypes(), expectedPositions);
this.lookupSourceFactory = lookupSourceFactory;
lookupSourceFactoryDestroyed = lookupSourceFactory.isDestroyed();
origin: prestosql/presto

  verify(partitions.length > 1, "Spill occurred when only one partition");
  lookupSourceSupplier = createPartitionedLookupSourceSupplier(ImmutableList.copyOf(partitions), hashChannelTypes, outer);
  closeCachedLookupSources();
supplyLookupSources();
origin: io.prestosql/presto-main

private ListenableFuture<Supplier<LookupSource>> loadSpilledLookupSource(int partitionNumber)
{
  return getSpilledLookupSourceHandle(partitionNumber).getLookupSource();
}
origin: prestosql/presto

@VisibleForTesting
public static JoinBridgeManager<PartitionedLookupSourceFactory> lookupAllAtOnce(PartitionedLookupSourceFactory factory)
{
  return new JoinBridgeManager<>(
      false,
      UNGROUPED_EXECUTION,
      UNGROUPED_EXECUTION,
      ignored -> factory,
      factory.getOutputTypes());
}
origin: prestosql/presto

private void finishInput()
{
  checkState(state == State.CONSUMING_INPUT);
  if (lookupSourceFactoryDestroyed.isDone()) {
    close();
    return;
  }
  LookupSourceSupplier partition = buildLookupSource();
  if (spillEnabled) {
    localRevocableMemoryContext.setBytes(partition.get().getInMemorySizeInBytes());
  }
  else {
    localUserMemoryContext.setBytes(partition.get().getInMemorySizeInBytes());
  }
  lookupSourceNotNeeded = Optional.of(lookupSourceFactory.lendPartitionLookupSource(partitionIndex, partition));
  state = State.LOOKUP_SOURCE_BUILT;
}
origin: io.prestosql/presto-main

@Override
public HashBuilderOperator createOperator(DriverContext driverContext)
{
  checkState(!closed, "Factory is already closed");
  OperatorContext operatorContext = driverContext.addOperatorContext(operatorId, planNodeId, HashBuilderOperator.class.getSimpleName());
  PartitionedLookupSourceFactory lookupSourceFactory = this.lookupSourceFactoryManager.getJoinBridge(driverContext.getLifespan());
  int partitionIndex = getAndIncrementPartitionIndex(driverContext.getLifespan());
  verify(partitionIndex < lookupSourceFactory.partitions());
  return new HashBuilderOperator(
      operatorContext,
      lookupSourceFactory,
      partitionIndex,
      outputChannels,
      hashChannels,
      preComputedHashChannel,
      filterFunctionFactory,
      sortChannel,
      searchFunctionFactories,
      expectedPositions,
      pagesIndexFactory,
      spillEnabled,
      singleStreamSpillerFactory);
}
origin: io.prestosql/presto-main

JoinBridgeManager<PartitionedLookupSourceFactory> lookupSourceFactoryManager = JoinBridgeManager.lookupAllAtOnce(new PartitionedLookupSourceFactory(
    buildPages.getTypes(),
    rangeList(buildPages.getTypes().size()).stream()
origin: prestosql/presto

@Override
public void destroy()
{
  lock.writeLock().lock();
  try {
    freePartitions();
    spilledPartitions.values().forEach(SpilledLookupSourceHandle::dispose);
    // Setting destroyed must be last because it's a part of the state exposed by isDestroyed() without synchronization.
    destroyed.set(null);
  }
  finally {
    lock.writeLock().unlock();
  }
}
origin: io.prestosql/presto-main

private void disposeSpilledLookupSource(int partitionNumber)
{
  getSpilledLookupSourceHandle(partitionNumber).dispose();
}
origin: io.prestosql/presto-main

@Override
public ListenableFuture<?> whenBuildFinishes()
{
  return transform(
      this.createLookupSourceProvider(),
      lookupSourceProvider -> {
        // Close the lookupSourceProvider we just created.
        // The only reason we created it is to wait until lookup source is ready.
        lookupSourceProvider.close();
        return null;
      },
      directExecutor());
}
io.prestosql.operatorPartitionedLookupSourceFactory

Most used methods

  • <init>
  • closeCachedLookupSources
  • createLookupSourceProvider
  • freePartitions
  • getOutputTypes
  • getSpilledLookupSourceHandle
  • getTypes
  • isDestroyed
  • lendPartitionLookupSource
  • partitions
  • setPartitionSpilledLookupSourceHandle
  • supplyLookupSources
  • setPartitionSpilledLookupSourceHandle,
  • supplyLookupSources

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • String (java.lang)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Best plugins for Eclipse
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