Search in sources :

Example 26 with Cache

use of com.google.common.cache.Cache in project atlasdb by palantir.

the class AtlasDbMetrics method registerCache.

public static void registerCache(Cache<?, ?> cache, String metricsPrefix) {
    MetricRegistry metricRegistry = getMetricRegistry();
    Set<String> existingMetrics = metricRegistry.getMetrics().keySet().stream().filter(name -> name.startsWith(metricsPrefix)).collect(Collectors.toSet());
    if (existingMetrics.isEmpty()) {
        MetricRegistries.registerCache(metricRegistry, cache, metricsPrefix);
    } else {
        log.info("Not registering cache with prefix '{}' as metric registry already contains metrics: {}", metricsPrefix, existingMetrics);
    }
}
Also used : Logger(org.slf4j.Logger) MetricRegistry(com.codahale.metrics.MetricRegistry) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) LoggingInvocationEventHandler(com.palantir.tritium.event.log.LoggingInvocationEventHandler) SharedMetricRegistries(com.codahale.metrics.SharedMetricRegistries) DefaultTaggedMetricRegistry(com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry) MetricRegistries(com.palantir.tritium.metrics.MetricRegistries) Instrumentation(com.palantir.tritium.proxy.Instrumentation) AtomicReference(java.util.concurrent.atomic.AtomicReference) Collectors(java.util.stream.Collectors) TaggedMetricRegistry(com.palantir.tritium.metrics.registry.TaggedMetricRegistry) MetricsInvocationEventHandler(com.palantir.tritium.event.metrics.MetricsInvocationEventHandler) LoggingLevel(com.palantir.tritium.event.log.LoggingLevel) Preconditions(com.google.common.base.Preconditions) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Cache(com.google.common.cache.Cache) MetricRegistry(com.codahale.metrics.MetricRegistry) DefaultTaggedMetricRegistry(com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry) TaggedMetricRegistry(com.palantir.tritium.metrics.registry.TaggedMetricRegistry)

Example 27 with Cache

use of com.google.common.cache.Cache in project OpenTripPlanner by opentripplanner.

the class AnalystWorker method run.

/**
 * This is the main worker event loop which fetches tasks from a broker and schedules them for execution.
 * It maintains a small local queue on the worker so that it doesn't idle while fetching new tasks.
 */
@Override
public void run() {
    // create executors with up to one thread per processor
    int nP = Runtime.getRuntime().availableProcessors();
    highPriorityExecutor = new ThreadPoolExecutor(1, nP, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(255));
    highPriorityExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
    batchExecutor = new ThreadPoolExecutor(1, nP, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(nP * 2));
    batchExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
    // Build a graph on startup, iff a graph ID was provided.
    if (graphId != null) {
        LOG.info("Prebuilding graph {}", graphId);
        Graph graph = clusterGraphBuilder.getGraph(graphId);
        // also prebuild the stop tree cache
        graph.index.getStopTreeCache();
        LOG.info("Done prebuilding graph {}", graphId);
    }
    // Start filling the work queues.
    boolean idle = false;
    while (true) {
        long now = System.currentTimeMillis();
        // Consider shutting down if enough time has passed
        if (now > nextShutdownCheckTime && autoShutdown) {
            if (idle && now > lastHighPriorityRequestProcessed + SINGLE_POINT_KEEPALIVE) {
                LOG.warn("Machine is idle, shutting down.");
                try {
                    Process process = new ProcessBuilder("sudo", "/sbin/shutdown", "-h", "now").start();
                    process.waitFor();
                } catch (Exception ex) {
                    LOG.error("Unable to terminate worker", ex);
                } finally {
                    System.exit(0);
                }
            }
            nextShutdownCheckTime += 60 * 60 * 1000;
        }
        LOG.info("Long-polling for work ({} second timeout).", POLL_TIMEOUT / 1000.0);
        // Long-poll (wait a few seconds for messages to become available)
        List<AnalystClusterRequest> tasks = getSomeWork(WorkType.BATCH);
        if (tasks == null) {
            LOG.info("Didn't get any work. Retrying.");
            idle = true;
            continue;
        }
        // run through high-priority tasks first to ensure they are enqueued even if the batch
        // queue blocks.
        tasks.stream().filter(t -> t.outputLocation == null).forEach(t -> highPriorityExecutor.execute(() -> {
            LOG.warn("Handling single point request via normal channel, side channel should open shortly.");
            this.handleOneRequest(t);
        }));
        logQueueStatus();
        // enqueue low-priority tasks; note that this may block anywhere in the process
        tasks.stream().filter(t -> t.outputLocation != null).forEach(t -> {
            // attempt to enqueue, waiting if the queue is full
            while (true) {
                try {
                    batchExecutor.execute(() -> this.handleOneRequest(t));
                    break;
                } catch (RejectedExecutionException e) {
                    // queue is full, wait 200ms and try again
                    try {
                        Thread.sleep(200);
                    } catch (InterruptedException e1) {
                    /* nothing */
                    }
                }
            }
        });
        logQueueStatus();
        idle = false;
    }
}
Also used : HttpPost(org.apache.http.client.methods.HttpPost) SocketConfig(org.apache.http.config.SocketConfig) LoggerFactory(org.slf4j.LoggerFactory) Random(java.util.Random) RequestConfig(org.apache.http.client.config.RequestConfig) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) EntityUtils(org.apache.http.util.EntityUtils) Graph(org.opentripplanner.routing.graph.Graph) PipedInputStream(java.io.PipedInputStream) GeoJsonModule(com.conveyal.geojson.GeoJsonModule) PoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager) URI(java.net.URI) TypeReference(com.fasterxml.jackson.core.type.TypeReference) MavenVersion(org.opentripplanner.common.MavenVersion) HttpEntity(org.apache.http.HttpEntity) AgencyAndIdSerializer(org.opentripplanner.api.model.AgencyAndIdSerializer) AmazonS3Client(com.amazonaws.services.s3.AmazonS3Client) UUID(java.util.UUID) RepeatedRaptorProfileRouter(org.opentripplanner.profile.RepeatedRaptorProfileRouter) RaptorWorkerData(org.opentripplanner.profile.RaptorWorkerData) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) List(java.util.List) HttpGet(org.apache.http.client.methods.HttpGet) GZIPOutputStream(java.util.zip.GZIPOutputStream) CacheBuilder(com.google.common.cache.CacheBuilder) HttpClients(org.apache.http.impl.client.HttpClients) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) JodaLocalDateSerializer(org.opentripplanner.api.model.JodaLocalDateSerializer) LocalDateTime(java.time.LocalDateTime) ByteArrayEntity(org.apache.http.entity.ByteArrayEntity) Regions(com.amazonaws.regions.Regions) HttpDelete(org.apache.http.client.methods.HttpDelete) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) HttpClient(org.apache.http.client.HttpClient) QualifiedModeSetSerializer(org.opentripplanner.api.model.QualifiedModeSetSerializer) SocketTimeoutException(java.net.SocketTimeoutException) AmazonS3(com.amazonaws.services.s3.AmazonS3) TraverseModeSetSerializer(org.opentripplanner.api.model.TraverseModeSetSerializer) PointSet(org.opentripplanner.analyst.PointSet) OutputStream(java.io.OutputStream) Logger(org.slf4j.Logger) Properties(java.util.Properties) JsonParser(com.fasterxml.jackson.core.JsonParser) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) R5Main(com.conveyal.r5.R5Main) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream) PipedOutputStream(java.io.PipedOutputStream) InputStreamReader(java.io.InputStreamReader) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) BasicHeader(org.apache.http.message.BasicHeader) DateTimeFormatter(java.time.format.DateTimeFormatter) HttpResponse(org.apache.http.HttpResponse) SampleSet(org.opentripplanner.analyst.SampleSet) BufferedReader(java.io.BufferedReader) Region(com.amazonaws.regions.Region) Cache(com.google.common.cache.Cache) InputStream(java.io.InputStream) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) SocketTimeoutException(java.net.SocketTimeoutException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) Graph(org.opentripplanner.routing.graph.Graph) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Example 28 with Cache

use of com.google.common.cache.Cache in project free-framework by a601942905git.

the class CacheTest1 method main.

public static void main(String[] args) throws ExecutionException, InterruptedException {
    CacheData cacheData = new CacheData();
    Cache cache = CacheBuilder.newBuilder().build();
    List<CacheEntity> cacheEntityList = (List<CacheEntity>) cache.get(CACHE_ENTITY_KEY, () -> cacheData.getCacheList());
    cacheEntityList.stream().forEach(System.out::println);
    System.out.println(cache.size());
    System.out.println("沉睡2s");
    Thread.sleep(2000);
    System.out.println("苏醒");
    cacheEntityList = (List<CacheEntity>) cache.get(CACHE_ENTITY_KEY, () -> cacheData.getCacheList());
    cacheEntityList.stream().forEach(System.out::println);
    System.out.println(cache.size());
    cache.put("key1", "value1");
    System.out.println(cache.size());
}
Also used : List(java.util.List) Cache(com.google.common.cache.Cache)

Example 29 with Cache

use of com.google.common.cache.Cache in project presto by prestodb.

the class IcebergModule method createStripeMetadataSourceFactory.

@Singleton
@Provides
public StripeMetadataSourceFactory createStripeMetadataSourceFactory(OrcCacheConfig orcCacheConfig, MBeanExporter exporter) {
    StripeMetadataSource stripeMetadataSource = new StorageStripeMetadataSource();
    if (orcCacheConfig.isStripeMetadataCacheEnabled()) {
        Cache<StripeReader.StripeId, Slice> footerCache = CacheBuilder.newBuilder().maximumWeight(orcCacheConfig.getStripeFooterCacheSize().toBytes()).weigher((id, footer) -> toIntExact(((Slice) footer).getRetainedSize())).expireAfterAccess(orcCacheConfig.getStripeFooterCacheTtlSinceLastAccess().toMillis(), MILLISECONDS).recordStats().build();
        Cache<StripeReader.StripeStreamId, Slice> streamCache = CacheBuilder.newBuilder().maximumWeight(orcCacheConfig.getStripeStreamCacheSize().toBytes()).weigher((id, stream) -> toIntExact(((Slice) stream).getRetainedSize())).expireAfterAccess(orcCacheConfig.getStripeStreamCacheTtlSinceLastAccess().toMillis(), MILLISECONDS).recordStats().build();
        CacheStatsMBean footerCacheStatsMBean = new CacheStatsMBean(footerCache);
        CacheStatsMBean streamCacheStatsMBean = new CacheStatsMBean(streamCache);
        exporter.export(generatedNameOf(CacheStatsMBean.class, connectorId + "_StripeFooter"), footerCacheStatsMBean);
        exporter.export(generatedNameOf(CacheStatsMBean.class, connectorId + "_StripeStream"), streamCacheStatsMBean);
        Optional<Cache<StripeReader.StripeStreamId, List<RowGroupIndex>>> rowGroupIndexCache = Optional.empty();
        if (orcCacheConfig.isRowGroupIndexCacheEnabled()) {
            rowGroupIndexCache = Optional.of(CacheBuilder.newBuilder().maximumWeight(orcCacheConfig.getRowGroupIndexCacheSize().toBytes()).weigher((id, rowGroupIndices) -> toIntExact(((List<RowGroupIndex>) rowGroupIndices).stream().mapToLong(RowGroupIndex::getRetainedSizeInBytes).sum())).expireAfterAccess(orcCacheConfig.getStripeStreamCacheTtlSinceLastAccess().toMillis(), MILLISECONDS).recordStats().build());
            CacheStatsMBean rowGroupIndexCacheStatsMBean = new CacheStatsMBean(rowGroupIndexCache.get());
            exporter.export(generatedNameOf(CacheStatsMBean.class, connectorId + "_StripeStreamRowGroupIndex"), rowGroupIndexCacheStatsMBean);
        }
        stripeMetadataSource = new CachingStripeMetadataSource(stripeMetadataSource, footerCache, streamCache, rowGroupIndexCache);
    }
    StripeMetadataSourceFactory factory = StripeMetadataSourceFactory.of(stripeMetadataSource);
    if (orcCacheConfig.isDwrfStripeCacheEnabled()) {
        factory = new DwrfAwareStripeMetadataSourceFactory(factory);
    }
    return factory;
}
Also used : StripeMetadataSource(com.facebook.presto.orc.StripeMetadataSource) CachingStripeMetadataSource(com.facebook.presto.orc.CachingStripeMetadataSource) StorageStripeMetadataSource(com.facebook.presto.orc.StorageStripeMetadataSource) HdfsEnvironment(com.facebook.presto.hive.HdfsEnvironment) Module(com.google.inject.Module) CacheStatsMBean(com.facebook.presto.hive.CacheStatsMBean) StripeMetadataSource(com.facebook.presto.orc.StripeMetadataSource) TestingMBeanServer(org.weakref.jmx.testing.TestingMBeanServer) OrcCacheConfig(com.facebook.presto.orc.cache.OrcCacheConfig) CacheConfig(com.facebook.presto.cache.CacheConfig) ConnectorNodePartitioningProvider(com.facebook.presto.spi.connector.ConnectorNodePartitioningProvider) ExtendedHiveMetastore(com.facebook.presto.hive.metastore.ExtendedHiveMetastore) EncryptionLibrary(com.facebook.presto.orc.EncryptionLibrary) RowGroupIndex(com.facebook.presto.orc.metadata.RowGroupIndex) ExportBinder.newExporter(org.weakref.jmx.guice.ExportBinder.newExporter) DynamicConfigurationProvider(com.facebook.presto.hive.DynamicConfigurationProvider) CachingOrcFileTailSource(com.facebook.presto.orc.cache.CachingOrcFileTailSource) Multibinder.newSetBinder(com.google.inject.multibindings.Multibinder.newSetBinder) FileFormatDataSourceStats(com.facebook.presto.hive.FileFormatDataSourceStats) ConnectorPageSourceProvider(com.facebook.presto.spi.connector.ConnectorPageSourceProvider) HiveHdfsConfiguration(com.facebook.presto.hive.HiveHdfsConfiguration) HiveClientConfig(com.facebook.presto.hive.HiveClientConfig) StripeMetadataSourceFactory(com.facebook.presto.orc.StripeMetadataSourceFactory) ConnectorSplitManager(com.facebook.presto.spi.connector.ConnectorSplitManager) PartitionMutator(com.facebook.presto.hive.PartitionMutator) HiveDwrfEncryptionProvider(com.facebook.presto.hive.HiveDwrfEncryptionProvider) GcsConfigurationInitializer(com.facebook.presto.hive.gcs.GcsConfigurationInitializer) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Multibinder(com.google.inject.multibindings.Multibinder) HdfsConfigurationInitializer(com.facebook.presto.hive.HdfsConfigurationInitializer) Threads.daemonThreadsNamed(com.facebook.airlift.concurrent.Threads.daemonThreadsNamed) CacheFactory(com.facebook.presto.cache.CacheFactory) DwrfAwareStripeMetadataSourceFactory(com.facebook.presto.orc.DwrfAwareStripeMetadataSourceFactory) Procedure(com.facebook.presto.spi.procedure.Procedure) List(java.util.List) CachingStripeMetadataSource(com.facebook.presto.orc.CachingStripeMetadataSource) StripeReader(com.facebook.presto.orc.StripeReader) Optional(java.util.Optional) CacheBuilder(com.google.common.cache.CacheBuilder) MetastoreConfig(com.facebook.presto.hive.metastore.MetastoreConfig) FileMergeCacheConfig(com.facebook.presto.cache.filemerge.FileMergeCacheConfig) Slice(io.airlift.slice.Slice) HiveGcsConfigurationInitializer(com.facebook.presto.hive.gcs.HiveGcsConfigurationInitializer) ForCachingHiveMetastore(com.facebook.presto.hive.ForCachingHiveMetastore) ParquetFileWriterConfig(com.facebook.presto.hive.ParquetFileWriterConfig) Singleton(javax.inject.Singleton) JsonCodecBinder.jsonCodecBinder(com.facebook.airlift.json.JsonCodecBinder.jsonCodecBinder) HdfsConfiguration(com.facebook.presto.hive.HdfsConfiguration) Binder(com.google.inject.Binder) OrcFileTail(com.facebook.presto.orc.metadata.OrcFileTail) MBeanServer(javax.management.MBeanServer) Math.toIntExact(java.lang.Math.toIntExact) OrcFileTailSource(com.facebook.presto.orc.cache.OrcFileTailSource) ConnectorPageSinkProvider(com.facebook.presto.spi.connector.ConnectorPageSinkProvider) HiveNodePartitioningProvider(com.facebook.presto.hive.HiveNodePartitioningProvider) MetastoreClientConfig(com.facebook.presto.hive.MetastoreClientConfig) ExecutorService(java.util.concurrent.ExecutorService) ForMetastoreHdfsEnvironment(com.facebook.presto.hive.ForMetastoreHdfsEnvironment) OrcDataSourceId(com.facebook.presto.orc.OrcDataSourceId) CacheStats(com.facebook.presto.cache.CacheStats) ObjectNames.generatedNameOf(org.weakref.jmx.ObjectNames.generatedNameOf) IcebergPlanOptimizer(com.facebook.presto.iceberg.optimizer.IcebergPlanOptimizer) CachingHiveMetastore(com.facebook.presto.hive.metastore.CachingHiveMetastore) OrcFileWriterConfig(com.facebook.presto.hive.OrcFileWriterConfig) StorageStripeMetadataSource(com.facebook.presto.orc.StorageStripeMetadataSource) UnsupportedEncryptionLibrary(com.facebook.presto.orc.UnsupportedEncryptionLibrary) Scopes(com.google.inject.Scopes) Executors.newFixedThreadPool(java.util.concurrent.Executors.newFixedThreadPool) HiveCachingHdfsConfiguration(com.facebook.presto.hive.cache.HiveCachingHdfsConfiguration) HivePartitionMutator(com.facebook.presto.hive.metastore.HivePartitionMutator) StorageOrcFileTailSource(com.facebook.presto.orc.cache.StorageOrcFileTailSource) Provides(com.google.inject.Provides) HiveGcsConfig(com.facebook.presto.hive.gcs.HiveGcsConfig) ForCachingFileSystem(com.facebook.presto.cache.ForCachingFileSystem) ConfigBinder.configBinder(com.facebook.airlift.configuration.ConfigBinder.configBinder) Cache(com.google.common.cache.Cache) MBeanExporter(org.weakref.jmx.MBeanExporter) StripeMetadataSourceFactory(com.facebook.presto.orc.StripeMetadataSourceFactory) DwrfAwareStripeMetadataSourceFactory(com.facebook.presto.orc.DwrfAwareStripeMetadataSourceFactory) CachingStripeMetadataSource(com.facebook.presto.orc.CachingStripeMetadataSource) StripeReader(com.facebook.presto.orc.StripeReader) RowGroupIndex(com.facebook.presto.orc.metadata.RowGroupIndex) Slice(io.airlift.slice.Slice) DwrfAwareStripeMetadataSourceFactory(com.facebook.presto.orc.DwrfAwareStripeMetadataSourceFactory) CacheStatsMBean(com.facebook.presto.hive.CacheStatsMBean) StorageStripeMetadataSource(com.facebook.presto.orc.StorageStripeMetadataSource) Cache(com.google.common.cache.Cache) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Example 30 with Cache

use of com.google.common.cache.Cache in project presto by prestodb.

the class DruidClient method toRemoteTable.

Optional<RemoteTableObject> toRemoteTable(SchemaTableName schemaTableName) {
    requireNonNull(schemaTableName, "schemaTableName is null");
    verify(CharMatcher.forPredicate(Character::isUpperCase).matchesNoneOf(schemaTableName.getTableName()), "Expected table name from internal metadata to be lowercase: %s", schemaTableName);
    if (!caseInsensitiveNameMatching) {
        return Optional.of(RemoteTableObject.of(schemaTableName.getTableName()));
    }
    @Nullable Optional<RemoteTableObject> remoteTable = remoteTables.getIfPresent(schemaTableName);
    if (remoteTable != null) {
        return remoteTable;
    }
    // Cache miss, reload the cache
    Map<SchemaTableName, Optional<RemoteTableObject>> mapping = new HashMap<>();
    for (String table : getTables()) {
        SchemaTableName cacheKey = new SchemaTableName(getSchema(), table);
        mapping.merge(cacheKey, Optional.of(RemoteTableObject.of(table)), (currentValue, collision) -> currentValue.map(current -> current.registerCollision(collision.get().getOnlyRemoteTableName())));
        remoteTables.put(cacheKey, mapping.get(cacheKey));
    }
    // explicitly cache if the requested table doesn't exist
    if (!mapping.containsKey(schemaTableName)) {
        remoteTables.put(schemaTableName, Optional.empty());
    }
    return mapping.containsKey(schemaTableName) ? mapping.get(schemaTableName) : Optional.empty();
}
Also used : JsonProperty(com.fasterxml.jackson.annotation.JsonProperty) JsonCodec(com.facebook.airlift.json.JsonCodec) Builder.preparePost(com.facebook.airlift.http.client.Request.Builder.preparePost) JsonCodec.listJsonCodec(com.facebook.airlift.json.JsonCodec.listJsonCodec) JSON_UTF_8(com.google.common.net.MediaType.JSON_UTF_8) Duration(io.airlift.units.Duration) SchemaTableName(com.facebook.presto.spi.SchemaTableName) Map(java.util.Map) URI(java.net.URI) ENGLISH(java.util.Locale.ENGLISH) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) JsonCodec.jsonCodec(com.facebook.airlift.json.JsonCodec.jsonCodec) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) ResponseHandler(com.facebook.airlift.http.client.ResponseHandler) List(java.util.List) Optional(java.util.Optional) DruidTableInfo(com.facebook.presto.druid.metadata.DruidTableInfo) CacheBuilder(com.google.common.cache.CacheBuilder) OBJECT(com.facebook.presto.druid.DruidResultFormat.OBJECT) DruidColumnInfo(com.facebook.presto.druid.metadata.DruidColumnInfo) HashMap(java.util.HashMap) HttpUriBuilder(com.facebook.airlift.http.client.HttpUriBuilder) DruidSegmentIdWrapper(com.facebook.presto.druid.metadata.DruidSegmentIdWrapper) PrestoException(com.facebook.presto.spi.PrestoException) OBJECT_LINES(com.facebook.presto.druid.DruidResultFormat.OBJECT_LINES) CONTENT_TYPE(com.google.common.net.HttpHeaders.CONTENT_TYPE) HTTP_OK(java.net.HttpURLConnection.HTTP_OK) Inject(javax.inject.Inject) ImmutableList(com.google.common.collect.ImmutableList) Verify.verify(com.google.common.base.Verify.verify) JsonResponseHandler.createJsonResponseHandler(com.facebook.airlift.http.client.JsonResponseHandler.createJsonResponseHandler) DRUID_AMBIGUOUS_OBJECT_NAME(com.facebook.presto.druid.DruidErrorCode.DRUID_AMBIGUOUS_OBJECT_NAME) Objects.requireNonNull(java.util.Objects.requireNonNull) StaticBodyGenerator.createStaticBodyGenerator(com.facebook.airlift.http.client.StaticBodyGenerator.createStaticBodyGenerator) Nullable(org.checkerframework.checker.nullness.qual.Nullable) DruidIngestTask(com.facebook.presto.druid.ingestion.DruidIngestTask) CharMatcher(com.google.common.base.CharMatcher) IOException(java.io.IOException) Iterables.getOnlyElement(com.google.common.collect.Iterables.getOnlyElement) HttpClient(com.facebook.airlift.http.client.HttpClient) InputStreamReader(java.io.InputStreamReader) HttpUriBuilder.uriBuilderFrom(com.facebook.airlift.http.client.HttpUriBuilder.uriBuilderFrom) DruidSegmentInfo(com.facebook.presto.druid.metadata.DruidSegmentInfo) Request(com.facebook.airlift.http.client.Request) DRUID_BROKER_RESULT_ERROR(com.facebook.presto.druid.DruidErrorCode.DRUID_BROKER_RESULT_ERROR) JsonCreator(com.fasterxml.jackson.annotation.JsonCreator) BufferedReader(java.io.BufferedReader) Cache(com.google.common.cache.Cache) Builder.prepareGet(com.facebook.airlift.http.client.Request.Builder.prepareGet) Collections(java.util.Collections) InputStream(java.io.InputStream) Optional(java.util.Optional) HashMap(java.util.HashMap) SchemaTableName(com.facebook.presto.spi.SchemaTableName) Nullable(org.checkerframework.checker.nullness.qual.Nullable)

Aggregations

Cache (com.google.common.cache.Cache)43 List (java.util.List)21 CacheBuilder (com.google.common.cache.CacheBuilder)19 Set (java.util.Set)11 Collectors (java.util.stream.Collectors)11 ArrayList (java.util.ArrayList)10 Optional (java.util.Optional)10 TimeUnit (java.util.concurrent.TimeUnit)10 MILLISECONDS (java.util.concurrent.TimeUnit.MILLISECONDS)10 Module (com.google.inject.Module)9 CachingOrcFileTailSource (com.facebook.presto.orc.cache.CachingOrcFileTailSource)8 OrcFileTailSource (com.facebook.presto.orc.cache.OrcFileTailSource)8 StorageOrcFileTailSource (com.facebook.presto.orc.cache.StorageOrcFileTailSource)8 OrcFileTail (com.facebook.presto.orc.metadata.OrcFileTail)8 ExecutorService (java.util.concurrent.ExecutorService)8 ConfigBinder.configBinder (com.facebook.airlift.configuration.ConfigBinder.configBinder)7 CachingStripeMetadataSource (com.facebook.presto.orc.CachingStripeMetadataSource)7 DwrfAwareStripeMetadataSourceFactory (com.facebook.presto.orc.DwrfAwareStripeMetadataSourceFactory)7 OrcDataSourceId (com.facebook.presto.orc.OrcDataSourceId)7 StorageStripeMetadataSource (com.facebook.presto.orc.StorageStripeMetadataSource)7