Search in sources :

Example 11 with PropertyType

use of org.apache.helix.PropertyType in project helix by apache.

the class ZKHelixDataAccessor method getChildValuesMap.

@Override
public <T extends HelixProperty> Map<String, T> getChildValuesMap(PropertyKey key, boolean throwException) {
    PropertyType type = key.getType();
    String parentPath = key.getPath();
    int options = constructOptions(type);
    List<T> children = getChildValues(key, throwException);
    Map<String, T> childValuesMap = new HashMap<String, T>();
    for (T t : children) {
        childValuesMap.put(t.getRecord().getId(), t);
    }
    return childValuesMap;
}
Also used : HashMap(java.util.HashMap) PropertyType(org.apache.helix.PropertyType)

Aggregations

PropertyType (org.apache.helix.PropertyType)11 ZNRecord (org.apache.helix.ZNRecord)6 ArrayList (java.util.ArrayList)5 HelixProperty (org.apache.helix.HelixProperty)5 PropertyKey (org.apache.helix.PropertyKey)3 ZNRecordAssembler (org.apache.helix.ZNRecordAssembler)3 Stat (org.apache.zookeeper.data.Stat)3 ZkNoNodeException (org.I0Itec.zkclient.exception.ZkNoNodeException)2 ZNRecordBucketizer (org.apache.helix.ZNRecordBucketizer)2 HashMap (java.util.HashMap)1 List (java.util.List)1 HelixMetaDataAccessException (org.apache.helix.api.exceptions.HelixMetaDataAccessException)1