Package org.apache.solr.common

## Class SimpleZkMap

- java.lang.Object
- - org.apache.solr.common.SimpleZkMap

All Implemented Interfaces:
  `SimpleMap<Resource>`, `MapSerializable`, `MapWriter`, `NavigableObject`

    public class SimpleZkMap
    extends Object
    implements SimpleMap<Resource>

A view of ZK as a `SimpleMap` impl. This gives a flat view of all paths instead of a tree view eg: a, b, c , a/a1, a/a2, a/a1/aa1 etc If possible, use the `abortableForEach(BiFunction)` to traverse DO not use the `size()` method. It always return 0 because it is very expensive to compute that

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

### Constructor Summary

Constructors
`SimpleZkMap​(ZkStateReader zkStateReader, String path)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `abortableForEach​(BiFunction<String,​? super Resource,​Boolean> fun)` Navigate through all key-values but abort in between if required.
`void` `forEachEntry​(BiConsumer<String,​? super Resource> fun)` Navigate through all keys and values
`Resource` `get​(String key)` get a value by key.
`int` `size()`

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

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

### Methods inherited from interface org.apache.solr.common.MapWriter

`jsonStr, toMap`

### Methods inherited from interface org.apache.solr.common.NavigableObject

`_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size`

### Methods inherited from interface org.apache.solr.cluster.api.SimpleMap

`abortableForEachKey, asMap, asMap, forEachKey, get, writeMap`

### Constructor Detail

#### SimpleZkMap

    public SimpleZkMap​(ZkStateReader zkStateReader,
                       String path)

### Method Detail

#### get

    public Resource get​(String key)

Description copied from interface: `SimpleMap`
get a value by key. If not present , null is returned

Specified by:
  `get` in interface `SimpleMap<Resource>`

#### abortableForEach

    public void abortableForEach​(BiFunction<String,​? super Resource,​Boolean> fun)

Description copied from interface: `SimpleMap`
Navigate through all key-values but abort in between if required. The default impl is suboptimal. Proper implementations must do it more efficiently

Specified by:
  `abortableForEach` in interface `SimpleMap<Resource>`
Parameters:
  `fun` - Consume each entry and return a boolean to signal whether to proceed or not. If true, continue, if false stop

#### forEachEntry

    public void forEachEntry​(BiConsumer<String,​? super Resource> fun)

Description copied from interface: `SimpleMap`
Navigate through all keys and values

Specified by:
  `forEachEntry` in interface `SimpleMap<Resource>`

#### size

    public int size()

Specified by:
  `size` in interface `SimpleMap<Resource>`