/** * Adds <code>incrementValue</code> to any existing value for the given <code>key</code> * or inserts <code>incrementValue</code> if <code>key</code> did not previously exist. * * @param key The key of the value to adjust. * @param incrementValue The value to put or add to the existing value if <code>key</code> exists. * @return Returns the current value associated with <code>key</code> (after changes). */ @Override public int addTo(KType key, int incrementValue) { return putOrAdd(key, incrementValue, incrementValue); }
/** * Adds <code>incrementValue</code> to any existing value for the given <code>key</code> * or inserts <code>incrementValue</code> if <code>key</code> did not previously exist. * * @param key The key of the value to adjust. * @param incrementValue The value to put or add to the existing value if <code>key</code> exists. * @return Returns the current value associated with <code>key</code> (after changes). */ @Override public int addTo(KType key, int incrementValue) { return putOrAdd(key, incrementValue, incrementValue); }
if (!node.nodeId().equals(nodeId)) { shardPerAttribute.putOrAdd(allocation.routingNodes().node(nodeId).node().getAttributes().get(awarenessAttribute), 0, -1); shardPerAttribute.addTo(node.node().getAttributes().get(awarenessAttribute), 1);
final int maxWidth = endpointAffinity.getMaxWidth(); final double affinity = endpointAffinity.getAffinity(); maxWidthPerNode.putOrAdd(endpoint, maxWidth, maxWidth); affinityPerNode.putOrAdd(endpoint, affinity, affinity);
if (!node.nodeId().equals(nodeId)) { shardPerAttribute.putOrAdd(allocation.routingNodes().node(nodeId).node().getAttributes().get(awarenessAttribute), 0, -1); shardPerAttribute.addTo(node.node().getAttributes().get(awarenessAttribute), 1);
if (!node.nodeId().equals(nodeId)) { shardPerAttribute.putOrAdd(allocation.routingNodes().node(nodeId).node().getAttributes().get(awarenessAttribute), 0, -1); shardPerAttribute.addTo(node.node().getAttributes().get(awarenessAttribute), 1);
if (!node.nodeId().equals(nodeId)) { shardPerAttribute.putOrAdd(allocation.routingNodes().node(nodeId).node().getAttributes().get(awarenessAttribute), 0, -1); shardPerAttribute.addTo(node.node().getAttributes().get(awarenessAttribute), 1);
if (!node.nodeId().equals(nodeId)) { shardPerAttribute.putOrAdd(allocation.routingNodes().node(nodeId).node().attributes().get(awarenessAttribute), 0, -1); shardPerAttribute.addTo(node.node().attributes().get(awarenessAttribute), 1);