protected void handleStoreEvent(NodeAttributesStoreEvent event) { List<NodeToAttributes> mappingList = new ArrayList<>(); Map<String, Map<NodeAttribute, AttributeValue>> nodeToAttr = event.getNodeAttributeMappingList(); nodeToAttr.forEach((k, v) -> mappingList .add(NodeToAttributes.newInstance(k, new ArrayList<>(v.keySet())))); try { switch (event.getOperation()) { case REPLACE: store.replaceNodeAttributes(mappingList); break; case ADD: store.addNodeAttributes(mappingList); break; case REMOVE: store.removeNodeAttributes(mappingList); break; default: LOG.warn("Unsupported operation"); } } catch (IOException e) { LOG.error("Failed to store attribute modification to storage"); throw new YarnRuntimeException(e); } }
.equals(attributePrefix)) { dispatcher.getEventHandler() .handle(new NodeAttributesStoreEvent(nodeAttributeMapping, op));