Package org.apache.solr.common
Class SimpleZkMap
- java.lang.Object
-
- org.apache.solr.common.SimpleZkMap
-
- All Implemented Interfaces:
org.apache.solr.cluster.api.SimpleMap<org.apache.solr.cluster.api.Resource>
,org.apache.solr.common.MapSerializable
,org.apache.solr.common.MapWriter
,org.apache.solr.common.NavigableObject
public class SimpleZkMap extends Object implements org.apache.solr.cluster.api.SimpleMap<org.apache.solr.cluster.api.Resource>
A view of ZK as aSimpleMap
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 theabortableForEach(BiFunction)
to traverse DO not use thesize()
method. It always return 0 because it is very expensive to compute that
-
-
Constructor Summary
Constructors Constructor Description SimpleZkMap(ZkStateReader zkStateReader, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortableForEach(BiFunction<String,? super org.apache.solr.cluster.api.Resource,Boolean> fun)
void
forEachEntry(BiConsumer<String,? super org.apache.solr.cluster.api.Resource> fun)
org.apache.solr.cluster.api.Resource
get(String key)
int
size()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
SimpleZkMap
public SimpleZkMap(ZkStateReader zkStateReader, String path)
-
-
Method Detail
-
get
public org.apache.solr.cluster.api.Resource get(String key)
- Specified by:
get
in interfaceorg.apache.solr.cluster.api.SimpleMap<org.apache.solr.cluster.api.Resource>
-
abortableForEach
public void abortableForEach(BiFunction<String,? super org.apache.solr.cluster.api.Resource,Boolean> fun)
- Specified by:
abortableForEach
in interfaceorg.apache.solr.cluster.api.SimpleMap<org.apache.solr.cluster.api.Resource>
-
forEachEntry
public void forEachEntry(BiConsumer<String,? super org.apache.solr.cluster.api.Resource> fun)
- Specified by:
forEachEntry
in interfaceorg.apache.solr.cluster.api.SimpleMap<org.apache.solr.cluster.api.Resource>
-
size
public int size()
- Specified by:
size
in interfaceorg.apache.solr.cluster.api.SimpleMap<org.apache.solr.cluster.api.Resource>
-
-