Skip to content

Commit

Permalink
removed dead code
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Alfonsi <[email protected]>
  • Loading branch information
Peter Alfonsi committed Nov 22, 2023
1 parent c51e0f3 commit 100ca7b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,6 @@ void invalidate(CacheEntity cacheEntity, DirectoryReader reader, BytesReference
tieredCacheService.invalidate(new Key(cacheEntity, cacheKey, readerCacheKeyId));
}

// Passed to TieredCacheService as its V -> W transformation function for inspecting BytesReferences in policies
public static QuerySearchResult convertBytesReferenceToQSR(BytesReference data) throws IOException, IllegalStateException {
return new QuerySearchResult(data.streamInput());
}

public static CachePolicyInfoWrapper getPolicyInfo(BytesReference data) throws IOException {
// Reads the policy info corresponding to this QSR, written in IndicesService$loadIntoContext,
// without having to create a potentially large short-lived QSR object just for this purpose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,16 +550,6 @@ private static BytesReference getQSRBytesReference(long tookTimeNanos) throws IO
return out.bytes();
}

public void testBytesReferenceToQSRFunction() throws Exception {
BytesReference badQSR = new BytesArray("I love bytes!!!");
long ttn = 1000L;
BytesReference goodQSR = getQSRBytesReference(ttn);
//assertThrows(IOException.class, () -> IndicesRequestCache.convertBytesReferenceToQSR(badQSR));
// TODO: Uncomment this line if we decide to enforce IRC only accepting BytesReferences which can become QSRs.
QuerySearchResult unpackedQSR = IndicesRequestCache.convertBytesReferenceToQSR(goodQSR);
assertEquals(ttn, (long) unpackedQSR.getTookTimeNanos());
}

private class TestBytesReference extends AbstractBytesReference {

int dummyValue;
Expand Down

0 comments on commit 100ca7b

Please sign in to comment.