You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/02/11 08:42:48 UTC

[GitHub] [solr] bruno-roustant commented on a change in pull request #608: SOLR-15986: CommitUpdateCommand writes user commit metadata.

bruno-roustant commented on a change in pull request #608:
URL: https://github.com/apache/solr/pull/608#discussion_r804447602



##########
File path: solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
##########
@@ -176,14 +176,18 @@ private SolrIndexWriter(SolrCore core, String name, String path, Directory direc
     }
   }
 
+  public static void setCommitData(IndexWriter iw, long commitCommandVersion) {
+    setCommitData(iw, commitCommandVersion, null);
+  }
+
   @SuppressForbidden(reason = "Need currentTimeMillis, commit time should be used only for debugging purposes, " +
       " but currently suspiciously used for replication as well")
-  public static void setCommitData(IndexWriter iw, long commitCommandVersion) {
-    log.debug("Calling setCommitData with IW:{} commitCommandVersion:{}", iw, commitCommandVersion);
-    final Map<String,String> commitData = new HashMap<>();
-    commitData.put(COMMIT_TIME_MSEC_KEY, String.valueOf(System.currentTimeMillis()));
-    commitData.put(COMMIT_COMMAND_VERSION, String.valueOf(commitCommandVersion));
-    iw.setLiveCommitData(commitData.entrySet());
+  public static void setCommitData(IndexWriter iw, long commitCommandVersion, Map<String, String> commitData) {

Review comment:
       I would prefer to keep the building here as we always want to add this Solr-internal data. As I see it, CommitUpdateCommand is the user command, it could be error-prone to have these internal params in CommitUpdateCommand.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

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



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