public static DataAffinity ReadDataAffinity(CompactReader reader) { byte isNull = reader.ReadByte(); if (isNull == 1) { return(null); } DataAffinity newAffinity = new DataAffinity(); newAffinity.Deserialize(reader); return(newAffinity); }
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); } } }
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; }
/// <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; } }
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(); }
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; }
public static DataAffinity ReadDataAffinity(CompactReader reader) { byte isNull = reader.ReadByte(); if (isNull == 1) return null; DataAffinity newAffinity = new DataAffinity(); newAffinity.Deserialize(reader); return newAffinity; }