LUCENE-9322: Add Vectors format to CodecReader accounting methods (#2353)

This commit is contained in:
Ignacio Vera 2021-02-11 16:54:59 +01:00 committed by GitHub
parent 019872453d
commit 683a9bd78a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -259,6 +259,11 @@ public abstract class CodecReader extends LeafReader implements Accountable {
ramBytesUsed += getPointsReader().ramBytesUsed();
}
// vectors
if (getVectorReader() != null) {
ramBytesUsed += getVectorReader().ramBytesUsed();
}
return ramBytesUsed;
}
@ -295,6 +300,11 @@ public abstract class CodecReader extends LeafReader implements Accountable {
resources.add(Accountables.namedAccountable("points", getPointsReader()));
}
// vectors
if (getVectorReader() != null) {
resources.add(Accountables.namedAccountable("vectors", getVectorReader()));
}
return Collections.unmodifiableList(resources);
}
@ -329,5 +339,10 @@ public abstract class CodecReader extends LeafReader implements Accountable {
if (getPointsReader() != null) {
getPointsReader().checkIntegrity();
}
// vectors
if (getVectorReader() != null) {
getVectorReader().checkIntegrity();
}
}
}