コード例 #1
0
        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;
        }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
 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();
     }
 }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
 public virtual ICollection GetKeysByTag(Tag[] tags, TagComparisonType comaprisonType)
 {
     return(null);
 }
コード例 #12
0
 public override Hashtable GetTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext)
 {
     return(this.Internal.GetTag(tags, comparisonType, operationContext));
 }
コード例 #13
0
ファイル: CacheBase.cs プロジェクト: fabrimaciel/colosoft
 public virtual Hashtable RemoveByTag(string[] tags, TagComparisonType tagComparisonType, bool notify, OperationContext operationContext)
 {
     return(null);
 }
コード例 #14
0
 public virtual void RemoveByTag(Tag[] tags, TagComparisonType comaprisonType)
 {
 }
コード例 #15
0
ファイル: CacheBase.cs プロジェクト: fabrimaciel/colosoft
 internal virtual ArrayList GetKeysByTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext)
 {
     return(null);
 }
コード例 #16
0
ファイル: CacheBase.cs プロジェクト: fabrimaciel/colosoft
 public virtual Hashtable GetTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext)
 {
     return(null);
 }
コード例 #17
0
 internal override ArrayList GetKeysByTag(string[] tags, TagComparisonType comparisonType, OperationContext operationContext)
 {
     return(this.Internal.GetKeysByTag(tags, comparisonType, operationContext));
 }
コード例 #18
0
 public virtual Hashtable GetByTag(Tag[] tags, TagComparisonType comaprisonType)
 {
     return(null);
 }
コード例 #19
0
 public override Hashtable RemoveByTag(string[] tags, TagComparisonType tagComparisonType, bool notify, OperationContext operationContext)
 {
     return(this.Internal.RemoveByTag(tags, tagComparisonType, notify, operationContext));
 }