Assert.assertEquals(1, dataSegmentList.size()); File tmpUnzippedSegmentDir = temporaryFolder.newFolder(); new LocalDataSegmentPuller().getSegmentFiles(dataSegmentList.get(0), tmpUnzippedSegmentDir); final QueryableIndex queryableIndex = DruidStorageHandlerUtils.INDEX_IO.loadIndex(tmpUnzippedSegmentDir);
@Override public void getSegmentFiles(DataSegment segment, File dir) throws SegmentLoadingException { getSegmentFiles(getFile(segment), dir); }
@Override public long getLastModified(DataSegment segment) throws SegmentLoadingException { final File file = getFile(segment); long lastModified = Long.MAX_VALUE; if (file.isDirectory()) { for (File childFile : file.listFiles()) { lastModified = Math.min(childFile.lastModified(), lastModified); } } else { lastModified = file.lastModified(); } return lastModified; }
@Override public LoadSpecResult loadSegment(final File outDir) throws SegmentLoadingException { return new LoadSpecResult(puller.getSegmentFiles(path.toFile(), outDir).size()); } }
@Override public InputStream getInputStream(URI uri) throws IOException { return buildFileObject(uri).openInputStream(); }
Files.asByteSource(oldFile), new File(dir, oldFile.getName()), shouldRetryPredicate(), DEFAULT_RETRY_COUNT ).getFiles() Files.asByteSource(sourceFile), dir, shouldRetryPredicate(), false ); Files.asByteSource(sourceFile), outFile, shouldRetryPredicate() ); log.info(
@Override public void getSegmentFiles(DataSegment segment, File dir) throws SegmentLoadingException final File path = getFile(segment);
/** * Returns the "version" (aka last modified timestamp) of the URI of interest * * @param uri The URI to check the last modified timestamp * * @return The last modified timestamp in ms of the URI in String format */ @Override public String getVersion(URI uri) { return StringUtils.format("%d", buildFileObject(uri).getLastModified()); }