Skip to content

Commit

Permalink
SOLR-3913: Optimize the commit/optimize cycle in the PostTool (apache…
Browse files Browse the repository at this point in the history
…#2667)

Arguably you shouldn't be able to pass in the skip-commit AND the optimize options as the same time...?
  • Loading branch information
epugh authored Aug 27, 2024
1 parent 391cdd0 commit 94146c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ Optimizations
* SOLR-17408: COLSTATUS command was fetching details remotely from replicas when this information
wasn't asked for. (Mathieu Marie)

* SOLR-3913: Optimize PostTool to call just optimize when both commit and optimize requested. (Eric Pugh)

Bug Fixes
---------------------
(No changes)
Expand Down
10 changes: 5 additions & 5 deletions solr/core/src/java/org/apache/solr/cli/PostTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ public void execute(String mode) throws SolrServerException, IOException {
return;
}

if (commit) {
commit();
}
if (optimize) {
// optimize does a commit under the covers.
optimize();
} else if (commit) {
commit();
}
displayTiming((long) timer.getTime());
}
Expand Down Expand Up @@ -461,7 +461,7 @@ boolean recursionPossible(String[] args) {
* @param args array of file names
* @param startIndexInArgs offset to start
* @param out output stream to post data to
* @param type default content-type to use when posting (may be overridden in auto mode)
* @param type default content-type to use when posting (this may be overridden in auto mode)
* @return number of files posted
*/
public int postFiles(String[] args, int startIndexInArgs, OutputStream out, String type) {
Expand Down Expand Up @@ -545,7 +545,7 @@ int postFiles(File[] files, OutputStream out, String type) {
*
* @param globFile file holding glob path
* @param out outputStream to write results to
* @param type default content-type to use when posting (may be overridden in auto mode)
* @param type default content-type to use when posting (this may be overridden in auto mode)
* @return number of files posted
*/
int handleGlob(File globFile, OutputStream out, String type) {
Expand Down

0 comments on commit 94146c1

Please sign in to comment.