package changes

This commit is contained in:
Noble Paul 2017-04-18 19:52:39 +09:30
parent ef7ab192f6
commit 69c0765eb5
4 changed files with 18 additions and 3 deletions

View File

@ -22,6 +22,9 @@ import java.io.IOException;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import org.apache.solr.client.solrj.SolrServerException;
public interface ClusterDataProvider extends Closeable { public interface ClusterDataProvider extends Closeable {

View File

@ -226,6 +226,7 @@ public class Policy implements MapWriter {
public static class ReplicaInfo implements MapWriter { public static class ReplicaInfo implements MapWriter {
final String name; final String name;
String core,collection,shard;
Map<String, Object> variables; Map<String, Object> variables;
public ReplicaInfo(String name, Map<String, Object> vals) { public ReplicaInfo(String name, Map<String, Object> vals) {
@ -237,6 +238,16 @@ public class Policy implements MapWriter {
public void writeMap(EntryWriter ew) throws IOException { public void writeMap(EntryWriter ew) throws IOException {
ew.put(name, variables); ew.put(name, variables);
} }
public String getCore(){
return core;
}
public String getCollection(){
return collection;
}
public String getShard(){
return shard;
}
} }

View File

@ -64,7 +64,7 @@ public class PolicyHelper {
return positionMapping; return positionMapping;
} }
public List<Map> addNode(Map<String, Object> autoScalingJson, String node, ClusterDataProvider cdp){ public List<Map> addNode(Map<String, Object> autoScalingJson, String node, ClusterDataProvider cdp) {
//todo //todo
return null; return null;

View File

@ -15,12 +15,13 @@
* limitations under the License. * limitations under the License.
*/ */
package org.apache.solr.autoscaling; package org.apache.solr.cloud.autoscaling;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@ -29,7 +30,7 @@ import java.util.Map;
import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.util.Utils; import org.apache.solr.common.util.Utils;
import org.apache.solr.common.util.ValidatingJsonMap; import org.apache.solr.common.util.ValidatingJsonMap;
import org.apache.solr.autoscaling.Policy.Suggester.Hint; import org.apache.solr.cloud.autoscaling.Policy.Suggester.Hint;
import static org.apache.solr.common.params.CollectionParams.CollectionAction.ADDREPLICA; import static org.apache.solr.common.params.CollectionParams.CollectionAction.ADDREPLICA;
import static org.apache.solr.common.util.Utils.getObjectByPath; import static org.apache.solr.common.util.Utils.getObjectByPath;