ExtractedTextCache { @Nullable public String get(String nodePath, String propertyName, Blob blob, boolean reindexMode){ String result = null; String propertyPath = concat(nodePath, propertyName); log.trace("Looking for extracted text for [{}] with blobId [{}]", propertyPath, blob.getContentIdentity()); if ((reindexMode || alwaysUsePreExtractedCache) && extractedTextProvider != null){ try { ExtractedText text = extractedTextProvider.getText(propertyPath, blob); if (text != null) { preFetchedCount++; result = getText(text); } } catch (IOException e) { log.warn("Error occurred while fetching pre extracted text for {}", propertyPath, e); } } String id = blob.getContentIdentity(); if (cache != null && id != null && result == null) { result = cache.getIfPresent(id); } if (result == null && id != null) { result = timeoutMap.get(id); } return result; } ExtractedTextCache(long maxWeight, long expiryTimeInSecs);  ExtractedTextCache(long maxWeight, long expiryTimeInSecs, boolean alwaysUsePreExtractedCache,
                              File indexDir);  ExtractedTextCache(long maxWeight, long expiryTimeInSecs, boolean alwaysUsePreExtractedCache,
                              File indexDir, StatisticsProvider statisticsProvider); @Nullable String get(String nodePath, String propertyName, Blob blob, boolean reindexMode); void put(@NotNull Blob blob, @NotNull ExtractedText extractedText); void putTimeout(@NotNull Blob blob, @NotNull ExtractedText extractedText); void addStats(int count, long timeInMillis, long bytesRead, long textLength); StatisticsProvider getStatisticsProvider(); TextExtractionStatsMBean getStatsMBean(); @Nullable CacheStats getCacheStats(); void setExtractedTextProvider(PreExtractedTextProvider extractedTextProvider); PreExtractedTextProvider getExtractedTextProvider(); void resetCache(); boolean isAlwaysUsePreExtractedCache(); void close(); void process(String name, Callable<Void> callable); void setExtractionTimeoutMillis(int extractionTimeoutMillis);  }
@Test public void preExtractionNoReindexNoProvider() throws Exception{ ExtractedTextCache cache = new ExtractedTextCache(10 * FileUtils.ONE_MB, 100); Blob b = new IdBlob("hello", "a"); String text = cache.get("/a", "foo", b, true); assertNull(text); }