Package org.apache.solr.common.cloud
Class ZkNodeProps
- java.lang.Object
-
- org.apache.solr.common.cloud.ZkNodeProps
-
- All Implemented Interfaces:
org.noggit.JSONWriter.Writable
- Direct Known Subclasses:
DocCollection
,Replica
,RoutingRule
,Slice
public class ZkNodeProps extends Object implements org.noggit.JSONWriter.Writable
ZkNodeProps contains generic immutable properties.
-
-
Constructor Summary
Constructors Constructor Description ZkNodeProps(String... keyVals)
Constructor that populates the from array of Strings in form key1, value1, key2, value2, ..., keyN, valueNZkNodeProps(Map<String,Object> propMap)
Construct ZKNodeProps from map.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
containsKey(String key)
Check if property key exists.boolean
equals(Object that)
static ZkNodeProps
fromKeyVals(Object... keyVals)
Deprecated.Object
get(String key)
boolean
getBool(String key, boolean b)
Integer
getInt(String key, Integer def)
Get a string property value.Map<String,Object>
getProperties()
Get all properties as map.String
getStr(String key)
Get a string property value.String
getStr(String key, String def)
Get a string property value.int
hashCode()
Set<String>
keySet()
Get property keys.static ZkNodeProps
load(byte[] bytes)
Create Replica from json string that is typically stored in zookeeper.ZkNodeProps
plus(String key, Object val)
ZkNodeProps
plus(Map<String,Object> newVals)
Map<String,Object>
shallowCopy()
Returns a shallow writable copy of the propertiesString
toString()
void
write(org.noggit.JSONWriter jsonWriter)
-
-
-
Method Detail
-
plus
public ZkNodeProps plus(String key, Object val)
-
plus
public ZkNodeProps plus(Map<String,Object> newVals)
-
fromKeyVals
@Deprecated(since="9.0.0") public static ZkNodeProps fromKeyVals(Object... keyVals)
Deprecated.
-
shallowCopy
public Map<String,Object> shallowCopy()
Returns a shallow writable copy of the properties
-
load
public static ZkNodeProps load(byte[] bytes)
Create Replica from json string that is typically stored in zookeeper.
-
write
public void write(org.noggit.JSONWriter jsonWriter)
- Specified by:
write
in interfaceorg.noggit.JSONWriter.Writable
-
containsKey
public boolean containsKey(String key)
Check if property key exists.
-
getBool
public boolean getBool(String key, boolean b)
-
-