Search in sources :

Example 1 with DefaultNodeGroupDomain

use of org.apache.hyracks.algebricks.core.algebra.properties.DefaultNodeGroupDomain in project asterixdb by apache.

the class MetadataManagerUtil method findNodeDomain.

public static INodeDomain findNodeDomain(MetadataTransactionContext mdTxnCtx, String nodeGroupName) throws AlgebricksException {
    NodeGroup nodeGroup = MetadataManager.INSTANCE.getNodegroup(mdTxnCtx, nodeGroupName);
    List<String> partitions = new ArrayList<>();
    for (String location : nodeGroup.getNodeNames()) {
        int numPartitions = ClusterStateManager.INSTANCE.getNodePartitionsCount(location);
        for (int i = 0; i < numPartitions; i++) {
            partitions.add(location);
        }
    }
    return new DefaultNodeGroupDomain(partitions);
}
Also used : ArrayList(java.util.ArrayList) DefaultNodeGroupDomain(org.apache.hyracks.algebricks.core.algebra.properties.DefaultNodeGroupDomain) NodeGroup(org.apache.asterix.metadata.entities.NodeGroup)

Aggregations

ArrayList (java.util.ArrayList)1 NodeGroup (org.apache.asterix.metadata.entities.NodeGroup)1 DefaultNodeGroupDomain (org.apache.hyracks.algebricks.core.algebra.properties.DefaultNodeGroupDomain)1