public bool Remove(v value) { k key; if (_valueToKey.TryGetValue(value, out key)) { _valueToKey.Remove(value); _keyToValue.Remove(key); return(true); } return(false); }
public bool Remove(k key) { v value; if ((_keyToValue.TryGetValue(key, out value))) { _keyToValue.Remove(key); _valueToKey.Remove(value); return(true); } return(false); }
public ClusteredList <DocumentKey> GetKeysForBucket(int bucketId) { ClusteredList <DocumentKey> list = null; lock (_bucketKeyIndex) if (!_bucketKeyIndex.TryGetValue(bucketId, out list)) { list = new ClusteredList <DocumentKey>(); } return(list); }
public virtual long GetFileId(long rowId) { long fileId; lock (_rowToFileIndex) if (_rowToFileIndex.TryGetValue(rowId, out fileId)) { return(fileId); } return(-1); }
public void KeyUpdated(string key, bool isUseroperation, string clientId) { lock (this) { KeyInfo keyInfo; if (_registeredKeys.TryGetValue(key, out keyInfo)) { _lastChangeTime = HPTime.Now; // set last change time keyInfo.UpdatedTime = HPTime.Now; keyInfo = keyInfo.Clone() as KeyInfo; keyInfo.UpdatedBy = clientId; _updatedKeys[key] = keyInfo; } } }