public void SetState(string taskId, WriteBehindAsyncProcessor.TaskState state, Hashtable newTable) { if ((_asyncWrites && (_context.DatasourceMgr != null)) && (_context.DatasourceMgr._writeBehindAsyncProcess != null)) { _context.DatasourceMgr._writeBehindAsyncProcess.SetState(taskId, state, newTable); } }
public void SetState(string taskId, WriteBehindAsyncProcessor.TaskState state, Hashtable newTable) { if (_context.DsMgr != null && _context.DsMgr._writeBehindAsyncProcess != null) { _context.DsMgr._writeBehindAsyncProcess.SetState(taskId, state, newTable); } }
public DSWriteBehindOperation(CacheRuntimeContext context, Object key, CacheEntry entry, OpCode opcode, string providerName, long operationDelay, string taskId, string source, WriteBehindAsyncProcessor.TaskState taskState) : base(context, key, entry, opcode, providerName) { this._taskId = taskId; this._state = taskState; this._source = source; this._delayInterval = operationDelay; }
/// <summary> /// Define o estado da tarefa. /// </summary> /// <param name="taskId">Identificador da tarefa.</param> /// <param name="providerName">Nome do provedor.</param> /// <param name="opCode">Código da operação.</param> /// <param name="state">Estado da tarefa.</param> /// <param name="table"></param> public void SetState(string taskId, string providerName, OpCode opCode, WriteBehindAsyncProcessor.TaskState state, Hashtable table) { foreach (WriteThruProviderManager mgr in this.GetWriteThruMgr(providerName, _writerProivder, opCode)) { if (mgr != null) { mgr.SetState(taskId, state, table); } } }
public void Deserialize(CompactReader reader) { base.Deserialize(reader); enqueueTime = reader.ReadDateTime(); operationState = (WriteBehindAsyncProcessor.OperationState)reader.ReadInt32(); _taskId = reader.ReadObject() as string; _source = reader.ReadObject() as string; _delayInterval = reader.ReadInt64(); _state = (WriteBehindAsyncProcessor.TaskState)reader.ReadByte(); }
public void Deserialize(CompactReader reader) { _key = reader.ReadObject(); _entry = reader.ReadObject() as CacheEntry; _opCode = (OpCode)reader.ReadInt32(); _source = reader.ReadString(); _taskId = reader.ReadString(); _state = (WriteBehindAsyncProcessor.TaskState)reader.ReadByte(); _providerName = reader.ReadString(); }
public WriteBehindTask(CacheBase internalCache, WriteThruProviderManager parent, object key, CacheEntry entry, string source, string taskId, string providerName, OpCode opCode, WriteBehindAsyncProcessor.TaskState state) { _internalCache = internalCache; _parent = parent; _key = key; _entry = entry; _opCode = opCode; _source = source; _taskId = taskId; _providerName = providerName; _state = state; }
public BulkWriteBehindTask(CacheBase internalCache, WriteThruProviderManager parent, object[] keys, object[] values, CacheEntry[] entries, string source, string taskId, string providerName, OpCode opCode, WriteBehindAsyncProcessor.TaskState state) { _internalCache = internalCache; _parent = parent; _keys = keys; _values = values; _entries = entries; _opCode = opCode; _taskId = taskId; _providerName = providerName; _source = source; _state = state; }
public void UpdateState(string taskId, WriteBehindAsyncProcessor.TaskState state) { lock (_queue) { for (int i = _queue.Count - 1; i >= 0; i--) { WriteBehindAsyncProcessor.IWriteBehindTask task = _queue[i] as WriteBehindAsyncProcessor.IWriteBehindTask; if (task.TaskId == taskId) { task.State = state; _queue[i] = task; break; } } } }
/// <summary> /// Responsible for updating/inserting an object to the data source. The Key and the /// object are passed as parameter. /// </summary> /// <param name="key"></param> /// <param name="val"></param> /// <returns></returns> public void WriteBehind(CacheBase internalCache, object[] keys, CacheEntry[] entries, string source, string taskId, OpCode operationCode, WriteBehindAsyncProcessor.TaskState state) { if (_context.DsMgr._writeBehindAsyncProcess != null) { for (int i = 0; i < keys.Length; i++) { _context.DsMgr._writeBehindAsyncProcess.Enqueue(new DSWriteBehindOperation(_context, keys[i], entries[i], operationCode, _myProvider, _operationDelay, taskId + "-" + i, source, state)); } } }
/// <summary> /// Responsible for updating/inserting an object to the data source. The Key and the /// object are passed as parameter. /// </summary> /// <param name="key"></param> /// <param name="val"></param> /// <returns></returns> public void WriteBehind(CacheBase internalCache, object key, CacheEntry entry, string source, string taskId, OpCode operationCode, WriteBehindAsyncProcessor.TaskState state) { if (_context.DsMgr._writeBehindAsyncProcess != null) { _context.DsMgr._writeBehindAsyncProcess.Enqueue(new DSWriteBehindOperation(_context, key, entry, operationCode, _myProvider, _operationDelay, taskId, source, state)); } }
public void WriteBehind(CacheBase internalCache, object[] keys, object[] values, CacheEntry[] entries, string source, string taskId, string providerName, OpCode operationCode, WriteBehindAsyncProcessor.TaskState state) { if (_writerProivder != null) { WriteThruProviderManager mgr = null; if (string.IsNullOrEmpty(providerName)) { providerName = this.DefaultWriteThruProvider; } if (_writerProivder.ContainsKey(providerName.ToLower())) { _writerProivder.TryGetValue(providerName.ToLower(), out mgr); if (mgr != null) { mgr.WriteBehind(internalCache, keys, values, entries, source, taskId, operationCode, state); } } } }
public void WriteBehind(CacheBase internalCache, object[] keys, object[] values, CacheEntry[] entries, string source, string taskId, OpCode operationCode, WriteBehindAsyncProcessor.TaskState state) { if (_asyncWrites && (_context.DatasourceMgr._writeBehindAsyncProcess != null)) { _context.DatasourceMgr._writeBehindAsyncProcess.Enqueue(new BulkWriteBehindTask(internalCache, this, keys, values, entries, source, taskId, _myProvider, operationCode, state)); } }