Search in sources :

Example 1 with RemoveClusterNodeLabels

use of org.apache.hadoop.yarn.nodelabels.event.RemoveClusterNodeLabels in project hadoop by apache.

the class CommonNodeLabelsManager method handleStoreEvent.

// Dispatcher related code
protected void handleStoreEvent(NodeLabelsStoreEvent event) {
    try {
        switch(event.getType()) {
            case ADD_LABELS:
                StoreNewClusterNodeLabels storeNewClusterNodeLabelsEvent = (StoreNewClusterNodeLabels) event;
                store.storeNewClusterNodeLabels(storeNewClusterNodeLabelsEvent.getLabels());
                break;
            case REMOVE_LABELS:
                RemoveClusterNodeLabels removeClusterNodeLabelsEvent = (RemoveClusterNodeLabels) event;
                store.removeClusterNodeLabels(removeClusterNodeLabelsEvent.getLabels());
                break;
            case STORE_NODE_TO_LABELS:
                UpdateNodeToLabelsMappingsEvent updateNodeToLabelsMappingsEvent = (UpdateNodeToLabelsMappingsEvent) event;
                store.updateNodeToLabelsMappings(updateNodeToLabelsMappingsEvent.getNodeToLabels());
                break;
        }
    } catch (IOException e) {
        LOG.error("Failed to store label modification to storage");
        throw new YarnRuntimeException(e);
    }
}
Also used : YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) StoreNewClusterNodeLabels(org.apache.hadoop.yarn.nodelabels.event.StoreNewClusterNodeLabels) UpdateNodeToLabelsMappingsEvent(org.apache.hadoop.yarn.nodelabels.event.UpdateNodeToLabelsMappingsEvent) IOException(java.io.IOException) RemoveClusterNodeLabels(org.apache.hadoop.yarn.nodelabels.event.RemoveClusterNodeLabels)

Aggregations

IOException (java.io.IOException)1 YarnRuntimeException (org.apache.hadoop.yarn.exceptions.YarnRuntimeException)1 RemoveClusterNodeLabels (org.apache.hadoop.yarn.nodelabels.event.RemoveClusterNodeLabels)1 StoreNewClusterNodeLabels (org.apache.hadoop.yarn.nodelabels.event.StoreNewClusterNodeLabels)1 UpdateNodeToLabelsMappingsEvent (org.apache.hadoop.yarn.nodelabels.event.UpdateNodeToLabelsMappingsEvent)1