diff --git a/modules/benchmark/conf/deletepercent.alg b/modules/benchmark/conf/deletepercent.alg deleted file mode 100644 index 59d16726710..00000000000 --- a/modules/benchmark/conf/deletepercent.alg +++ /dev/null @@ -1,105 +0,0 @@ -#/** -# * Licensed to the Apache Software Foundation (ASF) under one or more -# * contributor license agreements. See the NOTICE file distributed with -# * this work for additional information regarding copyright ownership. -# * The ASF licenses this file to You under the Apache License, Version 2.0 -# * (the "License"); you may not use this file except in compliance with -# * the License. You may obtain a copy of the License at -# * -# * http://www.apache.org/licenses/LICENSE-2.0 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# */ -# ------------------------------------------------------------------------------------- -# multi val params are iterated by NewRound's, added to reports, start with column name. - -analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer -directory=FSDirectory -#directory=RamDirectory - -doc.stored=true -doc.tokenized=true -doc.term.vector=false -log.step=500 - -docs.dir=reuters-out -#docs.dir=reuters-111 - -#doc.maker=org.apache.lucene.benchmark.byTask.feeds.SimpleDocMaker -#doc.maker=org.apache.lucene.benchmark.byTask.feeds.ReutersDocMaker -content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource - -#query.maker=org.apache.lucene.benchmark.byTask.feeds.SimpleQueryMaker -query.maker=org.apache.lucene.benchmark.byTask.feeds.ReutersQueryMaker -deletion.policy=org.apache.lucene.index.NoDeletionPolicy - -# task at this depth or less would print when they start -task.max.depth.log=2 - -log.queries=true -# ------------------------------------------------------------------------------------- - -{ "Rounds" - - ResetSystemErase - - { "Populate" - -CreateIndex - { "MAddDocs" AddDoc > : 1000 - CommitIndex(original) - CloseIndex - } - - OpenReader(false,original) - DeleteByPercent(5) - { "SearchSameRdr5" Search > : 500 - FlushReader(5%) - CloseReader - PrintReader(5%) - - OpenReader(false,5%) - DeleteByPercent(10) - { "SearchSameRdr10" Search > : 500 - FlushReader(10%) - CloseReader - PrintReader(10%) - - OpenReader(false,10%) - DeleteByPercent(20) - { "SearchSameRdr20" Search > : 500 - FlushReader(20%) - CloseReader - PrintReader(20%) - - OpenReader(false,20%) - DeleteByPercent(60) - { "SearchSameRdr60" Search > : 500 - FlushReader(60%) - CloseReader - PrintReader(60%) - - OpenReader(false,60%) - DeleteByPercent(75) - { "SearchSameRdr75" Search > : 500 - FlushReader(75%) - CloseReader - PrintReader(75%) - - # Test lower percentage of deletes (so undeleteAll is used) - OpenReader(false,75%) - DeleteByPercent(7) - { "SearchSameRdr7" Search > : 500 - FlushReader(7%) - CloseReader - PrintReader(7%) - - NewRound - -} : 1 - -RepSumByName -RepSumByPrefRound MAddDocs diff --git a/modules/benchmark/conf/deletes.alg b/modules/benchmark/conf/deletes.alg deleted file mode 100644 index 2f2e638385f..00000000000 --- a/modules/benchmark/conf/deletes.alg +++ /dev/null @@ -1,70 +0,0 @@ -#/** -# * Licensed to the Apache Software Foundation (ASF) under one or more -# * contributor license agreements. See the NOTICE file distributed with -# * this work for additional information regarding copyright ownership. -# * The ASF licenses this file to You under the Apache License, Version 2.0 -# * (the "License"); you may not use this file except in compliance with -# * the License. You may obtain a copy of the License at -# * -# * http://www.apache.org/licenses/LICENSE-2.0 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# */ -# -------------------------------------------------------- -# Deletes: what is the cost of deleting documents? -# -------------------------------------------------------- - -# ------------------------------------------------------------------------------------- -# multi val params are iterated by NewRound's, added to reports, start with column name. - -merge.factor=mrg:10 -max.buffered=buf:100 -compound=true - -analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer -directory=FSDirectory -#directory=RamDirectory - -doc.stored=true -doc.tokenized=true -doc.term.vector=false -log.step=10000 -log.step.DeleteDoc=100 - -docs.dir=reuters-out -#docs.dir=reuters-111 - -content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource -#content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource - -query.maker=org.apache.lucene.benchmark.byTask.feeds.SimpleQueryMaker -#query.maker=org.apache.lucene.benchmark.byTask.feeds.ReutersQueryMaker - -# task at this depth or less would print when they start -task.max.depth.log=1 - -log.queries=false -# ------------------------------------------------------------------------------------- - -ResetSystemErase - -CreateIndex -CloseIndex - -{ "Populate" - OpenIndex - { AddDoc(10) > : 200000 - ForcMerge(1) - CloseIndex -> - -{ "Deletions" - OpenReader(false) DeleteDoc CloseReader -} : 4000 - -RepSumByName - diff --git a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java b/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java index 2b026d8e893..8757775f77b 100644 --- a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java +++ b/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CommitIndexTask.java @@ -21,7 +21,6 @@ import java.util.Map; import org.apache.lucene.benchmark.byTask.PerfRunData; import org.apache.lucene.index.IndexWriter; -import org.apache.lucene.index.IndexReader; /** * Commits the IndexWriter. @@ -51,14 +50,6 @@ public class CommitIndexTask extends PerfTask { IndexWriter iw = getRunData().getIndexWriter(); if (iw != null) { iw.commit(commitUserData); - } else { - IndexReader r = getRunData().getIndexReader(); - if (r != null) { - r.commit(commitUserData); - r.decRef(); - } else { - throw new IllegalStateException("neither IndexWriter nor IndexReader is currently open"); - } } return 1; diff --git a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java b/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java deleted file mode 100644 index 240a1304882..00000000000 --- a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/DeleteByPercentTask.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.apache.lucene.benchmark.byTask.tasks; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.util.Random; - -import org.apache.lucene.benchmark.byTask.PerfRunData; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.MultiFields; -import org.apache.lucene.util.Bits; - -/** - * Deletes a percentage of documents from an index randomly - * over the number of documents. The parameter, X, is in - * percent. EG 50 means 1/2 of all documents will be - * deleted. - * - *
NOTE: the param is an absolute percentage of - * maxDoc(). This means if you delete 50%, and then delete - * 50% again, the 2nd delete will do nothing. - * - *
Parameters: - *
id = last-deleted-doc + doc.delete.step
.
- */
-public class DeleteDocTask extends PerfTask {
-
- /**
- * Gap between ids of deleted docs, applies when no docid param is provided.
- */
- public static final int DEFAULT_DOC_DELETE_STEP = 8;
-
- public DeleteDocTask(PerfRunData runData) {
- super(runData);
- }
-
- private int deleteStep = -1;
- private static int lastDeleted = -1;
-
- private int docid = -1;
- private boolean byStep = true;
-
- @Override
- public int doLogic() throws Exception {
- IndexReader r = getRunData().getIndexReader();
- r.deleteDocument(docid);
- lastDeleted = docid;
- r.decRef();
- return 1; // one work item done here
- }
-
- /* (non-Javadoc)
- * @see org.apache.lucene.benchmark.byTask.tasks.PerfTask#setup()
- */
- @Override
- public void setup() throws Exception {
- super.setup();
- if (deleteStep<0) {
- deleteStep = getRunData().getConfig().get("doc.delete.step",DEFAULT_DOC_DELETE_STEP);
- }
- // set the docid to be deleted
- docid = (byStep ? lastDeleted + deleteStep : docid);
- }
-
- @Override
- protected String getLogMessage(int recsCount) {
- return "deleted " + recsCount + " docs, last deleted: " + lastDeleted;
- }
-
- /**
- * Set the params (docid only)
- * @param params docid to delete, or -1 for deleting by delete gap settings.
- */
- @Override
- public void setParams(String params) {
- super.setParams(params);
- docid = (int) Float.parseFloat(params);
- byStep = (docid < 0);
- }
-
- /* (non-Javadoc)
- * @see org.apache.lucene.benchmark.byTask.tasks.PerfTask#supportsParams()
- */
- @Override
- public boolean supportsParams() {
- return true;
- }
-
-}
diff --git a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/FlushReaderTask.java b/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/FlushReaderTask.java
deleted file mode 100644
index 1a9d8ec5f21..00000000000
--- a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/FlushReaderTask.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.apache.lucene.benchmark.byTask.tasks;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.lucene.benchmark.byTask.PerfRunData;
-import org.apache.lucene.index.IndexReader;
-
-public class FlushReaderTask extends PerfTask {
- String userData = null;
-
- public FlushReaderTask(PerfRunData runData) {
- super(runData);
- }
-
- @Override
- public boolean supportsParams() {
- return true;
- }
-
- @Override
- public void setParams(String params) {
- super.setParams(params);
- userData = params;
- }
-
- @Override
- public int doLogic() throws IOException {
- IndexReader reader = getRunData().getIndexReader();
- if (userData != null) {
- Map