org.apache.solr.common.cloud

## Class Replica

- java.lang.Object
- - org.apache.solr.common.cloud.ZkNodeProps
  - - org.apache.solr.common.cloud.Replica

All Implemented Interfaces:
  JSONWriter.Writable

    public class Replica
    extends ZkNodeProps

### Nested Class Summary

Nested Classes
`static class` `Replica.State` The replica's state.
`static class` `Replica.Type`

### Field Summary

Fields
`String` `collection`
`String` `slice`

### Fields inherited from class org.apache.solr.common.cloud.ZkNodeProps

`propMap`

### Constructor Summary

Constructors
Constructor and Description
`Replica(String name, Map<String,Object> propMap, String collection, String slice)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Replica` `copyWith(PerReplicaStates.State state)`
`boolean` `equals(Object o)`
`String` `getBaseUrl()`
`String` `getCollection()`
`String` `getCoreName()` SolrCore name.
`String` `getCoreUrl()`
`String` `getName()` Also known as coreNodeName.
`String` `getNodeName()` The name of the node this replica resides on
`String` `getProperty(String propertyName)`
`PerReplicaStates.State` `getReplicaState()`
`String` `getSlice()`
`Replica.State` `getState()` Returns the `Replica.State` of this replica.
`static Replica.State` `getState(String c)`
`Replica.Type` `getType()`
`int` `hashCode()`
`boolean` `isActive(Set<String> liveNodes)`
`boolean` `isLeader()`
`String` `toString()`

### Methods inherited from class org.apache.solr.common.cloud.ZkNodeProps

`containsKey, fromKeyVals, get, getBool, getInt, getProperties, getStr, getStr, keySet, load, plus, plus, shallowCopy, write`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### slice

    public final String slice

#### collection

    public final String collection

### Constructor Detail

#### Replica

    public Replica(String name,
                   Map<String,Object> propMap,
                   String collection,
                   String slice)

### Method Detail

#### getCollection

    public String getCollection()

#### getSlice

    public String getSlice()

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `ZkNodeProps`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `ZkNodeProps`

#### getName

    public String getName()

Also known as coreNodeName.

#### getCoreUrl

    public String getCoreUrl()

#### getBaseUrl

    public String getBaseUrl()

#### getCoreName

    public String getCoreName()

SolrCore name.

#### getNodeName

    public String getNodeName()

The name of the node this replica resides on

#### getState

    public Replica.State getState()

Returns the `Replica.State` of this replica.

#### isActive

    public boolean isActive(Set<String> liveNodes)

#### getType

    public Replica.Type getType()

#### getProperty

    public String getProperty(String propertyName)

#### copyWith

    public Replica copyWith(PerReplicaStates.State state)

#### getReplicaState

    public PerReplicaStates.State getReplicaState()

#### getState

    public static Replica.State getState(String c)

#### isLeader

    public boolean isLeader()

#### toString

    public String toString()

Overrides:
  `toString` in class `ZkNodeProps`