Package com.basho.riak.client.core

Examples of com.basho.riak.client.core.RiakMessage


    }

    @Override
    protected RiakMessage createChannelMessage()
    {
        return new RiakMessage(RiakMessageCodes.MSG_DtFetchReq, reqBuilder.build().toByteArray());
    }
View Full Code Here


    @Override
    protected RiakMessage createChannelMessage()
    {
        RiakPB.RpbGetBucketReq req = reqBuilder.build();
        return new RiakMessage(RiakMessageCodes.MSG_GetBucketReq, req.toByteArray());
    }
View Full Code Here

    @Override
    protected RiakMessage createChannelMessage()
    {
        RiakSearchPB.RpbSearchQueryReq req = reqBuilder.build();
        return new RiakMessage(RiakMessageCodes.MSG_SearchQueryReq, req.toByteArray());
    }
View Full Code Here

    {
        code = 1;
        data = new byte[SIZE_DATA];
        Arrays.fill(data, (byte)1);
       
        RiakMessage pbMessage = new RiakMessage(code, data);
        RiakMessageCodec codec = new RiakMessageCodec();
       
        mockContext = mock(ChannelHandlerContext.class);
        buffer = Unpooled.buffer();
        Whitebox.invokeMethod(codec, "encode", mockContext, pbMessage, buffer);
View Full Code Here

    public void decode() throws Exception
    {
        RiakMessageCodec codec = new RiakMessageCodec();
        List<Object> outList = new ArrayList<Object>();
        Whitebox.invokeMethod(codec, "decode", mockContext, buffer, outList);
        RiakMessage message = (RiakMessage) outList.get(0);
        assertEquals(code, message.getCode());
        assertArrayEquals(data, message.getData());
       
    }
View Full Code Here

    }
   
    @Test
    public void notifiesListenerOnComplete() throws Exception
    {
        RiakMessage message = PowerMockito.mock(RiakMessage.class);
        doReturn((byte)10).when(message).getCode();
        handler.channelRead(mockContext, message);
       
        verify(mockListener).onSuccess(mockChannel, message);
    }
View Full Code Here

        StoreOperation operation =
            new StoreOperation.Builder(location)
                .withContent(ro)
                .build();

        RiakMessage rm = operation.createChannelMessage();

        assertTrue(rm.getCode() == RiakMessageCodes.MSG_PutReq);
        RiakKvPB.RpbPutReq req = RiakKvPB.RpbPutReq.parseFrom(rm.getData());
        assertTrue(Arrays.equals(req.getContent().getValue().toByteArray(), expectedValue));

    }
View Full Code Here

    }

    @Override
    protected RiakMessage createChannelMessage()
    {
        return new RiakMessage(RiakMessageCodes.MSG_IndexReq, pbReq.toByteArray());
    }
View Full Code Here

    }

    @Override
    protected RiakMessage createChannelMessage()
    {
        return new RiakMessage(RiakMessageCodes.MSG_DtFetchReq, reqBuilder.build().toByteArray());
    }
View Full Code Here

    @Override
    protected RiakMessage createChannelMessage()
    {
        RiakYokozunaPB.RpbYokozunaSchemaPutReq req = reqBuilder.build();
        return new RiakMessage(RiakMessageCodes.MSG_YokozunaSchemaPutReq, req.toByteArray());
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.RiakMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.