From 100ca7b5e01040cd3116fb6e78c0f202c250103d Mon Sep 17 00:00:00 2001 From: Peter Alfonsi Date: Wed, 22 Nov 2023 14:47:27 -0800 Subject: [PATCH] removed dead code Signed-off-by: Peter Alfonsi --- .../org/opensearch/indices/IndicesRequestCache.java | 5 ----- .../opensearch/indices/IndicesRequestCacheTests.java | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java index 3ec20482fabf5..2fbdd43abb23d 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java @@ -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 diff --git a/server/src/test/java/org/opensearch/indices/IndicesRequestCacheTests.java b/server/src/test/java/org/opensearch/indices/IndicesRequestCacheTests.java index 95c1056df5abe..aee54dcf3379c 100644 --- a/server/src/test/java/org/opensearch/indices/IndicesRequestCacheTests.java +++ b/server/src/test/java/org/opensearch/indices/IndicesRequestCacheTests.java @@ -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;