private SingularityS3SearchResult getS3Logs(S3Configuration s3Configuration, Map<SingularityS3Service, Set<String>> servicesToPrefixes, final SingularityS3SearchRequest search, final boolean paginated) throws InterruptedException, ExecutionException, TimeoutException { int totalPrefixCount = 0; for (Map.Entry<SingularityS3Service, Set<String>> entry : servicesToPrefixes.entrySet()) { totalPrefixCount += entry.getValue().size(); } if (totalPrefixCount == 0) { return SingularityS3SearchResult.empty(); } ListeningExecutorService executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(Math.min(totalPrefixCount, s3Configuration.getMaxS3Threads()), new ThreadFactoryBuilder().setNameFormat("S3LogFetcher-%d").build())); try { final ConcurrentHashMap<String, ContinuationToken> continuationTokens = new ConcurrentHashMap<>(); List<SingularityS3LogMetadata> logs = Lists.newArrayList(getS3LogsWithExecutorService(s3Configuration, executorService, servicesToPrefixes, totalPrefixCount, search, continuationTokens, paginated)); Collections.sort(logs, LOG_COMPARATOR); return new SingularityS3SearchResult(continuationTokens, isFinalPageForAllPrefixes(continuationTokens.values()), logs); } finally { executorService.shutdownNow(); } }
public static SingularityS3SearchResult empty() { return new SingularityS3SearchResult(Collections.<String, ContinuationToken>emptyMap(), false, Collections.<SingularityS3LogMetadata>emptyList()); }
return getS3Logs(configuration.get(), getServiceToPrefixes(search, user), search, false).getResults(); } catch (TimeoutException te) { throw timeout("Timed out waiting for response from S3 for %s", taskId);
Collections.<String, ContinuationToken>emptyMap()); return getS3Logs(configuration.get(), getServiceToPrefixes(search, user), search, false).getResults(); } catch (TimeoutException te) { throw timeout("Timed out waiting for response from S3 for %s", requestId);
private SingularityS3SearchResult getS3Logs(S3Configuration s3Configuration, Map<SingularityS3Service, Set<String>> servicesToPrefixes, final SingularityS3SearchRequest search, final boolean paginated) throws InterruptedException, ExecutionException, TimeoutException { int totalPrefixCount = 0; for (Map.Entry<SingularityS3Service, Set<String>> entry : servicesToPrefixes.entrySet()) { totalPrefixCount += entry.getValue().size(); } if (totalPrefixCount == 0) { return SingularityS3SearchResult.empty(); } ListeningExecutorService executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(Math.min(totalPrefixCount, s3Configuration.getMaxS3Threads()), new ThreadFactoryBuilder().setNameFormat("S3LogFetcher-%d").build())); try { final ConcurrentHashMap<String, ContinuationToken> continuationTokens = new ConcurrentHashMap<>(); List<SingularityS3LogMetadata> logs = Lists.newArrayList(getS3LogsWithExecutorService(s3Configuration, executorService, servicesToPrefixes, totalPrefixCount, search, continuationTokens, paginated)); Collections.sort(logs, LOG_COMPARATOR); return new SingularityS3SearchResult(continuationTokens, isFinalPageForAllPrefixes(continuationTokens.values()), logs); } finally { executorService.shutdownNow(); } }
Collections.<String, ContinuationToken>emptyMap()); return getS3Logs(configuration.get(), getServiceToPrefixes(search, user), search, false).getResults(); } catch (TimeoutException te) { throw timeout("Timed out waiting for response from S3 for %s-%s", requestId, deployId);
Collections.<String, ContinuationToken>emptyMap()); return getS3Logs(configuration.get(), getServiceToPrefixes(search, user), search, false).getResults(); } catch (TimeoutException te) { throw timeout("Timed out waiting for response from S3 for %s-%s", requestId, deployId);
Collections.<String, ContinuationToken>emptyMap()); return getS3Logs(configuration.get(), getServiceToPrefixes(search, user), search, false).getResults(); } catch (TimeoutException te) { throw timeout("Timed out waiting for response from S3 for %s", requestId);
return getS3Logs(configuration.get(), getServiceToPrefixes(search, user), search, false).getResults(); } catch (TimeoutException te) { throw timeout("Timed out waiting for response from S3 for %s", taskId);