Exemplo n.º 1
0
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			//DataType
			writer.Write((byte)dataType);

			//SortBy
			writer.Write((byte)sortBy);
		}
Exemplo n.º 2
0
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			if (ErrorQueues != null)
			{
				writer.Write(true);
				writer.Write(ErrorQueues.Keys.Count);				
				foreach (string key in ErrorQueues.Keys)
				{
					writer.Write(key);
					Dictionary<string, MessageQueue> groupQueue = ErrorQueues[key];
					if (groupQueue != null)
					{
						writer.Write(true);
						writer.Write(groupQueue.Keys.Count);
						if (groupQueue.Keys.Count > 0)
						{
							foreach (string serviceName in groupQueue.Keys)
							{
								writer.Write(serviceName);								
								writer.Write(groupQueue[serviceName],false);
							}
						}
					}
					else
					{
						writer.Write(false);
					}
				}				
			}
			else
			{
				writer.Write(false);
			}
		}
Exemplo n.º 3
0
		public override void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			base.Serialize(writer);
			
			if (data == null)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)data.Length);
				writer.Write(data);
			}
		}
		public override void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			base.Serialize(writer);

			if (sortFields == null || sortFields.Count == 0)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)sortFields.Count);
				foreach (KeyValuePair<string/*Indexname*/, byte[]/*Value*/> kvp in sortFields)
				{
					writer.Write(kvp.Key);
					writer.Write((ushort)kvp.Value.Length);
					writer.Write(kvp.Value);
				}
			}
		}
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			//IndexExists
			writer.Write(indexExists);

			//IndexSize
			writer.Write(indexSize);

			//Metadata
			if (metadata == null || metadata.Length == 0)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)metadata.Length);
				writer.Write(metadata);
			}

			//ResultItemList
			if (resultItemList == null || resultItemList.Count == 0)
			{
				writer.Write(0);
			}
			else
			{
				writer.Write(resultItemList.Count);
				foreach (ResultItem resultItem in resultItemList)
				{
					resultItem.Serialize(writer);
				}
			}

			//ExceptionInfo
			writer.Write(exceptionInfo);

            //VirtualCount
            writer.Write(virtualCount);
		}
Exemplo n.º 6
0
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			writer.Write(indexId.Length);
			writer.Write(indexId);

			SerializeList(writer, cacheDataList);
			SerializeList(writer, cacheDataDeleteList);
		}
Exemplo n.º 7
0
		private static void SerializeList(MySpace.Common.IO.IPrimitiveWriter writer, IList<CacheData> list)
		{			
			int count = 0;
			if (list != null && list.Count > 0)
			{
				count = list.Count;
				writer.Write(count);

				CacheData cacheData;
				for (int i = 0; i < count; i++)
				{
					cacheData = list[i];

					writer.Write(cacheData.Id.Length);
					writer.Write(cacheData.Id);

					if (cacheData.Data == null)
					{
						writer.Write((int)0);
					}
					else
					{
						writer.Write(cacheData.Data.Length);
						writer.Write(cacheData.Data);
					}				
					writer.Write(new SmallDateTime(cacheData.CreateTimestamp).TicksInt32);
					writer.Write(cacheData.CacheTypeId);
				}				
			}
			else
			{
				writer.Write(count);
			}
		}
 private void SerializeList(MySpace.Common.IO.IPrimitiveWriter writer)
 {
     for (int i = 0; i < this.cacheListNodeIds.Length; i++)
     {
         writer.Write(this.cacheListNodeIds[i].Length);
         writer.Write(this.cacheListNodeIds[i]);
     }
 }
 private void SerializeList(MySpace.Common.IO.IPrimitiveWriter writer)
 {
     foreach (CacheListNode node in this.CacheList)
     {
         if (node.NodeId == null || node.NodeId.Length <= 0)
         {
             writer.Write((int)0);
         }
         else
         {
             writer.Write(node.NodeId.Length);
             writer.Write(node.NodeId);
         }
         if (node.Data == null || node.Data.Length <= 0)
         {
             writer.Write((int)0);
         }
         else
         {
             writer.Write(node.Data.Length);
             writer.Write(node.Data);
         }
         writer.Write(node.TimestampTicks);
     }
 }
		public virtual void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			if (indexId == null)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)indexId.Length);
				writer.Write(indexId);
			}
			
			if (id == null)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)id.Length);
				writer.Write(id);
			}

			if (cacheType == null)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)cacheType.Length);
				writer.Write(cacheType);
			}			
		}
Exemplo n.º 11
0
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			if (this.data == null)
			{
				writer.Write((int)0);
			}
			else
			{
				writer.Write(this.data.Length);
				writer.Write(this.data);
			}
		}
Exemplo n.º 12
0
        public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
        {
            //FieldName
            writer.Write(fieldName);

            //IsTag
            writer.Write(isTag);

            //Operation
            writer.Write((byte)operation);

            //Value
            if (value == null || value.Length == 0)
            {
                writer.Write((ushort)0);
            }
            else
            {
                writer.Write((ushort)value.Length);
                writer.Write(value);
            }

            //DataType
            writer.Write((byte)dataType);
        }
 public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
 {
     if (this.cacheListId == null || this.cacheListId.Length <= 0)
     {
         writer.Write((int)0);
     }
     else
     {
         writer.Write(this.cacheListId.Length);
         writer.Write(this.cacheListId);
     }
     writer.Write(this.startIndex);
     writer.Write(this.count);
     if ((this.excludedIds != null) && (this.excludedIds.Length > 0))
     {
         writer.Write(this.excludedIds.Length);
         for (int i = 0; i < this.excludedIds.Length; i++)
         {
             writer.Write(this.excludedIds[i].Length);
             writer.Write(this.excludedIds[i]);
         }
     }
     else
     {
         writer.Write((int)0);
     }
     writer.Write(this.VirtualListCount);
     writer.Write(this.PrimaryId);
 }
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			writer.Write(this.totalCount);
			writer.Write(cacheDataList.Count); // List count

			if (cacheDataList.Count > 0)
			{
				writer.Write(cacheDataList[0].IndexId.Length);
				writer.Write(cacheDataList[0].Id.Length);

				foreach (CacheData cd in cacheDataList)
				{					
					writer.Write(cd.IndexId);
					writer.Write(cd.Id);
					if (cd.Data == null)
					{
						writer.Write((int)0);
					}
					else
					{
						writer.Write(cd.Data.Length);
						writer.Write(cd.Data);
					}					
					writer.Write( new SmallDateTime(cd.CreateTimestamp).TicksInt32);
					writer.Write(cd.CacheTypeId);
				}
			}
		}
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
            if (this.CacheListId == null || this.CacheListId.Length <= 0)
            {
                writer.Write((int)0);
            }
            else
            {
                writer.Write(this.CacheListId.Length);
                writer.Write(this.CacheListId);
            }
            writer.Write(this.StartIndex);
			writer.Write(this.Count);
			writer.Write(this.virtualListCount);
            writer.Write(this.PrimaryId);
		}
Exemplo n.º 16
0
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			lock (_inMessageQueueLock)
			{
				writer.Write(_enabled);
				writer.Write(_maxCount);
				writer.Write(_itemsPerDequeue);
				if (_inMessageQueue != null)
				{
					writer.Write(true);
					writer.Write(_inMessageQueue.Count);
					foreach (SerializedRelayMessage message in _inMessageQueue)
					{
						writer.Write<SerializedRelayMessage>(message, false);
					}
				}
				else
				{
					writer.Write(false);
				}
			}
		}
        public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
        {
            writer.Write(this.ContainsCacheListNode);
            writer.Write(this.ListExists);

            if (this.ListMetadata == null || this.ListMetadata.Length <= 0)
            {
                writer.Write((int)0);
            }
            else
            {
                writer.Write(this.ListMetadata.Length);
                writer.Write(this.ListMetadata);
            }

            writer.Write(this.CacheListTotalCount);
            writer.Write(this.CacheList.Count);

            if (this.CacheList.Count > 0)
            {
                SerializeList(writer);
            }
            writer.Write(this.VirtualListCount);
        }
Exemplo n.º 18
0
		private static void SerializeList(MySpace.Common.IO.IPrimitiveWriter writer, IList<CacheListNode> list)
		{
			int count = 0;
			if (list != null && list.Count > 0)
			{
				count = list.Count;
				writer.Write(count);

				CacheListNode listNode;
				for (int i = 0; i < count; i++)
				{
					listNode = list[i];

                    if (listNode.NodeId == null || listNode.NodeId.Length <= 0)
                        writer.Write((int)0);
                    else
                    {
                        writer.Write(listNode.NodeId.Length);
                        writer.Write(listNode.NodeId);
                    }

					if (listNode.Data == null || listNode.Data.Length <= 0)
					{
						writer.Write((int)0);
					}
					else
					{
						writer.Write(listNode.Data.Length);
						writer.Write(listNode.Data);
					}
					writer.Write(listNode.TimestampTicks);					
				}
			}
			else
			{
				writer.Write(count);
			}
		}
 public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
 {
     if (this.CacheListId == null || this.CacheListId.Length <= 0)
     {
         writer.Write((int)0);
     }
     else
     {
         writer.Write(this.CacheListId.Length);
         writer.Write(this.CacheListId);
     }
     if ((this.cacheListNodeIds != null) && (this.cacheListNodeIds.Length > 0))
     {
         writer.Write(this.cacheListNodeIds.Length);
         SerializeList(writer);
     }
     else
     {
         writer.Write((int)0);
     }
     writer.Write(this.VirtualListCount);
     writer.Write(this.PrimaryId);
 }
Exemplo n.º 20
0
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
            if (this.ListId == null || this.ListId.Length <= 0)
            {
                writer.Write((int)0);
            }
            else
            {
                writer.Write(this.ListId.Length);
                writer.Write(this.ListId);
            }

            writer.Write(this.TTLSeconds);
            writer.Write(this.UpdateListMetadata);

            if (this.ListMetadata == null || this.ListMetadata.Length <= 0)
            {
                writer.Write((int)0);
            }
            else
            {
                writer.Write(this.ListMetadata.Length);
                writer.Write(this.ListMetadata);
            }

			SerializeList(writer, this.addList);
			SerializeList(writer, this.deleteList);

            writer.Write(this.ClearList);
            writer.Write(this.ReplaceList);
            writer.Write(this.VirtualListCount);
            writer.Write(this.PrimaryId);
		}
 public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
 {
     if (this.CacheListId == null || this.CacheListId.Length <= 0)
     {
         writer.Write((int)0);
     }
     else
     {
         writer.Write(this.CacheListId.Length);
         writer.Write(this.CacheListId);
     }
     writer.Write(this.PageSize);
     writer.Write(this.PageNum);
     writer.Write(this.ReversePagedQuery);
     writer.Write(this.VirtualListCount);
     writer.Write(this.PrimaryId);
 }
		public void Serialize(MySpace.Common.IO.IPrimitiveWriter writer)
		{
			writer.Write((byte)cacheDataReferenceType);

			if (indexId == null)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)indexId.Length);
				writer.Write(indexId);
			}

			if (Id == null)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)id.Length);
				writer.Write(id);
			}
			
			if (cacheType == null)
			{
				writer.Write((ushort)0);
			}
			else
			{
				writer.Write((ushort)cacheType.Length);
				writer.Write(cacheType);
			}

			writer.Write(returnAllSortFields);
			writer.Write(preferredIndexName);
			writer.Write(metadataRequested);
		}