org.apache.solr.cloud

## Class DistributedMap

- java.lang.Object
- - org.apache.solr.cloud.DistributedMap

- Direct Known Subclasses:
    SizeLimitedDistributedMap

      public class DistributedMap
      extends Object

  A distributed map. This supports basic map functions e.g. get, put, contains for interaction with zk which don't have to be ordered i.e. DistributedQueue.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `dir`
    `protected String` | `prefix`
    `protected SolrZkClient` | `zookeeper`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DistributedMap(SolrZkClient zookeeper, String dir)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Helper method to clear all child nodes for a parent node.
    `boolean` | `contains(String trackingId)`
    `byte[]` | `get(String trackingId)`
    `void` | `put(String trackingId, byte[] data)`
    `boolean` | `remove(String trackingId)` return true if the znode was successfully deleted false if the node didn't exist and therefore not deleted exception an exception occurred while deleting
    `int` | `size()`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### dir

          protected final String dir

    - #### zookeeper

          protected SolrZkClient zookeeper

    - #### prefix

          protected final String prefix

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DistributedMap

          public DistributedMap(SolrZkClient zookeeper,
                                String dir)

  - ### Method Detail

    - #### put

          public void put(String trackingId,
                          byte[] data)
                   throws org.apache.zookeeper.KeeperException,
                          InterruptedException

      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### get

          public byte[] get(String trackingId)
                     throws org.apache.zookeeper.KeeperException,
                            InterruptedException

      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### contains

          public boolean contains(String trackingId)
                           throws org.apache.zookeeper.KeeperException,
                                  InterruptedException

      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### size

          public int size()
                   throws org.apache.zookeeper.KeeperException,
                          InterruptedException

      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### remove

          public boolean remove(String trackingId)
                         throws org.apache.zookeeper.KeeperException,
                                InterruptedException

      return true if the znode was successfully deleted false if the node didn't exist and therefore not deleted exception an exception occurred while deleting
      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

    - #### clear

          public void clear()
                     throws org.apache.zookeeper.KeeperException,
                            InterruptedException

      Helper method to clear all child nodes for a parent node.
      Throws:
        `org.apache.zookeeper.KeeperException`
        `InterruptedException`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.