diff options
12 files changed, 0 insertions, 442 deletions
diff --git a/docproc/src/main/java/com/yahoo/docproc/jdisc/messagebus/MbusRequestContext.java b/docproc/src/main/java/com/yahoo/docproc/jdisc/messagebus/MbusRequestContext.java index 0f3f3938701..187557791f3 100644 --- a/docproc/src/main/java/com/yahoo/docproc/jdisc/messagebus/MbusRequestContext.java +++ b/docproc/src/main/java/com/yahoo/docproc/jdisc/messagebus/MbusRequestContext.java @@ -168,7 +168,6 @@ public class MbusRequestContext implements RequestContext, ResponseHandler { case DocumentProtocol.MESSAGE_PUTDOCUMENT: case DocumentProtocol.MESSAGE_UPDATEDOCUMENT: case DocumentProtocol.MESSAGE_REMOVEDOCUMENT: - case DocumentProtocol.MESSAGE_BATCHDOCUMENTUPDATE: return true; } return false; diff --git a/docproc/src/main/java/com/yahoo/docproc/jdisc/messagebus/ProcessingFactory.java b/docproc/src/main/java/com/yahoo/docproc/jdisc/messagebus/ProcessingFactory.java index 044f86e93e6..49a6020d633 100644 --- a/docproc/src/main/java/com/yahoo/docproc/jdisc/messagebus/ProcessingFactory.java +++ b/docproc/src/main/java/com/yahoo/docproc/jdisc/messagebus/ProcessingFactory.java @@ -15,7 +15,6 @@ import com.yahoo.document.DocumentOperation; import com.yahoo.document.DocumentPut; import com.yahoo.document.DocumentRemove; import com.yahoo.document.DocumentUpdate; -import com.yahoo.documentapi.messagebus.protocol.BatchDocumentUpdateMessage; import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol; import com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage; import com.yahoo.documentapi.messagebus.protocol.RemoveDocumentMessage; @@ -67,12 +66,6 @@ class ProcessingFactory { processings.add(createProcessing(removeOperation, message)); break; } - case DocumentProtocol.MESSAGE_BATCHDOCUMENTUPDATE: { - for (DocumentUpdate update : ((BatchDocumentUpdateMessage) message).getUpdates()) { - processings.add(createProcessing(update, message)); - } - break; - } } return processings; } diff --git a/docproc/src/test/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerAllMessageTypesTestCase.java b/docproc/src/test/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerAllMessageTypesTestCase.java index 387436be546..e0ca630889d 100644 --- a/docproc/src/test/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerAllMessageTypesTestCase.java +++ b/docproc/src/test/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerAllMessageTypesTestCase.java @@ -10,7 +10,6 @@ import com.yahoo.document.datatypes.FieldValue; import com.yahoo.document.datatypes.IntegerFieldValue; import com.yahoo.document.datatypes.StringFieldValue; import com.yahoo.document.update.FieldUpdate; -import com.yahoo.documentapi.messagebus.protocol.BatchDocumentUpdateMessage; import com.yahoo.documentapi.messagebus.protocol.GetDocumentMessage; import com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage; import com.yahoo.documentapi.messagebus.protocol.RemoveDocumentMessage; @@ -52,7 +51,6 @@ public class DocumentProcessingHandlerAllMessageTypesTestCase extends DocumentPr put(); remove(); update(); - batchDocumentUpdate(); } private void get() throws InterruptedException { @@ -129,33 +127,6 @@ public class DocumentProcessingHandlerAllMessageTypesTestCase extends DocumentPr assertFalse(reply.hasErrors()); } - private void batchDocumentUpdate() throws InterruptedException { - DocumentUpdate doc1 = new DocumentUpdate(getType(), new DocumentId("userdoc:test:12345:multi:1")); - DocumentUpdate doc2 = new DocumentUpdate(getType(), new DocumentId("userdoc:test:12345:multi:2")); - - Field testField = getType().getField("blahblah"); - doc1.addFieldUpdate(FieldUpdate.createAssign(testField, new StringFieldValue("1 not yet processed"))); - doc2.addFieldUpdate(FieldUpdate.createAssign(testField, new StringFieldValue("2 not yet processed"))); - - BatchDocumentUpdateMessage message = new BatchDocumentUpdateMessage(12345); - message.addUpdate(doc1); - message.addUpdate(doc2); - - assertTrue(sendMessage(FOOBAR, message)); - - Message remote1 = remoteServer.awaitMessage(60, TimeUnit.SECONDS); - assertTrue(remote1 instanceof UpdateDocumentMessage); - remoteServer.ackMessage(remote1); - assertNull(driver.client().awaitReply(100, TimeUnit.MILLISECONDS)); - - Message remote2 = remoteServer.awaitMessage(60, TimeUnit.SECONDS); - assertTrue(remote2 instanceof UpdateDocumentMessage); - remoteServer.ackMessage(remote2); - Reply reply = driver.client().awaitReply(60, TimeUnit.SECONDS); - assertNotNull(reply); - assertFalse(reply.hasErrors()); - } - @Override public List<Pair<String,CallStack>> getCallStacks() { CallStack stack = new CallStack(); diff --git a/docproc/src/test/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerTransformingMessagesTestCase.java b/docproc/src/test/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerTransformingMessagesTestCase.java index 30ff43264a0..efa05273c8d 100644 --- a/docproc/src/test/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerTransformingMessagesTestCase.java +++ b/docproc/src/test/java/com/yahoo/docproc/jdisc/DocumentProcessingHandlerTransformingMessagesTestCase.java @@ -69,7 +69,6 @@ public class DocumentProcessingHandlerTransformingMessagesTestCase extends Docum put(); remove(); update(); - batchDocumentUpdate(); } private void put() throws InterruptedException { @@ -170,24 +169,6 @@ public class DocumentProcessingHandlerTransformingMessagesTestCase extends Docum } } - private void batchDocumentUpdate() throws InterruptedException { - DocumentUpdate doc1 = new DocumentUpdate(getType(), new DocumentId("userdoc:test:12345:batch:nodocstatus:keep:this")); - DocumentUpdate doc2 = new DocumentUpdate(getType(), new DocumentId("userdoc:test:12345:batch:nodocstatus:skip:this")); - - Field testField = getType().getField("foostring"); - doc1.addFieldUpdate(FieldUpdate.createAssign(testField, new StringFieldValue("1 not yet processed"))); - doc2.addFieldUpdate(FieldUpdate.createAssign(testField, new StringFieldValue("2 not yet processed"))); - - BatchDocumentUpdateMessage message = new BatchDocumentUpdateMessage(12345); - message.addUpdate(doc1); - message.addUpdate(doc2); - - Routable result = sendMessageAndGetResult(message); - assertThat(result, instanceOf(UpdateDocumentMessage.class)); - DocumentUpdate outputUpd = ((UpdateDocumentMessage)result).getDocumentUpdate(); - assertThat(outputUpd.getId().toString(), is("userdoc:test:12345:batch:nodocstatus:keep:this")); - } - public class TransformingDocumentProcessor extends DocumentProcessor { @Override diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/BatchDocumentUpdateMessage.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/BatchDocumentUpdateMessage.java deleted file mode 100644 index d8288a94ab6..00000000000 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/BatchDocumentUpdateMessage.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.documentapi.messagebus.protocol; - -import com.yahoo.document.BucketId; -import com.yahoo.document.BucketIdFactory; -import com.yahoo.document.DocumentId; -import com.yahoo.document.DocumentUpdate; -import com.yahoo.document.idstring.GroupDocIdString; -import com.yahoo.document.idstring.IdString; -import com.yahoo.document.idstring.UserDocIdString; -import com.yahoo.document.serialization.DocumentDeserializer; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Simon Thoresen Hult - */ -public class BatchDocumentUpdateMessage extends DocumentMessage { - - private DocumentDeserializer buffer = null; - private List<DocumentUpdate> updates = new ArrayList<DocumentUpdate>(); - private LazyDecoder decoder = null; - private String group = null; - private Long userId = null; - private BucketId bucketId = null; - - public String getGroup() { - return group; - } - - public Long getUserId() { - return userId; - } - - /** - * Constructs a new message for deserialization. - */ - BatchDocumentUpdateMessage() { - // empty - } - - /** - * Constructs a new message from a byte buffer. - * @param decoder The decoder to use for deserialization. - * @param buffer A byte buffer that contains a serialized message. - */ - public BatchDocumentUpdateMessage(long userId, LazyDecoder decoder, DocumentDeserializer buffer) { - this.userId = userId; - this.decoder = decoder; - this.buffer = buffer; - setBucketId(new UserDocIdString("foo", userId, "bar")); - } - - /** - * Constructs a new message from a byte buffer. - * @param decoder The decoder to use for deserialization. - * @param buffer A byte buffer that contains a serialized message. - */ - public BatchDocumentUpdateMessage(String group, LazyDecoder decoder, DocumentDeserializer buffer) { - this.group = group; - this.decoder = decoder; - this.buffer = buffer; - setBucketId(new GroupDocIdString("foo", group, "bar")); - } - - /** - * Constructs a batch document update message, to contain updates for documents for the given user. - */ - public BatchDocumentUpdateMessage(long userId) { - super(); - this.userId = userId; - setBucketId(new UserDocIdString("foo", userId, "bar")); - } - - /** - * Constructs a batch document update message, to contain updates for documents for the given user. - */ - public BatchDocumentUpdateMessage(String group) { - super(); - this.group = group; - setBucketId(new GroupDocIdString("foo", group, "bar")); - } - - void setBucketId(IdString id) { - BucketIdFactory factory = new BucketIdFactory(); - bucketId = factory.getBucketId(new DocumentId(id)); - } - - BucketId getBucketId() { - return bucketId; - } - - /** - * This method will make sure that any serialized content is deserialized into proper message content on first - * entry. Any subsequent entry into this function will do nothing. - */ - private void deserialize() { - if (decoder != null && buffer != null) { - decoder.decode(this, buffer); - decoder = null; - buffer = null; - } - } - - /** - * Returns the list of document updates to perform. - * - * @return The updates. - */ - public List<DocumentUpdate> getUpdates() { - deserialize(); - return updates; - } - - /** - * Adds a document update to perform. - * - * @param upd The document update to set. - */ - public void addUpdate(DocumentUpdate upd) { - buffer = null; - decoder = null; - - verifyUpdate(upd); - updates.add(upd); - } - - /** - * Returns the raw serialized buffer. This buffer is stored as the message is received from accross the network, and - * deserialized from as soon as a member is requested. This method will return null if the buffer has been decoded. - * - * @return The buffer containing the serialized data for this message, or null. - */ - ByteBuffer getSerializedBuffer() { - return buffer != null ? buffer.getBuf().getByteBuffer() : null; - } - - @Override - public DocumentReply createReply() { - return new BatchDocumentUpdateReply(); - } - - @Override - public int getType() { - return DocumentProtocol.MESSAGE_BATCHDOCUMENTUPDATE; - } - - void verifyUpdate(DocumentUpdate update) { - if (update == null) { - throw new IllegalArgumentException("Document update can not be null."); - } - - IdString idString = update.getId().getScheme(); - - if (group != null) { - String idGroup; - - if (idString.hasGroup()) { - idGroup = idString.getGroup(); - } else { - throw new IllegalArgumentException("Batch update message can only contain groupdoc or orderdoc items"); - } - - if (!group.equals(idGroup)) { - throw new IllegalArgumentException("Batch update message can not contain messages from group " + idGroup + " only group " + group); - } - } else { - long foundUserId = 0; - - if (idString.hasNumber()) { - foundUserId = idString.getNumber(); - } else { - throw new IllegalArgumentException("Batch update message can only contain userdoc or orderdoc items"); - } - - if (userId != foundUserId) { - throw new IllegalArgumentException("Batch update message can not contain messages from user " + foundUserId + " only user " + userId); - } - } - } - -} diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/BatchDocumentUpdateReply.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/BatchDocumentUpdateReply.java deleted file mode 100755 index 3e6e3a3429d..00000000000 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/BatchDocumentUpdateReply.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.documentapi.messagebus.protocol; - -import java.util.ArrayList; - -public class BatchDocumentUpdateReply extends WriteDocumentReply { - - private ArrayList<Boolean> documentsNotFound = new ArrayList<Boolean>(); - - /** - * Constructs a new reply with no content. - */ - public BatchDocumentUpdateReply() { - super(DocumentProtocol.REPLY_BATCHDOCUMENTUPDATE); - } - - /** - * If all documents to update are found, this vector will be empty. If - * one or more documents are not found, this vector will have the size of - * the initial number of updates, with entries set to true where the - * corresponding update was not found. - * - * @return Vector containing indices of not found documents, or empty - * if all documents were found - */ - public ArrayList<Boolean> getDocumentsNotFound() { - return documentsNotFound; - } -} diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocol.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocol.java index b765b928869..6983eb4fbd9 100755 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocol.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocol.java @@ -66,7 +66,6 @@ public class DocumentProtocol implements Protocol { public static final int MESSAGE_EMPTYBUCKETS = DOCUMENT_MESSAGE + 23; public static final int MESSAGE_REMOVELOCATION = DOCUMENT_MESSAGE + 24; public static final int MESSAGE_QUERYRESULT = DOCUMENT_MESSAGE + 25; - public static final int MESSAGE_BATCHDOCUMENTUPDATE = DOCUMENT_MESSAGE + 26; /** * All reply types that are implemented by this protocol. @@ -89,7 +88,6 @@ public class DocumentProtocol implements Protocol { public static final int REPLY_EMPTYBUCKETS = DOCUMENT_REPLY + 23; public static final int REPLY_REMOVELOCATION = DOCUMENT_REPLY + 24; public static final int REPLY_QUERYRESULT = DOCUMENT_REPLY + 25; - public static final int REPLY_BATCHDOCUMENTUPDATE = DOCUMENT_REPLY + 26; public static final int REPLY_WRONGDISTRIBUTION = DOCUMENT_REPLY + 1000; public static final int REPLY_DOCUMENTIGNORED = DOCUMENT_REPLY + 1001; @@ -314,7 +312,6 @@ public class DocumentProtocol implements Protocol { List<VersionSpecification> from6 = Collections.singletonList(version6); // TODO decide minor version... // 5.0 serialization (keep alphabetized please) - putRoutableFactory(MESSAGE_BATCHDOCUMENTUPDATE, new RoutableFactories50.BatchDocumentUpdateMessageFactory(), from50); putRoutableFactory(MESSAGE_CREATEVISITOR, new RoutableFactories50.CreateVisitorMessageFactory(), from50); putRoutableFactory(MESSAGE_DESTROYVISITOR, new RoutableFactories50.DestroyVisitorMessageFactory(), from50); putRoutableFactory(MESSAGE_DOCUMENTLIST, new RoutableFactories50.DocumentListMessageFactory(), from50); @@ -332,7 +329,6 @@ public class DocumentProtocol implements Protocol { putRoutableFactory(MESSAGE_STATBUCKET, new RoutableFactories50.StatBucketMessageFactory(), from50); putRoutableFactory(MESSAGE_UPDATEDOCUMENT, new RoutableFactories50.UpdateDocumentMessageFactory(), from50); putRoutableFactory(MESSAGE_VISITORINFO, new RoutableFactories50.VisitorInfoMessageFactory(), from50); - putRoutableFactory(REPLY_BATCHDOCUMENTUPDATE, new RoutableFactories50.BatchDocumentUpdateReplyFactory(), from50); putRoutableFactory(REPLY_CREATEVISITOR, new RoutableFactories50.CreateVisitorReplyFactory(), from50); putRoutableFactory(REPLY_DESTROYVISITOR, new RoutableFactories50.DestroyVisitorReplyFactory(), from50); putRoutableFactory(REPLY_DOCUMENTLIST, new RoutableFactories50.DocumentListReplyFactory(), from50); diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentRouteSelectorPolicy.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentRouteSelectorPolicy.java index e48026ae7d7..dbf4a6cc593 100755 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentRouteSelectorPolicy.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentRouteSelectorPolicy.java @@ -154,15 +154,6 @@ public class DocumentRouteSelectorPolicy } } - case DocumentProtocol.MESSAGE_BATCHDOCUMENTUPDATE: - BatchDocumentUpdateMessage bdu = (BatchDocumentUpdateMessage)msg; - for (int i = 0; i < bdu.getUpdates().size(); i++) { - if (selector.accepts(bdu.getUpdates().get(i)) == Result.FALSE) { - return false; - } - } - return true; - default: return true; } diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories50.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories50.java index dfc87b77474..c7c1121ae68 100755 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories50.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories50.java @@ -583,86 +583,6 @@ public abstract class RoutableFactories50 { } } - public static class BatchDocumentUpdateMessageFactory extends DocumentMessageFactory { - - private final LazyDecoder decoder = new LazyDecoder() { - - public void decode(Routable obj, DocumentDeserializer buf) { - BatchDocumentUpdateMessage msg = (BatchDocumentUpdateMessage)obj; - int size = buf.getInt(null); - for (int i = 0; i < size; i++) { - msg.addUpdate(new DocumentUpdate(buf)); - } - } - }; - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - long userId = buf.getLong(null); - String group = decodeString(buf); - - if (group.length() > 0) { - return new BatchDocumentUpdateMessage(group, decoder, buf); - } else { - return new BatchDocumentUpdateMessage(userId, decoder, buf); - } - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - BatchDocumentUpdateMessage msg = (BatchDocumentUpdateMessage)obj; - - if (msg.getSerializedBuffer() != null) { - buf.put(null, msg.getSerializedBuffer()); - } else { - if (msg.getUserId() != null) { - buf.putLong(null, msg.getUserId()); - } else { - buf.putLong(null, 0); - } - - if (msg.getGroup() != null) { - encodeString(msg.getGroup(), buf); - } else { - encodeString("", buf); - } - - buf.putInt(null, msg.getUpdates().size()); - for (int i = 0; i < msg.getUpdates().size(); i++) { - msg.getUpdates().get(i).serialize(buf); - } - } - - return true; - } - } - - public static class BatchDocumentUpdateReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - BatchDocumentUpdateReply rep = new BatchDocumentUpdateReply(); - rep.setHighestModificationTimestamp(buf.getLong(null)); - int size = buf.getInt(null); - rep.getDocumentsNotFound().ensureCapacity(size); - for (int i = 0; i < size; ++i) { - rep.getDocumentsNotFound().add(buf.getByte(null) == 1); - } - return rep; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - BatchDocumentUpdateReply rep = (BatchDocumentUpdateReply)obj; - buf.putLong(null, rep.getHighestModificationTimestamp()); - buf.putInt(null, rep.getDocumentsNotFound().size()); - for (int i = 0; i < rep.getDocumentsNotFound().size(); ++i) { - buf.putByte(null, (byte)(rep.getDocumentsNotFound().get(i) ? 1 : 0)); - } - return true; - } - } - public static class PutDocumentMessageFactory extends DocumentMessageFactory { protected void decodeInto(PutDocumentMessage msg, DocumentDeserializer buf) { msg.setDocumentPut(new DocumentPut(Document.createDocument(buf))); diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/StoragePolicy.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/StoragePolicy.java index 6a8c00cc1b1..22f7a491056 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/StoragePolicy.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/StoragePolicy.java @@ -252,7 +252,6 @@ public class StoragePolicy extends ExternalSlobrokPolicy { case DocumentProtocol.MESSAGE_STATBUCKET: return ((StatBucketMessage)msg).getBucketId(); case DocumentProtocol.MESSAGE_CREATEVISITOR: return ((CreateVisitorMessage)msg).getBuckets().get(0); case DocumentProtocol.MESSAGE_REMOVELOCATION: return ((RemoveLocationMessage)msg).getBucketId(); - case DocumentProtocol.MESSAGE_BATCHDOCUMENTUPDATE: return ((BatchDocumentUpdateMessage)msg).getBucketId(); default: log.log(LogLevel.ERROR, "Message type '" + msg.getType() + "' not supported."); return null; diff --git a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages50TestCase.java b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages50TestCase.java index 3d02aeee54d..5eca8f49967 100644 --- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages50TestCase.java +++ b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages50TestCase.java @@ -30,7 +30,6 @@ public class Messages50TestCase extends MessagesTestBase { protected void registerTests(Map<Integer, RunnableTest> out) { // This list MUST mirror the list of routable factories from the DocumentProtocol constructor that support // version 5.0. When adding tests to this list, please KEEP THEM ORDERED alphabetically like they are now. - out.put(DocumentProtocol.MESSAGE_BATCHDOCUMENTUPDATE, new testBatchDocumentUpdateMessage()); out.put(DocumentProtocol.MESSAGE_CREATEVISITOR, new testCreateVisitorMessage()); out.put(DocumentProtocol.MESSAGE_DESTROYVISITOR, new testDestroyVisitorMessage()); out.put(DocumentProtocol.MESSAGE_DOCUMENTLIST, new testDocumentListMessage()); @@ -48,7 +47,6 @@ public class Messages50TestCase extends MessagesTestBase { out.put(DocumentProtocol.MESSAGE_STATBUCKET, new testStatBucketMessage()); out.put(DocumentProtocol.MESSAGE_UPDATEDOCUMENT, new testUpdateDocumentMessage()); out.put(DocumentProtocol.MESSAGE_VISITORINFO, new testVisitorInfoMessage()); - out.put(DocumentProtocol.REPLY_BATCHDOCUMENTUPDATE, new testBatchDocumentUpdateReply()); out.put(DocumentProtocol.REPLY_CREATEVISITOR, new testCreateVisitorReply()); out.put(DocumentProtocol.REPLY_DESTROYVISITOR, new testDestroyVisitorReply()); out.put(DocumentProtocol.REPLY_DOCUMENTLIST, new testDocumentListReply()); @@ -722,78 +720,6 @@ public class Messages50TestCase extends MessagesTestBase { } } - public class testBatchDocumentUpdateMessage implements RunnableTest { - - @Override - public void run() { - DocumentType docType = protocol.getDocumentTypeManager().getDocumentType("testdoc"); - BatchDocumentUpdateMessage msg = new BatchDocumentUpdateMessage(1234); - - { - DocumentUpdate update = new DocumentUpdate(docType, new DocumentId("userdoc:footype:1234:foo")); - update.addFieldPathUpdate(new RemoveFieldPathUpdate(docType, "intfield", "testdoc.intfield > 0")); - msg.addUpdate(update); - } - { - DocumentUpdate update = new DocumentUpdate(docType, new DocumentId("orderdoc(32,17):footype:1234:123456789:foo")); - update.addFieldPathUpdate(new RemoveFieldPathUpdate(docType, "intfield", "testdoc.intfield > 0")); - msg.addUpdate(update); - } - - try { - DocumentUpdate update = new DocumentUpdate(docType, new DocumentId("orderdoc:footype:5678:foo")); - update.addFieldPathUpdate(new RemoveFieldPathUpdate(docType, "intfield", "testdoc.intfield > 0")); - msg.addUpdate(update); - fail(); - } catch (Exception e) { - - } - - try { - DocumentUpdate update = new DocumentUpdate(docType, new DocumentId("groupdoc:footype:hable:foo")); - update.addFieldPathUpdate(new RemoveFieldPathUpdate(docType, "intfield", "testdoc.intfield > 0")); - msg.addUpdate(update); - fail(); - } catch (Exception e) { - - } - - assertEquals(2, msg.getUpdates().size()); - - assertEquals(BASE_MESSAGE_LENGTH + 202, serialize("BatchDocumentUpdateMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (BatchDocumentUpdateMessage)deserialize("BatchDocumentUpdateMessage", DocumentProtocol.MESSAGE_BATCHDOCUMENTUPDATE, lang); - assertEquals(2, msg.getUpdates().size()); - } - } - } - - public class testBatchDocumentUpdateReply implements RunnableTest { - - @Override - public void run() { - BatchDocumentUpdateReply reply = new BatchDocumentUpdateReply(); - reply.setHighestModificationTimestamp(30); - reply.getDocumentsNotFound().add(false); - reply.getDocumentsNotFound().add(true); - reply.getDocumentsNotFound().add(true); - - assertEquals(20, serialize("BatchDocumentUpdateReply", reply)); - - for (Language lang : LANGUAGES) { - BatchDocumentUpdateReply obj = (BatchDocumentUpdateReply)deserialize("BatchDocumentUpdateReply", DocumentProtocol.REPLY_BATCHDOCUMENTUPDATE, lang); - assertNotNull(obj); - assertEquals(30, obj.getHighestModificationTimestamp()); - assertEquals(3, obj.getDocumentsNotFound().size()); - assertFalse(obj.getDocumentsNotFound().get(0)); - assertTrue(obj.getDocumentsNotFound().get(1)); - assertTrue(obj.getDocumentsNotFound().get(2)); - } - } - } - - public class testQueryResultReply implements RunnableTest { @Override diff --git a/vespaclient-core/src/main/java/com/yahoo/feedapi/DocprocMessageProcessor.java b/vespaclient-core/src/main/java/com/yahoo/feedapi/DocprocMessageProcessor.java index dca68c230f3..195604b067f 100755 --- a/vespaclient-core/src/main/java/com/yahoo/feedapi/DocprocMessageProcessor.java +++ b/vespaclient-core/src/main/java/com/yahoo/feedapi/DocprocMessageProcessor.java @@ -7,7 +7,6 @@ import com.yahoo.docproc.DocprocService; import com.yahoo.docproc.DocumentProcessor; import com.yahoo.docproc.Processing; import com.yahoo.document.*; -import com.yahoo.documentapi.messagebus.protocol.BatchDocumentUpdateMessage; import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol; import com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage; import com.yahoo.documentapi.messagebus.protocol.RemoveDocumentMessage; @@ -40,10 +39,6 @@ public class DocprocMessageProcessor implements MessageProcessor { documentBases.add(((UpdateDocumentMessage) m).getDocumentUpdate()); } else if (m.getType() == DocumentProtocol.MESSAGE_REMOVEDOCUMENT) { documentBases.add(((RemoveDocumentMessage) m).getDocumentRemove()); - } else if (m.getType() == DocumentProtocol.MESSAGE_BATCHDOCUMENTUPDATE) { - for (DocumentUpdate update : ((BatchDocumentUpdateMessage) m).getUpdates()) { - documentBases.add(update); - } } if (docproc != null) { |