Refine search
/** * 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 final class SpilledLookupSourceHandle @GuardedBy("this") private State state = State.SPILLED; @GuardedBy("this") @Nullable private SettableFuture<Supplier<LookupSource>> unspilledLookupSource;
@ThreadSafe public class PagesSpatialIndexFactory private final List<Type> outputTypes; @GuardedBy("this") private final List<SettableFuture<PagesSpatialIndex>> pagesSpatialIndexFutures = new ArrayList<>(); @GuardedBy("this") @Nullable private Supplier<PagesSpatialIndex> pagesSpatialIndex;
@ThreadSafe private static class OuterPositionTracker @GuardedBy("this") private final boolean[] visitedPositions; @GuardedBy("this") private boolean finished;
@ThreadSafe public class ComponentTreeHolder { private static final int UNINITIALIZED = -1; private @Nullable ComponentTreeMeasureListenerFactory mComponentTreeMeasureListenerFactory; @GuardedBy("this") private int mLastMeasuredHeight; @GuardedBy("this") private @Nullable ComponentTree mComponentTree; @GuardedBy("this") private StateHandler mStateHandler; @GuardedBy("this") private RenderInfo mRenderInfo; @GuardedBy("this") private @Nullable ComponentTree.NewLayoutStateReadyListener mPendingNewLayoutListener; @GuardedBy("this") private int mLastRequestedWidthSpec = UNINITIALIZED; @GuardedBy("this") private int mLastRequestedHeightSpec = UNINITIALIZED;
@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; } }
private final long maxBytes; @GuardedBy("this") private long reservedBytes; @GuardedBy("this") private long reservedRevocableBytes; @Nullable @GuardedBy("this") private NonCancellableMemoryFuture<?> future; @GuardedBy("this") @GuardedBy("this") private final Map<QueryId, Map<String, Long>> taggedMemoryAllocations = new HashMap<>(); @GuardedBy("this") private final Map<QueryId, Long> queryMemoryRevocableReservations = new HashMap<>();
@ThreadSafe public class ReferenceCount @GuardedBy("this") private int count;
@ThreadSafe public class ReopeningCluster extends DelegatingCluster @GuardedBy("this") private Cluster delegate; @GuardedBy("this") private boolean closed;
@Nullable private final CountingOutputStream mDecompressedCounter; private final ChromePeerManager mNetworkPeerManager; private final ResponseHandler mResponseHandler; @GuardedBy("this") private boolean mClosed; @GuardedBy("this") private boolean mEofSeen; @Nullable @GuardedBy("this") private byte[] mSkipBuffer;
@ThreadSafe final class FileHolder implements Closeable @GuardedBy("this") private boolean deleted;
@ThreadSafe public static class LocalExchangeFactory private final int bufferCount; @GuardedBy("this") private boolean noMoreSinkFactories; @GuardedBy("this") private int numSinkFactories; @GuardedBy("this") private final Map<Lifespan, LocalExchange> localExchangeMap = new HashMap<>(); @GuardedBy("this") private final List<LocalExchangeSinkFactoryId> closedSinkFactories = new ArrayList<>();