use of org.apache.hyracks.control.cc.NodeControllerState in project asterixdb by apache.
the class NodeManager method getNodeControllerInfoMap.
@Override
public Map<String, NodeControllerInfo> getNodeControllerInfoMap() {
Map<String, NodeControllerInfo> result = new LinkedHashMap<>();
for (Map.Entry<String, NodeControllerState> e : nodeRegistry.entrySet()) {
NodeControllerState ncState = e.getValue();
result.put(e.getKey(), new NodeControllerInfo(e.getKey(), NodeStatus.ALIVE, ncState.getDataPort(), ncState.getDatasetPort(), ncState.getMessagingPort(), ncState.getCapacity().getCores()));
}
return result;
}
use of org.apache.hyracks.control.cc.NodeControllerState in project asterixdb by apache.
the class NodeManager method removeNode.
@Override
public void removeNode(String nodeId) throws HyracksException {
NodeControllerState ncState = nodeRegistry.remove(nodeId);
removeNodeFromIpAddressMap(nodeId, ncState);
// Updates the cluster capacity.
resourceManager.update(nodeId, new NodeCapacity(0L, 0));
}
use of org.apache.hyracks.control.cc.NodeControllerState in project asterixdb by apache.
the class PartitionUtils method reportPartitionMatch.
public static void reportPartitionMatch(ClusterControllerService ccs, final PartitionId pid, Pair<PartitionDescriptor, PartitionRequest> match) throws Exception {
PartitionDescriptor desc = match.getLeft();
PartitionRequest req = match.getRight();
INodeManager nodeManager = ccs.getNodeManager();
NodeControllerState producerNCS = nodeManager.getNodeControllerState(desc.getNodeId());
NodeControllerState requestorNCS = nodeManager.getNodeControllerState(req.getNodeId());
final NetworkAddress dataport = producerNCS.getDataPort();
final INodeController requestorNC = requestorNCS.getNodeController();
requestorNC.reportPartitionAvailability(pid, dataport);
}
use of org.apache.hyracks.control.cc.NodeControllerState in project asterixdb by apache.
the class AbstractHeartbeatWork method doRun.
@Override
public void doRun() {
INodeManager nodeManager = ccs.getNodeManager();
NodeControllerState state = nodeManager.getNodeControllerState(nodeId);
if (state != null) {
state.notifyHeartbeat(hbData);
}
runWork();
}
use of org.apache.hyracks.control.cc.NodeControllerState in project asterixdb by apache.
the class JobExecutor method startTasks.
private void startTasks(Map<String, List<TaskAttemptDescriptor>> taskAttemptMap) throws HyracksException {
final DeploymentId deploymentId = jobRun.getDeploymentId();
final JobId jobId = jobRun.getJobId();
final ActivityClusterGraph acg = jobRun.getActivityClusterGraph();
final Map<ConnectorDescriptorId, IConnectorPolicy> connectorPolicies = new HashMap<>(jobRun.getConnectorPolicyMap());
INodeManager nodeManager = ccs.getNodeManager();
try {
byte[] acgBytes = predistributed ? null : JavaSerializationUtils.serialize(acg);
for (Map.Entry<String, List<TaskAttemptDescriptor>> entry : taskAttemptMap.entrySet()) {
String nodeId = entry.getKey();
final List<TaskAttemptDescriptor> taskDescriptors = entry.getValue();
final NodeControllerState node = nodeManager.getNodeControllerState(nodeId);
if (node != null) {
node.getActiveJobIds().add(jobRun.getJobId());
boolean changed = jobRun.getParticipatingNodeIds().add(nodeId);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Starting: " + taskDescriptors + " at " + entry.getKey());
}
byte[] jagBytes = changed ? acgBytes : null;
node.getNodeController().startTasks(deploymentId, jobId, jagBytes, taskDescriptors, connectorPolicies, jobRun.getFlags());
}
}
} catch (Exception e) {
throw new HyracksException(e);
}
}
Aggregations