mirror of https://github.com/apache/lucene.git
remove deprecated api
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1307319 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
95f80348f6
commit
42141717a3
|
@ -27,8 +27,6 @@ import java.util.Iterator;
|
||||||
|
|
||||||
import org.apache.solr.client.solrj.util.ClientUtils;
|
import org.apache.solr.client.solrj.util.ClientUtils;
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.apache.solr.common.params.ModifiableSolrParams;
|
|
||||||
import org.apache.solr.common.params.UpdateParams;
|
|
||||||
import org.apache.solr.common.util.ContentStream;
|
import org.apache.solr.common.util.ContentStream;
|
||||||
import org.apache.solr.common.util.XML;
|
import org.apache.solr.common.util.XML;
|
||||||
|
|
||||||
|
@ -38,16 +36,6 @@ import org.apache.solr.common.util.XML;
|
||||||
* @since solr 1.3
|
* @since solr 1.3
|
||||||
*/
|
*/
|
||||||
public class UpdateRequest extends AbstractUpdateRequest {
|
public class UpdateRequest extends AbstractUpdateRequest {
|
||||||
/**
|
|
||||||
* Kept for back compatibility.
|
|
||||||
*
|
|
||||||
* @deprecated Use {@link AbstractUpdateRequest.ACTION} instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public enum ACTION {
|
|
||||||
COMMIT,
|
|
||||||
OPTIMIZE
|
|
||||||
};
|
|
||||||
|
|
||||||
private List<SolrInputDocument> documents = null;
|
private List<SolrInputDocument> documents = null;
|
||||||
private Iterator<SolrInputDocument> docIterator = null;
|
private Iterator<SolrInputDocument> docIterator = null;
|
||||||
|
@ -130,48 +118,6 @@ public class UpdateRequest extends AbstractUpdateRequest {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets appropriate parameters for the given ACTION
|
|
||||||
*
|
|
||||||
* @deprecated Use {@link org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION} instead
|
|
||||||
* */
|
|
||||||
@Deprecated
|
|
||||||
public UpdateRequest setAction(ACTION action, boolean waitFlush, boolean waitSearcher ) {
|
|
||||||
return setAction(action, waitFlush, waitSearcher, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @deprecated Use {@link org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION} instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public UpdateRequest setAction(ACTION action, boolean waitFlush, boolean waitSearcher, int maxSegments ) {
|
|
||||||
if (params == null)
|
|
||||||
params = new ModifiableSolrParams();
|
|
||||||
|
|
||||||
if( action == ACTION.OPTIMIZE ) {
|
|
||||||
params.set( UpdateParams.OPTIMIZE, "true" );
|
|
||||||
params.set(UpdateParams.MAX_OPTIMIZE_SEGMENTS, maxSegments);
|
|
||||||
}
|
|
||||||
else if( action == ACTION.COMMIT ) {
|
|
||||||
params.set( UpdateParams.COMMIT, "true" );
|
|
||||||
}
|
|
||||||
params.set( UpdateParams.WAIT_SEARCHER, waitSearcher+"" );
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @deprecated Use {@link org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION} instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public UpdateRequest setAction(ACTION action, boolean waitFlush, boolean waitSearcher, int maxSegments , boolean expungeDeletes) {
|
|
||||||
setAction(action, waitFlush, waitSearcher,maxSegments) ;
|
|
||||||
params.set(UpdateParams.EXPUNGE_DELETES,""+expungeDeletes);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setDocIterator(Iterator<SolrInputDocument> docIterator) {
|
public void setDocIterator(Iterator<SolrInputDocument> docIterator) {
|
||||||
this.docIterator = docIterator;
|
this.docIterator = docIterator;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.io.File;
|
||||||
import org.apache.solr.client.solrj.request.CoreAdminRequest;
|
import org.apache.solr.client.solrj.request.CoreAdminRequest;
|
||||||
import org.apache.solr.client.solrj.request.QueryRequest;
|
import org.apache.solr.client.solrj.request.QueryRequest;
|
||||||
import org.apache.solr.client.solrj.request.UpdateRequest;
|
import org.apache.solr.client.solrj.request.UpdateRequest;
|
||||||
import org.apache.solr.client.solrj.request.UpdateRequest.ACTION;
|
import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION;
|
||||||
import org.apache.solr.client.solrj.response.CoreAdminResponse;
|
import org.apache.solr.client.solrj.response.CoreAdminResponse;
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.apache.solr.common.util.NamedList;
|
import org.apache.solr.common.util.NamedList;
|
||||||
|
@ -95,10 +95,10 @@ public abstract class MultiCoreExampleTestBase extends SolrExampleTestBase
|
||||||
public void testMultiCore() throws Exception
|
public void testMultiCore() throws Exception
|
||||||
{
|
{
|
||||||
UpdateRequest up = new UpdateRequest();
|
UpdateRequest up = new UpdateRequest();
|
||||||
up.setAction( ACTION.COMMIT, true, true );
|
up.setAction(ACTION.COMMIT, true, true);
|
||||||
up.deleteByQuery( "*:*" );
|
up.deleteByQuery("*:*");
|
||||||
up.process( getSolrCore0() );
|
up.process(getSolrCore0());
|
||||||
up.process( getSolrCore1() );
|
up.process(getSolrCore1());
|
||||||
up.clear();
|
up.clear();
|
||||||
|
|
||||||
// Add something to each core
|
// Add something to each core
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.apache.solr.client.solrj.SolrServer;
|
||||||
import org.apache.solr.client.solrj.impl.HttpSolrServer;
|
import org.apache.solr.client.solrj.impl.HttpSolrServer;
|
||||||
import org.apache.solr.client.solrj.request.QueryRequest;
|
import org.apache.solr.client.solrj.request.QueryRequest;
|
||||||
import org.apache.solr.client.solrj.request.UpdateRequest;
|
import org.apache.solr.client.solrj.request.UpdateRequest;
|
||||||
import org.apache.solr.client.solrj.request.UpdateRequest.ACTION;
|
import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION;
|
||||||
import org.apache.solr.common.SolrDocument;
|
import org.apache.solr.common.SolrDocument;
|
||||||
import org.apache.solr.common.SolrDocumentList;
|
import org.apache.solr.common.SolrDocumentList;
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
|
@ -112,10 +112,10 @@ public class MultiCoreExampleJettyTest extends MultiCoreExampleTestBase {
|
||||||
public void testDistributed() throws Exception
|
public void testDistributed() throws Exception
|
||||||
{
|
{
|
||||||
UpdateRequest up = new UpdateRequest();
|
UpdateRequest up = new UpdateRequest();
|
||||||
up.setAction( ACTION.COMMIT, true, true );
|
up.setAction(ACTION.COMMIT, true, true);
|
||||||
up.deleteByQuery( "*:*" );
|
up.deleteByQuery("*:*");
|
||||||
up.process( getSolrCore0() );
|
up.process(getSolrCore0());
|
||||||
up.process( getSolrCore1() );
|
up.process(getSolrCore1());
|
||||||
up.clear();
|
up.clear();
|
||||||
|
|
||||||
// Add something to each core
|
// Add something to each core
|
||||||
|
|
|
@ -22,10 +22,10 @@ import org.apache.lucene.util.SystemPropertiesRestoreRule;
|
||||||
import org.apache.solr.SolrTestCaseJ4;
|
import org.apache.solr.SolrTestCaseJ4;
|
||||||
import org.apache.solr.client.solrj.SolrQuery;
|
import org.apache.solr.client.solrj.SolrQuery;
|
||||||
import org.apache.solr.client.solrj.SolrServer;
|
import org.apache.solr.client.solrj.SolrServer;
|
||||||
|
import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION;
|
||||||
import org.apache.solr.client.solrj.request.CoreAdminRequest;
|
import org.apache.solr.client.solrj.request.CoreAdminRequest;
|
||||||
import org.apache.solr.client.solrj.request.QueryRequest;
|
import org.apache.solr.client.solrj.request.QueryRequest;
|
||||||
import org.apache.solr.client.solrj.request.UpdateRequest;
|
import org.apache.solr.client.solrj.request.UpdateRequest;
|
||||||
import org.apache.solr.client.solrj.request.UpdateRequest.ACTION;
|
|
||||||
import org.apache.solr.client.solrj.response.CoreAdminResponse;
|
import org.apache.solr.client.solrj.response.CoreAdminResponse;
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.apache.solr.common.util.FileUtils;
|
import org.apache.solr.common.util.FileUtils;
|
||||||
|
|
Loading…
Reference in New Issue