File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
solr/solrj/src/java/org/apache/solr/common/cloud Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -547,6 +547,7 @@ public int hashCode() {
547
547
* @return the number of replicas of type {@link org.apache.solr.common.cloud.Replica.Type#NRT}
548
548
* this collection was created with
549
549
*/
550
+ @ Deprecated
550
551
public Integer getNumNrtReplicas () {
551
552
return numNrtReplicas ;
552
553
}
@@ -555,6 +556,7 @@ public Integer getNumNrtReplicas() {
555
556
* @return the number of replicas of type {@link org.apache.solr.common.cloud.Replica.Type#TLOG}
556
557
* this collection was created with
557
558
*/
559
+ @ Deprecated
558
560
public Integer getNumTlogReplicas () {
559
561
return numTlogReplicas ;
560
562
}
@@ -563,10 +565,27 @@ public Integer getNumTlogReplicas() {
563
565
* @return the number of replicas of type {@link org.apache.solr.common.cloud.Replica.Type#PULL}
564
566
* this collection was created with
565
567
*/
568
+ @ Deprecated
566
569
public Integer getNumPullReplicas () {
567
570
return numPullReplicas ;
568
571
}
569
572
573
+ /**
574
+ * @return the number of replicas of a given type this collection was created with
575
+ */
576
+ public int getNumReplicas (Replica .Type type ) {
577
+ switch (type ) {
578
+ case NRT :
579
+ return numNrtReplicas == null ? 0 : numNrtReplicas ;
580
+ case TLOG :
581
+ return numTlogReplicas == null ? 0 : numTlogReplicas ;
582
+ case PULL :
583
+ return numPullReplicas == null ? 0 : numPullReplicas ;
584
+ default :
585
+ throw new AssertionError ("Unknown replica type: " + type );
586
+ }
587
+ }
588
+
570
589
public boolean isPerReplicaState () {
571
590
return Boolean .TRUE .equals (perReplicaState );
572
591
}
You can’t perform that action at this time.
0 commit comments