Exemple #1
0
        public long GetLastSeqId(ProducerId id)
        {
            long        result = -1;
            BitArrayBin bab    = null;

            lock (this.mutex)
            {
                if (map.TryGetValue(id, out bab))
                {
                    result = bab.GetLastSetIndex();
                }
            }
            return(result);
        }
Exemple #2
0
 public void Rollback(MessageId id)
 {
     if (id != null)
     {
         ProducerId pid = id.ProducerId;
         if (pid != null)
         {
             lock (this.mutex)
             {
                 BitArrayBin bab = null;
                 if (map.TryGetValue(pid, out bab))
                 {
                     bab.SetBit(id.ProducerSequenceId, false);
                 }
             }
         }
     }
 }
Exemple #3
0
        public bool IsDuplicate(MessageId id)
        {
            bool answer = false;

            if (id != null)
            {
                ProducerId pid = id.ProducerId;
                if (pid != null)
                {
                    lock (this.mutex)
                    {
                        BitArrayBin bab = null;
                        if (!map.TryGetValue(pid, out bab))
                        {
                            bab      = new BitArrayBin(auditDepth);
                            map[pid] = bab;
                        }
                        answer = bab.SetBit(id.ProducerSequenceId, true);
                    }
                }
            }
            return(answer);
        }