Пример #1
0
        public async Task GetMultipleResultViaPbc(IRiakEndPointContext riakEndPointContext, Func <RiakPbcSocket, Task> useFun)
        {
            if (_disposing)
            {
                throw new RiakException((uint)ResultCode.ShuttingDown, "System currently shutting down", true);
            }

            if (riakEndPointContext.Node == null)
            {
                riakEndPointContext.Node = _loadBalancer.SelectNode();

                if (riakEndPointContext.Node == null)
                {
                    throw new RiakException((uint)ResultCode.ClusterOffline, "Unable to access functioning Riak node", true);
                }
            }

            if (riakEndPointContext.Socket == null)
            {
                riakEndPointContext.Socket = await riakEndPointContext.Node.CreateSocket();
            }

            try
            {
                await riakEndPointContext.Node.GetMultipleResultViaPbc(riakEndPointContext.Socket, useFun).ConfigureAwait(false);
            }
            catch (RiakException riakException)
            {
                if (riakException.NodeOffline)
                {
                    DeactivateNode(riakEndPointContext.Node);
                }
                throw;
            }
        }
Пример #2
0
        public async Task GetSingleResultViaPbc(IRiakEndPointContext riakEndPointContext, Func <RiakPbcSocket, Task> useFun)
        {
            if (_disposing)
            {
                throw new RiakException((uint)ResultCode.ShuttingDown, "System currently shutting down", true);
            }

            if (riakEndPointContext.Node == null)
            {
                riakEndPointContext.Node = _node;
            }

            if (riakEndPointContext.Socket == null)
            {
                riakEndPointContext.Socket = await riakEndPointContext.Node.CreateSocket();
            }

            await riakEndPointContext.Node.GetSingleResultViaPbc(riakEndPointContext.Socket, useFun).ConfigureAwait(false);
        }
Пример #3
0
 public async Task <TResult> GetSingleResultViaPbc <TResult>(IRiakEndPointContext riakEndPointContext, Func <RiakPbcSocket, Task <TResult> > useFun)
 {
     return(await _endPoint.GetSingleResultViaPbc(riakEndPointContext, useFun).ConfigureAwait(false));
 }
Пример #4
0
 public async Task GetMultipleResultViaPbc(IRiakEndPointContext riakEndPointContext, Func <RiakPbcSocket, Task> useFun)
 {
     await _endPoint.GetMultipleResultViaPbc(riakEndPointContext, useFun).ConfigureAwait(false);
 }
Пример #5
0
 public RiakBatch(IRiakEndPoint endPoint)
 {
     _endPoint        = endPoint;
     _endPointContext = new RiakEndPointContext();
 }