//PROTOBUF public override void ExecuteCommand(ClientManager clientManager, Alachisoft.NCache.Common.Protobuf.Command command) { CommandInfo cmdInfo; try { cmdInfo = ParseCommand(command, clientManager); } catch (Exception exc) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID)); return; } //TODO try { NCache nCache = clientManager.CmdExecuter as NCache; ClusteredList <ReaderResultSet> resultSetList = null; Alachisoft.NCache.Caching.OperationContext operationContext = new Alachisoft.NCache.Caching.OperationContext(Alachisoft.NCache.Caching.OperationContextFieldName.OperationType, Alachisoft.NCache.Caching.OperationContextOperationType.CacheOperation); operationContext.Add(OperationContextFieldName.ClientLastViewId, cmdInfo.ClientLastViewId); //client id operationContext.Add(OperationContextFieldName.ClientId, clientManager.ClientID); resultSetList = nCache.Cache.ExecuteReader(cmdInfo.Query, cmdInfo.Values, cmdInfo.GetData, cmdInfo.ChunkSize, false, operationContext); ReaderResponseBuilder.Cache = nCache.Cache; ReaderResponseBuilder.BuildExecuteReaderResponse(resultSetList, cmdInfo.RequestId, _serializedResponsePackets); } catch (Exception exc) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID)); } }
public override void ExecuteCommand(ClientManager clientManager, Alachisoft.NCache.Common.Protobuf.Command command) { CommandInfo cmdInfo; try { cmdInfo = ParseCommand(command, clientManager); } catch (Exception exc) { if (!base.immatureId.Equals("-2")) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID)); } return; } try { NCache nCache = clientManager.CmdExecuter as NCache; ReaderResultSet reader = nCache.Cache.GetReaderChunk(cmdInfo.ReaderId, cmdInfo.nextIndex, false, cmdInfo.OperationContext); ReaderResponseBuilder.BuildReaderChunkResponse(reader, cmdInfo.RequestId, _serializedResponsePackets); } catch (Exception exc) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID)); } }
public override void ExecuteCommand(ClientManager clientManager, Common.Protobuf.Command command) { CommandInfo cmdInfo; int overload; string exception = null; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); try { overload = command.MethodOverload; cmdInfo = ParseCommand(command, clientManager); } catch (Exception exc) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID, command.commandID)); return; } int resultCount = 0; try { NCache cache = clientManager.CmdExecuter as NCache; List <ReaderResultSet> resultSetList = null; QueryDataFilters datafilters = new QueryDataFilters(cmdInfo.addDF, cmdInfo.updateDF, cmdInfo.removeDF); Alachisoft.NCache.Caching.OperationContext operationContext = new Caching.OperationContext(Alachisoft.NCache.Caching.OperationContextFieldName.OperationType, Alachisoft.NCache.Caching.OperationContextOperationType.CacheOperation); operationContext.Add(Caching.OperationContextFieldName.ClientId, clientManager.ClientID); operationContext.Add(Caching.OperationContextFieldName.ClientLastViewId, cmdInfo.ClientLastViewId); resultSetList = cache.Cache.ExecuteReaderCQ(cmdInfo.Query, cmdInfo.Values, cmdInfo.getData, cmdInfo.chunkSize, cmdInfo.clientUniqueId, clientManager.ClientID, cmdInfo.notifyAdd, cmdInfo.notifyUpdate, cmdInfo.notifyRemove, operationContext, datafilters); stopWatch.Stop(); ReaderResponseBuilder.Cache = cache.Cache; ReaderResponseBuilder.BuildExecuteReaderCQResponse(resultSetList, cmdInfo.CommandVersion, cmdInfo.RequestId, _serializedResponsePackets, command.commandID, clientManager.ClientVersion < 4620, out resultCount); } catch (Exception exc) { //PROTOBUF:RESPONSE exception = exc.ToString(); _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID, command.commandID)); } finally { TimeSpan executionTime = stopWatch.Elapsed; try { if (Alachisoft.NCache.Management.APILogging.APILogManager.APILogManger != null && Alachisoft.NCache.Management.APILogging.APILogManager.EnableLogging) { APILogItemBuilder log = new APILogItemBuilder(MethodsName.ExecuteReaderCQ.ToLower()); log.GenerateExecuteReaderCQAPILogItem(cmdInfo.Query, cmdInfo.Values, cmdInfo.getData, cmdInfo.chunkSize, overload, exception, executionTime, clientManager.ClientID.ToLower(), clientManager.ClientSocketId.ToString(), resultCount); } } catch { } } }
public override void ExecuteCommand(ClientManager clientManager, Alachisoft.NCache.Common.Protobuf.Command command) { CommandInfo cmdInfo; int overload; int count = 0; string exception = null; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); try { overload = 1; cmdInfo = ParseCommand(command, clientManager); } catch (Exception exc) { if (!base.immatureId.Equals("-2")) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID, command.commandID)); } return; } try { NCache nCache = clientManager.CmdExecuter as NCache; ReaderResultSet reader = nCache.Cache.GetReaderChunk(cmdInfo.ReaderId, cmdInfo.nextIndex, false, cmdInfo.OperationContext); stopWatch.Stop(); ReaderResponseBuilder.BuildReaderChunkResponse(reader, cmdInfo.RequestId, _serializedResponsePackets, command.commandID, clientManager.ClientVersion < 4620, out count); } catch (Exception exc) { exception = exc.ToString(); _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID, command.commandID)); } finally { TimeSpan executionTime = stopWatch.Elapsed; try { if (Alachisoft.NCache.Management.APILogging.APILogManager.APILogManger != null && Alachisoft.NCache.Management.APILogging.APILogManager.EnableLogging) { APILogItemBuilder log = new APILogItemBuilder(MethodsName.GetReaderChunkCommand.ToLower()); log.GenerateGetReaderChunkCommand(cmdInfo.ReaderId, count, overload, exception, executionTime, clientManager.ClientID, clientManager.ClientSocketId.ToString()); } } catch { } } }
public override void ExecuteCommand(ClientManager clientManager, Alachisoft.NCache.Common.Protobuf.Command command) { int overload; string exception = null; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); try { overload = command.MethodOverload; cmdInfo = ParseCommand(command, clientManager); } catch (Exception exc) { //PROTOBUF:RESPONSE _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID, command.commandID)); return; } int resultCount = 0; try { NCache nCache = clientManager.CmdExecuter as NCache; ClusteredList <ReaderResultSet> resultSetList = null; Alachisoft.NCache.Caching.OperationContext operationContext = new Alachisoft.NCache.Caching.OperationContext(Alachisoft.NCache.Caching.OperationContextFieldName.OperationType, Alachisoft.NCache.Caching.OperationContextOperationType.CacheOperation); operationContext.Add(OperationContextFieldName.ClientLastViewId, cmdInfo.ClientLastViewId); //client id operationContext.Add(OperationContextFieldName.ClientId, clientManager.ClientID); operationContext.Add(OperationContextFieldName.ClientOperationTimeout, clientManager.RequestTimeout); operationContext.CancellationToken = CancellationToken; resultSetList = nCache.Cache.ExecuteReader(cmdInfo.Query, cmdInfo.Values, cmdInfo.GetData, cmdInfo.ChunkSize, false, operationContext); stopWatch.Stop(); ReaderResponseBuilder.Cache = nCache.Cache; ReaderResponseBuilder.BuildExecuteReaderResponse(resultSetList, cmdInfo.CommandVersion, cmdInfo.RequestId, _serializedResponsePackets, command.commandID, clientManager.ClientVersion < 4620, out resultCount); } catch (OperationCanceledException ex) { exception = ex.ToString(); Dispose(); } catch (Exception exc) { //PROTOBUF:RESPONSE exception = exc.ToString(); _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponse(exc, command.requestID, command.commandID)); } finally { TimeSpan executionTime = stopWatch.Elapsed; try { if (Alachisoft.NCache.Management.APILogging.APILogManager.APILogManger != null && Alachisoft.NCache.Management.APILogging.APILogManager.EnableLogging) { APILogItemBuilder log = new APILogItemBuilder(MethodsName.ExecuteReader.ToLower()); log.GenerateExecuteReaderAPILogItem(cmdInfo.Query, cmdInfo.Values, cmdInfo.GetData, cmdInfo.ChunkSize, overload, exception, executionTime, clientManager.ClientID.ToLower(), clientManager.ClientSocketId.ToString(), resultCount); } } catch { } } }