/// <summary> /// Initializes a new instance of the <see cref="InteropDotNetPortableConfiguration"/> class. /// </summary> /// <param name="reader">The reader.</param> public InteropDotNetPortableConfiguration(IPortableReader reader) { IPortableRawReader rawReader = reader.RawReader(); TypeConfigurations = rawReader.ReadGenericCollection <InteropDotNetPortableTypeConfiguration>(); Types = rawReader.ReadGenericCollection <string>(); DefaultNameMapper = rawReader.ReadString(); DefaultIdMapper = rawReader.ReadString(); DefaultSerializer = rawReader.ReadString(); DefaultMetadataEnabled = rawReader.ReadBoolean(); DefaultKeepDeserialized = rawReader.ReadBoolean(); }
/// <summary> /// Initializes a new instance of the <see cref="ClusterNodeImpl"/> class. /// </summary> /// <param name="reader">The reader.</param> public ClusterNodeImpl(IPortableRawReader reader) { _id = reader.ReadGuid() ?? default(Guid); _attrs = reader.ReadGenericDictionary <string, object>().AsReadOnly(); _addrs = reader.ReadGenericCollection <string>().AsReadOnly(); _hosts = reader.ReadGenericCollection <string>().AsReadOnly(); _order = reader.ReadLong(); _local = reader.ReadBoolean(); _daemon = reader.ReadBoolean(); _metrics = reader.ReadBoolean() ? new ClusterMetricsImpl(reader) : null; }
/// <summary> /// Constructor. /// </summary> /// <param name="r">The reader to read data from.</param> internal TaskEvent(IPortableRawReader r) : base(r) { _taskName = r.ReadString(); _taskClassName = r.ReadString(); _taskSessionId = IgniteGuid.ReadPortable(r); _internal = r.ReadBoolean(); _subjectId = r.ReadGuid() ?? Guid.Empty; }
/// <summary> /// Constructor. /// </summary> /// <param name="r">The reader to read data from.</param> internal TaskEvent(IPortableRawReader r) : base(r) { _taskName = r.ReadString(); _taskClassName = r.ReadString(); _taskSessionId = IgniteGuid.ReadPortable(r); _internal = r.ReadBoolean(); _subjectId = r.ReadGuid() ?? Guid.Empty; }
/// <summary> /// Constructor. /// </summary> /// <param name="r">The reader to read data from.</param> internal CacheEvent(IPortableRawReader r) : base(r) { _cacheName = r.ReadString(); _partition = r.ReadInt(); _isNear = r.ReadBoolean(); _eventNode = ReadNode(r); _key = r.ReadObject <object>(); _xid = IgniteGuid.ReadPortable(r); _lockId = r.ReadObject <object>(); _newValue = r.ReadObject <object>(); _oldValue = r.ReadObject <object>(); _hasOldValue = r.ReadBoolean(); _hasNewValue = r.ReadBoolean(); _subjectId = r.ReadGuid() ?? Guid.Empty; _closureClassName = r.ReadString(); _taskName = r.ReadString(); }
/// <summary> /// Initializes a new instance of the <see cref="ServiceContext"/> class. /// </summary> /// <param name="reader">The reader.</param> public ServiceContext(IPortableRawReader reader) { Debug.Assert(reader != null); Name = reader.ReadString(); ExecutionId = reader.ReadGuid() ?? Guid.Empty; IsCancelled = reader.ReadBoolean(); CacheName = reader.ReadString(); AffinityKey = reader.ReadObject <object>(); }
/// <summary> /// Initializes a new instance of the <see cref="ServiceContext"/> class. /// </summary> /// <param name="reader">The reader.</param> public ServiceContext(IPortableRawReader reader) { Debug.Assert(reader != null); Name = reader.ReadString(); ExecutionId = reader.ReadGuid() ?? Guid.Empty; IsCancelled = reader.ReadBoolean(); CacheName = reader.ReadString(); AffinityKey = reader.ReadObject<object>(); }
/// <summary> /// Initializes a new instance of the <see cref="CacheMetricsImpl"/> class. /// </summary> /// <param name="reader">The reader.</param> public CacheMetricsImpl(IPortableRawReader reader) { CacheGets = reader.ReadLong(); CachePuts = reader.ReadLong(); CacheHits = reader.ReadLong(); CacheMisses = reader.ReadLong(); CacheTxCommits = reader.ReadLong(); CacheTxRollbacks = reader.ReadLong(); CacheEvictions = reader.ReadLong(); CacheRemovals = reader.ReadLong(); AveragePutTime = reader.ReadFloat(); AverageGetTime = reader.ReadFloat(); AverageRemoveTime = reader.ReadFloat(); AverageTxCommitTime = reader.ReadFloat(); AverageTxRollbackTime = reader.ReadFloat(); CacheName = reader.ReadString(); OverflowSize = reader.ReadLong(); OffHeapEntriesCount = reader.ReadLong(); OffHeapAllocatedSize = reader.ReadLong(); Size = reader.ReadInt(); KeySize = reader.ReadInt(); IsEmpty = reader.ReadBoolean(); DhtEvictQueueCurrentSize = reader.ReadInt(); TxThreadMapSize = reader.ReadInt(); TxXidMapSize = reader.ReadInt(); TxCommitQueueSize = reader.ReadInt(); TxPrepareQueueSize = reader.ReadInt(); TxStartVersionCountsSize = reader.ReadInt(); TxCommittedVersionsSize = reader.ReadInt(); TxRolledbackVersionsSize = reader.ReadInt(); TxDhtThreadMapSize = reader.ReadInt(); TxDhtXidMapSize = reader.ReadInt(); TxDhtCommitQueueSize = reader.ReadInt(); TxDhtPrepareQueueSize = reader.ReadInt(); TxDhtStartVersionCountsSize = reader.ReadInt(); TxDhtCommittedVersionsSize = reader.ReadInt(); TxDhtRolledbackVersionsSize = reader.ReadInt(); IsWriteBehindEnabled = reader.ReadBoolean(); WriteBehindFlushSize = reader.ReadInt(); WriteBehindFlushThreadCount = reader.ReadInt(); WriteBehindFlushFrequency = reader.ReadLong(); WriteBehindStoreBatchSize = reader.ReadInt(); WriteBehindTotalCriticalOverflowCount = reader.ReadInt(); WriteBehindCriticalOverflowCount = reader.ReadInt(); WriteBehindErrorRetryCount = reader.ReadInt(); WriteBehindBufferSize = reader.ReadInt(); KeyType = reader.ReadString(); ValueType = reader.ReadString(); IsStoreByValue = reader.ReadBoolean(); IsStatisticsEnabled = reader.ReadBoolean(); IsManagementEnabled = reader.ReadBoolean(); IsReadThrough = reader.ReadBoolean(); IsWriteThrough = reader.ReadBoolean(); CacheHitPercentage = reader.ReadFloat(); CacheMissPercentage = reader.ReadFloat(); }
/// <summary> /// Initializes a new instance of the <see cref="CacheMetricsImpl"/> class. /// </summary> /// <param name="reader">The reader.</param> public CacheMetricsImpl(IPortableRawReader reader) { CacheGets = reader.ReadLong(); CachePuts = reader.ReadLong(); CacheHits = reader.ReadLong(); CacheMisses = reader.ReadLong(); CacheTxCommits = reader.ReadLong(); CacheTxRollbacks = reader.ReadLong(); CacheEvictions = reader.ReadLong(); CacheRemovals = reader.ReadLong(); AveragePutTime = reader.ReadFloat(); AverageGetTime = reader.ReadFloat(); AverageRemoveTime = reader.ReadFloat(); AverageTxCommitTime = reader.ReadFloat(); AverageTxRollbackTime = reader.ReadFloat(); CacheName = reader.ReadString(); OverflowSize = reader.ReadLong(); OffHeapEntriesCount = reader.ReadLong(); OffHeapAllocatedSize = reader.ReadLong(); Size = reader.ReadInt(); KeySize = reader.ReadInt(); IsEmpty = reader.ReadBoolean(); DhtEvictQueueCurrentSize = reader.ReadInt(); TxThreadMapSize = reader.ReadInt(); TxXidMapSize = reader.ReadInt(); TxCommitQueueSize = reader.ReadInt(); TxPrepareQueueSize = reader.ReadInt(); TxStartVersionCountsSize = reader.ReadInt(); TxCommittedVersionsSize = reader.ReadInt(); TxRolledbackVersionsSize = reader.ReadInt(); TxDhtThreadMapSize = reader.ReadInt(); TxDhtXidMapSize = reader.ReadInt(); TxDhtCommitQueueSize = reader.ReadInt(); TxDhtPrepareQueueSize = reader.ReadInt(); TxDhtStartVersionCountsSize = reader.ReadInt(); TxDhtCommittedVersionsSize = reader.ReadInt(); TxDhtRolledbackVersionsSize = reader.ReadInt(); IsWriteBehindEnabled = reader.ReadBoolean(); WriteBehindFlushSize = reader.ReadInt(); WriteBehindFlushThreadCount = reader.ReadInt(); WriteBehindFlushFrequency = reader.ReadLong(); WriteBehindStoreBatchSize = reader.ReadInt(); WriteBehindTotalCriticalOverflowCount = reader.ReadInt(); WriteBehindCriticalOverflowCount = reader.ReadInt(); WriteBehindErrorRetryCount = reader.ReadInt(); WriteBehindBufferSize = reader.ReadInt(); KeyType = reader.ReadString(); ValueType = reader.ReadString(); IsStoreByValue = reader.ReadBoolean(); IsStatisticsEnabled = reader.ReadBoolean(); IsManagementEnabled = reader.ReadBoolean(); IsReadThrough = reader.ReadBoolean(); IsWriteThrough = reader.ReadBoolean(); CacheHitPercentage = reader.ReadFloat(); CacheMissPercentage = reader.ReadFloat(); }
/// <summary> /// Refresh cluster node metrics. /// </summary> /// <param name="nodeId">Node</param> /// <param name="lastUpdateTime"></param> /// <returns></returns> internal ClusterMetricsImpl RefreshClusterNodeMetrics(Guid nodeId, long lastUpdateTime) { return(DoOutInOp(OpNodeMetrics, writer => { writer.WriteGuid(nodeId); writer.WriteLong(lastUpdateTime); }, stream => { IPortableRawReader reader = Marshaller.StartUnmarshal(stream, false); return reader.ReadBoolean() ? new ClusterMetricsImpl(reader) : null; } )); }
/// <summary> /// Constructor. /// </summary> /// <param name="r">The reader to read data from.</param> internal CacheEvent(IPortableRawReader r) : base(r) { _cacheName = r.ReadString(); _partition = r.ReadInt(); _isNear = r.ReadBoolean(); _eventNode = ReadNode(r); _key = r.ReadObject<object>(); _xid = IgniteGuid.ReadPortable(r); _lockId = r.ReadObject<object>(); _newValue = r.ReadObject<object>(); _oldValue = r.ReadObject<object>(); _hasOldValue = r.ReadBoolean(); _hasNewValue = r.ReadBoolean(); _subjectId = r.ReadGuid() ?? Guid.Empty; _closureClassName = r.ReadString(); _taskName = r.ReadString(); }
/** <inheritDoc /> */ public IClusterMetrics Metrics() { if (_pred == null) { return(DoInOp(OpMetrics, stream => { IPortableRawReader reader = Marshaller.StartUnmarshal(stream, false); return reader.ReadBoolean() ? new ClusterMetricsImpl(reader) : null; })); } return(DoOutInOp(OpMetricsFiltered, writer => { WriteEnumerable(writer, Nodes().Select(node => node.Id)); }, stream => { IPortableRawReader reader = Marshaller.StartUnmarshal(stream, false); return reader.ReadBoolean() ? new ClusterMetricsImpl(reader) : null; })); }
/// <summary> /// Invokes a store operation. /// </summary> /// <param name="input">Input stream.</param> /// <param name="cb">Callback.</param> /// <param name="grid">Grid.</param> /// <returns>Invocation result.</returns> /// <exception cref="IgniteException">Invalid operation type: + opType</exception> public int Invoke(IPortableStream input, IUnmanagedTarget cb, Ignite grid) { IPortableReader reader = grid.Marshaller.StartUnmarshal(input, _convertPortable ? PortableMode.Deserialize : PortableMode.ForcePortable); IPortableRawReader rawReader = reader.RawReader(); int opType = rawReader.ReadByte(); // Setup cache sessoin for this invocation. long sesId = rawReader.ReadLong(); CacheStoreSession ses = grid.HandleRegistry.Get <CacheStoreSession>(sesId, true); ses.CacheName = rawReader.ReadString(); _sesProxy.SetSession(ses); try { // Perform operation. switch (opType) { case OpLoadCache: _store.LoadCache((k, v) => WriteObjects(cb, grid, k, v), rawReader.ReadObjectArray <object>()); break; case OpLoad: object val = _store.Load(rawReader.ReadObject <object>()); if (val != null) { WriteObjects(cb, grid, val); } break; case OpLoadAll: var keys = rawReader.ReadCollection(); var result = _store.LoadAll(keys); foreach (DictionaryEntry entry in result) { WriteObjects(cb, grid, entry.Key, entry.Value); } break; case OpPut: _store.Write(rawReader.ReadObject <object>(), rawReader.ReadObject <object>()); break; case OpPutAll: _store.WriteAll(rawReader.ReadDictionary()); break; case OpRmv: _store.Delete(rawReader.ReadObject <object>()); break; case OpRmvAll: _store.DeleteAll(rawReader.ReadCollection()); break; case OpSesEnd: grid.HandleRegistry.Release(sesId); _store.SessionEnd(rawReader.ReadBoolean()); break; default: throw new IgniteException("Invalid operation type: " + opType); } return(0); } finally { _sesProxy.ClearSession(); } }