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);
}
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();
}
Aggregations