/// <summary> /// Does the out in op with affinity awareness. /// </summary> private Task <T> DoOutInOpAffinityAsync <T>(ClientOp opId, TK key, Func <IBinaryStream, T> readFunc) { return(_ignite.Socket.DoOutInOpAffinityAsync(opId, stream => WriteRequest(w => w.WriteObjectDetached(key), stream), readFunc, _id, key, HandleError <T>)); }
/// <summary> /// Does the out op. /// </summary> private void DoOutOp(ClientOp opId, Action <BinaryWriter> writeAction = null) { DoOutInOp <object>(opId, writeAction, null); }
/// <summary> /// Does the out op. /// </summary> private void DoOutOp(ClientOp opId, Action <ClientRequestContext> writeAction = null) { DoOutInOp <object>(opId, writeAction, null); }
/// <summary> /// Does the out op with affinity awareness. /// </summary> private void DoOutOpAffinity(ClientOp opId, TK key, TV val) { DoOutInOpAffinity <object>(opId, key, val, null); }
/// <summary> /// Performs an async send-receive operation. /// </summary> public Task <T> DoOutInOpAsync <T>(ClientOp opId, Action <ClientRequestContext> writeAction, Func <ClientResponseContext, T> readFunc, Func <ClientStatusCode, string, T> errorFunc = null) { return(GetSocket().DoOutInOpAsync(opId, writeAction, readFunc, errorFunc)); }
/// <summary> /// Does the out in op. /// </summary> private T DoOutInOp <T>(ClientOp opId, Action <ClientRequestContext> writeAction, Func <ClientResponseContext, T> readFunc) { return(_socket.DoOutInOp(opId, writeAction, readFunc)); }
/// <summary> /// Validates specified op code against current protocol version and features. /// </summary> /// <param name="operation">Operation.</param> public void ValidateOp(ClientOp operation) { ValidateOp(operation, true); }
/// <summary> /// Does the out op with partition awareness. /// </summary> private Task DoOutOpAffinityAsync(ClientOp opId, TK key, Action <ClientRequestContext> writeAction = null) { return(DoOutInOpAffinityAsync <object>(opId, key, writeAction, null)); }
/// <summary> /// Writes the message to a byte array. /// </summary> private RequestMessage WriteMessage(Action <ClientRequestContext> writeAction, ClientOp opId) { _features.ValidateOp(opId); var requestId = Interlocked.Increment(ref _requestId); // Potential perf improvements: // * ArrayPool<T> // * Write to socket stream directly (not trivial because of unknown size) var stream = new BinaryHeapStream(256); stream.WriteInt(0); // Reserve message size. stream.WriteShort((short)opId); stream.WriteLong(requestId); if (writeAction != null) { var ctx = new ClientRequestContext(stream, this); writeAction(ctx); ctx.FinishMarshal(); } stream.WriteInt(0, stream.Position - 4); // Write message size. return(new RequestMessage(requestId, stream.GetArray(), stream.Position)); }
/// <summary> /// Does the out in op. /// </summary> protected T DoOutInOp <T>(ClientOp opId, Action <ClientRequestContext> writeAction, Func <ClientResponseContext, T> readFunc) { return(_ignite.Socket.DoOutInOp(opId, writeAction, readFunc, HandleError <T>)); }
/// <summary> /// Validates op code against current protocol version. /// </summary> /// <param name="operation">Operation.</param> /// <param name="protocolVersion">Protocol version.</param> public static void ValidateOp(ClientOp operation, ClientProtocolVersion protocolVersion) { ValidateOp(operation, protocolVersion, operation.GetMinVersion()); }
/// <summary> /// Does the out in op with partition awareness. /// </summary> private Task <T> DoOutInOpAffinityAsync <T>(ClientOp opId, TK key, Action <ClientRequestContext> writeAction, Func <ClientResponseContext, T> readFunc) { return(_ignite.Socket.DoOutInOpAffinityAsync(opId, ctx => WriteRequest(writeAction, ctx), readFunc, _id, key, HandleError <T>)); }
/// <summary> /// Does the out in op. /// </summary> private T DoOutInOp <T>(ClientOp opId, Action <ClientRequestContext> writeAction, Func <ClientResponseContext, T> readFunc) { return(_ignite.Socket.DoOutInOp(opId, ctx => WriteRequest(writeAction, ctx), readFunc, HandleError <T>)); }
/// <summary> /// Does the out op. /// </summary> private Task DoOutOpAsync(ClientOp opId, Action <BinaryWriter> writeAction = null) { return(DoOutInOpAsync <object>(opId, writeAction, null)); }
/// <summary> /// Returns a value indicating whether specified operation is supported. /// </summary> public bool HasOp(ClientOp op) { return(ValidateOp(op, false)); }
/// <summary> /// Does the out in op. /// </summary> private Task <T> DoOutInOpAsync <T>(ClientOp opId, Action <BinaryWriter> writeAction, Func <IBinaryStream, T> readFunc) { return(_ignite.Socket.DoOutInOpAsync(opId, stream => WriteRequest(writeAction, stream), readFunc, HandleError <T>)); }
/** <inheritdoc /> */ public Task <T> DoOutInOpAsync <T>(ClientOp opId, Action <IBinaryStream> writeAction, Func <IBinaryStream, T> readFunc, Func <ClientStatusCode, string, T> errorFunc = null) { return(GetSocket().DoOutInOpAsync(opId, writeAction, readFunc, errorFunc)); }