コード例 #1
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Client.Protocol.AnchorDataListHolder anchorDataListHolder)
        {
            clientMessage.Add(BeginFrame.Copy());

            ListIntegerCodec.Encode(clientMessage, anchorDataListHolder.AnchorPageList);
            EntryListCodec.Encode(clientMessage, anchorDataListHolder.AnchorDataList, DataCodec.Encode, DataCodec.EncodeNullable);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #2
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Client.DistributedObjectInfo distributedObjectInfo)
        {
            clientMessage.Add(BeginFrame.Copy());

            StringCodec.Encode(clientMessage, distributedObjectInfo.ServiceName);
            StringCodec.Encode(clientMessage, distributedObjectInfo.Name);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #3
0
        public static void Encode <T>(ClientMessage clientMessage, IEnumerable <T> collection, Action <ClientMessage, T> encodeFunction)
        {
            clientMessage.Add(BeginFrame.Copy());

            foreach (var item in collection)
            {
                encodeFunction(clientMessage, item);
            }

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #4
0
        public static void Encode <TKey, TValue>(ClientMessage clientMessage, IDictionary <TKey, TValue> map, Action <ClientMessage, TKey> encodeKey, Action <ClientMessage, TValue> encodeValue)
        {
            clientMessage.Add(BeginFrame.Copy());

            foreach (var kvp in map)
            {
                encodeKey(clientMessage, kvp.Key);
                encodeValue(clientMessage, kvp.Value);
            }

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #5
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Config.BitmapIndexOptions bitmapIndexOptions)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeInt(initialFrame.Content, UniqueKeyTransformationFieldOffset, bitmapIndexOptions.UniqueKeyTransformation);
            clientMessage.Add(initialFrame);

            StringCodec.Encode(clientMessage, bitmapIndexOptions.UniqueKey);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #6
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.IO.Address address)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeInt(initialFrame.Content, PortFieldOffset, address.Port);
            clientMessage.Add(initialFrame);

            StringCodec.Encode(clientMessage, address.Host);

            clientMessage.Add(EndFrame.Copy());
        }
        public static void Encode(ClientMessage clientMessage, ICollection <KeyValuePair <Guid, ICollection <int> > > collection)
        {
            var keyList = new List <Guid>(collection.Count);

            clientMessage.Add(BeginFrame.Copy());
            foreach (var kvp in collection)
            {
                keyList.Add(kvp.Key);
                ListIntegerCodec.Encode(clientMessage, kvp.Value);
            }
            clientMessage.Add(EndFrame.Copy());
            ListUUIDCodec.Encode(clientMessage, keyList);
        }
コード例 #8
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Core.MemberVersion memberVersion)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeByte(initialFrame.Content, MajorFieldOffset, memberVersion.Major);
            EncodeByte(initialFrame.Content, MinorFieldOffset, memberVersion.Minor);
            EncodeByte(initialFrame.Content, PatchFieldOffset, memberVersion.Patch);
            clientMessage.Add(initialFrame);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #9
0
        public static void Encode <TKey, TValue>(ClientMessage clientMessage, IEnumerable <KeyValuePair <TKey, TValue> > collection,
                                                 Action <ClientMessage, TKey> encodeKeyFunc,
                                                 Action <ClientMessage, TValue> encodeValueFunc)
        {
            clientMessage.Add(BeginFrame.Copy());

            foreach (var kvp in collection)
            {
                encodeKeyFunc(clientMessage, kvp.Key);
                encodeValueFunc(clientMessage, kvp.Value);
            }

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #10
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Client.Protocol.ErrorHolder errorHolder)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeInt(initialFrame.Content, ErrorCodeFieldOffset, errorHolder.ErrorCode);
            clientMessage.Add(initialFrame);

            StringCodec.Encode(clientMessage, errorHolder.ClassName);
            CodecUtil.EncodeNullable(clientMessage, errorHolder.Message, StringCodec.Encode);
            ListMultiFrameCodec.Encode(clientMessage, errorHolder.StackTraceElements, StackTraceElementCodec.Encode);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #11
0
        public static void Encode(ClientMessage clientMessage, IEnumerable <KeyValuePair <long, byte[]> > collection)
        {
            var valueList = new List <long>();

            clientMessage.Add(BeginFrame.Copy());

            foreach (var kvp in collection)
            {
                valueList.Add(kvp.Key);
                ByteArrayCodec.Encode(clientMessage, kvp.Value);
            }

            clientMessage.Add(EndFrame);
            ListLongCodec.Encode(clientMessage, valueList);
        }
コード例 #12
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Config.IndexConfig indexConfig)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeInt(initialFrame.Content, TypeFieldOffset, indexConfig.Type);
            clientMessage.Add(initialFrame);

            CodecUtil.EncodeNullable(clientMessage, indexConfig.Name, StringCodec.Encode);
            ListMultiFrameCodec.Encode(clientMessage, indexConfig.Attributes, StringCodec.Encode);
            CodecUtil.EncodeNullable(clientMessage, indexConfig.BitmapIndexOptions, BitmapIndexOptionsCodec.Encode);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #13
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Util.StackTraceElement stackTraceElement)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeInt(initialFrame.Content, LineNumberFieldOffset, stackTraceElement.LineNumber);
            clientMessage.Add(initialFrame);

            StringCodec.Encode(clientMessage, stackTraceElement.ClassName);
            StringCodec.Encode(clientMessage, stackTraceElement.MethodName);
            CodecUtil.EncodeNullable(clientMessage, stackTraceElement.FileName, StringCodec.Encode);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #14
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Core.MemberInfo memberInfo)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeGuid(initialFrame.Content, UuidFieldOffset, memberInfo.Uuid);
            EncodeBool(initialFrame.Content, LiteMemberFieldOffset, memberInfo.IsLiteMember);
            clientMessage.Add(initialFrame);

            AddressCodec.Encode(clientMessage, memberInfo.Address);
            MapCodec.Encode(clientMessage, memberInfo.Attributes, StringCodec.Encode, StringCodec.Encode);
            MemberVersionCodec.Encode(clientMessage, memberInfo.Version);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #15
0
        public static void EncodeContainsNullable <T>(ClientMessage clientMessage, IEnumerable <T> collection, Action <ClientMessage, T> encodeFunction)
        {
            clientMessage.Add(BeginFrame.Copy());

            foreach (var item in collection)
            {
                if (item == null)
                {
                    clientMessage.Add(NullFrame.Copy());
                }
                else
                {
                    encodeFunction(clientMessage, item);
                }
            }

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #16
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Client.Protocol.PagingPredicateHolder pagingPredicateHolder)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeInt(initialFrame.Content, PageSizeFieldOffset, pagingPredicateHolder.PageSize);
            EncodeInt(initialFrame.Content, PageFieldOffset, pagingPredicateHolder.Page);
            EncodeByte(initialFrame.Content, IterationTypeIdFieldOffset, pagingPredicateHolder.IterationTypeId);
            clientMessage.Add(initialFrame);

            AnchorDataListHolderCodec.Encode(clientMessage, pagingPredicateHolder.AnchorDataListHolder);
            CodecUtil.EncodeNullable(clientMessage, pagingPredicateHolder.PredicateData, DataCodec.Encode);
            CodecUtil.EncodeNullable(clientMessage, pagingPredicateHolder.ComparatorData, DataCodec.Encode);
            CodecUtil.EncodeNullable(clientMessage, pagingPredicateHolder.PartitionKeyData, DataCodec.Encode);

            clientMessage.Add(EndFrame.Copy());
        }
コード例 #17
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Map.SimpleEntryView <IData, IData> simpleEntryView)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeLong(initialFrame.Content, CostFieldOffset, simpleEntryView.Cost);
            EncodeLong(initialFrame.Content, CreationTimeFieldOffset, simpleEntryView.CreationTime);
            EncodeLong(initialFrame.Content, ExpirationTimeFieldOffset, simpleEntryView.ExpirationTime);
            EncodeLong(initialFrame.Content, HitsFieldOffset, simpleEntryView.Hits);
            EncodeLong(initialFrame.Content, LastAccessTimeFieldOffset, simpleEntryView.LastAccessTime);
            EncodeLong(initialFrame.Content, LastStoredTimeFieldOffset, simpleEntryView.LastStoredTime);
            EncodeLong(initialFrame.Content, LastUpdateTimeFieldOffset, simpleEntryView.LastUpdateTime);
            EncodeLong(initialFrame.Content, VersionFieldOffset, simpleEntryView.Version);
            EncodeLong(initialFrame.Content, TtlFieldOffset, simpleEntryView.Ttl);
            EncodeLong(initialFrame.Content, MaxIdleFieldOffset, simpleEntryView.MaxIdle);
            clientMessage.Add(initialFrame);

            DataCodec.Encode(clientMessage, simpleEntryView.Key);
            DataCodec.Encode(clientMessage, simpleEntryView.Value);

            clientMessage.Add(EndFrame.Copy());
        }