public GetKeysByTagCommand(string[] tags, TagComparisonType comparisonType, int methodOverload) { base.name = "GetKeysByTagCommand"; _getTagCommand = new Alachisoft.NCache.Common.Protobuf.GetKeysByTagCommand(); _getTagCommand.tagComparisonType = (int)comparisonType; _getTagCommand.tags.AddRange(tags); _getTagCommand.requestId = base.RequestId; _methodOverload = methodOverload; }
internal override ArrayList GetKeysByTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext) { base.Sync.AcquireReaderLock(-1); try { return(this.Internal.GetKeysByTag(tags, comparisonType, operationContext)); } finally { base.Sync.ReleaseReaderLock(); } }
public override Hashtable GetTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext) { base.Sync.AcquireReaderLock(-1); try { return(this.Internal.GetTag(tags, comparisonType, operationContext)); } finally { base.Sync.ReleaseReaderLock(); } }
public override Hashtable RemoveByTag(string[] tags, TagComparisonType tagComparisonType, bool notify, OperationContext operationContext) { base.Sync.AcquireWriterLock(-1); try { return(this.Internal.RemoveByTag(tags, tagComparisonType, notify, operationContext)); } finally { base.Sync.ReleaseWriterLock(); } }
protected ArrayList Clustered_GetKeysByTag(ArrayList dests, string[] tags, TagComparisonType comparisonType, bool excludeSelf, OperationContext operationContext) { ArrayList keys = new ArrayList(); try { Function func = new Function((int)OpCodes.GetKeysByTag, new object[] { tags, comparisonType, operationContext }, excludeSelf); func.Cancellable = true; RspList results = Cluster.Multicast(dests, func, GroupRequest.GET_ALL, false, Cluster.Timeout * 10); if (results == null) { return(null); } ClusterHelper.ValidateResponses(results, typeof(ArrayList), Name); IList rspList = ClusterHelper.GetAllNonNullRsp(results, typeof(ClusteredArrayList)); if (rspList.Count <= 0) { return(null); } else { IEnumerator im = rspList.GetEnumerator(); while (im.MoveNext()) { Rsp rsp = (Rsp)im.Current; ICollection entries = (ICollection)rsp.Value; if (entries != null) { IEnumerator ide = entries.GetEnumerator(); while (ide.MoveNext()) { keys.Add(ide.Current); } } } } return(keys); } catch (CacheException e) { throw; } catch (Exception e) { throw new GeneralFailureException(e.Message, e); } }
protected Hashtable Clustered_GetTag(ArrayList dests, string[] tags, TagComparisonType comparisonType, bool excludeSelf, OperationContext operationContext) { Hashtable keyValues = new Hashtable(); try { Function func = new Function((int)OpCodes.GetTag, new object[] { tags, comparisonType, operationContext }, excludeSelf); func.Cancellable = true; RspList results = Cluster.BroadcastToMultiple(dests, func, GroupRequest.GET_ALL, false); if (results == null) { return(null); } ClusterHelper.ValidateResponses(results, typeof(HashVector), Name); IList rspList = ClusterHelper.GetAllNonNullRsp(results, typeof(HashVector)); if (rspList.Count <= 0) { return(null); } else { IEnumerator im = rspList.GetEnumerator(); while (im.MoveNext()) { Rsp rsp = (Rsp)im.Current; IDictionary entries = (IDictionary)rsp.Value; if (entries != null) { IDictionaryEnumerator ide = entries.GetEnumerator(); while (ide.MoveNext()) { keyValues[ide.Key] = ide.Value; } } } } return(keyValues); } catch (CacheException e) { throw; } catch (Exception e) { throw new GeneralFailureException(e.Message, e); } }
public static string ToString(TagComparisonType comparisonType) { switch (comparisonType) { case TagComparisonType.BY_TAG: return("1"); case TagComparisonType.ALL_MATCHING_TAGS: return("2"); case TagComparisonType.ANY_MATCHING_TAG: return("3"); } return(string.Empty); }
internal override ArrayList GetKeysByTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext) { switch (comparisonType) { case TagComparisonType.BY_TAG: return(((NamedTagIndexManager)_queryIndexManager).GetByTag(tags[0])); case TagComparisonType.ALL_MATCHING_TAGS: return(((NamedTagIndexManager)_queryIndexManager).GetAllMatchingTags(tags)); case TagComparisonType.ANY_MATCHING_TAG: return(((NamedTagIndexManager)_queryIndexManager).GetAnyMatchingTag(tags)); } return(null); }
protected Hashtable Clustered_RemoveByTag(ArrayList dests, string[] tags, TagComparisonType comparisonType, bool notify, bool excludeSelf, OperationContext operationContext) { Hashtable removedEntries = new Hashtable(); try { Function func = new Function((int)OpCodes.RemoveByTag, new object[] { tags, comparisonType, notify, operationContext }, excludeSelf); func.Cancellable = true; RspList results = Cluster.BroadcastToMultiple(dests, func, GroupRequest.GET_ALL, false); if (results == null) { return(removedEntries); } ClusterHelper.ValidateResponses(results, typeof(Hashtable), Name); IList rspList = ClusterHelper.GetAllNonNullRsp(results, typeof(Hashtable)); if (rspList.Count <= 0) { return(removedEntries); } IEnumerator ia = rspList.GetEnumerator(); while (ia.MoveNext()) { Rsp rsp = (Rsp)ia.Current; Hashtable removed = (Hashtable)rsp.Value; IDictionaryEnumerator ide = removed.GetEnumerator(); while (ide.MoveNext()) { removedEntries.Add(ide.Key, ide.Value); } } } catch (CacheException e) { throw; } catch (Exception e) { throw new GeneralFailureException(e.Message, e); } return(removedEntries); }
internal override ICollection GetTagKeys(string[] tags, TagComparisonType comparisonType, OperationContext operationContext) { switch (comparisonType) { case TagComparisonType.BY_TAG: return(((NamedTagIndexManager)_queryIndexManager).GetByTag(tags[0], operationContext.CancellationToken)); case TagComparisonType.ANY_MATCHING_TAG: return(((NamedTagIndexManager)_queryIndexManager).GetAnyMatchingTag(tags, operationContext.CancellationToken)); case TagComparisonType.ALL_MATCHING_TAGS: return(((NamedTagIndexManager)_queryIndexManager).GetAllMatchingTags(tags, operationContext.CancellationToken)); case TagComparisonType.BY_WILDCARDTAG: return(((NamedTagIndexManager)_queryIndexManager).GetByWildCardTag(tags[0], operationContext.CancellationToken)); } return(null); }
public virtual ICollection GetKeysByTag(Tag[] tags, TagComparisonType comaprisonType) { return(null); }
public override Hashtable GetTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext) { return(this.Internal.GetTag(tags, comparisonType, operationContext)); }
public virtual Hashtable RemoveByTag(string[] tags, TagComparisonType tagComparisonType, bool notify, OperationContext operationContext) { return(null); }
public virtual void RemoveByTag(Tag[] tags, TagComparisonType comaprisonType) { }
internal virtual ArrayList GetKeysByTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext) { return(null); }
public virtual Hashtable GetTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext) { return(null); }
internal override ArrayList GetKeysByTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext) { return(this.Internal.GetKeysByTag(tags, comparisonType, operationContext)); }
public virtual Hashtable GetByTag(Tag[] tags, TagComparisonType comaprisonType) { return(null); }
public override Hashtable RemoveByTag(string[] tags, TagComparisonType tagComparisonType, bool notify, OperationContext operationContext) { return(this.Internal.RemoveByTag(tags, tagComparisonType, notify, operationContext)); }