diff --git a/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java index e0342d54390..8f79fd9e2c4 100644 --- a/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java +++ b/lucene/core/src/java/org/apache/lucene/store/NRTCachingDirectory.java @@ -24,6 +24,7 @@ import java.util.Set; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.store.RAMDirectory; // javadocs +import org.apache.lucene.util.Accountable; import org.apache.lucene.util.IOUtils; // TODO @@ -63,7 +64,7 @@ import org.apache.lucene.util.IOUtils; * @lucene.experimental */ -public class NRTCachingDirectory extends FilterDirectory { +public class NRTCachingDirectory extends FilterDirectory implements Accountable { private final RAMDirectory cache = new RAMDirectory(); @@ -117,12 +118,6 @@ public class NRTCachingDirectory extends FilterDirectory { return files.toArray(new String[files.size()]); } - /** Returns how many bytes are being used by the - * RAMDirectory cache */ - public long cacheRamBytesUsed() { - return cache.ramBytesUsed(); - } - @Override public synchronized void deleteFile(String name) throws IOException { if (VERBOSE) { @@ -261,4 +256,9 @@ public class NRTCachingDirectory extends FilterDirectory { } } } + + @Override + public long ramBytesUsed() { + return cache.ramBytesUsed(); + } }