示例#1
0
        public static DataAffinity ReadDataAffinity(CompactReader reader)
        {
            byte isNull = reader.ReadByte();

            if (isNull == 1)
            {
                return(null);
            }
            DataAffinity newAffinity = new DataAffinity();

            newAffinity.Deserialize(reader);
            return(newAffinity);
        }
示例#2
0
 public void AddDataGroup(DataAffinity affinity, Address node)
 {
     if (affinity == null || node == null)
     {
         return;
     }
     if (affinity.Groups != null)
     {
         foreach (string group in affinity.Groups)
         {
             AddDataGroup(group, node);
         }
     }
 }
示例#3
0
        public static void WriteDataAffinity(CompactWriter writer, DataAffinity dataAffinity)
        {
            byte isNull = 1;

            if (dataAffinity == null)
            {
                writer.Write(isNull);
            }
            else
            {
                isNull = 0;
                writer.Write(isNull);
                dataAffinity.Serialize(writer);
            }
            return;
        }
示例#4
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="info"></param>
 protected NodeInfo(NodeInfo info)
 {
     this._address = info._address == null ? null : info._address.Clone() as Address;
     this._rendererAddress = info._rendererAddress != null ? info._rendererAddress.Clone() as Address : null;
     this._stats = info._stats == null ? null:info._stats.Clone() as CacheStatistics;
     this._status = info._status;
     this._subgroupName = info._subgroupName;
     this._isInproc = info._isInproc;
     this._dataAffinity = info._dataAffinity == null ? null : info._dataAffinity.Clone() as DataAffinity;
     _isStartedAsMirror = info.IsStartedAsMirror;
     if(info._connectedClients != null)
     {
         lock(info._connectedClients.SyncRoot) 
             this._connectedClients = info._connectedClients.Clone() as ArrayList;
     }
 }
示例#5
0
 public void Deserialize(CompactReader reader)
 {
     _address = Address.ReadAddress(reader);
     _subgroupName = reader.ReadObject() as string;
     _stats = CacheStatistics.ReadCacheStatistics(reader);
     _status = new BitSet(reader.ReadByte());
     _dataAffinity = DataAffinity.ReadDataAffinity(reader);
     _connectedClients = (ArrayList)reader.ReadObject();
     _isInproc = reader.ReadBoolean();
     _rendererAddress = Address.ReadAddress(reader);
     _isStartedAsMirror = reader.ReadBoolean();
 }
示例#6
0
 public static void WriteDataAffinity(CompactWriter writer, DataAffinity dataAffinity)
 {
     byte isNull = 1;
     if (dataAffinity == null)
         writer.Write(isNull);
     else
     {
         isNull = 0;
         writer.Write(isNull);
         dataAffinity.Serialize(writer);
     }
     return;
 }
示例#7
0
 public static DataAffinity ReadDataAffinity(CompactReader reader)
 {
     byte isNull = reader.ReadByte();
     if (isNull == 1)
         return null;
     DataAffinity newAffinity = new DataAffinity();
     newAffinity.Deserialize(reader);
     return newAffinity;
 }