use of com.yahoo.documentapi.messagebus.protocol.GetDocumentMessage in project vespa by vespa-engine.
the class GetSearcher method sendDocumentGetMessages.
private void sendDocumentGetMessages(List<String> documentIds, String fieldSet, SingleSender sender) {
for (String docIdStr : documentIds) {
DocumentId docId = new DocumentId(docIdStr);
GetDocumentMessage getMsg = new GetDocumentMessage(docId, fieldSet);
sender.send(getMsg);
if (log.isLoggable(LogLevel.DEBUG)) {
log.log(LogLevel.DEBUG, "Sent GetDocumentMessage for " + docId.toString());
}
}
}
use of com.yahoo.documentapi.messagebus.protocol.GetDocumentMessage in project vespa by vespa-engine.
the class MessageBusSyncSession method get.
@Override
public Document get(DocumentId id, String fieldSet, DocumentProtocol.Priority pri, Duration timeout) {
GetDocumentMessage msg = new GetDocumentMessage(id, fieldSet);
msg.setPriority(pri);
Reply reply = syncSend(msg, timeout != null ? timeout : defaultTimeout);
if (reply.hasErrors()) {
throw new DocumentAccessException(MessageBusAsyncSession.getErrorMessage(reply));
}
if (reply.getType() != DocumentProtocol.REPLY_GETDOCUMENT) {
throw new DocumentAccessException("Received unknown response: " + reply);
}
GetDocumentReply docReply = ((GetDocumentReply) reply);
Document doc = docReply.getDocument();
if (doc != null) {
doc.setLastModified(docReply.getLastModified());
}
return doc;
}
use of com.yahoo.documentapi.messagebus.protocol.GetDocumentMessage in project vespa by vespa-engine.
the class VisitorDataQueueTest method unknown_message_throws_unsupported_operation_exception.
@Test(expected = UnsupportedOperationException.class)
public void unknown_message_throws_unsupported_operation_exception() {
final VisitorDataQueue queue = new VisitorDataQueue();
queue.onMessage(new GetDocumentMessage(new DocumentId("id:foo:testdoc::bar")), createDummyAckToken());
}
Aggregations