Class 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 Detail

      • ZkNodeProps

        public ZkNodeProps​(Map<String,​Object> propMap)
        Construct ZKNodeProps from map.
      • ZkNodeProps

        public ZkNodeProps​(String... keyVals)
        Constructor that populates the from array of Strings in form key1, value1, key2, value2, ..., keyN, valueN
    • Method Detail

      • keySet

        public Set<String> keySet()
        Get property keys.
      • getProperties

        public Map<String,​Object> getProperties()
        Get all properties as map.
      • 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 interface org.noggit.JSONWriter.Writable
      • getStr

        public String getStr​(String key)
        Get a string property value.
      • containsKey

        public boolean containsKey​(String key)
        Check if property key exists.
      • getBool

        public boolean getBool​(String key,
                               boolean b)