Source:
<code>public void loadLocalCache() { final long start = System.currentTimeMillis(); moveSegmentFiles(); List<DataSegment> cachedSegments = Lists.newArrayList(); List<File> segmentsToLoad = new ArrayList<>(); for (Path location : segmentManager.getSegmentLocations()) { try { Files.walk(location, Integer.MAX_VALUE) .filter(p -> p.toString().endsWith("info.json")) .map(Path::toFile) .collect(Collectors.toCollection(() -> segmentsToLoad)); } catch (Exception e) { log.makeAlert(e, "Failed to walk through files") .addData("location", location) .emit(); } } for (File file : segmentsToLoad) { log.info("Loading segment cache file [%d][%s].", segmentsToLoad.size(), file); try { final DataSegment segment = jsonMapper.readValue(file, DataSegment.class); if (segmentManager.isSegmentCached(segment)) { <START> cachedSegments.add(segment); <END> } else { log.warn("Unable to find cache file [%s] for %s. Deleting lookup entry", file, segment.getIdentifier()); if (!file.delete()) { log.warn("Unable to delete segmentInfoCacheFile[%s]", file); } } } catch (Exception e) { log.makeAlert(e, "Failed to load segment from segmentInfo file") .addData("file", file) .emit(); } } addSegments( cachedSegments, new DataSegmentChangeCallback() { @Override public void execute() { log.info("Cache load took %,d ms", System.currentTimeMillis() - start); } } ); }</code><technical_language>I this is weird spacing. github, appears if if is 2 spaces of paired else a line below</technical_language>

Target:
public void loadLocalCache() { final long start = System.currentTimeMillis(); if (config.getInfoDir() != null) { moveSegmentFiles(); } List<File> segmentLocations = segmentManager.getSegmentLocations(); List<File> segmentsToLoad = Lists.newArrayList(); for (File location : segmentLocations) { try { segmentsToLoad.addAll( Files.walk(location.toPath()) .filter(p -> p.toFile().getName().equals(SEGMENT_CACHE_FILENAME)) .map(p -> p.toFile()) .collect(Collectors.toList()) ); } catch (IOException e) { log.error("Could not load storage location[%s] , skipping this storage location ... ", location); } } List<DataSegment> cachedSegments = Lists.newArrayList(); int ignored = 0; for (File file : segmentsToLoad) { log.info("Loading segment cache file [%d][%s].", segmentsToLoad.size(), file); try { final DataSegment segment = jsonMapper.readValue(file, DataSegment.class); if (!file.getName().equals(SEGMENT_CACHE_FILENAME)) { log.warn("Ignoring cache file[%s] for segment[%s].", file.getPath(), segment.getIdentifier()); ignored++; } else if (segmentManager.isSegmentCached(segment)) { cachedSegments.add(segment); } else { log.warn("Unable to find cache file for %s. Deleting lookup entry", segment.getIdentifier()); if (!file.delete()) { log.warn("Unable to delete segmentInfoCacheFile[%s]", file); } } } catch (Exception e) { log.makeAlert(e, "Failed to load segment from segmentInfo file") .addData("file", file) .emit(); } } if (ignored > 0) { log.makeAlert("Ignored misnamed segment cache files on startup.") .addData("numIgnored", ignored) .emit(); } addSegments( cachedSegments, new DataSegmentChangeCallback() { @Override public void execute() { log.info("Cache load took %,d ms", System.currentTimeMillis() - start); } } ); }