Package ai.libs.jaicore.basic.kvstore
Class KVStoreCollectionOneLayerPartition
- java.lang.Object
-
- ai.libs.jaicore.basic.kvstore.KVStoreCollectionOneLayerPartition
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<java.lang.String,KVStoreCollection>>
public class KVStoreCollectionOneLayerPartition extends java.lang.Object implements java.lang.Iterable<java.util.Map.Entry<java.lang.String,KVStoreCollection>>
Automatically partitions a KVStoreCollection according to the values of the partitioning key when KVStores or KVStoreCollections are added.
-
-
Constructor Summary
Constructors Constructor Description KVStoreCollectionOneLayerPartition(java.lang.String firstLevelKey)Creates an empty two layer KVStorCollection partition.KVStoreCollectionOneLayerPartition(java.lang.String partitionKey, KVStoreCollection collection)Creates an empty two layerKVStoreCollectionpartition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.api4.java.datastructure.kvstore.IKVStore store)Adds a signleKVStoreto thisKVStoreCollectionOneLayerPartition.voidaddAll(KVStoreCollection collection)Adds an entireto this {@link KVStoreCollectionOneLayerPartition}.java.util.Set<java.util.Map.Entry<java.lang.String,KVStoreCollection>>entrySet()java.util.Map<java.lang.String,KVStoreCollection>getData()java.util.Iterator<java.util.Map.Entry<java.lang.String,KVStoreCollection>>iterator()java.lang.StringtoString()
-
-
-
Constructor Detail
-
KVStoreCollectionOneLayerPartition
public KVStoreCollectionOneLayerPartition(java.lang.String partitionKey, KVStoreCollection collection)Creates an empty two layerKVStoreCollectionpartition.- Parameters:
partitionKey- The field name for the partitioning key.collection- TheKVStoreCollectionto initialize this partition.
-
KVStoreCollectionOneLayerPartition
public KVStoreCollectionOneLayerPartition(java.lang.String firstLevelKey)
Creates an empty two layer KVStorCollection partition.- Parameters:
partitionKey- The field name for the first level partition.
-
-
Method Detail
-
getData
public java.util.Map<java.lang.String,KVStoreCollection> getData()
-
add
public void add(org.api4.java.datastructure.kvstore.IKVStore store)
Adds a signleKVStoreto thisKVStoreCollectionOneLayerPartition.- Parameters:
store-
-
addAll
public void addAll(KVStoreCollection collection)
Adds an entireto this {@link KVStoreCollectionOneLayerPartition}.- Parameters:
collection- The collection to be added to this partition.
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,KVStoreCollection>> entrySet()
- Returns:
- The set of entries of this partition.
-
iterator
public java.util.Iterator<java.util.Map.Entry<java.lang.String,KVStoreCollection>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.String,KVStoreCollection>>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-