Search in sources :

Example 1 with StatBucketReply

use of com.yahoo.documentapi.messagebus.protocol.StatBucketReply in project vespa by vespa-engine.

the class BucketStatsRetrieverTest method testRetrieveBucketStats.

@Test
public void testRetrieveBucketStats() throws BucketStatsException {
    String docId = "id:ns:type::another";
    String bucketInfo = "I like turtles!";
    BucketId bucketId = bucketIdFactory.getBucketId(new DocumentId(docId));
    StatBucketReply reply = new StatBucketReply();
    reply.setResults(bucketInfo);
    when(mockedSession.syncSend(any())).thenReturn(reply);
    String result = createRetriever().retrieveBucketStats(ClientParameters.SelectionType.DOCUMENT, docId, bucketId, bucketSpace);
    verify(mockedSession, times(1)).syncSend(any());
    assertEquals(bucketInfo, result);
}
Also used : StatBucketReply(com.yahoo.documentapi.messagebus.protocol.StatBucketReply) DocumentId(com.yahoo.document.DocumentId) BucketId(com.yahoo.document.BucketId) Test(org.junit.Test)

Example 2 with StatBucketReply

use of com.yahoo.documentapi.messagebus.protocol.StatBucketReply in project vespa by vespa-engine.

the class BucketStatsRetriever method retrieveBucketStats.

public String retrieveBucketStats(ClientParameters.SelectionType type, String id, BucketId bucketId, String bucketSpace) throws BucketStatsException {
    String documentSelection = createDocumentSelection(type, id);
    StatBucketMessage msg = new StatBucketMessage(bucketId, bucketSpace, documentSelection);
    StatBucketReply statBucketReply = sendMessage(msg, StatBucketReply.class);
    return statBucketReply.getResults();
}
Also used : StatBucketReply(com.yahoo.documentapi.messagebus.protocol.StatBucketReply) StatBucketMessage(com.yahoo.documentapi.messagebus.protocol.StatBucketMessage)

Aggregations

StatBucketReply (com.yahoo.documentapi.messagebus.protocol.StatBucketReply)2 BucketId (com.yahoo.document.BucketId)1 DocumentId (com.yahoo.document.DocumentId)1 StatBucketMessage (com.yahoo.documentapi.messagebus.protocol.StatBucketMessage)1 Test (org.junit.Test)1