コード例 #1
0
            private void getLastCommitInfo(StringBuilder lastCommitParam, LastCommitInfo lastCommitInfo, int size)
            {
                // We are at the end, encode the size

                if (lastCommitInfo == null)
                {
                    lastCommitParam.Append(Convert.ToString(size));
                    lastCommitParam.Append(LAST_INFO_SEPARATOR);
                }
                else
                {

                    // Recurse into each LastCommitInfo instance so we can find out the size ...

                    getLastCommitInfo(lastCommitParam, lastCommitInfo.next, ++size);

                    // ... then include this node's info

                    lastCommitInfo.getLastCommitInfo(lastCommitParam);
                }
            }
コード例 #2
0
 internal LastCommitInfo(LastCommitInfo next)
 {
     this.next = next;
 }
コード例 #3
0
            public virtual void setLast(long lastTxnId, int nodeId, long commitSequence)
            {
                if (commitSequence <= 0 || lastTxnId <= 0 || nodeId <= 0)
                {
                    return;
                }

                LastCommitInfo lastCommitInfo = getCommitInfo(nodeId);

                if (lastCommitInfo == null)
                {
                    lock (this)
                    {
                        lastCommitInfo = getCommitInfo(nodeId);

                        if (lastCommitInfo == null)
                        {
                            infos = lastCommitInfo = new LastCommitInfo(infos);
                        }
                    }
                }

                lastCommitInfo.setLast(lastTxnId, nodeId, commitSequence);
            }