Skip to content

Commit

Permalink
Merge pull request DSpace#9034 from DSpace/backport-9025-to-dspace-7_x
Browse files Browse the repository at this point in the history
[Port dspace-7_x] 3331 - remove the --optimize feature of 'dspace stats-util'
  • Loading branch information
alanorth authored Aug 23, 2023
2 parents 785d070 + 79e4783 commit c88a25f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1203,22 +1203,6 @@ public String getIgnoreSpiderIPs() {

}

@Override
public void optimizeSOLR() {
try {
long start = System.currentTimeMillis();
System.out.println("SOLR Optimize -- Process Started:" + start);
solr.optimize();
long finish = System.currentTimeMillis();
System.out.println("SOLR Optimize -- Process Finished:" + finish);
System.out.println("SOLR Optimize -- Total time taken:" + (finish - start) + " (ms).");
} catch (SolrServerException sse) {
System.err.println(sse.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
}

@Override
public void shardSolrIndex() throws IOException, SolrServerException {
if (!(solr instanceof HttpSolrClient)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,6 @@ public QueryResponse query(String query, String filterQuery,
*/
public String getIgnoreSpiderIPs();

/**
* Maintenance to keep a SOLR index efficient.
* Note: This might take a long time.
*/
public void optimizeSOLR();

public void shardSolrIndex() throws IOException, SolrServerException;

public void reindexBitstreamHits(boolean removeDeletedBitstreams) throws Exception;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public static void main(String[] args) throws Exception {
options.addOption("m", "mark-spiders", false, "Update isBot Flag in Solr");
options.addOption("f", "delete-spiders-by-flag", false, "Delete Spiders in Solr By isBot Flag");
options.addOption("i", "delete-spiders-by-ip", false, "Delete Spiders in Solr By IP Address");
options.addOption("o", "optimize", false, "Run maintenance on the SOLR index");
options.addOption("b", "reindex-bitstreams", false, "Reindex the bitstreams to ensure we have the bundle name");
options.addOption("e", "export", false,
"Export SOLR view statistics data to usage-statistics-intermediate-format");
Expand All @@ -93,8 +92,6 @@ public static void main(String[] args) throws Exception {
solrLoggerService.deleteRobotsByIsBotFlag();
} else if (line.hasOption('i')) {
solrLoggerService.deleteRobotsByIP();
} else if (line.hasOption('o')) {
solrLoggerService.optimizeSOLR();
} else if (line.hasOption('b')) {
solrLoggerService.reindexBitstreamHits(line.hasOption('r'));
} else if (line.hasOption('e')) {
Expand Down

0 comments on commit c88a25f

Please sign in to comment.