implement MapWriter

This commit is contained in:
Noble Paul 2018-01-09 19:15:58 +11:00
parent 7a375fda82
commit 74128cf695
2 changed files with 17 additions and 0 deletions

View File

@ -17,13 +17,16 @@
package org.apache.solr.client.solrj.cloud.autoscaling;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.common.MapWriter;
import org.apache.solr.common.cloud.Replica;
import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.util.Pair;
class AddReplicaSuggester extends Suggester {
@ -72,4 +75,10 @@ class AddReplicaSuggester extends Suggester {
}
@Override
public void writeMap(MapWriter.EntryWriter ew) throws IOException {
ew.put("action", CollectionParams.CollectionAction.ADDREPLICA.toString());
super.writeMap(ew);
}
}

View File

@ -17,10 +17,12 @@
package org.apache.solr.client.solrj.cloud.autoscaling;
import java.io.IOException;
import java.util.List;
import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.util.Pair;
public class MoveReplicaSuggester extends Suggester {
@ -79,4 +81,10 @@ public class MoveReplicaSuggester extends Suggester {
return null;
}
@Override
public void writeMap(EntryWriter ew) throws IOException {
ew.put("action", CollectionParams.CollectionAction.MOVEREPLICA.toString());
super.writeMap(ew);
}
}