Refine search
@ThreadSafe public class DefaultWarningCollector implements WarningCollector { @GuardedBy("this") private final Map<WarningCode, PrestoWarning> warnings = new LinkedHashMap<>(); private final WarningCollectorConfig config; public DefaultWarningCollector(WarningCollectorConfig config) { this.config = requireNonNull(config, "config is null"); } @Override public synchronized void add(PrestoWarning warning) { requireNonNull(warning, "warning is null"); if (warnings.size() < config.getMaxWarnings()) { warnings.putIfAbsent(warning.getWarningCode(), warning); } } @Override public synchronized List<PrestoWarning> getWarnings() { return ImmutableList.copyOf(warnings.values()); } }
@ThreadSafe private static class SharedLookupOuterPositionIterator implements OuterPositionIterator { private final LookupSource lookupSource; private final boolean[] visitedPositions; @GuardedBy("this") private int currentPosition; public SharedLookupOuterPositionIterator(LookupSource lookupSource, boolean[] visitedPositions) { this.lookupSource = requireNonNull(lookupSource, "lookupSource is null"); this.visitedPositions = requireNonNull(visitedPositions, "visitedPositions is null"); checkArgument(lookupSource.getJoinPositionCount() == visitedPositions.length); } @Override public synchronized boolean appendToNext(PageBuilder pageBuilder, int outputChannelOffset) { while (currentPosition < visitedPositions.length) { if (!visitedPositions[currentPosition]) { lookupSource.appendTo(currentPosition, pageBuilder, outputChannelOffset); currentPosition++; return true; } currentPosition++; } return false; } }
@ThreadSafe public class ReferenceCount @GuardedBy("this") private int count;
@ThreadSafe final class FileHolder implements Closeable @GuardedBy("this") private boolean deleted;
@ThreadSafe class BroadcastOutputBufferManager implements OutputBufferManager @GuardedBy("this") private OutputBuffers outputBuffers = createInitialEmptyOutputBuffers(BROADCAST);
@ThreadSafe private static class OuterPositionTracker @GuardedBy("this") private final boolean[] visitedPositions; @GuardedBy("this") private boolean finished;
@ThreadSafe public class FutureStateChange<T> @GuardedBy("listeners") private final Set<SettableFuture<T>> listeners = new HashSet<>();
@ThreadSafe public class TestingWarningCollector implements WarningCollector @GuardedBy("this") private final Map<WarningCode, PrestoWarning> warnings = new LinkedHashMap<>(); private final WarningCollectorConfig config;
@ThreadSafe public class LocalExchangeMemoryManager private final AtomicLong bufferedBytes = new AtomicLong(); @GuardedBy("this") private SettableFuture<?> notFullFuture = NOT_FULL;
@ThreadSafe public class ClusterMemoryLeakDetector @GuardedBy("this") private Set<QueryId> leakedQueries;
/** * A wrapper on the resource to include the last time at which it was used. * * @param <R> the resource type */ protected class ResourceInternal<R> { /** The resource. */ private R mResource; /** The last access time in ms. */ private long mLastAccessTimeMs; /** * @param lastAccessTimeMs the last access time in ms */ public void setLastAccessTimeMs(long lastAccessTimeMs) { mLastAccessTimeMs = lastAccessTimeMs; } /** * @return the last access time in ms */ public long getLastAccessTimeMs() { return mLastAccessTimeMs; } /** * Creates a {@link ResourceInternal} instance. * * @param resource the resource
@ThreadSafe public class SpillSpaceTracker @GuardedBy("this") private long currentBytes;
/** * Just hold an object. * @param <T> the type of object */ private class ObjectHolder<T> { private T object; ObjectHolder() { } public T getObject() { return object; } public void setObject(T object) { this.object = object; } }
@ThreadSafe public abstract class InterningOrdinalDomain<S, E extends OrdinalValue<E>> extends OrdinalDomain<E> { @GuardedBy("internedInstances") private final Map<S, E> internedInstances = new HashMap<>();
@ThreadSafe public class ReopeningCluster extends DelegatingCluster @GuardedBy("this") private Cluster delegate; @GuardedBy("this") private boolean closed;
@ThreadSafe public final class SimpleLocalMemoryContext implements LocalMemoryContext private final String allocationTag; @GuardedBy("this") private long usedBytes; @GuardedBy("this") private boolean closed;
@ThreadSafe public class DriverYieldSignal @GuardedBy("this") private long runningSequence; @GuardedBy("this") private ScheduledFuture<?> yieldFuture;
@ThreadSafe public class MemoryPagesStore @GuardedBy("this") private long currentBytes;
@ThreadSafe abstract class AbstractAggregatedMemoryContext implements AggregatedMemoryContext @GuardedBy("this") private long usedBytes; @GuardedBy("this") private boolean closed;
@ThreadSafe private static class DatabasePeerRegistrationListener extends PeersRegisteredListener { private final List<DatabaseDriver2> mDatabaseDrivers; @GuardedBy("this") private final SparseArray<DatabaseDescriptorHolder> mDatabaseHolders = new SparseArray<>(); @GuardedBy("this") private final ObjectIdMapper mDatabaseIdMapper = new ObjectIdMapper();