update the count of this stat datanode

@param lastPrefix
the path of the node that is quotaed.
@param diff
the diff to be added to the count
9816
public void updateCount(String lastPrefix, int diff) {
        String statNode = Quotas.statPath(lastPrefix);
        DataNode node = nodes.get(statNode);
        StatsTrack updatedStat = null;
        if (node == null) {
            // should not happen
            LOG.error("Missing count node for stat " + statNode);
            return;
        }
        synchronized (node) {
            updatedStat = new StatsTrack(new String(node.data));
            updatedStat.setCount(updatedStat.getCount() + diff);
            node.data = updatedStat.toString().getBytes();
        }
        // now check if the counts match the quota
        String quotaNode = Quotas.quotaPath(lastPrefix);
        node = nodes.get(quotaNode);
        StatsTrack thisStats = null;
        if (node == null) {
            // should not happen
            LOG.error("Missing count node for quota " + quotaNode);
            return;
        }
        synchronized (node) {
            thisStats = new StatsTrack(new String(node.data));
        }
        if (thisStats.getCount() < updatedStat.getCount()) {
            LOG
                    .warn("Quota exceeded: " + lastPrefix + " count="
                            + updatedStat.getCount() + " limit="
                            + thisStats.getCount());
        }
    }
793667
function nodeSBindUpdate(node, sBind, changes, updater) {
    if (sBind) {
        var len = changes.length;

        while (len--) {
            if (changeExprCompare(changes[len].expr, sBind.value, node.scope)) {
                var newBindData = evalExpr(sBind.value, node.scope, node.owner);
                var keys = unionKeys(newBindData, node._sbindData);

                for (var i = 0, l = keys.length; i < l; i++) {
                    var key = keys[i];
                    var value = newBindData[key];

                    if (value !== node._sbindData[key]) {
                        updater(key, value);
                    }
                }

                node._sbindData = newBindData;
                break;
            }

        }
    }
}
749808
public void writeDiffFile(final Task<Diff> diff)
		throws IOException
	{

		int partsCount;
		int size = diff.size();
		Diff d;
		DiffPart p;
		RevisionCodecData codec;

		this.writer
				.write(WikipediaXMLKeys.KEY_START_PAGE.getKeyword() + "\r\n");

		ArticleInformation header = diff.getHeader();

		this.writer.write("\t" + WikipediaXMLKeys.KEY_START_TITLE.getKeyword());
		this.writer.write(header.getArticleName());
		this.writer.write(WikipediaXMLKeys.KEY_END_TITLE.getKeyword() + "\r\n");

		this.writer.write("\t" + WikipediaXMLKeys.KEY_START_ID.getKeyword());
		this.writer.write(Integer.toString(header.getArticleId()));
		this.writer.write(WikipediaXMLKeys.KEY_END_ID.getKeyword() + "\r\n");

		this.writer.write("\t<partCounter>");
		this.writer.write(Integer.toString(diff.getPartCounter()));
		this.writer.write("</partCounter>\r\n");

		for (int i = 0; i < size; i++) {
			d = diff.get(i);

			this.writer
					.write("\t"
							+ WikipediaXMLKeys.KEY_START_REVISION.getKeyword()
							+ "\r\n");

			codec = d.getCodecData();
			if (!codec.isConverted()) {
				codec.totalSizeInBits();
			}

			this.writer.write("\t\t<codecData>\r\n");

			this.writer.write("\t\t\t<s>"
					+ Integer.toString(codec.getBlocksizeS()) + "</s>\r\n");
			this.writer.write("\t\t\t<e>"
					+ Integer.toString(codec.getBlocksizeE()) + "</e>\r\n");
			this.writer.write("\t\t\t<b>"
					+ Integer.toString(codec.getBlocksizeB()) + "</b>\r\n");
			this.writer.write("\t\t\t<l>"
					+ Integer.toString(codec.getBlocksizeL()) + "</l>\r\n");

			this.writer.write("\t\t</codecData>\r\n");

			this.writer.write("\t\t"
					+ WikipediaXMLKeys.KEY_START_ID.getKeyword());
			this.writer.write(Integer.toString(d.getRevisionID()));
			this.writer
					.write(WikipediaXMLKeys.KEY_END_ID.getKeyword() + "\r\n");

			this.writer.write("\t\t<revCount>");
			this.writer.write(Integer.toString(d.getRevisionCounter()));
			this.writer.write("</revCount>\r\n");

			this.writer.write("\t\t"
					+ WikipediaXMLKeys.KEY_START_TIMESTAMP.getKeyword());
			this.writer.write(d.getTimeStamp().toString());
			this.writer.write(WikipediaXMLKeys.KEY_END_TIMESTAMP.getKeyword()
					+ "\r\n");

			this.writer.write("\t\t<diff>\r\n");
			partsCount = d.size();
			for (int j = 0; j < partsCount; j++) {

				p = d.get(j);
				this.writer.write("\t\t\t<diffPart>\r\n");

				this.writer.write("\t\t\t\t<action>" + p.getAction()
						+ "</action>\r\n");
				this.writer.write("\t\t\t\t<start>"
						+ Integer.toString(p.getStart()) + "</start>\r\n");
				this.writer.write("\t\t\t\t<end>"
						+ Integer.toString(p.getEnd()) + "</end>\r\n");
				if (p.getText() != null) {
					this.writer
							.write("\t\t\t\t<content xml:space=\"preserve\">"
									+ p.getText());
					this.writer.write("</content>\r\n");
				}

				this.writer.write("\t\t\t</diffPart>\r\n");
			}

			this.writer.write("\t\t</diff>\r\n");
			this.writer.write("\t"
					+ WikipediaXMLKeys.KEY_END_REVISION.getKeyword() + "\r\n");
		}

		this.writer.write(WikipediaXMLKeys.KEY_END_PAGE.getKeyword() + "\r\n");
		this.writer.flush();
	}
1103611
public void writeDiff(final Task<Diff> diff, final int start)
		throws IOException
	{

		int size = diff.size();
		Diff d;
		String previousRevision = null, currentRevision = null;

		this.writer
				.write(WikipediaXMLKeys.KEY_START_PAGE.getKeyword() + "\r\n");

		ArticleInformation header = diff.getHeader();

		this.writer.write("\t" + WikipediaXMLKeys.KEY_START_TITLE.getKeyword());
		this.writer.write(header.getArticleName());
		this.writer.write(WikipediaXMLKeys.KEY_END_TITLE.getKeyword() + "\r\n");

		this.writer.write("\t" + WikipediaXMLKeys.KEY_START_ID.getKeyword());
		this.writer.write(Integer.toString(header.getArticleId()));
		this.writer.write(WikipediaXMLKeys.KEY_END_ID.getKeyword() + "\r\n");

		this.writer.write("\t<partCounter>");
		this.writer.write(Integer.toString(diff.getPartCounter()));
		this.writer.write("</partCounter>\r\n");

		for (int i = start; i < size; i++) {
			d = diff.get(i);
			currentRevision = d.buildRevision(previousRevision);

			this.writer
					.write("\t"
							+ WikipediaXMLKeys.KEY_START_REVISION.getKeyword()
							+ "\r\n");

			this.writer.write("\t\t"
					+ WikipediaXMLKeys.KEY_START_ID.getKeyword());
			this.writer.write(Integer.toString(d.getRevisionID()));
			this.writer
					.write(WikipediaXMLKeys.KEY_END_ID.getKeyword() + "\r\n");

			this.writer.write("\t\t<revCount>");
			this.writer.write(Integer.toString(d.getRevisionCounter()));
			this.writer.write("</revCount>\r\n");

			this.writer.write("\t\t"
					+ WikipediaXMLKeys.KEY_START_TIMESTAMP.getKeyword());
			this.writer.write(d.getTimeStamp().toString());
			this.writer.write(WikipediaXMLKeys.KEY_END_TIMESTAMP.getKeyword()
					+ "\r\n");

			this.writer.write("\t\t"
					+ WikipediaXMLKeys.KEY_START_TEXT.getKeyword());
			if (currentRevision != null) {
				this.writer.write(currentRevision);
				previousRevision = currentRevision;
			}
			this.writer.write(WikipediaXMLKeys.KEY_END_TEXT.getKeyword()
					+ "\r\n");

			this.writer.write("\t"
					+ WikipediaXMLKeys.KEY_END_REVISION.getKeyword() + "\r\n");

		}

		this.writer.write(WikipediaXMLKeys.KEY_END_PAGE.getKeyword() + "\r\n");
		this.writer.flush();
	}
194546
function _onChildNodeCountUpdated(event, res) {
        // res = {nodeId, childNodeCount}
        if (res.nodeId > 0) {
            Inspector.DOM.requestChildNodes(res.nodeId);
        }
    }
890689
void updateCount() {
		if (this.hasChanged) {
			this.countArray = ArrayUtils.toPrimitive(getCountList().toArray(
					new Long[0]));
			this.hasChanged = false;
		}
	}
1303099
public int lastModified(int iAreaDesc, boolean bForceUniqueKey)
    {   // Set up the end key
        int iLastKeyField = this.getKeyFields(bForceUniqueKey, false) - 1;
        for (int iKeyFieldSeq = iLastKeyField; iKeyFieldSeq >= DBConstants.MAIN_KEY_FIELD; iKeyFieldSeq--)
        {
            KeyField keyField = this.getKeyField(iKeyFieldSeq, bForceUniqueKey);
            if (keyField.getField(iAreaDesc).isModified())
                return iKeyFieldSeq;
        }
        return -1;
    }
615002
public void update(int node) {
        final int prev = prev(node);
        final int next = next(node);
        if ((prev == NIL || compare(prev) > 0) && (next == NIL || compare(next) < 0)) {
            // Update can be done in-place
            copy(node);
            for (int n = node; n != NIL; n = parent(n)) {
                fixAggregates(n);
            }
        } else {
            // TODO: it should be possible to find the new node position without
            // starting from scratch
            remove(node);
            add();
        }
    }
132515
private void updateQuotaForPath(String path) {
        Counts c = new Counts();
        getCounts(path, c);
        StatsTrack strack = new StatsTrack();
        strack.setBytes(c.bytes);
        strack.setCount(c.count);
        String statPath = Quotas.quotaZookeeper + path + "/" + Quotas.statNode;
        DataNode node = getNode(statPath);
        // it should exist
        if (node == null) {
            LOG.warn("Missing quota stat node " + statPath);
            return;
        }
        synchronized (node) {
            node.data = strack.toString().getBytes();
        }
    }
947187
protected void updateCounts(LoadStatisticsSnapshot current) {
        definedExecutors.update(current.getDefinedExecutors());
        onlineExecutors.update(current.getOnlineExecutors());
        connectingExecutors.update(current.getConnectingExecutors());
        busyExecutors.update(current.getBusyExecutors());
        idleExecutors.update(current.getIdleExecutors());
        availableExecutors.update(current.getAvailableExecutors());
        queueLength.update(current.getQueueLength());
    }
1122285
function updateIfNodeValueChanged(currentNode, newNode){
    var nodeValueChanged = newNode.nodeValue !== currentNode.nodeValue;
    if (nodeValueChanged) {
      $(currentNode).replaceWith(newNode);
    }
  }
711137
protected void updateReporting(Reporting value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "excludeDefaults",
                  (value.isExcludeDefaults() == false) ? null : String.valueOf(value.isExcludeDefaults()), "false");
         findAndReplaceSimpleElement(innerCount, root, "outputDirectory", value.getOutputDirectory(), null);
         iterateReportPlugin(innerCount, root, value.getPlugins(), "plugins", "plugin");
      }
   }
1320692
public void setPreferredNodeIdPrefix(String preferredNodeIdPrefix) {
        LettuceAssert.notNull(preferredNodeIdPrefix, "preferredNodeIdPrefix must not be null");
        boolean resetRoundRobin = false;

        if (this.preferredNodeIdPrefix == null || !preferredNodeIdPrefix.equals(this.preferredNodeIdPrefix)) {
            resetRoundRobin = true;
        }

        this.preferredNodeIdPrefix = preferredNodeIdPrefix;

        if (resetRoundRobin) {
            resetRoundRobin(preferredNodeIdPrefix);
        }
    }
1079673
private void updateSubtreeMap(final ITreeData paramNode, final INodeReadTrx paramRtx) throws TTIOException {
        assert paramNode != null;
        assert paramRtx != null;

        mIsInSubtree.set(paramNode, paramNode, true);
        if (paramNode.hasParent()) {
            paramRtx.moveTo(paramNode.getDataKey());
            while (((ITreeStructData)paramRtx.getNode()).hasParent()) {
                paramRtx.moveTo(paramRtx.getNode().getParentKey());
                mIsInSubtree.set(paramRtx.getNode(), paramNode, true);
            }
        }
    }
396505
public ComputeNodeRebootHeaders withLastModified(DateTime lastModified) {
        if (lastModified == null) {
            this.lastModified = null;
        } else {
            this.lastModified = new DateTimeRfc1123(lastModified);
        }
        return this;
    }
723193
@Override
    public synchronized void update(WSStats newStats, boolean keepOld, boolean recursiveUpdate) {
        if (newStats == null)
            return;

        StatsImpl newStats1 = (StatsImpl) newStats;
        // check if they are same Stats
        if (!name.equals(newStats1.getName()) || type != newStats1.getType())
            return;

        myupdate(newStats1, keepOld, recursiveUpdate);
    }
946447
public void updateNode (NodeRecord record)
    {
        record.lastUpdated = new Timestamp(System.currentTimeMillis());
        store(record);
    }