You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/09/09 10:10:20 UTC

[GitHub] [lucene-solr] mikemccand commented on a change in pull request #1847: LUCENE-9514: Include TermVectorsWriter in DWPT accounting

mikemccand commented on a change in pull request #1847:
URL: https://github.com/apache/lucene-solr/pull/1847#discussion_r485497049



##########
File path: lucene/core/src/java/org/apache/lucene/util/Accountable.java
##########
@@ -41,4 +41,8 @@
     return Collections.emptyList();
   }
 
+  /**
+   * An accountable that always returns 0
+   */
+  Accountable NULL_ACCOUNTABLE = () -> 0;

Review comment:
       Interface members are always `static final` right?

##########
File path: lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextTermVectorsWriter.java
##########
@@ -193,4 +189,9 @@ private void write(BytesRef bytes) throws IOException {
   private void newLine() throws IOException {
     SimpleTextUtil.writeNewline(out);
   }
+
+  @Override
+  public long ramBytesUsed() {
+    return scratch.get().bytes.length;

Review comment:
       Ha.

##########
File path: lucene/core/src/java/org/apache/lucene/index/StoredFieldsConsumer.java
##########
@@ -42,6 +44,7 @@
   protected void initStoredFieldsWriter() throws IOException {
     if (writer == null) { // TODO can we allocate this in the ctor? we call start document for every doc anyway
       this.writer = codec.storedFieldsFormat().fieldsWriter(directory, info, IOContext.DEFAULT);
+      accountable = writer;

Review comment:
       Hmm what is happening here?  Are we using this new `accountable` member somewhere?  I don't see it in the diffs?  Oh, I see, it is returned in `DefaultIndexingChain.getChildResources()`, ok!  Maybe add comment above its declaration explaining that our parent/owning `DefaultIndexingChain` returns/uses it?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org