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); }
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); } } } } }
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); }