diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java index 22e1005ed8b..960729a3906 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java @@ -96,6 +96,7 @@ public ClusterState(Map collectionStates, Set liv * @param collectionName the name of the modified (or deleted) collection * @param collection the collection object. A null value deletes the collection from the state * @return the updated cluster state which preserves the current live nodes + * @lucene.internal */ public ClusterState copyWith(String collectionName, DocCollection collection) { LinkedHashMap collections = new LinkedHashMap<>(collectionStates); @@ -223,6 +224,7 @@ public String getShardId(String collectionName, String nodeName, String coreName return null; } + @Deprecated public Map> getReplicaNamesPerCollectionOnNode(final String nodeName) { Map> replicaNamesPerCollectionOnNode = new HashMap<>(); collectionStates.values().stream() @@ -264,6 +266,7 @@ public String toString() { * {@link ClusterState} * @return the ClusterState */ + @Deprecated public static ClusterState createFromJson( int version, byte[] bytes, @@ -284,6 +287,7 @@ public static ClusterState createFromJson(int version, byte[] bytes, Set return createFromJson(version, bytes, liveNodes, Instant.EPOCH, null); } + @Deprecated public static ClusterState createFromCollectionMap( int version, Map stateMap, @@ -313,6 +317,9 @@ public static ClusterState createFromCollectionMap( return createFromCollectionMap(version, stateMap, liveNodes, Instant.EPOCH, null); } + /** + * @lucene.internal + */ // TODO move to static DocCollection.loadFromMap public static DocCollection collectionFromObjects( String name, @@ -384,7 +391,9 @@ public boolean equals(Object obj) { } else return liveNodes.equals(other.liveNodes); } - /** Internal API used only by ZkStateReader */ + /** + * @lucene.internal used only by ZkStateReader + */ void setLiveNodes(Set liveNodes) { this.liveNodes = Set.copyOf(liveNodes); } @@ -473,6 +482,9 @@ public int size() { private static volatile Function STR_INTERNER_OBJ_BUILDER = STANDARDOBJBUILDER; + /** + * @lucene.internal + */ public static void setStrInternerParser(Function fun) { if (fun == null) return; STR_INTERNER_OBJ_BUILDER = fun; diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java index 1bb0cd42d41..cbfd5e7be92 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java @@ -232,6 +232,8 @@ public static String getCollectionPathRoot(String coll) { * that holds the same AtomicReference will see the same update * *

This does not create a new DocCollection. + * + * @lucene.internal */ public final DocCollection setPerReplicaStates(PerReplicaStates newPerReplicaStates) { if (this.perReplicaStatesRef != null) { @@ -260,11 +262,14 @@ private void addNodeNameReplica(Replica replica) { } } + /** + * @lucene.internal + */ public static Object verifyProp(Map props, String propName) { return verifyProp(props, propName, null); } - public static Object verifyProp(Map props, String propName, Object def) { + private static Object verifyProp(Map props, String propName, Object def) { Object o = props.get(propName); if (o == null) { return def; @@ -337,6 +342,7 @@ public Collection getActiveSlices() { } /** Return array of active slices for this collection (performance optimization). */ + @Deprecated public Slice[] getActiveSlicesArr() { return activeSlicesArr; } @@ -357,6 +363,7 @@ public List getReplicas(String nodeName) { } /** Get the list of all leaders hosted on the given node or null if none. */ + @Deprecated public List getLeaderReplicas(String nodeName) { return nodeNameLeaderReplicas.get(nodeName); } @@ -469,6 +476,7 @@ public Iterator iterator() { return slices.values().iterator(); } + @Deprecated // low usage and builds an ArrayList (surprising) public List getReplicas() { List replicas = new ArrayList<>(); for (Slice slice : this) { @@ -481,6 +489,7 @@ public List getReplicas() { * @param predicate test against shardName vs. replica * @return the first replica that matches the predicate */ + @Deprecated // just one test; move it public Replica getReplica(BiPredicate predicate) { final Replica[] result = new Replica[1]; forEachReplica( @@ -493,6 +502,7 @@ public Replica getReplica(BiPredicate predicate) { return result[0]; } + @Deprecated // just tests, so move out or make package-protected public List getReplicas(EnumSet s) { List replicas = new ArrayList<>(); for (Slice slice : this) { diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java b/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java index bd526c4fda2..d50dc1a1da8 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java @@ -329,6 +329,7 @@ public State getState() { return state; } + @Deprecated public void setState(State state) { this.state = state; propMap.put(ReplicaStateProps.STATE, this.state.toString());