diff options
Diffstat (limited to 'documentapi')
195 files changed, 1800 insertions, 2241 deletions
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 6983eb4fbd9..10a316f7751 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 @@ -301,63 +301,50 @@ public class DocumentProtocol implements Protocol { putRoutingPolicyFactory("SubsetService", new RoutingPolicyFactories.SubsetServicePolicyFactory()); // Prepare version specifications to use when adding routable factories. - VersionSpecification version50 = new VersionSpecification(5, 0); - VersionSpecification version51 = new VersionSpecification(5, 1); VersionSpecification version52 = new VersionSpecification(5, 115); VersionSpecification version6 = new VersionSpecification(6, 221); - List<VersionSpecification> from50 = Arrays.asList(version50, version51, version52, version6); - List<VersionSpecification> from51 = Arrays.asList(version51, version52, version6); List<VersionSpecification> from52 = Arrays.asList(version52, version6); List<VersionSpecification> from6 = Collections.singletonList(version6); // TODO decide minor version... - // 5.0 serialization (keep alphabetized please) - putRoutableFactory(MESSAGE_CREATEVISITOR, new RoutableFactories50.CreateVisitorMessageFactory(), from50); - putRoutableFactory(MESSAGE_DESTROYVISITOR, new RoutableFactories50.DestroyVisitorMessageFactory(), from50); - putRoutableFactory(MESSAGE_DOCUMENTLIST, new RoutableFactories50.DocumentListMessageFactory(), from50); - putRoutableFactory(MESSAGE_DOCUMENTSUMMARY, new RoutableFactories50.DocumentSummaryMessageFactory(), from50); - putRoutableFactory(MESSAGE_EMPTYBUCKETS, new RoutableFactories50.EmptyBucketsMessageFactory(), from50); - putRoutableFactory(MESSAGE_GETBUCKETLIST, new RoutableFactories50.GetBucketListMessageFactory(), from50); - putRoutableFactory(MESSAGE_GETBUCKETSTATE, new RoutableFactories50.GetBucketStateMessageFactory(), from50); - putRoutableFactory(MESSAGE_GETDOCUMENT, new RoutableFactories50.GetDocumentMessageFactory(), from50); - putRoutableFactory(MESSAGE_MAPVISITOR, new RoutableFactories50.MapVisitorMessageFactory(), from50); - putRoutableFactory(MESSAGE_PUTDOCUMENT, new RoutableFactories50.PutDocumentMessageFactory(), from50); - putRoutableFactory(MESSAGE_QUERYRESULT, new RoutableFactories50.QueryResultMessageFactory(), from50); - putRoutableFactory(MESSAGE_REMOVEDOCUMENT, new RoutableFactories50.RemoveDocumentMessageFactory(), from50); - putRoutableFactory(MESSAGE_REMOVELOCATION, new RoutableFactories50.RemoveLocationMessageFactory(), from50); - putRoutableFactory(MESSAGE_SEARCHRESULT, new RoutableFactories50.SearchResultMessageFactory(), from50); - putRoutableFactory(MESSAGE_STATBUCKET, new RoutableFactories50.StatBucketMessageFactory(), from50); - putRoutableFactory(MESSAGE_UPDATEDOCUMENT, new RoutableFactories50.UpdateDocumentMessageFactory(), from50); - putRoutableFactory(MESSAGE_VISITORINFO, new RoutableFactories50.VisitorInfoMessageFactory(), from50); - putRoutableFactory(REPLY_CREATEVISITOR, new RoutableFactories50.CreateVisitorReplyFactory(), from50); - putRoutableFactory(REPLY_DESTROYVISITOR, new RoutableFactories50.DestroyVisitorReplyFactory(), from50); - putRoutableFactory(REPLY_DOCUMENTLIST, new RoutableFactories50.DocumentListReplyFactory(), from50); - putRoutableFactory(REPLY_DOCUMENTSUMMARY, new RoutableFactories50.DocumentSummaryReplyFactory(), from50); - putRoutableFactory(REPLY_EMPTYBUCKETS, new RoutableFactories50.EmptyBucketsReplyFactory(), from50); - putRoutableFactory(REPLY_GETBUCKETLIST, new RoutableFactories50.GetBucketListReplyFactory(), from50); - putRoutableFactory(REPLY_GETBUCKETSTATE, new RoutableFactories50.GetBucketStateReplyFactory(), from50); - putRoutableFactory(REPLY_GETDOCUMENT, new RoutableFactories50.GetDocumentReplyFactory(), from50); - putRoutableFactory(REPLY_MAPVISITOR, new RoutableFactories50.MapVisitorReplyFactory(), from50); - putRoutableFactory(REPLY_PUTDOCUMENT, new RoutableFactories50.PutDocumentReplyFactory(), from50); - putRoutableFactory(REPLY_QUERYRESULT, new RoutableFactories50.QueryResultReplyFactory(), from50); - putRoutableFactory(REPLY_REMOVEDOCUMENT, new RoutableFactories50.RemoveDocumentReplyFactory(), from50); - putRoutableFactory(REPLY_REMOVELOCATION, new RoutableFactories50.RemoveLocationReplyFactory(), from50); - putRoutableFactory(REPLY_SEARCHRESULT, new RoutableFactories50.SearchResultReplyFactory(), from50); - putRoutableFactory(REPLY_STATBUCKET, new RoutableFactories50.StatBucketReplyFactory(), from50); - putRoutableFactory(REPLY_UPDATEDOCUMENT, new RoutableFactories50.UpdateDocumentReplyFactory(), from50); - putRoutableFactory(REPLY_UPDATEDOCUMENT, new RoutableFactories50.UpdateDocumentReplyFactory(), from50); - putRoutableFactory(REPLY_VISITORINFO, new RoutableFactories50.VisitorInfoReplyFactory(), from50); - putRoutableFactory(REPLY_WRONGDISTRIBUTION, new RoutableFactories50.WrongDistributionReplyFactory(), from50); - - // 5.1 serialization - putRoutableFactory(MESSAGE_CREATEVISITOR, new RoutableFactories51.CreateVisitorMessageFactory(), from51); - putRoutableFactory(MESSAGE_GETDOCUMENT, new RoutableFactories51.GetDocumentMessageFactory(), from51); - putRoutableFactory(REPLY_DOCUMENTIGNORED, new RoutableFactories51.DocumentIgnoredReplyFactory(), from51); - - // 5.2 serialization + // 5.2 serialization (keep alphabetized please) + putRoutableFactory(MESSAGE_CREATEVISITOR, new RoutableFactories52.CreateVisitorMessageFactory(), from52); + putRoutableFactory(MESSAGE_DESTROYVISITOR, new RoutableFactories52.DestroyVisitorMessageFactory(), from52); + putRoutableFactory(MESSAGE_DOCUMENTLIST, new RoutableFactories52.DocumentListMessageFactory(), from52); + putRoutableFactory(MESSAGE_DOCUMENTSUMMARY, new RoutableFactories52.DocumentSummaryMessageFactory(), from52); + putRoutableFactory(MESSAGE_EMPTYBUCKETS, new RoutableFactories52.EmptyBucketsMessageFactory(), from52); + putRoutableFactory(MESSAGE_GETBUCKETLIST, new RoutableFactories52.GetBucketListMessageFactory(), from52); + putRoutableFactory(MESSAGE_GETBUCKETSTATE, new RoutableFactories52.GetBucketStateMessageFactory(), from52); + putRoutableFactory(MESSAGE_GETDOCUMENT, new RoutableFactories52.GetDocumentMessageFactory(), from52); + putRoutableFactory(MESSAGE_MAPVISITOR, new RoutableFactories52.MapVisitorMessageFactory(), from52); putRoutableFactory(MESSAGE_PUTDOCUMENT, new RoutableFactories52.PutDocumentMessageFactory(), from52); - putRoutableFactory(MESSAGE_UPDATEDOCUMENT, new RoutableFactories52.UpdateDocumentMessageFactory(), from52); + putRoutableFactory(MESSAGE_QUERYRESULT, new RoutableFactories52.QueryResultMessageFactory(), from52); putRoutableFactory(MESSAGE_REMOVEDOCUMENT, new RoutableFactories52.RemoveDocumentMessageFactory(), from52); + putRoutableFactory(MESSAGE_REMOVELOCATION, new RoutableFactories52.RemoveLocationMessageFactory(), from52); + putRoutableFactory(MESSAGE_SEARCHRESULT, new RoutableFactories52.SearchResultMessageFactory(), from52); + putRoutableFactory(MESSAGE_STATBUCKET, new RoutableFactories52.StatBucketMessageFactory(), from52); + putRoutableFactory(MESSAGE_UPDATEDOCUMENT, new RoutableFactories52.UpdateDocumentMessageFactory(), from52); + putRoutableFactory(MESSAGE_VISITORINFO, new RoutableFactories52.VisitorInfoMessageFactory(), from52); + putRoutableFactory(REPLY_CREATEVISITOR, new RoutableFactories52.CreateVisitorReplyFactory(), from52); + putRoutableFactory(REPLY_DESTROYVISITOR, new RoutableFactories52.DestroyVisitorReplyFactory(), from52); + putRoutableFactory(REPLY_DOCUMENTIGNORED, new RoutableFactories52.DocumentIgnoredReplyFactory(), from52); + putRoutableFactory(REPLY_DOCUMENTLIST, new RoutableFactories52.DocumentListReplyFactory(), from52); + putRoutableFactory(REPLY_DOCUMENTSUMMARY, new RoutableFactories52.DocumentSummaryReplyFactory(), from52); + putRoutableFactory(REPLY_EMPTYBUCKETS, new RoutableFactories52.EmptyBucketsReplyFactory(), from52); + putRoutableFactory(REPLY_GETBUCKETLIST, new RoutableFactories52.GetBucketListReplyFactory(), from52); + putRoutableFactory(REPLY_GETBUCKETSTATE, new RoutableFactories52.GetBucketStateReplyFactory(), from52); + putRoutableFactory(REPLY_GETDOCUMENT, new RoutableFactories52.GetDocumentReplyFactory(), from52); + putRoutableFactory(REPLY_MAPVISITOR, new RoutableFactories52.MapVisitorReplyFactory(), from52); + putRoutableFactory(REPLY_PUTDOCUMENT, new RoutableFactories52.PutDocumentReplyFactory(), from52); + putRoutableFactory(REPLY_QUERYRESULT, new RoutableFactories52.QueryResultReplyFactory(), from52); + putRoutableFactory(REPLY_REMOVEDOCUMENT, new RoutableFactories52.RemoveDocumentReplyFactory(), from52); + putRoutableFactory(REPLY_REMOVELOCATION, new RoutableFactories52.RemoveLocationReplyFactory(), from52); + putRoutableFactory(REPLY_SEARCHRESULT, new RoutableFactories52.SearchResultReplyFactory(), from52); + putRoutableFactory(REPLY_STATBUCKET, new RoutableFactories52.StatBucketReplyFactory(), from52); + putRoutableFactory(REPLY_UPDATEDOCUMENT, new RoutableFactories52.UpdateDocumentReplyFactory(), from52); + putRoutableFactory(REPLY_UPDATEDOCUMENT, new RoutableFactories52.UpdateDocumentReplyFactory(), from52); + putRoutableFactory(REPLY_VISITORINFO, new RoutableFactories52.VisitorInfoReplyFactory(), from52); + putRoutableFactory(REPLY_WRONGDISTRIBUTION, new RoutableFactories52.WrongDistributionReplyFactory(), from52); // 6.x serialization putRoutableFactory(MESSAGE_CREATEVISITOR, new RoutableFactories60.CreateVisitorMessageFactory(), from6); 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 deleted file mode 100755 index c7c1121ae68..00000000000 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories50.java +++ /dev/null @@ -1,917 +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.*; -import com.yahoo.document.serialization.DocumentDeserializer; -import com.yahoo.document.serialization.DocumentSerializer; -import com.yahoo.document.serialization.DocumentSerializerFactory; -import com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet; -import com.yahoo.log.LogLevel; -import com.yahoo.messagebus.Routable; -import com.yahoo.vdslib.DocumentList; -import com.yahoo.vdslib.DocumentSummary; -import com.yahoo.vdslib.SearchResult; -import com.yahoo.vdslib.VisitorStatistics; -import com.yahoo.vespa.objects.Deserializer; -import com.yahoo.vespa.objects.Serializer; - -import java.util.Map; -import java.util.logging.Logger; - - -/** - * This class encapsulates all the {@link RoutableFactory} classes needed to implement serialization for the document - * protocol. When adding new factories to this class, please KEEP THE THEM ORDERED alphabetically like they are now. - */ -public abstract class RoutableFactories50 { - - /** - * Implements the shared factory logic required for {@link DocumentMessage} objects, and it offers a more convenient - * interface for implementing {@link RoutableFactory}. - * - * @author Simon Thoresen Hult - */ - public static abstract class DocumentMessageFactory extends AbstractRoutableFactory { - - /** - * This method encodes the given message using the given serializer. You are guaranteed to only receive messages - * of the type that this factory was registered for. - * <p> - * This method is NOT exception safe. Return false to - * signal failure. - * - * @param msg The message to encode. - * @param serializer The serializer to use for encoding. - * @return True if the message was encoded. - */ - protected abstract boolean doEncode(DocumentMessage msg, DocumentSerializer serializer); - - /** - * This method decodes a message from the given deserializer. You are guaranteed to only receive byte buffers - * generated by a previous call to {@link #doEncode(DocumentMessage, DocumentSerializer)}. - * <p> - * This method is NOT exception safe. Return null to signal failure. - * - * @param deserializer The deserializer to use for decoding. - * @return The decoded message. - */ - protected abstract DocumentMessage doDecode(DocumentDeserializer deserializer); - - public boolean encode(Routable obj, DocumentSerializer out) { - if (!(obj instanceof DocumentMessage)) { - throw new AssertionError( - "Document message factory (" + getClass().getName() + ") registered for incompatible " + - "routable type " + obj.getType() + "(" + obj.getClass().getName() + ")."); - } - DocumentMessage msg = (DocumentMessage)obj; - out.putByte(null, (byte)(msg.getPriority().getValue())); - out.putInt(null, msg.getLoadType().getId()); - return doEncode(msg, out); - } - - public Routable decode(DocumentDeserializer in, LoadTypeSet loadTypes) { - byte pri = in.getByte(null); - int loadType = in.getInt(null); - DocumentMessage msg = doDecode(in); - if (msg != null) { - msg.setPriority(DocumentProtocol.getPriority(pri)); - msg.setLoadType(loadTypes.getIdMap().get(loadType)); - } - return msg; - } - } - - /** - * Implements the shared factory logic required for {@link DocumentReply} objects, and it offers a more convenient - * interface for implementing {@link RoutableFactory}. - * - * @author Simon Thoresen Hult - */ - public static abstract class DocumentReplyFactory extends AbstractRoutableFactory { - - /** - * This method encodes the given reply into the given byte buffer. You are guaranteed to only receive replies of - * the type that this factory was registered for. - * <p> - * This method is NOT exception safe. Return false to signal - * failure. - * - * @param reply The reply to encode. - * @param buf The byte buffer to write to. - * @return True if the message was encoded. - */ - protected abstract boolean doEncode(DocumentReply reply, DocumentSerializer buf); - - /** - * This method decodes a reply from the given byte buffer. You are guaranteed to only receive byte buffers - * generated by a previous call to {@link #doEncode(DocumentReply, com.yahoo.document.serialization.DocumentSerializer)}. - * - * <p> - * This method is NOT exception safe. Return null to signal failure. - * - * @param buf The byte buffer to read from. - * @return The decoded reply. - */ - protected abstract DocumentReply doDecode(DocumentDeserializer buf); - - public boolean encode(Routable obj, DocumentSerializer out) { - if (!(obj instanceof DocumentReply)) { - throw new AssertionError( - "Document reply factory (" + getClass().getName() + ") registered for incompatible " + - "routable type " + obj.getType() + "(" + obj.getClass().getName() + ")."); - } - DocumentReply reply = (DocumentReply)obj; - out.putByte(null, (byte)(reply.getPriority().getValue())); - return doEncode(reply, out); - } - - public Routable decode(DocumentDeserializer in, LoadTypeSet loadTypes) { - byte pri = in.getByte(null); - DocumentReply reply = doDecode(in); - if (reply != null) { - reply.setPriority(DocumentProtocol.getPriority(pri)); - } - return reply; - } - } - - public static class CreateVisitorMessageFactory extends DocumentMessageFactory { - - @Override - @SuppressWarnings("deprecation") - protected DocumentMessage doDecode(DocumentDeserializer buf) { - CreateVisitorMessage msg = new CreateVisitorMessage(); - msg.setLibraryName(decodeString(buf)); - msg.setInstanceId(decodeString(buf)); - msg.setControlDestination(decodeString(buf)); - msg.setDataDestination(decodeString(buf)); - msg.setDocumentSelection(decodeString(buf)); - msg.setMaxPendingReplyCount(buf.getInt(null)); - - int size = buf.getInt(null); - for (int i = 0; i < size; i++) { - long reversed = buf.getLong(null); - long rawid = ((reversed >>> 56) & 0x00000000000000FFl) | ((reversed >>> 40) & 0x000000000000FF00l) | - ((reversed >>> 24) & 0x0000000000FF0000l) | ((reversed >>> 8) & 0x00000000FF000000l) | - ((reversed << 8) & 0x000000FF00000000l) | ((reversed << 24) & 0x0000FF0000000000l) | - ((reversed << 40) & 0x00FF000000000000l) | ((reversed << 56) & 0xFF00000000000000l); - msg.getBuckets().add(new BucketId(rawid)); - } - - msg.setFromTimestamp(buf.getLong(null)); - msg.setToTimestamp(buf.getLong(null)); - msg.setVisitRemoves(buf.getByte(null) == (byte)1); - buf.getByte(null); // removed feature "visitHeadersOnly" - msg.setVisitInconsistentBuckets(buf.getByte(null) == (byte)1); - - size = buf.getInt(null); - for (int i = 0; i < size; i++) { - String key = decodeString(buf); - int sz = buf.getInt(null); - msg.getParameters().put(key, buf.getBytes(null, sz)); - } - - msg.setVisitorOrdering(buf.getInt(null)); - msg.setMaxBucketsPerVisitor(buf.getInt(null)); - msg.setVisitorDispatcherVersion(50); - return msg; - } - - @Override - @SuppressWarnings("deprecation") - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - CreateVisitorMessage msg = (CreateVisitorMessage)obj; - encodeString(msg.getLibraryName(), buf); - encodeString(msg.getInstanceId(), buf); - encodeString(msg.getControlDestination(), buf); - encodeString(msg.getDataDestination(), buf); - encodeString(msg.getDocumentSelection(), buf); - buf.putInt(null, msg.getMaxPendingReplyCount()); - - buf.putInt(null, msg.getBuckets().size()); - for (BucketId id : msg.getBuckets()) { - long rawid = id.getRawId(); - long reversed = ((rawid >>> 56) & 0x00000000000000FFl) | ((rawid >>> 40) & 0x000000000000FF00l) | - ((rawid >>> 24) & 0x0000000000FF0000l) | ((rawid >>> 8) & 0x00000000FF000000l) | - ((rawid << 8) & 0x000000FF00000000l) | ((rawid << 24) & 0x0000FF0000000000l) | - ((rawid << 40) & 0x00FF000000000000l) | ((rawid << 56) & 0xFF00000000000000l); - buf.putLong(null, reversed); - } - - buf.putLong(null, msg.getFromTimestamp()); - buf.putLong(null, msg.getToTimestamp()); - buf.putByte(null, msg.getVisitRemoves() ? (byte)1 : (byte)0); - buf.putByte(null, (byte)0); // removed feature "visitHeadersOnly" - buf.putByte(null, msg.getVisitInconsistentBuckets() ? (byte)1 : (byte)0); - - buf.putInt(null, msg.getParameters().size()); - for (Map.Entry<String, byte[]> pairs : msg.getParameters().entrySet()) { - encodeString(pairs.getKey(), buf); - byte[] b = pairs.getValue(); - buf.putInt(null, b.length); - buf.put(null, b); - } - - buf.putInt(null, msg.getVisitorOrdering()); - buf.putInt(null, msg.getMaxBucketsPerVisitor()); - return true; - } - } - - public static class CreateVisitorReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - CreateVisitorReply reply = new CreateVisitorReply(DocumentProtocol.REPLY_CREATEVISITOR); - reply.setLastBucket(new BucketId(buf.getLong(null))); - - VisitorStatistics vs = new VisitorStatistics(); - vs.setBucketsVisited(buf.getInt(null)); - vs.setDocumentsVisited(buf.getLong(null)); - vs.setBytesVisited(buf.getLong(null)); - vs.setDocumentsReturned(buf.getLong(null)); - vs.setBytesReturned(buf.getLong(null)); - vs.setSecondPassDocumentsReturned(buf.getLong(null)); - vs.setSecondPassBytesReturned(buf.getLong(null)); - reply.setVisitorStatistics(vs); - return reply; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - CreateVisitorReply reply = (CreateVisitorReply)obj; - buf.putLong(null, reply.getLastBucket().getRawId()); - buf.putInt(null, reply.getVisitorStatistics().getBucketsVisited()); - buf.putLong(null, reply.getVisitorStatistics().getDocumentsVisited()); - buf.putLong(null, reply.getVisitorStatistics().getBytesVisited()); - buf.putLong(null, reply.getVisitorStatistics().getDocumentsReturned()); - buf.putLong(null, reply.getVisitorStatistics().getBytesReturned()); - buf.putLong(null, reply.getVisitorStatistics().getSecondPassDocumentsReturned()); - buf.putLong(null, reply.getVisitorStatistics().getSecondPassBytesReturned()); - return true; - } - } - - public static class DestroyVisitorMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - DestroyVisitorMessage msg = new DestroyVisitorMessage(); - msg.setInstanceId(decodeString(buf)); - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - DestroyVisitorMessage msg = (DestroyVisitorMessage)obj; - encodeString(msg.getInstanceId(), buf); - return true; - } - } - - public static class DestroyVisitorReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new VisitorReply(DocumentProtocol.REPLY_DESTROYVISITOR); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class DocumentListMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - DocumentListMessage msg = new DocumentListMessage(); - msg.setBucketId(new BucketId(buf.getLong(null))); - int len = buf.getInt(null); - for (int i = 0; i < len; i++) { - msg.getDocuments().add(new DocumentListEntry(buf)); - } - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - DocumentListMessage msg = (DocumentListMessage)obj; - buf.putLong(null, msg.getBucketId().getRawId()); - buf.putInt(null, msg.getDocuments().size()); - - for (int i = 0; i < msg.getDocuments().size(); i++) { - msg.getDocuments().get(i).serialize(buf); - } - return true; - } - } - - public static class DocumentListReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new VisitorReply(DocumentProtocol.REPLY_DOCUMENTLIST); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class DocumentSummaryMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - DocumentSummaryMessage msg = new DocumentSummaryMessage(); - msg.setDocumentSummary(new DocumentSummary(buf)); - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - return false; // not supported - } - } - - public static class DocumentSummaryReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new VisitorReply(DocumentProtocol.REPLY_DOCUMENTSUMMARY); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class EmptyBucketsMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - EmptyBucketsMessage msg = new EmptyBucketsMessage(); - int size = buf.getInt(null); - for (int i = 0; i < size; ++i) { - msg.getBucketIds().add(new BucketId(buf.getLong(null))); - } - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - EmptyBucketsMessage msg = (EmptyBucketsMessage)obj; - buf.putInt(null, msg.getBucketIds().size()); - for (BucketId bid : msg.getBucketIds()) { - buf.putLong(null, bid.getRawId()); - } - return true; - } - } - - public static class EmptyBucketsReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new VisitorReply(DocumentProtocol.REPLY_EMPTYBUCKETS); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class GetBucketListMessageFactory extends DocumentMessageFactory { - - protected String decodeBucketSpace(Deserializer deserializer) { - return FixedBucketSpaces.defaultSpace(); - } - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - GetBucketListMessage msg = new GetBucketListMessage(); - msg.setBucketId(new BucketId(buf.getLong(null))); - msg.setBucketSpace(decodeBucketSpace(buf)); - return msg; - } - - protected boolean encodeBucketSpace(String bucketSpace, DocumentSerializer buf) { - return FixedBucketSpaces.defaultSpace().equals(bucketSpace); - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - GetBucketListMessage msg = (GetBucketListMessage)obj; - buf.putLong(null, msg.getBucketId().getRawId()); - return encodeBucketSpace(msg.getBucketSpace(), buf); - } - } - - public static class GetBucketListReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - GetBucketListReply reply = new GetBucketListReply(); - int len = buf.getInt(null); - for (int i = 0; i < len; i++) { - GetBucketListReply.BucketInfo info = new GetBucketListReply.BucketInfo(); - info.bucket = new BucketId(buf.getLong(null)); - info.bucketInformation = decodeString(buf); - reply.getBuckets().add(info); - } - return reply; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - GetBucketListReply reply = (GetBucketListReply)obj; - buf.putInt(null, reply.getBuckets().size()); - for (GetBucketListReply.BucketInfo info : reply.getBuckets()) { - buf.putLong(null, info.bucket.getRawId()); - encodeString(info.bucketInformation, buf); - } - return true; - } - } - - public static class GetBucketStateMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - GetBucketStateMessage msg = new GetBucketStateMessage(); - msg.setBucketId(new BucketId(buf.getLong(null))); - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - GetBucketStateMessage msg = (GetBucketStateMessage)obj; - buf.putLong(null, msg.getBucketId().getRawId()); - return true; - } - } - - public static class GetBucketStateReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - GetBucketStateReply reply = new GetBucketStateReply(); - int size = buf.getInt(null); - for (int i = 0; i < size; i++) { - reply.getBucketState().add(new DocumentState(buf)); - } - return reply; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - GetBucketStateReply reply = (GetBucketStateReply)obj; - buf.putInt(null, reply.getBucketState().size()); - for (DocumentState stat : reply.getBucketState()) { - stat.serialize(buf); - } - return true; - } - } - - public static class GetDocumentMessageFactory extends DocumentMessageFactory { - - @Override - @SuppressWarnings("deprecation") - protected DocumentMessage doDecode(DocumentDeserializer buf) { - GetDocumentMessage msg = new GetDocumentMessage(); - msg.setDocumentId(new DocumentId(buf)); - buf.getInt(null); // removed feature "flags"; ignore - return msg; - } - - @Override - @SuppressWarnings("deprecation") - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - GetDocumentMessage msg = (GetDocumentMessage)obj; - msg.getDocumentId().serialize(buf); - buf.putInt(null, 0); // removed feature "flags" - return true; - } - } - - public static class GetDocumentReplyFactory extends DocumentReplyFactory { - - private final LazyDecoder decoder = new LazyDecoder() { - - public void decode(Routable obj, DocumentDeserializer buf) { - GetDocumentReply reply = (GetDocumentReply)obj; - - Document doc = null; - byte flag = buf.getByte(null); - if (flag != 0) { - doc = Document.createDocument(buf); - reply.setDocument(doc); - } - long lastModified = buf.getLong(null); - reply.setLastModified(lastModified); - if (doc != null) { - doc.setLastModified(lastModified); - } - } - }; - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - GetDocumentReply reply = new GetDocumentReply(decoder, buf); - - return reply; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - GetDocumentReply reply = (GetDocumentReply)obj; - if (reply.getSerializedBuffer() != null) { - buf.put(null, reply.getSerializedBuffer()); - } else { - Document document = reply.getDocument(); - buf.putByte(null, (byte)(document == null ? 0 : 1)); - if (document != null) { - document.serialize(buf); - } - buf.putLong(null, reply.getLastModified()); - } - return true; - } - } - - public static class MapVisitorMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - MapVisitorMessage msg = new MapVisitorMessage(); - int size = buf.getInt(null); - for (int i = 0; i < size; i++) { - String key = decodeString(buf); - String value = decodeString(buf); - msg.getData().put(key, value); - } - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - MapVisitorMessage msg = (MapVisitorMessage)obj; - buf.putInt(null, msg.getData().size()); - for (Map.Entry<String, String> pairs : msg.getData().entrySet()) { - encodeString(pairs.getKey(), buf); - encodeString(pairs.getValue(), buf); - } - return true; - } - } - - public static class MapVisitorReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new VisitorReply(DocumentProtocol.REPLY_MAPVISITOR); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class PutDocumentMessageFactory extends DocumentMessageFactory { - protected void decodeInto(PutDocumentMessage msg, DocumentDeserializer buf) { - msg.setDocumentPut(new DocumentPut(Document.createDocument(buf))); - msg.setTimestamp(buf.getLong(null)); - } - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buffer) { - final LazyDecoder decoder = (obj, buf) -> { - decodeInto((PutDocumentMessage) obj, buf); - }; - - return new PutDocumentMessage(decoder, buffer); - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - PutDocumentMessage msg = (PutDocumentMessage)obj; - if (msg.getSerializedBuffer() != null) { - buf.put(null, msg.getSerializedBuffer()); - } else { - msg.getDocumentPut().getDocument().serialize(buf); - buf.putLong(null, msg.getTimestamp()); - } - return true; - } - } - - public static class PutDocumentReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - WriteDocumentReply rep = new WriteDocumentReply(DocumentProtocol.REPLY_PUTDOCUMENT); - rep.setHighestModificationTimestamp(buf.getLong(null)); - return rep; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - WriteDocumentReply rep = (WriteDocumentReply)obj; - buf.putLong(null, rep.getHighestModificationTimestamp()); - return true; - } - } - - public static class RemoveDocumentMessageFactory extends DocumentMessageFactory { - protected void decodeInto(RemoveDocumentMessage msg, DocumentDeserializer buf) { - msg.setDocumentId(new DocumentId(buf)); - } - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - RemoveDocumentMessage msg = new RemoveDocumentMessage(); - decodeInto(msg, buf); - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - RemoveDocumentMessage msg = (RemoveDocumentMessage)obj; - msg.getDocumentId().serialize(buf); - return true; - } - } - - public static class RemoveDocumentReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - RemoveDocumentReply reply = new RemoveDocumentReply(); - byte flag = buf.getByte(null); - reply.setWasFound(flag != 0); - reply.setHighestModificationTimestamp(buf.getLong(null)); - return reply; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - RemoveDocumentReply reply = (RemoveDocumentReply)obj; - buf.putByte(null, (byte)(reply.wasFound() ? 1 : 0)); - buf.putLong(null, reply.getHighestModificationTimestamp()); - return true; - } - } - - public static class RemoveLocationMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - return new RemoveLocationMessage(decodeString(buf)); - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - RemoveLocationMessage msg = (RemoveLocationMessage)obj; - encodeString(msg.getDocumentSelection(), buf); - return true; - } - } - - public static class RemoveLocationReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new DocumentReply(DocumentProtocol.REPLY_REMOVELOCATION); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class SearchResultMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - SearchResultMessage msg = new SearchResultMessage(); - msg.setSearchResult(new SearchResult(buf)); - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - return false; // not supported - } - } - - public static class QueryResultMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - QueryResultMessage msg = new QueryResultMessage(); - msg.setSearchResult(new SearchResult(buf)); - msg.setSummary(new DocumentSummary(buf)); - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - return false; // not supported - } - } - - public static class SearchResultReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new VisitorReply(DocumentProtocol.REPLY_SEARCHRESULT); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class QueryResultReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new VisitorReply(DocumentProtocol.REPLY_QUERYRESULT); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class StatBucketMessageFactory extends DocumentMessageFactory { - - protected String decodeBucketSpace(Deserializer deserializer) { - return FixedBucketSpaces.defaultSpace(); - } - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - StatBucketMessage msg = new StatBucketMessage(); - msg.setBucketId(new BucketId(buf.getLong(null))); - msg.setDocumentSelection(decodeString(buf)); - msg.setBucketSpace(decodeBucketSpace(buf)); - return msg; - } - - protected boolean encodeBucketSpace(String bucketSpace, DocumentSerializer buf) { - return FixedBucketSpaces.defaultSpace().equals(bucketSpace); - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - StatBucketMessage msg = (StatBucketMessage)obj; - buf.putLong(null, msg.getBucketId().getRawId()); - encodeString(msg.getDocumentSelection(), buf); - return encodeBucketSpace(msg.getBucketSpace(), buf); - } - } - - public static class StatBucketReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - StatBucketReply reply = new StatBucketReply(); - reply.setResults(decodeString(buf)); - return reply; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - StatBucketReply reply = (StatBucketReply)obj; - encodeString(reply.getResults(), buf); - return true; - } - } - - public static class UpdateDocumentMessageFactory extends DocumentMessageFactory { - protected void decodeInto(UpdateDocumentMessage msg, DocumentDeserializer buf) { - msg.setDocumentUpdate(new DocumentUpdate(buf)); - msg.setOldTimestamp(buf.getLong(null)); - msg.setNewTimestamp(buf.getLong(null)); - } - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buffer) { - final LazyDecoder decoder = (obj, buf) -> { - decodeInto((UpdateDocumentMessage) obj, buf); - }; - - return new UpdateDocumentMessage(decoder, buffer); - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - UpdateDocumentMessage msg = (UpdateDocumentMessage)obj; - if (msg.getSerializedBuffer() != null) { - buf.put(null, msg.getSerializedBuffer()); - } else { - msg.getDocumentUpdate().serialize(buf); - buf.putLong(null, msg.getOldTimestamp()); - buf.putLong(null, msg.getNewTimestamp()); - } - return true; - } - } - - public static class UpdateDocumentReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - UpdateDocumentReply rep = new UpdateDocumentReply(); - byte flag = buf.getByte(null); - rep.setWasFound(flag != 0); - rep.setHighestModificationTimestamp(buf.getLong(null)); - return rep; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - UpdateDocumentReply rep = (UpdateDocumentReply)obj; - buf.putByte(null, (byte)(rep.wasFound() ? 1 : 0)); - buf.putLong(null, rep.getHighestModificationTimestamp()); - return true; - } - } - - public static class VisitorInfoMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - VisitorInfoMessage msg = new VisitorInfoMessage(); - int size = buf.getInt(null); - for (int i = 0; i < size; i++) { - long reversed = buf.getLong(null); - long rawid = ((reversed >>> 56) & 0x00000000000000FFl) | ((reversed >>> 40) & 0x000000000000FF00l) | - ((reversed >>> 24) & 0x0000000000FF0000l) | ((reversed >>> 8) & 0x00000000FF000000l) | - ((reversed << 8) & 0x000000FF00000000l) | ((reversed << 24) & 0x0000FF0000000000l) | - ((reversed << 40) & 0x00FF000000000000l) | ((reversed << 56) & 0xFF00000000000000l); - msg.getFinishedBuckets().add(new BucketId(rawid)); - } - - msg.setErrorMessage(decodeString(buf)); - return msg; - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - VisitorInfoMessage msg = (VisitorInfoMessage)obj; - buf.putInt(null, msg.getFinishedBuckets().size()); - for (BucketId id : msg.getFinishedBuckets()) { - long rawid = id.getRawId(); - long reversed = ((rawid >>> 56) & 0x00000000000000FFl) | ((rawid >>> 40) & 0x000000000000FF00l) | - ((rawid >>> 24) & 0x0000000000FF0000l) | ((rawid >>> 8) & 0x00000000FF000000l) | - ((rawid << 8) & 0x000000FF00000000l) | ((rawid << 24) & 0x0000FF0000000000l) | - ((rawid << 40) & 0x00FF000000000000l) | ((rawid << 56) & 0xFF00000000000000l); - buf.putLong(null, reversed); - } - encodeString(msg.getErrorMessage(), buf); - return true; - } - } - - public static class VisitorInfoReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new VisitorReply(DocumentProtocol.REPLY_VISITORINFO); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } - - public static class WrongDistributionReplyFactory extends DocumentReplyFactory { - - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - WrongDistributionReply reply = new WrongDistributionReply(); - reply.setSystemState(decodeString(buf)); - return reply; - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - WrongDistributionReply reply = (WrongDistributionReply)obj; - encodeString(reply.getSystemState(), buf); - return true; - } - } - -} diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories51.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories51.java deleted file mode 100755 index 0ef5835008a..00000000000 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories51.java +++ /dev/null @@ -1,137 +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.DocumentId; -import com.yahoo.document.FixedBucketSpaces; -import com.yahoo.document.serialization.DocumentDeserializer; -import com.yahoo.document.serialization.DocumentSerializer; -import com.yahoo.vespa.objects.Deserializer; - -import java.util.Map; - -/** - * This class encapsulates all the {@link RoutableFactory} classes needed to implement serialization for the document - * protocol. When adding new factories to this class, please KEEP THE THEM ORDERED alphabetically like they are now. - * - */ -public abstract class RoutableFactories51 extends RoutableFactories50 { - - public static class CreateVisitorMessageFactory extends DocumentMessageFactory { - - protected String decodeBucketSpace(Deserializer deserializer) { - return FixedBucketSpaces.defaultSpace(); - } - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - CreateVisitorMessage msg = new CreateVisitorMessage(); - msg.setLibraryName(decodeString(buf)); - msg.setInstanceId(decodeString(buf)); - msg.setControlDestination(decodeString(buf)); - msg.setDataDestination(decodeString(buf)); - msg.setDocumentSelection(decodeString(buf)); - msg.setMaxPendingReplyCount(buf.getInt(null)); - - int size = buf.getInt(null); - for (int i = 0; i < size; i++) { - long reversed = buf.getLong(null); - long rawid = ((reversed >>> 56) & 0x00000000000000FFl) | ((reversed >>> 40) & 0x000000000000FF00l) | - ((reversed >>> 24) & 0x0000000000FF0000l) | ((reversed >>> 8) & 0x00000000FF000000l) | - ((reversed << 8) & 0x000000FF00000000l) | ((reversed << 24) & 0x0000FF0000000000l) | - ((reversed << 40) & 0x00FF000000000000l) | ((reversed << 56) & 0xFF00000000000000l); - msg.getBuckets().add(new BucketId(rawid)); - } - - msg.setFromTimestamp(buf.getLong(null)); - msg.setToTimestamp(buf.getLong(null)); - msg.setVisitRemoves(buf.getByte(null) == (byte)1); - msg.setFieldSet(decodeString(buf)); - msg.setVisitInconsistentBuckets(buf.getByte(null) == (byte)1); - - size = buf.getInt(null); - for (int i = 0; i < size; i++) { - String key = decodeString(buf); - int sz = buf.getInt(null); - msg.getParameters().put(key, buf.getBytes(null, sz)); - } - - msg.setVisitorOrdering(buf.getInt(null)); - msg.setMaxBucketsPerVisitor(buf.getInt(null)); - msg.setVisitorDispatcherVersion(50); - msg.setBucketSpace(decodeBucketSpace(buf)); - return msg; - } - - protected boolean encodeBucketSpace(String bucketSpace, DocumentSerializer buf) { - return FixedBucketSpaces.defaultSpace().equals(bucketSpace); - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - CreateVisitorMessage msg = (CreateVisitorMessage)obj; - encodeString(msg.getLibraryName(), buf); - encodeString(msg.getInstanceId(), buf); - encodeString(msg.getControlDestination(), buf); - encodeString(msg.getDataDestination(), buf); - encodeString(msg.getDocumentSelection(), buf); - buf.putInt(null, msg.getMaxPendingReplyCount()); - - buf.putInt(null, msg.getBuckets().size()); - for (BucketId id : msg.getBuckets()) { - long rawid = id.getRawId(); - long reversed = ((rawid >>> 56) & 0x00000000000000FFl) | ((rawid >>> 40) & 0x000000000000FF00l) | - ((rawid >>> 24) & 0x0000000000FF0000l) | ((rawid >>> 8) & 0x00000000FF000000l) | - ((rawid << 8) & 0x000000FF00000000l) | ((rawid << 24) & 0x0000FF0000000000l) | - ((rawid << 40) & 0x00FF000000000000l) | ((rawid << 56) & 0xFF00000000000000l); - buf.putLong(null, reversed); - } - - buf.putLong(null, msg.getFromTimestamp()); - buf.putLong(null, msg.getToTimestamp()); - buf.putByte(null, msg.getVisitRemoves() ? (byte)1 : (byte)0); - encodeString(msg.getFieldSet(), buf); - buf.putByte(null, msg.getVisitInconsistentBuckets() ? (byte)1 : (byte)0); - - buf.putInt(null, msg.getParameters().size()); - for (Map.Entry<String, byte[]> pairs : msg.getParameters().entrySet()) { - encodeString(pairs.getKey(), buf); - byte[] b = pairs.getValue(); - buf.putInt(null, b.length); - buf.put(null, b); - } - - buf.putInt(null, msg.getVisitorOrdering()); - buf.putInt(null, msg.getMaxBucketsPerVisitor()); - return encodeBucketSpace(msg.getBucketSpace(), buf); - } - } - - public static class GetDocumentMessageFactory extends DocumentMessageFactory { - - @Override - protected DocumentMessage doDecode(DocumentDeserializer buf) { - return new GetDocumentMessage(new DocumentId(buf), decodeString(buf)); - } - - @Override - protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - GetDocumentMessage msg = (GetDocumentMessage)obj; - msg.getDocumentId().serialize(buf); - encodeString(msg.getFieldSet(), buf); - return true; - } - } - - public static class DocumentIgnoredReplyFactory extends DocumentReplyFactory { - @Override - protected DocumentReply doDecode(DocumentDeserializer buf) { - return new DocumentIgnoredReply(); - } - - @Override - protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { - return true; - } - } -} diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories52.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories52.java index 2e18c681c50..89a0aa22bb3 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories52.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories52.java @@ -1,82 +1,948 @@ // 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.google.common.annotations.Beta; +import com.yahoo.document.BucketId; +import com.yahoo.document.Document; +import com.yahoo.document.DocumentId; +import com.yahoo.document.DocumentPut; +import com.yahoo.document.DocumentUpdate; +import com.yahoo.document.FixedBucketSpaces; import com.yahoo.document.TestAndSetCondition; import com.yahoo.document.serialization.DocumentDeserializer; import com.yahoo.document.serialization.DocumentSerializer; +import com.yahoo.document.serialization.DocumentSerializerFactory; +import com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet; +import com.yahoo.log.LogLevel; +import com.yahoo.messagebus.Routable; +import com.yahoo.vdslib.DocumentList; +import com.yahoo.vdslib.DocumentSummary; +import com.yahoo.vdslib.SearchResult; +import com.yahoo.vdslib.VisitorStatistics; +import com.yahoo.vespa.objects.Deserializer; +import com.yahoo.vespa.objects.Serializer; + +import java.util.Map; +import java.util.logging.Logger; import static com.yahoo.documentapi.messagebus.protocol.AbstractRoutableFactory.decodeString; import static com.yahoo.documentapi.messagebus.protocol.AbstractRoutableFactory.encodeString; + /** * @author Vegard Sjonfjell + * This class encapsulates all the {@link RoutableFactory} classes needed to implement serialization for the document + * protocol. When adding new factories to this class, please KEEP THE THEM ORDERED alphabetically like they are now. */ +public abstract class RoutableFactories52 { + + /** + * Implements the shared factory logic required for {@link DocumentMessage} objects, and it offers a more convenient + * interface for implementing {@link RoutableFactory}. + * + * @author Simon Thoresen Hult + */ + public static abstract class DocumentMessageFactory extends AbstractRoutableFactory { + + /** + * This method encodes the given message using the given serializer. You are guaranteed to only receive messages + * of the type that this factory was registered for. + * <p> + * This method is NOT exception safe. Return false to + * signal failure. + * + * @param msg The message to encode. + * @param serializer The serializer to use for encoding. + * @return True if the message was encoded. + */ + protected abstract boolean doEncode(DocumentMessage msg, DocumentSerializer serializer); + + /** + * This method decodes a message from the given deserializer. You are guaranteed to only receive byte buffers + * generated by a previous call to {@link #doEncode(DocumentMessage, DocumentSerializer)}. + * <p> + * This method is NOT exception safe. Return null to signal failure. + * + * @param deserializer The deserializer to use for decoding. + * @return The decoded message. + */ + protected abstract DocumentMessage doDecode(DocumentDeserializer deserializer); + + public boolean encode(Routable obj, DocumentSerializer out) { + if (!(obj instanceof DocumentMessage)) { + throw new AssertionError( + "Document message factory (" + getClass().getName() + ") registered for incompatible " + + "routable type " + obj.getType() + "(" + obj.getClass().getName() + ")."); + } + DocumentMessage msg = (DocumentMessage)obj; + out.putByte(null, (byte)(msg.getPriority().getValue())); + out.putInt(null, msg.getLoadType().getId()); + return doEncode(msg, out); + } + + public Routable decode(DocumentDeserializer in, LoadTypeSet loadTypes) { + byte pri = in.getByte(null); + int loadType = in.getInt(null); + DocumentMessage msg = doDecode(in); + if (msg != null) { + msg.setPriority(DocumentProtocol.getPriority(pri)); + msg.setLoadType(loadTypes.getIdMap().get(loadType)); + } + return msg; + } + } + + /** + * Implements the shared factory logic required for {@link DocumentReply} objects, and it offers a more convenient + * interface for implementing {@link RoutableFactory}. + * + * @author Simon Thoresen Hult + */ + public static abstract class DocumentReplyFactory extends AbstractRoutableFactory { + + /** + * This method encodes the given reply into the given byte buffer. You are guaranteed to only receive replies of + * the type that this factory was registered for. + * <p> + * This method is NOT exception safe. Return false to signal + * failure. + * + * @param reply The reply to encode. + * @param buf The byte buffer to write to. + * @return True if the message was encoded. + */ + protected abstract boolean doEncode(DocumentReply reply, DocumentSerializer buf); + + /** + * This method decodes a reply from the given byte buffer. You are guaranteed to only receive byte buffers + * generated by a previous call to {@link #doEncode(DocumentReply, com.yahoo.document.serialization.DocumentSerializer)}. + * + * <p> + * This method is NOT exception safe. Return null to signal failure. + * + * @param buf The byte buffer to read from. + * @return The decoded reply. + */ + protected abstract DocumentReply doDecode(DocumentDeserializer buf); + + public boolean encode(Routable obj, DocumentSerializer out) { + if (!(obj instanceof DocumentReply)) { + throw new AssertionError( + "Document reply factory (" + getClass().getName() + ") registered for incompatible " + + "routable type " + obj.getType() + "(" + obj.getClass().getName() + ")."); + } + DocumentReply reply = (DocumentReply)obj; + out.putByte(null, (byte)(reply.getPriority().getValue())); + return doEncode(reply, out); + } + + public Routable decode(DocumentDeserializer in, LoadTypeSet loadTypes) { + byte pri = in.getByte(null); + DocumentReply reply = doDecode(in); + if (reply != null) { + reply.setPriority(DocumentProtocol.getPriority(pri)); + } + return reply; + } + } + + public static class CreateVisitorMessageFactory extends DocumentMessageFactory { + + protected String decodeBucketSpace(Deserializer deserializer) { + return FixedBucketSpaces.defaultSpace(); + } -@Beta -public abstract class RoutableFactories52 extends RoutableFactories51 { - protected static class PutDocumentMessageFactory extends RoutableFactories51.PutDocumentMessageFactory { @Override - protected void decodeInto(PutDocumentMessage msg, DocumentDeserializer buf) { - super.decodeInto(msg, buf); - decodeTasCondition(msg, buf); + protected DocumentMessage doDecode(DocumentDeserializer buf) { + CreateVisitorMessage msg = new CreateVisitorMessage(); + msg.setLibraryName(decodeString(buf)); + msg.setInstanceId(decodeString(buf)); + msg.setControlDestination(decodeString(buf)); + msg.setDataDestination(decodeString(buf)); + msg.setDocumentSelection(decodeString(buf)); + msg.setMaxPendingReplyCount(buf.getInt(null)); + + int size = buf.getInt(null); + for (int i = 0; i < size; i++) { + long reversed = buf.getLong(null); + long rawid = ((reversed >>> 56) & 0x00000000000000FFl) | ((reversed >>> 40) & 0x000000000000FF00l) | + ((reversed >>> 24) & 0x0000000000FF0000l) | ((reversed >>> 8) & 0x00000000FF000000l) | + ((reversed << 8) & 0x000000FF00000000l) | ((reversed << 24) & 0x0000FF0000000000l) | + ((reversed << 40) & 0x00FF000000000000l) | ((reversed << 56) & 0xFF00000000000000l); + msg.getBuckets().add(new BucketId(rawid)); + } + + msg.setFromTimestamp(buf.getLong(null)); + msg.setToTimestamp(buf.getLong(null)); + msg.setVisitRemoves(buf.getByte(null) == (byte)1); + msg.setFieldSet(decodeString(buf)); + msg.setVisitInconsistentBuckets(buf.getByte(null) == (byte)1); + + size = buf.getInt(null); + for (int i = 0; i < size; i++) { + String key = decodeString(buf); + int sz = buf.getInt(null); + msg.getParameters().put(key, buf.getBytes(null, sz)); + } + + msg.setVisitorOrdering(buf.getInt(null)); + msg.setMaxBucketsPerVisitor(buf.getInt(null)); + msg.setVisitorDispatcherVersion(50); + msg.setBucketSpace(decodeBucketSpace(buf)); + return msg; + } + + protected boolean encodeBucketSpace(String bucketSpace, DocumentSerializer buf) { + return FixedBucketSpaces.defaultSpace().equals(bucketSpace); } @Override protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - if (!super.doEncode(obj, buf)) { - return false; + CreateVisitorMessage msg = (CreateVisitorMessage)obj; + encodeString(msg.getLibraryName(), buf); + encodeString(msg.getInstanceId(), buf); + encodeString(msg.getControlDestination(), buf); + encodeString(msg.getDataDestination(), buf); + encodeString(msg.getDocumentSelection(), buf); + buf.putInt(null, msg.getMaxPendingReplyCount()); + + buf.putInt(null, msg.getBuckets().size()); + for (BucketId id : msg.getBuckets()) { + long rawid = id.getRawId(); + long reversed = ((rawid >>> 56) & 0x00000000000000FFl) | ((rawid >>> 40) & 0x000000000000FF00l) | + ((rawid >>> 24) & 0x0000000000FF0000l) | ((rawid >>> 8) & 0x00000000FF000000l) | + ((rawid << 8) & 0x000000FF00000000l) | ((rawid << 24) & 0x0000FF0000000000l) | + ((rawid << 40) & 0x00FF000000000000l) | ((rawid << 56) & 0xFF00000000000000l); + buf.putLong(null, reversed); } - // If the serialized buffer exists, the test and set condition has already been encoded - if (((PutDocumentMessage)obj).getSerializedBuffer() == null) { - encodeTasCondition(buf, (TestAndSetMessage) obj); + buf.putLong(null, msg.getFromTimestamp()); + buf.putLong(null, msg.getToTimestamp()); + buf.putByte(null, msg.getVisitRemoves() ? (byte)1 : (byte)0); + encodeString(msg.getFieldSet(), buf); + buf.putByte(null, msg.getVisitInconsistentBuckets() ? (byte)1 : (byte)0); + + buf.putInt(null, msg.getParameters().size()); + for (Map.Entry<String, byte[]> pairs : msg.getParameters().entrySet()) { + encodeString(pairs.getKey(), buf); + byte[] b = pairs.getValue(); + buf.putInt(null, b.length); + buf.put(null, b); + } + + buf.putInt(null, msg.getVisitorOrdering()); + buf.putInt(null, msg.getMaxBucketsPerVisitor()); + return encodeBucketSpace(msg.getBucketSpace(), buf); + } + } + + public static class CreateVisitorReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + CreateVisitorReply reply = new CreateVisitorReply(DocumentProtocol.REPLY_CREATEVISITOR); + reply.setLastBucket(new BucketId(buf.getLong(null))); + + VisitorStatistics vs = new VisitorStatistics(); + vs.setBucketsVisited(buf.getInt(null)); + vs.setDocumentsVisited(buf.getLong(null)); + vs.setBytesVisited(buf.getLong(null)); + vs.setDocumentsReturned(buf.getLong(null)); + vs.setBytesReturned(buf.getLong(null)); + vs.setSecondPassDocumentsReturned(buf.getLong(null)); + vs.setSecondPassBytesReturned(buf.getLong(null)); + reply.setVisitorStatistics(vs); + return reply; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + CreateVisitorReply reply = (CreateVisitorReply)obj; + buf.putLong(null, reply.getLastBucket().getRawId()); + buf.putInt(null, reply.getVisitorStatistics().getBucketsVisited()); + buf.putLong(null, reply.getVisitorStatistics().getDocumentsVisited()); + buf.putLong(null, reply.getVisitorStatistics().getBytesVisited()); + buf.putLong(null, reply.getVisitorStatistics().getDocumentsReturned()); + buf.putLong(null, reply.getVisitorStatistics().getBytesReturned()); + buf.putLong(null, reply.getVisitorStatistics().getSecondPassDocumentsReturned()); + buf.putLong(null, reply.getVisitorStatistics().getSecondPassBytesReturned()); + return true; + } + } + + public static class DestroyVisitorMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + DestroyVisitorMessage msg = new DestroyVisitorMessage(); + msg.setInstanceId(decodeString(buf)); + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + DestroyVisitorMessage msg = (DestroyVisitorMessage)obj; + encodeString(msg.getInstanceId(), buf); + return true; + } + } + + public static class DestroyVisitorReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new VisitorReply(DocumentProtocol.REPLY_DESTROYVISITOR); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class DocumentIgnoredReplyFactory extends DocumentReplyFactory { + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new DocumentIgnoredReply(); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class DocumentListMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + DocumentListMessage msg = new DocumentListMessage(); + msg.setBucketId(new BucketId(buf.getLong(null))); + int len = buf.getInt(null); + for (int i = 0; i < len; i++) { + msg.getDocuments().add(new DocumentListEntry(buf)); } + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + DocumentListMessage msg = (DocumentListMessage)obj; + buf.putLong(null, msg.getBucketId().getRawId()); + buf.putInt(null, msg.getDocuments().size()); + for (int i = 0; i < msg.getDocuments().size(); i++) { + msg.getDocuments().get(i).serialize(buf); + } return true; - } + } } - protected static class RemoveDocumentMessageFactory extends RoutableFactories51.RemoveDocumentMessageFactory { + public static class DocumentListReplyFactory extends DocumentReplyFactory { + @Override - protected void decodeInto(RemoveDocumentMessage msg, DocumentDeserializer buf) { - super.decodeInto(msg, buf); + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new VisitorReply(DocumentProtocol.REPLY_DOCUMENTLIST); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class DocumentSummaryMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + DocumentSummaryMessage msg = new DocumentSummaryMessage(); + msg.setDocumentSummary(new DocumentSummary(buf)); + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + return false; // not supported + } + } + + public static class DocumentSummaryReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new VisitorReply(DocumentProtocol.REPLY_DOCUMENTSUMMARY); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class EmptyBucketsMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + EmptyBucketsMessage msg = new EmptyBucketsMessage(); + int size = buf.getInt(null); + for (int i = 0; i < size; ++i) { + msg.getBucketIds().add(new BucketId(buf.getLong(null))); + } + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + EmptyBucketsMessage msg = (EmptyBucketsMessage)obj; + buf.putInt(null, msg.getBucketIds().size()); + for (BucketId bid : msg.getBucketIds()) { + buf.putLong(null, bid.getRawId()); + } + return true; + } + } + + public static class EmptyBucketsReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new VisitorReply(DocumentProtocol.REPLY_EMPTYBUCKETS); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class GetBucketListMessageFactory extends DocumentMessageFactory { + + protected String decodeBucketSpace(Deserializer deserializer) { + return FixedBucketSpaces.defaultSpace(); + } + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + GetBucketListMessage msg = new GetBucketListMessage(); + msg.setBucketId(new BucketId(buf.getLong(null))); + msg.setBucketSpace(decodeBucketSpace(buf)); + return msg; + } + + protected boolean encodeBucketSpace(String bucketSpace, DocumentSerializer buf) { + return FixedBucketSpaces.defaultSpace().equals(bucketSpace); + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + GetBucketListMessage msg = (GetBucketListMessage)obj; + buf.putLong(null, msg.getBucketId().getRawId()); + return encodeBucketSpace(msg.getBucketSpace(), buf); + } + } + + public static class GetBucketListReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + GetBucketListReply reply = new GetBucketListReply(); + int len = buf.getInt(null); + for (int i = 0; i < len; i++) { + GetBucketListReply.BucketInfo info = new GetBucketListReply.BucketInfo(); + info.bucket = new BucketId(buf.getLong(null)); + info.bucketInformation = decodeString(buf); + reply.getBuckets().add(info); + } + return reply; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + GetBucketListReply reply = (GetBucketListReply)obj; + buf.putInt(null, reply.getBuckets().size()); + for (GetBucketListReply.BucketInfo info : reply.getBuckets()) { + buf.putLong(null, info.bucket.getRawId()); + encodeString(info.bucketInformation, buf); + } + return true; + } + } + + public static class GetBucketStateMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + GetBucketStateMessage msg = new GetBucketStateMessage(); + msg.setBucketId(new BucketId(buf.getLong(null))); + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + GetBucketStateMessage msg = (GetBucketStateMessage)obj; + buf.putLong(null, msg.getBucketId().getRawId()); + return true; + } + } + + public static class GetBucketStateReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + GetBucketStateReply reply = new GetBucketStateReply(); + int size = buf.getInt(null); + for (int i = 0; i < size; i++) { + reply.getBucketState().add(new DocumentState(buf)); + } + return reply; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + GetBucketStateReply reply = (GetBucketStateReply)obj; + buf.putInt(null, reply.getBucketState().size()); + for (DocumentState stat : reply.getBucketState()) { + stat.serialize(buf); + } + return true; + } + } + + public static class GetDocumentMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + return new GetDocumentMessage(new DocumentId(buf), decodeString(buf)); + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + GetDocumentMessage msg = (GetDocumentMessage)obj; + msg.getDocumentId().serialize(buf); + encodeString(msg.getFieldSet(), buf); + return true; + } + } + + public static class GetDocumentReplyFactory extends DocumentReplyFactory { + + private final LazyDecoder decoder = new LazyDecoder() { + + public void decode(Routable obj, DocumentDeserializer buf) { + GetDocumentReply reply = (GetDocumentReply)obj; + + Document doc = null; + byte flag = buf.getByte(null); + if (flag != 0) { + doc = Document.createDocument(buf); + reply.setDocument(doc); + } + long lastModified = buf.getLong(null); + reply.setLastModified(lastModified); + if (doc != null) { + doc.setLastModified(lastModified); + } + } + }; + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + GetDocumentReply reply = new GetDocumentReply(decoder, buf); + + return reply; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + GetDocumentReply reply = (GetDocumentReply)obj; + if (reply.getSerializedBuffer() != null) { + buf.put(null, reply.getSerializedBuffer()); + } else { + Document document = reply.getDocument(); + buf.putByte(null, (byte)(document == null ? 0 : 1)); + if (document != null) { + document.serialize(buf); + } + buf.putLong(null, reply.getLastModified()); + } + return true; + } + } + + public static class MapVisitorMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + MapVisitorMessage msg = new MapVisitorMessage(); + int size = buf.getInt(null); + for (int i = 0; i < size; i++) { + String key = decodeString(buf); + String value = decodeString(buf); + msg.getData().put(key, value); + } + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + MapVisitorMessage msg = (MapVisitorMessage)obj; + buf.putInt(null, msg.getData().size()); + for (Map.Entry<String, String> pairs : msg.getData().entrySet()) { + encodeString(pairs.getKey(), buf); + encodeString(pairs.getValue(), buf); + } + return true; + } + } + + public static class MapVisitorReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new VisitorReply(DocumentProtocol.REPLY_MAPVISITOR); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class PutDocumentMessageFactory extends DocumentMessageFactory { + protected void decodeInto(PutDocumentMessage msg, DocumentDeserializer buf) { + msg.setDocumentPut(new DocumentPut(Document.createDocument(buf))); + msg.setTimestamp(buf.getLong(null)); decodeTasCondition(msg, buf); } @Override + protected DocumentMessage doDecode(DocumentDeserializer buffer) { + final LazyDecoder decoder = (obj, buf) -> { + decodeInto((PutDocumentMessage) obj, buf); + }; + + return new PutDocumentMessage(decoder, buffer); + } + + @Override protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - if (!super.doEncode(obj, buf)) { - return false; + PutDocumentMessage msg = (PutDocumentMessage)obj; + if (msg.getSerializedBuffer() != null) { + buf.put(null, msg.getSerializedBuffer()); + } else { + msg.getDocumentPut().getDocument().serialize(buf); + buf.putLong(null, msg.getTimestamp()); + encodeTasCondition(buf, (TestAndSetMessage) obj); } + return true; + } + } + public static class PutDocumentReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + WriteDocumentReply rep = new WriteDocumentReply(DocumentProtocol.REPLY_PUTDOCUMENT); + rep.setHighestModificationTimestamp(buf.getLong(null)); + return rep; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + WriteDocumentReply rep = (WriteDocumentReply)obj; + buf.putLong(null, rep.getHighestModificationTimestamp()); + return true; + } + } + + public static class RemoveDocumentMessageFactory extends DocumentMessageFactory { + protected void decodeInto(RemoveDocumentMessage msg, DocumentDeserializer buf) { + msg.setDocumentId(new DocumentId(buf)); + decodeTasCondition(msg, buf); + } + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + RemoveDocumentMessage msg = new RemoveDocumentMessage(); + decodeInto(msg, buf); + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + RemoveDocumentMessage msg = (RemoveDocumentMessage)obj; + msg.getDocumentId().serialize(buf); encodeTasCondition(buf, (TestAndSetMessage) obj); return true; } } - protected static class UpdateDocumentMessageFactory extends RoutableFactories51.UpdateDocumentMessageFactory { + public static class RemoveDocumentReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + RemoveDocumentReply reply = new RemoveDocumentReply(); + byte flag = buf.getByte(null); + reply.setWasFound(flag != 0); + reply.setHighestModificationTimestamp(buf.getLong(null)); + return reply; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + RemoveDocumentReply reply = (RemoveDocumentReply)obj; + buf.putByte(null, (byte)(reply.wasFound() ? 1 : 0)); + buf.putLong(null, reply.getHighestModificationTimestamp()); + return true; + } + } + + public static class RemoveLocationMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + return new RemoveLocationMessage(decodeString(buf)); + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + RemoveLocationMessage msg = (RemoveLocationMessage)obj; + encodeString(msg.getDocumentSelection(), buf); + return true; + } + } + + public static class RemoveLocationReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new DocumentReply(DocumentProtocol.REPLY_REMOVELOCATION); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class SearchResultMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + SearchResultMessage msg = new SearchResultMessage(); + msg.setSearchResult(new SearchResult(buf)); + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + return false; // not supported + } + } + + public static class QueryResultMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + QueryResultMessage msg = new QueryResultMessage(); + msg.setSearchResult(new SearchResult(buf)); + msg.setSummary(new DocumentSummary(buf)); + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + return false; // not supported + } + } + + public static class SearchResultReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new VisitorReply(DocumentProtocol.REPLY_SEARCHRESULT); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class QueryResultReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new VisitorReply(DocumentProtocol.REPLY_QUERYRESULT); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class StatBucketMessageFactory extends DocumentMessageFactory { + + protected String decodeBucketSpace(Deserializer deserializer) { + return FixedBucketSpaces.defaultSpace(); + } + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + StatBucketMessage msg = new StatBucketMessage(); + msg.setBucketId(new BucketId(buf.getLong(null))); + msg.setDocumentSelection(decodeString(buf)); + msg.setBucketSpace(decodeBucketSpace(buf)); + return msg; + } + + protected boolean encodeBucketSpace(String bucketSpace, DocumentSerializer buf) { + return FixedBucketSpaces.defaultSpace().equals(bucketSpace); + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + StatBucketMessage msg = (StatBucketMessage)obj; + buf.putLong(null, msg.getBucketId().getRawId()); + encodeString(msg.getDocumentSelection(), buf); + return encodeBucketSpace(msg.getBucketSpace(), buf); + } + } + + public static class StatBucketReplyFactory extends DocumentReplyFactory { + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + StatBucketReply reply = new StatBucketReply(); + reply.setResults(decodeString(buf)); + return reply; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + StatBucketReply reply = (StatBucketReply)obj; + encodeString(reply.getResults(), buf); + return true; + } + } + + public static class UpdateDocumentMessageFactory extends DocumentMessageFactory { protected void decodeInto(UpdateDocumentMessage msg, DocumentDeserializer buf) { - super.decodeInto(msg, buf); + msg.setDocumentUpdate(new DocumentUpdate(buf)); + msg.setOldTimestamp(buf.getLong(null)); + msg.setNewTimestamp(buf.getLong(null)); decodeTasCondition(msg, buf); } @Override + protected DocumentMessage doDecode(DocumentDeserializer buffer) { + final LazyDecoder decoder = (obj, buf) -> { + decodeInto((UpdateDocumentMessage) obj, buf); + }; + + return new UpdateDocumentMessage(decoder, buffer); + } + + @Override protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { - if (!super.doEncode(obj, buf)) { - return false; + UpdateDocumentMessage msg = (UpdateDocumentMessage)obj; + if (msg.getSerializedBuffer() != null) { + buf.put(null, msg.getSerializedBuffer()); + } else { + msg.getDocumentUpdate().serialize(buf); + buf.putLong(null, msg.getOldTimestamp()); + buf.putLong(null, msg.getNewTimestamp()); + encodeTasCondition(buf, (TestAndSetMessage) obj); } + return true; + } + } - // If the serialized buffer exists, the test and set condition has already been encoded - if (((UpdateDocumentMessage)obj).getSerializedBuffer() == null) { - encodeTasCondition(buf, (TestAndSetMessage) obj); + public static class UpdateDocumentReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + UpdateDocumentReply rep = new UpdateDocumentReply(); + byte flag = buf.getByte(null); + rep.setWasFound(flag != 0); + rep.setHighestModificationTimestamp(buf.getLong(null)); + return rep; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + UpdateDocumentReply rep = (UpdateDocumentReply)obj; + buf.putByte(null, (byte)(rep.wasFound() ? 1 : 0)); + buf.putLong(null, rep.getHighestModificationTimestamp()); + return true; + } + } + + public static class VisitorInfoMessageFactory extends DocumentMessageFactory { + + @Override + protected DocumentMessage doDecode(DocumentDeserializer buf) { + VisitorInfoMessage msg = new VisitorInfoMessage(); + int size = buf.getInt(null); + for (int i = 0; i < size; i++) { + long reversed = buf.getLong(null); + long rawid = ((reversed >>> 56) & 0x00000000000000FFl) | ((reversed >>> 40) & 0x000000000000FF00l) | + ((reversed >>> 24) & 0x0000000000FF0000l) | ((reversed >>> 8) & 0x00000000FF000000l) | + ((reversed << 8) & 0x000000FF00000000l) | ((reversed << 24) & 0x0000FF0000000000l) | + ((reversed << 40) & 0x00FF000000000000l) | ((reversed << 56) & 0xFF00000000000000l); + msg.getFinishedBuckets().add(new BucketId(rawid)); } + msg.setErrorMessage(decodeString(buf)); + return msg; + } + + @Override + protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { + VisitorInfoMessage msg = (VisitorInfoMessage)obj; + buf.putInt(null, msg.getFinishedBuckets().size()); + for (BucketId id : msg.getFinishedBuckets()) { + long rawid = id.getRawId(); + long reversed = ((rawid >>> 56) & 0x00000000000000FFl) | ((rawid >>> 40) & 0x000000000000FF00l) | + ((rawid >>> 24) & 0x0000000000FF0000l) | ((rawid >>> 8) & 0x00000000FF000000l) | + ((rawid << 8) & 0x000000FF00000000l) | ((rawid << 24) & 0x0000FF0000000000l) | + ((rawid << 40) & 0x00FF000000000000l) | ((rawid << 56) & 0xFF00000000000000l); + buf.putLong(null, reversed); + } + encodeString(msg.getErrorMessage(), buf); return true; } } + public static class VisitorInfoReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + return new VisitorReply(DocumentProtocol.REPLY_VISITORINFO); + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + return true; + } + } + + public static class WrongDistributionReplyFactory extends DocumentReplyFactory { + + @Override + protected DocumentReply doDecode(DocumentDeserializer buf) { + WrongDistributionReply reply = new WrongDistributionReply(); + reply.setSystemState(decodeString(buf)); + return reply; + } + + @Override + protected boolean doEncode(DocumentReply obj, DocumentSerializer buf) { + WrongDistributionReply reply = (WrongDistributionReply)obj; + encodeString(reply.getSystemState(), buf); + return true; + } + } static void decodeTasCondition(TestAndSetMessage msg, DocumentDeserializer buf) { msg.setCondition(new TestAndSetCondition(decodeString(buf))); } diff --git a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocolTest.java b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocolTest.java deleted file mode 100644 index 50778e00519..00000000000 --- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocolTest.java +++ /dev/null @@ -1,36 +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.component.Version; -import com.yahoo.document.DocumentId; -import com.yahoo.document.DocumentTypeManager; -import com.yahoo.document.DocumentTypeManagerConfigurer; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -/** - * @author Simon Thoresen Hult - */ -public class DocumentProtocolTest { - - private final DocumentTypeManager manager = new DocumentTypeManager(); - - @Before - public void setUp() { - DocumentTypeManagerConfigurer.configure(manager, "file:./test/cfg/testdoc.cfg"); - } - - @SuppressWarnings("deprecation") - @Test - public void requireThat50SerializationPrecedes5xSerialization() { - DocumentProtocol protocol = new DocumentProtocol(manager); - GetDocumentMessage prev = new GetDocumentMessage(new DocumentId("doc:scheme:"), "foo"); - byte[] buf = protocol.encode(new Version(5, 0), prev); - - GetDocumentMessage next = (GetDocumentMessage)protocol.decode(new Version(5, 0), buf); - assertEquals(GetDocumentMessage.DEFAULT_FIELD_SET, next.getFieldSet()); - } - -} 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 deleted file mode 100644 index 18411fd26fa..00000000000 --- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages50TestCase.java +++ /dev/null @@ -1,855 +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.test; - -import com.yahoo.component.Version; -import com.yahoo.document.*; -import com.yahoo.document.fieldpathupdate.RemoveFieldPathUpdate; -import com.yahoo.document.idstring.IdString; -import com.yahoo.document.select.OrderingSpecification; -import com.yahoo.documentapi.messagebus.protocol.*; -import com.yahoo.messagebus.Routable; -import com.yahoo.text.Utf8; -import com.yahoo.vdslib.DocumentList; -import com.yahoo.vdslib.Entry; -import com.yahoo.vdslib.SearchResult; - -import java.io.FileInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import static org.junit.Assert.*; - -/** - * @author Simon Thoresen Hult - */ -public class Messages50TestCase extends MessagesTestBase { - - @Override - 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_CREATEVISITOR, new testCreateVisitorMessage()); - out.put(DocumentProtocol.MESSAGE_DESTROYVISITOR, new testDestroyVisitorMessage()); - out.put(DocumentProtocol.MESSAGE_DOCUMENTLIST, new testDocumentListMessage()); - out.put(DocumentProtocol.MESSAGE_DOCUMENTSUMMARY, new testDocumentSummaryMessage()); - out.put(DocumentProtocol.MESSAGE_EMPTYBUCKETS, new testEmptyBucketsMessage()); - out.put(DocumentProtocol.MESSAGE_GETBUCKETLIST, new testGetBucketListMessage()); - out.put(DocumentProtocol.MESSAGE_GETBUCKETSTATE, new testGetBucketStateMessage()); - out.put(DocumentProtocol.MESSAGE_GETDOCUMENT, new testGetDocumentMessage()); - out.put(DocumentProtocol.MESSAGE_MAPVISITOR, new testMapVisitorMessage()); - out.put(DocumentProtocol.MESSAGE_PUTDOCUMENT, new testPutDocumentMessage()); - out.put(DocumentProtocol.MESSAGE_QUERYRESULT, new testQueryResultMessage()); - out.put(DocumentProtocol.MESSAGE_REMOVEDOCUMENT, new testRemoveDocumentMessage()); - out.put(DocumentProtocol.MESSAGE_REMOVELOCATION, new testRemoveLocationMessage()); - out.put(DocumentProtocol.MESSAGE_SEARCHRESULT, new testSearchResultMessage()); - 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_CREATEVISITOR, new testCreateVisitorReply()); - out.put(DocumentProtocol.REPLY_DESTROYVISITOR, new testDestroyVisitorReply()); - out.put(DocumentProtocol.REPLY_DOCUMENTLIST, new testDocumentListReply()); - out.put(DocumentProtocol.REPLY_DOCUMENTSUMMARY, new testDocumentSummaryReply()); - out.put(DocumentProtocol.REPLY_EMPTYBUCKETS, new testEmptyBucketsReply()); - out.put(DocumentProtocol.REPLY_GETBUCKETLIST, new testGetBucketListReply()); - out.put(DocumentProtocol.REPLY_GETBUCKETSTATE, new testGetBucketStateReply()); - out.put(DocumentProtocol.REPLY_GETDOCUMENT, new testGetDocumentReply()); - out.put(DocumentProtocol.REPLY_MAPVISITOR, new testMapVisitorReply()); - out.put(DocumentProtocol.REPLY_PUTDOCUMENT, new testPutDocumentReply()); - out.put(DocumentProtocol.REPLY_QUERYRESULT, new testQueryResultReply()); - out.put(DocumentProtocol.REPLY_REMOVEDOCUMENT, new testRemoveDocumentReply()); - out.put(DocumentProtocol.REPLY_REMOVELOCATION, new testRemoveLocationReply()); - out.put(DocumentProtocol.REPLY_SEARCHRESULT, new testSearchResultReply()); - out.put(DocumentProtocol.REPLY_STATBUCKET, new testStatBucketReply()); - out.put(DocumentProtocol.REPLY_UPDATEDOCUMENT, new testUpdateDocumentReply()); - out.put(DocumentProtocol.REPLY_VISITORINFO, new testVisitorInfoReply()); - out.put(DocumentProtocol.REPLY_WRONGDISTRIBUTION, new testWrongDistributionReply()); - } - - @Override - protected Version version() { - return new Version(5, 0); - } - - @Override - protected boolean shouldTestCoverage() { - return false; - } - - //////////////////////////////////////////////////////////////////////////////// - // - // Tests - // - //////////////////////////////////////////////////////////////////////////////// - - private static int BASE_MESSAGE_LENGTH = 5; - - public class testRemoveLocationMessage implements RunnableTest { - - @Override - public void run() { - { - RemoveLocationMessage msg = new RemoveLocationMessage("id.group == \"mygroup\""); - assertEquals(BASE_MESSAGE_LENGTH + 29, serialize("RemoveLocationMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (RemoveLocationMessage)deserialize("RemoveLocationMessage", DocumentProtocol.MESSAGE_REMOVELOCATION, lang); - assertEquals("id.group == \"mygroup\"", msg.getDocumentSelection()); - } - } - } - } - - public class testGetBucketListMessage implements RunnableTest { - - @Override - public void run() { - GetBucketListMessage msg = new GetBucketListMessage(new BucketId(16, 123)); - msg.setLoadType(loadTypes.getNameMap().get("foo")); - assertEquals(BASE_MESSAGE_LENGTH + 12, serialize("GetBucketListMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (GetBucketListMessage)deserialize("GetBucketListMessage", DocumentProtocol.MESSAGE_GETBUCKETLIST, lang); - assertEquals(new BucketId(16, 123), msg.getBucketId()); - assertEquals("foo", msg.getLoadType().getName()); - } - } - } - - - public class testStatBucketMessage implements RunnableTest { - - @Override - public void run() { - StatBucketMessage msg = new StatBucketMessage(new BucketId(16, 123), "id.user=123"); - msg.setLoadType(null); - assertEquals(BASE_MESSAGE_LENGTH + 27, serialize("StatBucketMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (StatBucketMessage)deserialize("StatBucketMessage", DocumentProtocol.MESSAGE_STATBUCKET, lang); - assertEquals(new BucketId(16, 123), msg.getBucketId()); - assertEquals("id.user=123", msg.getDocumentSelection()); - assertEquals("default", msg.getLoadType().getName()); - } - } - } - - public class testGetBucketStateMessage implements RunnableTest { - - @Override - public void run() { - GetBucketStateMessage msg = new GetBucketStateMessage(new BucketId(16, 666)); - assertEquals(BASE_MESSAGE_LENGTH + 12, serialize("GetBucketStateMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (GetBucketStateMessage)deserialize("GetBucketStateMessage", DocumentProtocol.MESSAGE_GETBUCKETSTATE, lang); - assertEquals(16, msg.getBucketId().getUsedBits()); - assertEquals(4611686018427388570l, msg.getBucketId().getId()); - } - } - } - - public class testCreateVisitorMessage implements RunnableTest { - - @Override - @SuppressWarnings("deprecation") - public void run() { - CreateVisitorMessage msg = new CreateVisitorMessage("SomeLibrary", "myvisitor", "newyork", "london"); - msg.setDocumentSelection("true and false or true"); - msg.getParameters().put("myvar", Utf8.toBytes("somevalue")); - msg.getParameters().put("anothervar", Utf8.toBytes("34")); - msg.getBuckets().add(new BucketId(16, 1234)); - msg.setVisitRemoves(true); - msg.setVisitorOrdering(OrderingSpecification.DESCENDING); - msg.setMaxBucketsPerVisitor(2); - assertEquals(BASE_MESSAGE_LENGTH + 168, serialize("CreateVisitorMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (CreateVisitorMessage)deserialize("CreateVisitorMessage", DocumentProtocol.MESSAGE_CREATEVISITOR, lang); - assertEquals("SomeLibrary", msg.getLibraryName()); - assertEquals("myvisitor", msg.getInstanceId()); - assertEquals("newyork", msg.getControlDestination()); - assertEquals("london", msg.getDataDestination()); - assertEquals("true and false or true", msg.getDocumentSelection()); - assertEquals(8, msg.getMaxPendingReplyCount()); - assertEquals(true, msg.getVisitRemoves()); - assertEquals(false, msg.getVisitInconsistentBuckets()); - assertEquals(1, msg.getBuckets().size()); - assertEquals(new BucketId(16, 1234), msg.getBuckets().iterator().next()); - assertEquals("somevalue", Utf8.toString(msg.getParameters().get("myvar"))); - assertEquals("34", Utf8.toString(msg.getParameters().get("anothervar"))); - assertEquals(OrderingSpecification.DESCENDING, msg.getVisitorOrdering()); - assertEquals(2, msg.getMaxBucketsPerVisitor()); - } - - msg.getBuckets().clear(); - - assertEquals("CreateVisitorMessage(" + - "No buckets, " + - "selection 'true and false or true', " + - "bucket space 'default', " + - "library SomeLibrary, including removes, " + - "get fields: [all]" + - ")", - msg.toString()); - - msg.getBuckets().add(new BucketId(16, 1234)); - - assertEquals("CreateVisitorMessage(" + - "Bucket BucketId(0x40000000000004d2), " + - "selection 'true and false or true', " + - "bucket space 'default', " + - "library SomeLibrary, including removes, " + - "get fields: [all]" + - ")", - msg.toString()); - - msg.getBuckets().add(new BucketId(16, 1235)); - msg.getBuckets().add(new BucketId(16, 1236)); - msg.getBuckets().add(new BucketId(16, 1237)); - msg.getBuckets().add(new BucketId(16, 1238)); - msg.setFromTimestamp(10001); - msg.setToTimestamp(20002); - msg.setVisitInconsistentBuckets(true); - assertEquals("CreateVisitorMessage(" + - "5 buckets: BucketId(0x40000000000004d2) BucketId(0x40000000000004d3) BucketId(0x40000000000004d4) ..., " + - "time 10001-20002, " + - "selection 'true and false or true', " + - "bucket space 'default', " + - "library SomeLibrary, including removes, " + - "get fields: [all], " + - "visit inconsistent buckets" + - ")", - msg.toString()); - } - } - - public class testCreateVisitorReply implements RunnableTest { - - @Override - public void run() { - CreateVisitorReply reply = new CreateVisitorReply(DocumentProtocol.REPLY_CREATEVISITOR); - reply.setLastBucket(new BucketId(16, 123)); - reply.getVisitorStatistics().setBucketsVisited(3); - reply.getVisitorStatistics().setDocumentsVisited(1000); - reply.getVisitorStatistics().setBytesVisited(1024000); - reply.getVisitorStatistics().setDocumentsReturned(123); - reply.getVisitorStatistics().setBytesReturned(512000); - reply.getVisitorStatistics().setSecondPassDocumentsReturned(456); - reply.getVisitorStatistics().setSecondPassBytesReturned(789100); - - assertEquals(65, serialize("CreateVisitorReply", reply)); - - for (Language lang : LANGUAGES) { - reply = (CreateVisitorReply)deserialize("CreateVisitorReply", DocumentProtocol.REPLY_CREATEVISITOR, lang); - assertNotNull(reply); - assertEquals(new BucketId(16, 123), reply.getLastBucket()); - assertEquals(3, reply.getVisitorStatistics().getBucketsVisited()); - assertEquals(1000, reply.getVisitorStatistics().getDocumentsVisited()); - assertEquals(1024000, reply.getVisitorStatistics().getBytesVisited()); - assertEquals(123, reply.getVisitorStatistics().getDocumentsReturned()); - assertEquals(512000, reply.getVisitorStatistics().getBytesReturned()); - assertEquals(456, reply.getVisitorStatistics().getSecondPassDocumentsReturned()); - assertEquals(789100, reply.getVisitorStatistics().getSecondPassBytesReturned()); - } - } - } - - public class testDestroyVisitorReply implements RunnableTest { - - @Override - public void run() { - testVisitorReply("DestroyVisitorReply", DocumentProtocol.REPLY_DESTROYVISITOR); - } - } - - public class testDocumentListReply implements RunnableTest { - - @Override - public void run() { - testVisitorReply("DocumentListReply", DocumentProtocol.REPLY_DOCUMENTLIST); - } - } - - public class testDocumentSummaryReply implements RunnableTest { - - @Override - public void run() { - testVisitorReply("DocumentSummaryReply", DocumentProtocol.REPLY_DOCUMENTSUMMARY); - } - } - - public class testEmptyBucketsReply implements RunnableTest { - - @Override - public void run() { - testVisitorReply("EmptyBucketsReply", DocumentProtocol.REPLY_EMPTYBUCKETS); - } - } - - public class testDestroyVisitorMessage implements RunnableTest { - - @Override - public void run() { - DestroyVisitorMessage msg = new DestroyVisitorMessage("myvisitor"); - assertEquals(BASE_MESSAGE_LENGTH + 17, serialize("DestroyVisitorMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (DestroyVisitorMessage)deserialize("DestroyVisitorMessage", DocumentProtocol.MESSAGE_DESTROYVISITOR, lang); - assertEquals("myvisitor", msg.getInstanceId()); - } - } - } - - public class testDocumentListMessage implements RunnableTest { - - @Override - public void run() { - DocumentListMessage msg = (DocumentListMessage)deserialize("DocumentListMessage", DocumentProtocol.MESSAGE_DOCUMENTLIST, Language.CPP); - assertEquals("userdoc:scheme:1234:", msg.getDocuments().get(0).getDocument().getId().toString()); - assertEquals(1234, msg.getDocuments().get(0).getTimestamp()); - assertFalse(msg.getDocuments().get(0).isRemoveEntry()); - - assertEquals(BASE_MESSAGE_LENGTH + 63, serialize("DocumentListMessage", msg)); - msg = (DocumentListMessage)deserialize("DocumentListMessage", DocumentProtocol.MESSAGE_DOCUMENTLIST, Language.JAVA); - assertEquals("userdoc:scheme:1234:", msg.getDocuments().get(0).getDocument().getId().toString()); - assertEquals(1234, msg.getDocuments().get(0).getTimestamp()); - assertFalse(msg.getDocuments().get(0).isRemoveEntry()); - - } - } - - public class testEmptyBucketsMessage implements RunnableTest { - - @Override - public void run() { - List<BucketId> bids = new ArrayList<>(); - for (int i = 0; i < 13; ++i) { - bids.add(new BucketId(16, i)); - } - - EmptyBucketsMessage ebm = new EmptyBucketsMessage(bids); - assertEquals(BASE_MESSAGE_LENGTH + 112, serialize("EmptyBucketsMessage", ebm)); - for (Language lang : LANGUAGES) { - ebm = (EmptyBucketsMessage)deserialize("EmptyBucketsMessage", DocumentProtocol.MESSAGE_EMPTYBUCKETS, lang); - for (int i = 0; i < 13; ++i) { - assertEquals(new BucketId(16, i), ebm.getBucketIds().get(i)); - } - } - } - } - - public class testDocumentSummaryMessage implements RunnableTest { - - @Override - public void run() { - Routable routable = deserialize("DocumentSummaryMessage-1", DocumentProtocol.MESSAGE_DOCUMENTSUMMARY, Language.CPP); - assertTrue(routable instanceof DocumentSummaryMessage); - - DocumentSummaryMessage msg = (DocumentSummaryMessage) routable; - assertEquals(0, msg.getResult().getSummaryCount()); - - routable = deserialize("DocumentSummaryMessage-2", DocumentProtocol.MESSAGE_DOCUMENTSUMMARY, Language.CPP); - assertTrue(routable instanceof DocumentSummaryMessage); - - msg = (DocumentSummaryMessage) routable; - assertEquals(2, msg.getResult().getSummaryCount()); - com.yahoo.vdslib.DocumentSummary.Summary s = msg.getResult().getSummary(0); - assertEquals("doc1", s.getDocId()); - byte[] b = s.getSummary(); - assertEquals(8, b.length); - byte[] c = {'s', 'u', 'm', 'm', 'a', 'r', 'y', '1'}; - for (int i = 0; i < b.length; i++) { - assertEquals(c[i], b[i]); - } - - s = msg.getResult().getSummary(1); - assertEquals("aoc17", s.getDocId()); - b = s.getSummary(); - assertEquals(9, b.length); - byte[] d = {'s', 'u', 'm', 'm', 'a', 'r', 'y', '4', '5'}; - for (int i = 0; i < b.length; i++) { - assertEquals(d[i], b[i]); - } - routable = deserialize("DocumentSummaryMessage-3", DocumentProtocol.MESSAGE_DOCUMENTSUMMARY, Language.CPP); - assertTrue(routable instanceof DocumentSummaryMessage); - - msg = (DocumentSummaryMessage) routable; - assertEquals(2, msg.getResult().getSummaryCount()); - - s = msg.getResult().getSummary(0); - assertEquals("aoc17", s.getDocId()); - b = s.getSummary(); - assertEquals(9, b.length); - byte[] e = {'s', 'u', 'm', 'm', 'a', 'r', 'y', '4', '5'}; - for (int i = 0; i < b.length; i++) { - assertEquals(e[i], b[i]); - } - - s = msg.getResult().getSummary(1); - assertEquals("doc1", s.getDocId()); - b = s.getSummary(); - assertEquals(8, b.length); - byte[] f = {'s', 'u', 'm', 'm', 'a', 'r', 'y', '1'}; - for (int i = 0; i < b.length; i++) { - assertEquals(f[i], b[i]); - } - } - } - - - public class testGetDocumentMessage implements RunnableTest { - - @Override - @SuppressWarnings("deprecation") - public void run() { - GetDocumentMessage msg = new GetDocumentMessage(new DocumentId("doc:scheme:")); - assertEquals(BASE_MESSAGE_LENGTH + 20, serialize("GetDocumentMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (GetDocumentMessage)deserialize("GetDocumentMessage", DocumentProtocol.MESSAGE_GETDOCUMENT, lang); - assertEquals("doc:scheme:", msg.getDocumentId().toString()); - } - } - } - - - public class testRemoveDocumentMessage implements RunnableTest { - - @Override - public void run() { - RemoveDocumentMessage msg = new RemoveDocumentMessage(new DocumentId("doc:scheme:")); - assertEquals(BASE_MESSAGE_LENGTH + 16, serialize("RemoveDocumentMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (RemoveDocumentMessage)deserialize("RemoveDocumentMessage", DocumentProtocol.MESSAGE_REMOVEDOCUMENT, lang); - assertEquals("doc:scheme:", msg.getDocumentId().toString()); - } - } - } - - public class testMapVisitorMessage implements RunnableTest { - - @Override - public void run() { - MapVisitorMessage msg = (MapVisitorMessage)deserialize("MapVisitorMessage", DocumentProtocol.MESSAGE_MAPVISITOR, Language.CPP); - assertEquals("3", msg.getData().get("foo")); - assertEquals("5", msg.getData().get("bar")); - - assertEquals(BASE_MESSAGE_LENGTH + 32, serialize("MapVisitorMessage", msg)); - - msg = (MapVisitorMessage)deserialize("MapVisitorMessage", DocumentProtocol.MESSAGE_MAPVISITOR, Language.JAVA); - assertEquals("3", msg.getData().get("foo")); - assertEquals("5", msg.getData().get("bar")); - } - } - - - public class testVisitorInfoMessage implements RunnableTest { - - @Override - public void run() { - VisitorInfoMessage msg = new VisitorInfoMessage(); - msg.getFinishedBuckets().add(new BucketId(16, 1)); - msg.getFinishedBuckets().add(new BucketId(16, 2)); - msg.getFinishedBuckets().add(new BucketId(16, 4)); - msg.setErrorMessage("error message: \u00e6\u00c6\u00f8\u00d8\u00e5\u00c5\u00f6\u00d6"); - assertEquals(BASE_MESSAGE_LENGTH + 67, serialize("VisitorInfoMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (VisitorInfoMessage)deserialize("VisitorInfoMessage", DocumentProtocol.MESSAGE_VISITORINFO, lang); - assertTrue(msg.getFinishedBuckets().contains(new BucketId(16, 1))); - assertTrue(msg.getFinishedBuckets().contains(new BucketId(16, 2))); - assertTrue(msg.getFinishedBuckets().contains(new BucketId(16, 4))); - assertEquals("error message: \u00e6\u00c6\u00f8\u00d8\u00e5\u00c5\u00f6\u00d6", msg.getErrorMessage()); - } - } - } - - public class testSearchResultMessage implements RunnableTest { - - @Override - public void run() throws Exception { - Routable routable = deserialize("SearchResultMessage-1", DocumentProtocol.MESSAGE_SEARCHRESULT, Language.CPP); - assertTrue(routable instanceof SearchResultMessage); - - SearchResultMessage msg = (SearchResultMessage)routable; - assertEquals(0, msg.getResult().getHitCount()); - - routable = deserialize("SearchResultMessage-2", DocumentProtocol.MESSAGE_SEARCHRESULT, Language.CPP); - assertTrue(routable instanceof SearchResultMessage); - - msg = (SearchResultMessage)routable; - assertEquals(2, msg.getResult().getHitCount()); - com.yahoo.vdslib.SearchResult.Hit h = msg.getResult().getHit(0); - assertEquals(89.0, h.getRank(), 1E-6); - assertEquals("doc1", h.getDocId()); - h = msg.getResult().getHit(1); - assertEquals(109.0, h.getRank(), 1E-6); - assertEquals("doc17", h.getDocId()); - - routable = deserialize("SearchResultMessage-3", DocumentProtocol.MESSAGE_SEARCHRESULT, Language.CPP); - assertTrue(routable instanceof SearchResultMessage); - - msg = (SearchResultMessage)routable; - assertEquals(2, msg.getResult().getHitCount()); - h = msg.getResult().getHit(0); - assertEquals(109.0, h.getRank(), 1E-6); - assertEquals("doc17", h.getDocId()); - h = msg.getResult().getHit(1); - assertEquals(89.0, h.getRank(), 1E-6); - assertEquals("doc1", h.getDocId()); - - routable = deserialize("SearchResultMessage-4", DocumentProtocol.MESSAGE_SEARCHRESULT, Language.CPP); - assertTrue(routable instanceof SearchResultMessage); - - msg = (SearchResultMessage)routable; - assertEquals(3, msg.getResult().getHitCount()); - h = msg.getResult().getHit(0); - assertTrue(h instanceof SearchResult.HitWithSortBlob); - assertEquals(89.0, h.getRank(), 1E-6); - assertEquals("doc1", h.getDocId()); - byte[] b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); - assertEquals(9, b.length); - byte[] e = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '2' }; - for (int i = 0; i < b.length; i++) { - assertEquals(e[i], b[i]); - } - h = msg.getResult().getHit(1); - assertTrue(h instanceof SearchResult.HitWithSortBlob); - assertEquals(109.0, h.getRank(), 1E-6); - assertEquals("doc17", h.getDocId()); - b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); - assertEquals(9, b.length); - byte[] d = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '1' }; - for (int i = 0; i < b.length; i++) { - assertEquals(d[i], b[i]); - } - h = msg.getResult().getHit(2); - assertTrue(h instanceof SearchResult.HitWithSortBlob); - assertEquals(90.0, h.getRank(), 1E-6); - assertEquals("doc18", h.getDocId()); - b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); - assertEquals(9, b.length); - byte[] c = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '3' }; - for (int i = 0; i < b.length; i++) { - assertEquals(c[i], b[i]); - } - } - } - - public class testPutDocumentMessage implements RunnableTest { - - @Override - public void run() { - PutDocumentMessage msg = new PutDocumentMessage(new DocumentPut(new Document(protocol.getDocumentTypeManager().getDocumentType("testdoc"), "doc:scheme:"))); - msg.setTimestamp(666); - assertEquals(BASE_MESSAGE_LENGTH + 41, serialize("PutDocumentMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (PutDocumentMessage)deserialize("PutDocumentMessage", DocumentProtocol.MESSAGE_PUTDOCUMENT, lang); - assertEquals("testdoc", msg.getDocumentPut().getDocument().getDataType().getName()); - assertEquals("doc:scheme:", msg.getDocumentPut().getDocument().getId().toString()); - assertEquals(666, msg.getTimestamp()); - } - } - } - - public class testPutDocumentReply implements RunnableTest { - - @Override - public void run() { - WriteDocumentReply reply = new WriteDocumentReply(DocumentProtocol.REPLY_PUTDOCUMENT); - reply.setHighestModificationTimestamp(30); - - assertEquals(13, serialize("PutDocumentReply", reply)); - - for (Language lang : LANGUAGES) { - WriteDocumentReply obj = (WriteDocumentReply)deserialize("PutDocumentReply", DocumentProtocol.REPLY_PUTDOCUMENT, lang); - assertNotNull(obj); - assertEquals(30, obj.getHighestModificationTimestamp()); - } - } - } - - public class testUpdateDocumentMessage implements RunnableTest { - - @Override - public void run() { - DocumentType docType = protocol.getDocumentTypeManager().getDocumentType("testdoc"); - DocumentUpdate update = new DocumentUpdate(docType, new DocumentId("doc:scheme:")); - update.addFieldPathUpdate(new RemoveFieldPathUpdate(docType, "intfield", "testdoc.intfield > 0")); - UpdateDocumentMessage msg = new UpdateDocumentMessage(update); - msg.setNewTimestamp(777); - msg.setOldTimestamp(666); - - assertEquals(BASE_MESSAGE_LENGTH + 89, serialize("UpdateDocumentMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (UpdateDocumentMessage)deserialize("UpdateDocumentMessage", DocumentProtocol.MESSAGE_UPDATEDOCUMENT, lang); - assertEquals(update, msg.getDocumentUpdate()); - assertEquals(777, msg.getNewTimestamp()); - assertEquals(666, msg.getOldTimestamp()); - } - } - } - - public class testUpdateDocumentReply implements RunnableTest { - - @Override - public void run() { - UpdateDocumentReply reply = new UpdateDocumentReply(); - reply.setHighestModificationTimestamp(30); - reply.setWasFound(false); - - assertEquals(14, serialize("UpdateDocumentReply", reply)); - - for (Language lang : LANGUAGES) { - UpdateDocumentReply obj = (UpdateDocumentReply)deserialize("UpdateDocumentReply", DocumentProtocol.REPLY_UPDATEDOCUMENT, lang); - assertNotNull(obj); - assertEquals(30, reply.getHighestModificationTimestamp()); - assertEquals(false, obj.wasFound()); - } - } - } - - public class testVisitorInfoReply implements RunnableTest { - - @Override - public void run() { - testVisitorReply("VisitorInfoReply", DocumentProtocol.REPLY_VISITORINFO); - } - } - - public class testWrongDistributionReply implements RunnableTest { - - @Override - public void run() { - WrongDistributionReply reply = new WrongDistributionReply("distributor:3 storage:2"); - assertEquals(32, serialize("WrongDistributionReply", reply)); - - for (Language lang : LANGUAGES) { - reply = (WrongDistributionReply)deserialize("WrongDistributionReply", DocumentProtocol.REPLY_WRONGDISTRIBUTION, lang); - assertEquals("distributor:3 storage:2", reply.getSystemState()); - } - } - } - - public class testRemoveDocumentReply implements RunnableTest { - - @Override - public void run() { - RemoveDocumentReply reply = new RemoveDocumentReply(); - reply.setHighestModificationTimestamp(30); - reply.setWasFound(false); - - assertEquals(14, serialize("RemoveDocumentReply", reply)); - - for (Language lang : LANGUAGES) { - RemoveDocumentReply obj = (RemoveDocumentReply)deserialize("RemoveDocumentReply", DocumentProtocol.REPLY_REMOVEDOCUMENT, lang); - assertNotNull(obj); - assertEquals(30, obj.getHighestModificationTimestamp()); - assertEquals(false, obj.wasFound()); - } - } - } - - public class testRemoveLocationReply implements RunnableTest { - - @Override - public void run() { - testDocumentReply("RemoveLocationReply", DocumentProtocol.REPLY_REMOVELOCATION); - } - } - - public class testSearchResultReply implements RunnableTest { - - @Override - public void run() { - testVisitorReply("SearchResultReply", DocumentProtocol.REPLY_SEARCHRESULT); - } - } - - public class testStatBucketReply implements RunnableTest { - - @Override - public void run() { - StatBucketReply msg = new StatBucketReply(); - msg.setResults("These are the votes of the Norwegian jury"); - - assertEquals(50, serialize("StatBucketReply", msg)); - - for (Language lang : LANGUAGES) { - msg = (StatBucketReply)deserialize("StatBucketReply", DocumentProtocol.REPLY_STATBUCKET, lang); - assertEquals("These are the votes of the Norwegian jury", msg.getResults()); - } - } - } - - public class testQueryResultReply implements RunnableTest { - - @Override - public void run() { - testVisitorReply("QueryResultReply", DocumentProtocol.REPLY_QUERYRESULT); - } - } - - public class testQueryResultMessage implements RunnableTest { - - @Override - public void run() throws Exception { - Routable routable = deserialize("QueryResultMessage-1", DocumentProtocol.MESSAGE_QUERYRESULT, Language.CPP); - assertTrue(routable instanceof QueryResultMessage); - - QueryResultMessage msg = (QueryResultMessage)routable; - assertEquals(0, msg.getResult().getHitCount()); - - routable = deserialize("QueryResultMessage-2", DocumentProtocol.MESSAGE_QUERYRESULT, Language.CPP); - assertTrue(routable instanceof QueryResultMessage); - - msg = (QueryResultMessage)routable; - assertEquals(2, msg.getResult().getHitCount()); - com.yahoo.vdslib.SearchResult.Hit h = msg.getResult().getHit(0); - assertEquals(89.0, h.getRank(), 1E-6); - assertEquals("doc1", h.getDocId()); - h = msg.getResult().getHit(1); - assertEquals(109.0, h.getRank(), 1E-6); - assertEquals("doc17", h.getDocId()); - - routable = deserialize("QueryResultMessage-3", DocumentProtocol.MESSAGE_QUERYRESULT, Language.CPP); - assertTrue(routable instanceof QueryResultMessage); - - msg = (QueryResultMessage)routable; - assertEquals(2, msg.getResult().getHitCount()); - h = msg.getResult().getHit(0); - assertEquals(109.0, h.getRank(), 1E-6); - assertEquals("doc17", h.getDocId()); - h = msg.getResult().getHit(1); - assertEquals(89.0, h.getRank(), 1E-6); - assertEquals("doc1", h.getDocId()); - - routable = deserialize("QueryResultMessage-4", DocumentProtocol.MESSAGE_QUERYRESULT, Language.CPP); - assertTrue(routable instanceof QueryResultMessage); - - msg = (QueryResultMessage)routable; - assertEquals(3, msg.getResult().getHitCount()); - h = msg.getResult().getHit(0); - assertTrue(h instanceof SearchResult.HitWithSortBlob); - assertEquals(89.0, h.getRank(), 1E-6); - assertEquals("doc1", h.getDocId()); - byte[] b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); - assertEquals(9, b.length); - byte[] e = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '2' }; - for (int i = 0; i < b.length; i++) { - assertEquals(e[i], b[i]); - } - h = msg.getResult().getHit(1); - assertTrue(h instanceof SearchResult.HitWithSortBlob); - assertEquals(109.0, h.getRank(), 1E-6); - assertEquals("doc17", h.getDocId()); - b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); - assertEquals(9, b.length); - byte[] d = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '1' }; - for (int i = 0; i < b.length; i++) { - assertEquals(d[i], b[i]); - } - h = msg.getResult().getHit(2); - assertTrue(h instanceof SearchResult.HitWithSortBlob); - assertEquals(90.0, h.getRank(), 1E-6); - assertEquals("doc18", h.getDocId()); - b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); - assertEquals(9, b.length); - byte[] c = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '3' }; - for (int i = 0; i < b.length; i++) { - assertEquals(c[i], b[i]); - } - } - } - - public class testGetBucketListReply implements RunnableTest { - - public void run() { - GetBucketListReply reply = new GetBucketListReply(); - reply.getBuckets().add(new GetBucketListReply.BucketInfo(new BucketId(16, 123), "foo")); - reply.getBuckets().add(new GetBucketListReply.BucketInfo(new BucketId(17, 1123), "bar")); - reply.getBuckets().add(new GetBucketListReply.BucketInfo(new BucketId(18, 11123), "zoink")); - - assertEquals(56, serialize("GetBucketListReply", reply)); - - for (Language lang : LANGUAGES) { - reply = (GetBucketListReply)deserialize("GetBucketListReply", DocumentProtocol.REPLY_GETBUCKETLIST, lang); - assertEquals(reply.getBuckets().get(0), new GetBucketListReply.BucketInfo(new BucketId(16, 123), "foo")); - assertEquals(reply.getBuckets().get(1), new GetBucketListReply.BucketInfo(new BucketId(17, 1123), "bar")); - assertEquals(reply.getBuckets().get(2), new GetBucketListReply.BucketInfo(new BucketId(18, 11123), "zoink")); - } - } - } - - public class testGetBucketStateReply implements RunnableTest { - - public void run() { - GlobalId foo = new GlobalId(IdString.createIdString("doc:scheme:foo")); - GlobalId bar = new GlobalId(IdString.createIdString("doc:scheme:bar")); - - GetBucketStateReply reply = new GetBucketStateReply(); - List<DocumentState> state = new ArrayList<>(2); - state.add(new DocumentState(foo, 777, false)); - state.add(new DocumentState(bar, 888, true)); - reply.setBucketState(state); - assertEquals(53, serialize("GetBucketStateReply", reply)); - - for (Language lang : LANGUAGES) { - reply = (GetBucketStateReply)deserialize("GetBucketStateReply", DocumentProtocol.REPLY_GETBUCKETSTATE, lang); - assertEquals(777, reply.getBucketState().get(0).getTimestamp()); - assertEquals(foo, reply.getBucketState().get(0).getGid()); - assertEquals(false, reply.getBucketState().get(0).isRemoveEntry()); - assertEquals(888, reply.getBucketState().get(1).getTimestamp()); - assertEquals(bar, reply.getBucketState().get(1).getGid()); - assertEquals(true, reply.getBucketState().get(1).isRemoveEntry()); - } - } - } - - public class testGetDocumentReply implements RunnableTest { - - public void run() { - GetDocumentReply reply = new GetDocumentReply(new Document(protocol.getDocumentTypeManager().getDocumentType("testdoc"), "doc:scheme:")); - assertEquals(43, serialize("GetDocumentReply", reply)); - - for (Language lang : LANGUAGES) { - reply = (GetDocumentReply)deserialize("GetDocumentReply", DocumentProtocol.REPLY_GETDOCUMENT, lang); - assertEquals("testdoc", reply.getDocument().getDataType().getName()); - assertEquals("doc:scheme:", reply.getDocument().getId().toString()); - } - } - } - - public class testMapVisitorReply implements RunnableTest { - - public void run() { - testVisitorReply("MapVisitorReply", DocumentProtocol.REPLY_MAPVISITOR); - } - } - - protected void testDocumentReply(String filename, int type) { - DocumentReply reply = new DocumentReply(type); - assertEquals(5, serialize(filename, reply)); - - for (Language lang : LANGUAGES) { - reply = (DocumentReply)deserialize(filename, type, lang); - assertNotNull(reply); - } - } - - protected void testVisitorReply(String filename, int type) { - VisitorReply reply = new VisitorReply(type); - assertEquals(5, serialize(filename, reply)); - - for (Language lang : LANGUAGES) { - reply = (VisitorReply)deserialize(filename, type, lang); - assertNotNull(reply); - } - } - -} diff --git a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages51TestCase.java b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages51TestCase.java deleted file mode 100644 index 862244236f8..00000000000 --- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages51TestCase.java +++ /dev/null @@ -1,121 +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.test; - -import com.yahoo.component.Version; -import com.yahoo.document.BucketId; -import com.yahoo.document.DocumentId; -import com.yahoo.document.select.OrderingSpecification; -import com.yahoo.documentapi.messagebus.protocol.CreateVisitorMessage; -import com.yahoo.documentapi.messagebus.protocol.DocumentIgnoredReply; -import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol; -import com.yahoo.documentapi.messagebus.protocol.GetDocumentMessage; -import com.yahoo.text.Utf8; - -import java.util.Map; - -import static org.junit.Assert.assertEquals; - -/** - * @author Simon Thoresen Hult - */ -public class Messages51TestCase extends Messages50TestCase { - - //////////////////////////////////////////////////////////////////////////////// - // - // Setup - // - /////////////////////////////////////////////////////////////////////////////// - - @Override - protected void registerTests(Map<Integer, RunnableTest> out) { - super.registerTests(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_CREATEVISITOR, new testCreateVisitorMessage()); - out.put(DocumentProtocol.MESSAGE_GETDOCUMENT, new testGetDocumentMessage()); - out.put(DocumentProtocol.REPLY_DOCUMENTIGNORED, new testDocumentIgnoredReply()); - } - - @Override - protected Version version() { - return new Version(5, 1); - } - - @Override - protected boolean shouldTestCoverage() { - return true; - } - - //////////////////////////////////////////////////////////////////////////////// - // - // Tests - // - //////////////////////////////////////////////////////////////////////////////// - - protected static int BASE_MESSAGE_LENGTH = 5; - - public class testCreateVisitorMessage implements RunnableTest { - - @Override - public void run() { - CreateVisitorMessage msg = new CreateVisitorMessage("SomeLibrary", "myvisitor", "newyork", "london"); - msg.setDocumentSelection("true and false or true"); - msg.getParameters().put("myvar", Utf8.toBytes("somevalue")); - msg.getParameters().put("anothervar", Utf8.toBytes("34")); - msg.getBuckets().add(new BucketId(16, 1234)); - msg.setVisitRemoves(true); - msg.setFieldSet("foo bar"); - msg.setVisitorOrdering(OrderingSpecification.DESCENDING); - msg.setMaxBucketsPerVisitor(2); - assertEquals(BASE_MESSAGE_LENGTH + 178, serialize("CreateVisitorMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (CreateVisitorMessage)deserialize("CreateVisitorMessage", DocumentProtocol.MESSAGE_CREATEVISITOR, lang); - assertEquals("SomeLibrary", msg.getLibraryName()); - assertEquals("myvisitor", msg.getInstanceId()); - assertEquals("newyork", msg.getControlDestination()); - assertEquals("london", msg.getDataDestination()); - assertEquals("true and false or true", msg.getDocumentSelection()); - assertEquals(8, msg.getMaxPendingReplyCount()); - assertEquals(true, msg.getVisitRemoves()); - assertEquals("foo bar", msg.getFieldSet()); - assertEquals(false, msg.getVisitInconsistentBuckets()); - assertEquals(1, msg.getBuckets().size()); - assertEquals(new BucketId(16, 1234), msg.getBuckets().iterator().next()); - assertEquals("somevalue", Utf8.toString(msg.getParameters().get("myvar"))); - assertEquals("34", Utf8.toString(msg.getParameters().get("anothervar"))); - assertEquals(OrderingSpecification.DESCENDING, msg.getVisitorOrdering()); - assertEquals(2, msg.getMaxBucketsPerVisitor()); - } - } - } - - public class testGetDocumentMessage implements RunnableTest { - - @Override - public void run() { - GetDocumentMessage msg = new GetDocumentMessage(new DocumentId("doc:scheme:"), "foo bar"); - assertEquals(BASE_MESSAGE_LENGTH + 27, serialize("GetDocumentMessage", msg)); - - for (Language lang : LANGUAGES) { - msg = (GetDocumentMessage)deserialize("GetDocumentMessage", DocumentProtocol.MESSAGE_GETDOCUMENT, lang); - assertEquals("doc:scheme:", msg.getDocumentId().toString()); - assertEquals("foo bar", msg.getFieldSet()); - } - } - } - - public class testDocumentIgnoredReply implements RunnableTest { - - @Override - public void run() { - DocumentIgnoredReply reply = new DocumentIgnoredReply(); - assertEquals(BASE_MESSAGE_LENGTH, serialize("DocumentIgnoredReply", reply)); - - for (Language lang : LANGUAGES) { - reply = (DocumentIgnoredReply)deserialize("DocumentIgnoredReply", DocumentProtocol.REPLY_DOCUMENTIGNORED, lang); - } - } - } -} diff --git a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages52TestCase.java b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages52TestCase.java index 1bda3ea3610..448c8fcb520 100644 --- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages52TestCase.java +++ b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/Messages52TestCase.java @@ -2,19 +2,108 @@ package com.yahoo.documentapi.messagebus.protocol.test; import com.yahoo.component.Version; -import com.yahoo.document.*; +import com.yahoo.document.BucketId; +import com.yahoo.document.Document; +import com.yahoo.document.DocumentId; +import com.yahoo.document.DocumentPut; +import com.yahoo.document.DocumentType; +import com.yahoo.document.DocumentUpdate; +import com.yahoo.document.GlobalId; +import com.yahoo.document.TestAndSetCondition; import com.yahoo.document.fieldpathupdate.RemoveFieldPathUpdate; -import com.yahoo.documentapi.messagebus.protocol.*; +import com.yahoo.document.idstring.IdString; +import com.yahoo.document.select.OrderingSpecification; +import com.yahoo.documentapi.messagebus.protocol.CreateVisitorMessage; +import com.yahoo.documentapi.messagebus.protocol.CreateVisitorReply; +import com.yahoo.documentapi.messagebus.protocol.DestroyVisitorMessage; +import com.yahoo.documentapi.messagebus.protocol.DocumentIgnoredReply; +import com.yahoo.documentapi.messagebus.protocol.DocumentListMessage; +import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol; +import com.yahoo.documentapi.messagebus.protocol.DocumentReply; +import com.yahoo.documentapi.messagebus.protocol.DocumentState; +import com.yahoo.documentapi.messagebus.protocol.DocumentSummaryMessage; +import com.yahoo.documentapi.messagebus.protocol.EmptyBucketsMessage; +import com.yahoo.documentapi.messagebus.protocol.GetBucketListMessage; +import com.yahoo.documentapi.messagebus.protocol.GetBucketListReply; +import com.yahoo.documentapi.messagebus.protocol.GetBucketStateMessage; +import com.yahoo.documentapi.messagebus.protocol.GetBucketStateReply; +import com.yahoo.documentapi.messagebus.protocol.GetDocumentMessage; +import com.yahoo.documentapi.messagebus.protocol.GetDocumentReply; +import com.yahoo.documentapi.messagebus.protocol.MapVisitorMessage; +import com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage; +import com.yahoo.documentapi.messagebus.protocol.QueryResultMessage; +import com.yahoo.documentapi.messagebus.protocol.RemoveDocumentMessage; +import com.yahoo.documentapi.messagebus.protocol.RemoveDocumentReply; +import com.yahoo.documentapi.messagebus.protocol.RemoveLocationMessage; +import com.yahoo.documentapi.messagebus.protocol.SearchResultMessage; +import com.yahoo.documentapi.messagebus.protocol.StatBucketMessage; +import com.yahoo.documentapi.messagebus.protocol.StatBucketReply; +import com.yahoo.documentapi.messagebus.protocol.UpdateDocumentMessage; +import com.yahoo.documentapi.messagebus.protocol.UpdateDocumentReply; +import com.yahoo.documentapi.messagebus.protocol.VisitorInfoMessage; +import com.yahoo.documentapi.messagebus.protocol.VisitorReply; +import com.yahoo.documentapi.messagebus.protocol.WriteDocumentReply; +import com.yahoo.documentapi.messagebus.protocol.WrongDistributionReply; +import com.yahoo.messagebus.Routable; +import com.yahoo.text.Utf8; +import com.yahoo.vdslib.SearchResult; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** + * @author Simon Thoresen Hult * @author Vegard Sjonfjell */ -public class Messages52TestCase extends Messages51TestCase { +public class Messages52TestCase extends MessagesTestBase { + @Override + protected void registerTests(Map<Integer, RunnableTest> out) { + // This list MUST mirror the list of routable factories from the DocumentProtocol constructor that support + // version 5.2. When adding tests to this list, please KEEP THEM ORDERED alphabetically like they are now. + out.put(DocumentProtocol.MESSAGE_CREATEVISITOR, new testCreateVisitorMessage()); + out.put(DocumentProtocol.MESSAGE_DESTROYVISITOR, new testDestroyVisitorMessage()); + out.put(DocumentProtocol.MESSAGE_DOCUMENTLIST, new testDocumentListMessage()); + out.put(DocumentProtocol.MESSAGE_DOCUMENTSUMMARY, new testDocumentSummaryMessage()); + out.put(DocumentProtocol.MESSAGE_EMPTYBUCKETS, new testEmptyBucketsMessage()); + out.put(DocumentProtocol.MESSAGE_GETBUCKETLIST, new testGetBucketListMessage()); + out.put(DocumentProtocol.MESSAGE_GETBUCKETSTATE, new testGetBucketStateMessage()); + out.put(DocumentProtocol.MESSAGE_GETDOCUMENT, new testGetDocumentMessage()); + out.put(DocumentProtocol.MESSAGE_MAPVISITOR, new testMapVisitorMessage()); + out.put(DocumentProtocol.MESSAGE_PUTDOCUMENT, new testPutDocumentMessage()); + out.put(DocumentProtocol.MESSAGE_QUERYRESULT, new testQueryResultMessage()); + out.put(DocumentProtocol.MESSAGE_REMOVEDOCUMENT, new testRemoveDocumentMessage()); + out.put(DocumentProtocol.MESSAGE_REMOVELOCATION, new testRemoveLocationMessage()); + out.put(DocumentProtocol.MESSAGE_SEARCHRESULT, new testSearchResultMessage()); + 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_CREATEVISITOR, new testCreateVisitorReply()); + out.put(DocumentProtocol.REPLY_DESTROYVISITOR, new testDestroyVisitorReply()); + out.put(DocumentProtocol.REPLY_DOCUMENTIGNORED, new testDocumentIgnoredReply()); + out.put(DocumentProtocol.REPLY_DOCUMENTLIST, new testDocumentListReply()); + out.put(DocumentProtocol.REPLY_DOCUMENTSUMMARY, new testDocumentSummaryReply()); + out.put(DocumentProtocol.REPLY_EMPTYBUCKETS, new testEmptyBucketsReply()); + out.put(DocumentProtocol.REPLY_GETBUCKETLIST, new testGetBucketListReply()); + out.put(DocumentProtocol.REPLY_GETBUCKETSTATE, new testGetBucketStateReply()); + out.put(DocumentProtocol.REPLY_GETDOCUMENT, new testGetDocumentReply()); + out.put(DocumentProtocol.REPLY_MAPVISITOR, new testMapVisitorReply()); + out.put(DocumentProtocol.REPLY_PUTDOCUMENT, new testPutDocumentReply()); + out.put(DocumentProtocol.REPLY_QUERYRESULT, new testQueryResultReply()); + out.put(DocumentProtocol.REPLY_REMOVEDOCUMENT, new testRemoveDocumentReply()); + out.put(DocumentProtocol.REPLY_REMOVELOCATION, new testRemoveLocationReply()); + out.put(DocumentProtocol.REPLY_SEARCHRESULT, new testSearchResultReply()); + out.put(DocumentProtocol.REPLY_STATBUCKET, new testStatBucketReply()); + out.put(DocumentProtocol.REPLY_UPDATEDOCUMENT, new testUpdateDocumentReply()); + out.put(DocumentProtocol.REPLY_VISITORINFO, new testVisitorInfoReply()); + out.put(DocumentProtocol.REPLY_WRONGDISTRIBUTION, new testWrongDistributionReply()); + } @Override protected Version version() { @@ -26,21 +115,488 @@ public class Messages52TestCase extends Messages51TestCase { return true; } - @Override - protected void registerTests(Map<Integer, RunnableTest> out) { - super.registerTests(out); + //////////////////////////////////////////////////////////////////////////////// + // + // Tests + // + //////////////////////////////////////////////////////////////////////////////// - // This list MUST mirror the list of routable factories from the DocumentProtocol constructor that support - // version 5.2. When adding tests to this list, please KEEP THEM ORDERED alphabetically like they are now. + protected static int BASE_MESSAGE_LENGTH = 5; - out.put(DocumentProtocol.MESSAGE_PUTDOCUMENT, new testPutDocumentMessage()); - out.put(DocumentProtocol.MESSAGE_UPDATEDOCUMENT, new testUpdateDocumentMessage()); - out.put(DocumentProtocol.MESSAGE_REMOVEDOCUMENT, new testRemoveDocumentMessage()); + public class testRemoveLocationMessage implements RunnableTest { + + @Override + public void run() { + { + RemoveLocationMessage msg = new RemoveLocationMessage("id.group == \"mygroup\""); + assertEquals(BASE_MESSAGE_LENGTH + 29, serialize("RemoveLocationMessage", msg)); + + for (Language lang : LANGUAGES) { + msg = (RemoveLocationMessage)deserialize("RemoveLocationMessage", DocumentProtocol.MESSAGE_REMOVELOCATION, lang); + assertEquals("id.group == \"mygroup\"", msg.getDocumentSelection()); + } + } + } + } + + public class testGetBucketListMessage implements RunnableTest { + + @Override + public void run() { + GetBucketListMessage msg = new GetBucketListMessage(new BucketId(16, 123)); + msg.setLoadType(loadTypes.getNameMap().get("foo")); + assertEquals(BASE_MESSAGE_LENGTH + 12, serialize("GetBucketListMessage", msg)); + + for (Language lang : LANGUAGES) { + msg = (GetBucketListMessage)deserialize("GetBucketListMessage", DocumentProtocol.MESSAGE_GETBUCKETLIST, lang); + assertEquals(new BucketId(16, 123), msg.getBucketId()); + assertEquals("foo", msg.getLoadType().getName()); + } + } + } + + + public class testStatBucketMessage implements RunnableTest { + + @Override + public void run() { + StatBucketMessage msg = new StatBucketMessage(new BucketId(16, 123), "id.user=123"); + msg.setLoadType(null); + assertEquals(BASE_MESSAGE_LENGTH + 27, serialize("StatBucketMessage", msg)); + + for (Language lang : LANGUAGES) { + msg = (StatBucketMessage)deserialize("StatBucketMessage", DocumentProtocol.MESSAGE_STATBUCKET, lang); + assertEquals(new BucketId(16, 123), msg.getBucketId()); + assertEquals("id.user=123", msg.getDocumentSelection()); + assertEquals("default", msg.getLoadType().getName()); + } + } + } + + public class testGetBucketStateMessage implements RunnableTest { + + @Override + public void run() { + GetBucketStateMessage msg = new GetBucketStateMessage(new BucketId(16, 666)); + assertEquals(BASE_MESSAGE_LENGTH + 12, serialize("GetBucketStateMessage", msg)); + + for (Language lang : LANGUAGES) { + msg = (GetBucketStateMessage)deserialize("GetBucketStateMessage", DocumentProtocol.MESSAGE_GETBUCKETSTATE, lang); + assertEquals(16, msg.getBucketId().getUsedBits()); + assertEquals(4611686018427388570l, msg.getBucketId().getId()); + } + } + } + + public class testCreateVisitorMessage implements RunnableTest { + + @Override + public void run() { + CreateVisitorMessage msg = new CreateVisitorMessage("SomeLibrary", "myvisitor", "newyork", "london"); + msg.setDocumentSelection("true and false or true"); + msg.getParameters().put("myvar", Utf8.toBytes("somevalue")); + msg.getParameters().put("anothervar", Utf8.toBytes("34")); + msg.getBuckets().add(new BucketId(16, 1234)); + msg.setVisitRemoves(true); + msg.setFieldSet("foo bar"); + msg.setVisitorOrdering(OrderingSpecification.DESCENDING); + msg.setMaxBucketsPerVisitor(2); + assertEquals(BASE_MESSAGE_LENGTH + 178, serialize("CreateVisitorMessage", msg)); + + for (Language lang : LANGUAGES) { + msg = (CreateVisitorMessage)deserialize("CreateVisitorMessage", DocumentProtocol.MESSAGE_CREATEVISITOR, lang); + assertEquals("SomeLibrary", msg.getLibraryName()); + assertEquals("myvisitor", msg.getInstanceId()); + assertEquals("newyork", msg.getControlDestination()); + assertEquals("london", msg.getDataDestination()); + assertEquals("true and false or true", msg.getDocumentSelection()); + assertEquals(8, msg.getMaxPendingReplyCount()); + assertEquals(true, msg.getVisitRemoves()); + assertEquals("foo bar", msg.getFieldSet()); + assertEquals(false, msg.getVisitInconsistentBuckets()); + assertEquals(1, msg.getBuckets().size()); + assertEquals(new BucketId(16, 1234), msg.getBuckets().iterator().next()); + assertEquals("somevalue", Utf8.toString(msg.getParameters().get("myvar"))); + assertEquals("34", Utf8.toString(msg.getParameters().get("anothervar"))); + assertEquals(OrderingSpecification.DESCENDING, msg.getVisitorOrdering()); + assertEquals(2, msg.getMaxBucketsPerVisitor()); + } + + msg.getBuckets().clear(); + + assertEquals("CreateVisitorMessage(" + + "No buckets, " + + "selection 'true and false or true', " + + "bucket space 'default', " + + "library SomeLibrary, including removes, " + + "get fields: foo bar" + + ")", + msg.toString()); + + msg.getBuckets().add(new BucketId(16, 1234)); + + assertEquals("CreateVisitorMessage(" + + "Bucket BucketId(0x40000000000004d2), " + + "selection 'true and false or true', " + + "bucket space 'default', " + + "library SomeLibrary, including removes, " + + "get fields: foo bar" + + ")", + msg.toString()); + + msg.getBuckets().add(new BucketId(16, 1235)); + msg.getBuckets().add(new BucketId(16, 1236)); + msg.getBuckets().add(new BucketId(16, 1237)); + msg.getBuckets().add(new BucketId(16, 1238)); + msg.setFromTimestamp(10001); + msg.setToTimestamp(20002); + msg.setVisitInconsistentBuckets(true); + assertEquals("CreateVisitorMessage(" + + "5 buckets: BucketId(0x40000000000004d2) BucketId(0x40000000000004d3) BucketId(0x40000000000004d4) ..., " + + "time 10001-20002, " + + "selection 'true and false or true', " + + "bucket space 'default', " + + "library SomeLibrary, including removes, " + + "get fields: foo bar, " + + "visit inconsistent buckets" + + ")", + msg.toString()); + } + } + + public class testCreateVisitorReply implements RunnableTest { + + @Override + public void run() { + CreateVisitorReply reply = new CreateVisitorReply(DocumentProtocol.REPLY_CREATEVISITOR); + reply.setLastBucket(new BucketId(16, 123)); + reply.getVisitorStatistics().setBucketsVisited(3); + reply.getVisitorStatistics().setDocumentsVisited(1000); + reply.getVisitorStatistics().setBytesVisited(1024000); + reply.getVisitorStatistics().setDocumentsReturned(123); + reply.getVisitorStatistics().setBytesReturned(512000); + reply.getVisitorStatistics().setSecondPassDocumentsReturned(456); + reply.getVisitorStatistics().setSecondPassBytesReturned(789100); + + assertEquals(65, serialize("CreateVisitorReply", reply)); + + for (Language lang : LANGUAGES) { + reply = (CreateVisitorReply)deserialize("CreateVisitorReply", DocumentProtocol.REPLY_CREATEVISITOR, lang); + assertNotNull(reply); + assertEquals(new BucketId(16, 123), reply.getLastBucket()); + assertEquals(3, reply.getVisitorStatistics().getBucketsVisited()); + assertEquals(1000, reply.getVisitorStatistics().getDocumentsVisited()); + assertEquals(1024000, reply.getVisitorStatistics().getBytesVisited()); + assertEquals(123, reply.getVisitorStatistics().getDocumentsReturned()); + assertEquals(512000, reply.getVisitorStatistics().getBytesReturned()); + assertEquals(456, reply.getVisitorStatistics().getSecondPassDocumentsReturned()); + assertEquals(789100, reply.getVisitorStatistics().getSecondPassBytesReturned()); + } + } + } + + public class testDestroyVisitorReply implements RunnableTest { + + @Override + public void run() { + testVisitorReply("DestroyVisitorReply", DocumentProtocol.REPLY_DESTROYVISITOR); + } + } + + public class testDocumentIgnoredReply implements RunnableTest { + + @Override + public void run() { + DocumentIgnoredReply reply = new DocumentIgnoredReply(); + assertEquals(BASE_MESSAGE_LENGTH, serialize("DocumentIgnoredReply", reply)); + + for (Language lang : LANGUAGES) { + reply = (DocumentIgnoredReply)deserialize("DocumentIgnoredReply", DocumentProtocol.REPLY_DOCUMENTIGNORED, lang); + } + } + } + + public class testDocumentListReply implements RunnableTest { + + @Override + public void run() { + testVisitorReply("DocumentListReply", DocumentProtocol.REPLY_DOCUMENTLIST); + } + } + + public class testDocumentSummaryReply implements RunnableTest { + + @Override + public void run() { + testVisitorReply("DocumentSummaryReply", DocumentProtocol.REPLY_DOCUMENTSUMMARY); + } + } + + public class testEmptyBucketsReply implements RunnableTest { + + @Override + public void run() { + testVisitorReply("EmptyBucketsReply", DocumentProtocol.REPLY_EMPTYBUCKETS); + } + } + + public class testDestroyVisitorMessage implements RunnableTest { + + @Override + public void run() { + DestroyVisitorMessage msg = new DestroyVisitorMessage("myvisitor"); + assertEquals(BASE_MESSAGE_LENGTH + 17, serialize("DestroyVisitorMessage", msg)); + + for (Language lang : LANGUAGES) { + msg = (DestroyVisitorMessage)deserialize("DestroyVisitorMessage", DocumentProtocol.MESSAGE_DESTROYVISITOR, lang); + assertEquals("myvisitor", msg.getInstanceId()); + } + } + } + + public class testDocumentListMessage implements RunnableTest { + + @Override + public void run() { + DocumentListMessage msg = (DocumentListMessage)deserialize("DocumentListMessage", DocumentProtocol.MESSAGE_DOCUMENTLIST, Language.CPP); + assertEquals("userdoc:scheme:1234:", msg.getDocuments().get(0).getDocument().getId().toString()); + assertEquals(1234, msg.getDocuments().get(0).getTimestamp()); + assertFalse(msg.getDocuments().get(0).isRemoveEntry()); + + assertEquals(BASE_MESSAGE_LENGTH + 63, serialize("DocumentListMessage", msg)); + msg = (DocumentListMessage)deserialize("DocumentListMessage", DocumentProtocol.MESSAGE_DOCUMENTLIST, Language.JAVA); + assertEquals("userdoc:scheme:1234:", msg.getDocuments().get(0).getDocument().getId().toString()); + assertEquals(1234, msg.getDocuments().get(0).getTimestamp()); + assertFalse(msg.getDocuments().get(0).isRemoveEntry()); + + } + } + + public class testEmptyBucketsMessage implements RunnableTest { + + @Override + public void run() { + List<BucketId> bids = new ArrayList<>(); + for (int i = 0; i < 13; ++i) { + bids.add(new BucketId(16, i)); + } + + EmptyBucketsMessage ebm = new EmptyBucketsMessage(bids); + assertEquals(BASE_MESSAGE_LENGTH + 112, serialize("EmptyBucketsMessage", ebm)); + for (Language lang : LANGUAGES) { + ebm = (EmptyBucketsMessage)deserialize("EmptyBucketsMessage", DocumentProtocol.MESSAGE_EMPTYBUCKETS, lang); + for (int i = 0; i < 13; ++i) { + assertEquals(new BucketId(16, i), ebm.getBucketIds().get(i)); + } + } + } + } + + public class testDocumentSummaryMessage implements RunnableTest { + + @Override + public void run() { + Routable routable = deserialize("DocumentSummaryMessage-1", DocumentProtocol.MESSAGE_DOCUMENTSUMMARY, Language.CPP); + assertTrue(routable instanceof DocumentSummaryMessage); + + DocumentSummaryMessage msg = (DocumentSummaryMessage) routable; + assertEquals(0, msg.getResult().getSummaryCount()); + + routable = deserialize("DocumentSummaryMessage-2", DocumentProtocol.MESSAGE_DOCUMENTSUMMARY, Language.CPP); + assertTrue(routable instanceof DocumentSummaryMessage); + + msg = (DocumentSummaryMessage) routable; + assertEquals(2, msg.getResult().getSummaryCount()); + com.yahoo.vdslib.DocumentSummary.Summary s = msg.getResult().getSummary(0); + assertEquals("doc1", s.getDocId()); + byte[] b = s.getSummary(); + assertEquals(8, b.length); + byte[] c = {'s', 'u', 'm', 'm', 'a', 'r', 'y', '1'}; + for (int i = 0; i < b.length; i++) { + assertEquals(c[i], b[i]); + } + + s = msg.getResult().getSummary(1); + assertEquals("aoc17", s.getDocId()); + b = s.getSummary(); + assertEquals(9, b.length); + byte[] d = {'s', 'u', 'm', 'm', 'a', 'r', 'y', '4', '5'}; + for (int i = 0; i < b.length; i++) { + assertEquals(d[i], b[i]); + } + routable = deserialize("DocumentSummaryMessage-3", DocumentProtocol.MESSAGE_DOCUMENTSUMMARY, Language.CPP); + assertTrue(routable instanceof DocumentSummaryMessage); + + msg = (DocumentSummaryMessage) routable; + assertEquals(2, msg.getResult().getSummaryCount()); + + s = msg.getResult().getSummary(0); + assertEquals("aoc17", s.getDocId()); + b = s.getSummary(); + assertEquals(9, b.length); + byte[] e = {'s', 'u', 'm', 'm', 'a', 'r', 'y', '4', '5'}; + for (int i = 0; i < b.length; i++) { + assertEquals(e[i], b[i]); + } + + s = msg.getResult().getSummary(1); + assertEquals("doc1", s.getDocId()); + b = s.getSummary(); + assertEquals(8, b.length); + byte[] f = {'s', 'u', 'm', 'm', 'a', 'r', 'y', '1'}; + for (int i = 0; i < b.length; i++) { + assertEquals(f[i], b[i]); + } + } + } + + + public class testGetDocumentMessage implements RunnableTest { + + @Override + public void run() { + GetDocumentMessage msg = new GetDocumentMessage(new DocumentId("doc:scheme:"), "foo bar"); + assertEquals(BASE_MESSAGE_LENGTH + 27, serialize("GetDocumentMessage", msg)); + + for (Language lang : LANGUAGES) { + msg = (GetDocumentMessage)deserialize("GetDocumentMessage", DocumentProtocol.MESSAGE_GETDOCUMENT, lang); + assertEquals("doc:scheme:", msg.getDocumentId().toString()); + assertEquals("foo bar", msg.getFieldSet()); + } + } + } + + + public class testRemoveDocumentMessage implements RunnableTest { + + @Override + public void run() { + final RemoveDocumentMessage msg = new RemoveDocumentMessage(new DocumentId("doc:scheme:")); + msg.setCondition(new TestAndSetCondition(CONDITION_STRING)); + + assertEquals(BASE_MESSAGE_LENGTH + 16 + serializedLength(msg.getCondition().getSelection()), serialize("RemoveDocumentMessage", msg)); + + for (Language lang : LANGUAGES) { + final RemoveDocumentMessage deserializedMsg = (RemoveDocumentMessage)deserialize("RemoveDocumentMessage", DocumentProtocol.MESSAGE_REMOVEDOCUMENT, lang); + assertEquals(deserializedMsg.getDocumentId().toString(), msg.getDocumentId().toString()); + } + } + } + + public class testMapVisitorMessage implements RunnableTest { + + @Override + public void run() { + MapVisitorMessage msg = (MapVisitorMessage)deserialize("MapVisitorMessage", DocumentProtocol.MESSAGE_MAPVISITOR, Language.CPP); + assertEquals("3", msg.getData().get("foo")); + assertEquals("5", msg.getData().get("bar")); + + assertEquals(BASE_MESSAGE_LENGTH + 32, serialize("MapVisitorMessage", msg)); + + msg = (MapVisitorMessage)deserialize("MapVisitorMessage", DocumentProtocol.MESSAGE_MAPVISITOR, Language.JAVA); + assertEquals("3", msg.getData().get("foo")); + assertEquals("5", msg.getData().get("bar")); + } + } + + + public class testVisitorInfoMessage implements RunnableTest { + + @Override + public void run() { + VisitorInfoMessage msg = new VisitorInfoMessage(); + msg.getFinishedBuckets().add(new BucketId(16, 1)); + msg.getFinishedBuckets().add(new BucketId(16, 2)); + msg.getFinishedBuckets().add(new BucketId(16, 4)); + msg.setErrorMessage("error message: \u00e6\u00c6\u00f8\u00d8\u00e5\u00c5\u00f6\u00d6"); + assertEquals(BASE_MESSAGE_LENGTH + 67, serialize("VisitorInfoMessage", msg)); + + for (Language lang : LANGUAGES) { + msg = (VisitorInfoMessage)deserialize("VisitorInfoMessage", DocumentProtocol.MESSAGE_VISITORINFO, lang); + assertTrue(msg.getFinishedBuckets().contains(new BucketId(16, 1))); + assertTrue(msg.getFinishedBuckets().contains(new BucketId(16, 2))); + assertTrue(msg.getFinishedBuckets().contains(new BucketId(16, 4))); + assertEquals("error message: \u00e6\u00c6\u00f8\u00d8\u00e5\u00c5\u00f6\u00d6", msg.getErrorMessage()); + } + } + } + + public class testSearchResultMessage implements RunnableTest { + + @Override + public void run() throws Exception { + Routable routable = deserialize("SearchResultMessage-1", DocumentProtocol.MESSAGE_SEARCHRESULT, Language.CPP); + assertTrue(routable instanceof SearchResultMessage); + + SearchResultMessage msg = (SearchResultMessage)routable; + assertEquals(0, msg.getResult().getHitCount()); + + routable = deserialize("SearchResultMessage-2", DocumentProtocol.MESSAGE_SEARCHRESULT, Language.CPP); + assertTrue(routable instanceof SearchResultMessage); + + msg = (SearchResultMessage)routable; + assertEquals(2, msg.getResult().getHitCount()); + com.yahoo.vdslib.SearchResult.Hit h = msg.getResult().getHit(0); + assertEquals(89.0, h.getRank(), 1E-6); + assertEquals("doc1", h.getDocId()); + h = msg.getResult().getHit(1); + assertEquals(109.0, h.getRank(), 1E-6); + assertEquals("doc17", h.getDocId()); + + routable = deserialize("SearchResultMessage-3", DocumentProtocol.MESSAGE_SEARCHRESULT, Language.CPP); + assertTrue(routable instanceof SearchResultMessage); + + msg = (SearchResultMessage)routable; + assertEquals(2, msg.getResult().getHitCount()); + h = msg.getResult().getHit(0); + assertEquals(109.0, h.getRank(), 1E-6); + assertEquals("doc17", h.getDocId()); + h = msg.getResult().getHit(1); + assertEquals(89.0, h.getRank(), 1E-6); + assertEquals("doc1", h.getDocId()); + + routable = deserialize("SearchResultMessage-4", DocumentProtocol.MESSAGE_SEARCHRESULT, Language.CPP); + assertTrue(routable instanceof SearchResultMessage); + + msg = (SearchResultMessage)routable; + assertEquals(3, msg.getResult().getHitCount()); + h = msg.getResult().getHit(0); + assertTrue(h instanceof SearchResult.HitWithSortBlob); + assertEquals(89.0, h.getRank(), 1E-6); + assertEquals("doc1", h.getDocId()); + byte[] b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); + assertEquals(9, b.length); + byte[] e = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '2' }; + for (int i = 0; i < b.length; i++) { + assertEquals(e[i], b[i]); + } + h = msg.getResult().getHit(1); + assertTrue(h instanceof SearchResult.HitWithSortBlob); + assertEquals(109.0, h.getRank(), 1E-6); + assertEquals("doc17", h.getDocId()); + b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); + assertEquals(9, b.length); + byte[] d = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '1' }; + for (int i = 0; i < b.length; i++) { + assertEquals(d[i], b[i]); + } + h = msg.getResult().getHit(2); + assertTrue(h instanceof SearchResult.HitWithSortBlob); + assertEquals(90.0, h.getRank(), 1E-6); + assertEquals("doc18", h.getDocId()); + b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); + assertEquals(9, b.length); + byte[] c = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '3' }; + for (int i = 0; i < b.length; i++) { + assertEquals(c[i], b[i]); + } + } } private static String CONDITION_STRING = "There's just one condition"; public class testPutDocumentMessage implements RunnableTest { + @Override public void run() { PutDocumentMessage msg = new PutDocumentMessage(new DocumentPut(new Document(protocol.getDocumentTypeManager().getDocumentType("testdoc"), "doc:scheme:"))); @@ -60,7 +616,25 @@ public class Messages52TestCase extends Messages51TestCase { } } + public class testPutDocumentReply implements RunnableTest { + + @Override + public void run() { + WriteDocumentReply reply = new WriteDocumentReply(DocumentProtocol.REPLY_PUTDOCUMENT); + reply.setHighestModificationTimestamp(30); + + assertEquals(13, serialize("PutDocumentReply", reply)); + + for (Language lang : LANGUAGES) { + WriteDocumentReply obj = (WriteDocumentReply)deserialize("PutDocumentReply", DocumentProtocol.REPLY_PUTDOCUMENT, lang); + assertNotNull(obj); + assertEquals(30, obj.getHighestModificationTimestamp()); + } + } + } + public class testUpdateDocumentMessage implements RunnableTest { + @Override public void run() { DocumentType docType = protocol.getDocumentTypeManager().getDocumentType("testdoc"); @@ -84,21 +658,263 @@ public class Messages52TestCase extends Messages51TestCase { } } - public class testRemoveDocumentMessage implements RunnableTest { + public class testUpdateDocumentReply implements RunnableTest { + @Override public void run() { - final RemoveDocumentMessage msg = new RemoveDocumentMessage(new DocumentId("doc:scheme:")); - msg.setCondition(new TestAndSetCondition(CONDITION_STRING)); + UpdateDocumentReply reply = new UpdateDocumentReply(); + reply.setHighestModificationTimestamp(30); + reply.setWasFound(false); - assertEquals(BASE_MESSAGE_LENGTH + 16 + serializedLength(msg.getCondition().getSelection()), serialize("RemoveDocumentMessage", msg)); + assertEquals(14, serialize("UpdateDocumentReply", reply)); for (Language lang : LANGUAGES) { - final RemoveDocumentMessage deserializedMsg = (RemoveDocumentMessage)deserialize("RemoveDocumentMessage", DocumentProtocol.MESSAGE_REMOVEDOCUMENT, lang); - assertEquals(deserializedMsg.getDocumentId().toString(), msg.getDocumentId().toString()); + UpdateDocumentReply obj = (UpdateDocumentReply)deserialize("UpdateDocumentReply", DocumentProtocol.REPLY_UPDATEDOCUMENT, lang); + assertNotNull(obj); + assertEquals(30, reply.getHighestModificationTimestamp()); + assertEquals(false, obj.wasFound()); + } + } + } + + public class testVisitorInfoReply implements RunnableTest { + + @Override + public void run() { + testVisitorReply("VisitorInfoReply", DocumentProtocol.REPLY_VISITORINFO); + } + } + + public class testWrongDistributionReply implements RunnableTest { + + @Override + public void run() { + WrongDistributionReply reply = new WrongDistributionReply("distributor:3 storage:2"); + assertEquals(32, serialize("WrongDistributionReply", reply)); + + for (Language lang : LANGUAGES) { + reply = (WrongDistributionReply)deserialize("WrongDistributionReply", DocumentProtocol.REPLY_WRONGDISTRIBUTION, lang); + assertEquals("distributor:3 storage:2", reply.getSystemState()); + } + } + } + + public class testRemoveDocumentReply implements RunnableTest { + + @Override + public void run() { + RemoveDocumentReply reply = new RemoveDocumentReply(); + reply.setHighestModificationTimestamp(30); + reply.setWasFound(false); + + assertEquals(14, serialize("RemoveDocumentReply", reply)); + + for (Language lang : LANGUAGES) { + RemoveDocumentReply obj = (RemoveDocumentReply)deserialize("RemoveDocumentReply", DocumentProtocol.REPLY_REMOVEDOCUMENT, lang); + assertNotNull(obj); + assertEquals(30, obj.getHighestModificationTimestamp()); + assertEquals(false, obj.wasFound()); + } + } + } + + public class testRemoveLocationReply implements RunnableTest { + + @Override + public void run() { + testDocumentReply("RemoveLocationReply", DocumentProtocol.REPLY_REMOVELOCATION); + } + } + + public class testSearchResultReply implements RunnableTest { + + @Override + public void run() { + testVisitorReply("SearchResultReply", DocumentProtocol.REPLY_SEARCHRESULT); + } + } + + public class testStatBucketReply implements RunnableTest { + + @Override + public void run() { + StatBucketReply msg = new StatBucketReply(); + msg.setResults("These are the votes of the Norwegian jury"); + + assertEquals(50, serialize("StatBucketReply", msg)); + + for (Language lang : LANGUAGES) { + msg = (StatBucketReply)deserialize("StatBucketReply", DocumentProtocol.REPLY_STATBUCKET, lang); + assertEquals("These are the votes of the Norwegian jury", msg.getResults()); + } + } + } + + public class testQueryResultReply implements RunnableTest { + + @Override + public void run() { + testVisitorReply("QueryResultReply", DocumentProtocol.REPLY_QUERYRESULT); + } + } + + public class testQueryResultMessage implements RunnableTest { + + @Override + public void run() throws Exception { + Routable routable = deserialize("QueryResultMessage-1", DocumentProtocol.MESSAGE_QUERYRESULT, Language.CPP); + assertTrue(routable instanceof QueryResultMessage); + + QueryResultMessage msg = (QueryResultMessage)routable; + assertEquals(0, msg.getResult().getHitCount()); + + routable = deserialize("QueryResultMessage-2", DocumentProtocol.MESSAGE_QUERYRESULT, Language.CPP); + assertTrue(routable instanceof QueryResultMessage); + + msg = (QueryResultMessage)routable; + assertEquals(2, msg.getResult().getHitCount()); + com.yahoo.vdslib.SearchResult.Hit h = msg.getResult().getHit(0); + assertEquals(89.0, h.getRank(), 1E-6); + assertEquals("doc1", h.getDocId()); + h = msg.getResult().getHit(1); + assertEquals(109.0, h.getRank(), 1E-6); + assertEquals("doc17", h.getDocId()); + + routable = deserialize("QueryResultMessage-3", DocumentProtocol.MESSAGE_QUERYRESULT, Language.CPP); + assertTrue(routable instanceof QueryResultMessage); + + msg = (QueryResultMessage)routable; + assertEquals(2, msg.getResult().getHitCount()); + h = msg.getResult().getHit(0); + assertEquals(109.0, h.getRank(), 1E-6); + assertEquals("doc17", h.getDocId()); + h = msg.getResult().getHit(1); + assertEquals(89.0, h.getRank(), 1E-6); + assertEquals("doc1", h.getDocId()); + + routable = deserialize("QueryResultMessage-4", DocumentProtocol.MESSAGE_QUERYRESULT, Language.CPP); + assertTrue(routable instanceof QueryResultMessage); + + msg = (QueryResultMessage)routable; + assertEquals(3, msg.getResult().getHitCount()); + h = msg.getResult().getHit(0); + assertTrue(h instanceof SearchResult.HitWithSortBlob); + assertEquals(89.0, h.getRank(), 1E-6); + assertEquals("doc1", h.getDocId()); + byte[] b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); + assertEquals(9, b.length); + byte[] e = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '2' }; + for (int i = 0; i < b.length; i++) { + assertEquals(e[i], b[i]); + } + h = msg.getResult().getHit(1); + assertTrue(h instanceof SearchResult.HitWithSortBlob); + assertEquals(109.0, h.getRank(), 1E-6); + assertEquals("doc17", h.getDocId()); + b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); + assertEquals(9, b.length); + byte[] d = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '1' }; + for (int i = 0; i < b.length; i++) { + assertEquals(d[i], b[i]); + } + h = msg.getResult().getHit(2); + assertTrue(h instanceof SearchResult.HitWithSortBlob); + assertEquals(90.0, h.getRank(), 1E-6); + assertEquals("doc18", h.getDocId()); + b = ((SearchResult.HitWithSortBlob)h).getSortBlob(); + assertEquals(9, b.length); + byte[] c = { 's', 'o', 'r', 't', 'd', 'a', 't', 'a', '3' }; + for (int i = 0; i < b.length; i++) { + assertEquals(c[i], b[i]); + } + } + } + + public class testGetBucketListReply implements RunnableTest { + + public void run() { + GetBucketListReply reply = new GetBucketListReply(); + reply.getBuckets().add(new GetBucketListReply.BucketInfo(new BucketId(16, 123), "foo")); + reply.getBuckets().add(new GetBucketListReply.BucketInfo(new BucketId(17, 1123), "bar")); + reply.getBuckets().add(new GetBucketListReply.BucketInfo(new BucketId(18, 11123), "zoink")); + + assertEquals(56, serialize("GetBucketListReply", reply)); + + for (Language lang : LANGUAGES) { + reply = (GetBucketListReply)deserialize("GetBucketListReply", DocumentProtocol.REPLY_GETBUCKETLIST, lang); + assertEquals(reply.getBuckets().get(0), new GetBucketListReply.BucketInfo(new BucketId(16, 123), "foo")); + assertEquals(reply.getBuckets().get(1), new GetBucketListReply.BucketInfo(new BucketId(17, 1123), "bar")); + assertEquals(reply.getBuckets().get(2), new GetBucketListReply.BucketInfo(new BucketId(18, 11123), "zoink")); + } + } + } + + public class testGetBucketStateReply implements RunnableTest { + + public void run() { + GlobalId foo = new GlobalId(IdString.createIdString("doc:scheme:foo")); + GlobalId bar = new GlobalId(IdString.createIdString("doc:scheme:bar")); + + GetBucketStateReply reply = new GetBucketStateReply(); + List<DocumentState> state = new ArrayList<>(2); + state.add(new DocumentState(foo, 777, false)); + state.add(new DocumentState(bar, 888, true)); + reply.setBucketState(state); + assertEquals(53, serialize("GetBucketStateReply", reply)); + + for (Language lang : LANGUAGES) { + reply = (GetBucketStateReply)deserialize("GetBucketStateReply", DocumentProtocol.REPLY_GETBUCKETSTATE, lang); + assertEquals(777, reply.getBucketState().get(0).getTimestamp()); + assertEquals(foo, reply.getBucketState().get(0).getGid()); + assertEquals(false, reply.getBucketState().get(0).isRemoveEntry()); + assertEquals(888, reply.getBucketState().get(1).getTimestamp()); + assertEquals(bar, reply.getBucketState().get(1).getGid()); + assertEquals(true, reply.getBucketState().get(1).isRemoveEntry()); } } } + public class testGetDocumentReply implements RunnableTest { + + public void run() { + GetDocumentReply reply = new GetDocumentReply(new Document(protocol.getDocumentTypeManager().getDocumentType("testdoc"), "doc:scheme:")); + assertEquals(43, serialize("GetDocumentReply", reply)); + + for (Language lang : LANGUAGES) { + reply = (GetDocumentReply)deserialize("GetDocumentReply", DocumentProtocol.REPLY_GETDOCUMENT, lang); + assertEquals("testdoc", reply.getDocument().getDataType().getName()); + assertEquals("doc:scheme:", reply.getDocument().getId().toString()); + } + } + } + + public class testMapVisitorReply implements RunnableTest { + + public void run() { + testVisitorReply("MapVisitorReply", DocumentProtocol.REPLY_MAPVISITOR); + } + } + + protected void testDocumentReply(String filename, int type) { + DocumentReply reply = new DocumentReply(type); + assertEquals(5, serialize(filename, reply)); + + for (Language lang : LANGUAGES) { + reply = (DocumentReply)deserialize(filename, type, lang); + assertNotNull(reply); + } + } + + protected void testVisitorReply(String filename, int type) { + VisitorReply reply = new VisitorReply(type); + assertEquals(5, serialize(filename, reply)); + + for (Language lang : LANGUAGES) { + reply = (VisitorReply)deserialize(filename, type, lang); + assertNotNull(reply); + } + } + static int serializedLength(String str) { return 4 + str.length(); } diff --git a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/RoutableFactoryTestCase.java b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/RoutableFactoryTestCase.java index 89698e44705..59cbf5b65ae 100755 --- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/RoutableFactoryTestCase.java +++ b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/RoutableFactoryTestCase.java @@ -8,7 +8,7 @@ import com.yahoo.document.serialization.DocumentSerializer; import com.yahoo.documentapi.messagebus.protocol.DocumentMessage; import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol; import com.yahoo.documentapi.messagebus.protocol.DocumentReply; -import com.yahoo.documentapi.messagebus.protocol.RoutableFactories50; +import com.yahoo.documentapi.messagebus.protocol.RoutableFactories52; import com.yahoo.jrt.ListenFailedException; import com.yahoo.jrt.slobrok.server.Slobrok; import com.yahoo.messagebus.DestinationSession; @@ -130,7 +130,7 @@ public class RoutableFactoryTestCase { assertFalse(reply.hasErrors()); } - private static class MyMessageFactory extends RoutableFactories50.DocumentMessageFactory { + private static class MyMessageFactory extends RoutableFactories52.DocumentMessageFactory { @Override protected DocumentMessage doDecode(DocumentDeserializer buf) { @@ -143,7 +143,7 @@ public class RoutableFactoryTestCase { } } - private static class MyReplyFactory extends RoutableFactories50.DocumentReplyFactory { + private static class MyReplyFactory extends RoutableFactories52.DocumentReplyFactory { @Override protected DocumentReply doDecode(DocumentDeserializer buf) { diff --git a/documentapi/src/tests/messagebus/messagebus_test.cpp b/documentapi/src/tests/messagebus/messagebus_test.cpp index ea328007027..22a46951ecc 100644 --- a/documentapi/src/tests/messagebus/messagebus_test.cpp +++ b/documentapi/src/tests/messagebus/messagebus_test.cpp @@ -70,10 +70,10 @@ void Test::testMessage() { LoadTypeSet set; DocumentProtocol protocol(set, _repo); - Blob blob = protocol.encode(vespalib::Version(5,0), upd1); + Blob blob = protocol.encode(vespalib::Version(5,115), upd1); EXPECT_TRUE(blob.size() > 0); - Routable::UP dec1 = protocol.decode(vespalib::Version(5,0), blob); + Routable::UP dec1 = protocol.decode(vespalib::Version(5,115), blob); EXPECT_TRUE(dec1.get() != NULL); EXPECT_TRUE(dec1->isReply() == false); EXPECT_TRUE(dec1->getType() == DocumentProtocol::MESSAGE_UPDATEDOCUMENT); diff --git a/documentapi/src/tests/messages/CMakeLists.txt b/documentapi/src/tests/messages/CMakeLists.txt index b762eaca657..19e1901003d 100644 --- a/documentapi/src/tests/messages/CMakeLists.txt +++ b/documentapi/src/tests/messages/CMakeLists.txt @@ -1,23 +1,4 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(documentapi_messages50_test_app TEST - SOURCES - testbase.cpp - messages50test.cpp - messages50app.cpp - DEPENDS - documentapi -) -vespa_add_test(NAME documentapi_messages50_test_app COMMAND documentapi_messages50_test_app) -vespa_add_executable(documentapi_messages51_test_app TEST - SOURCES - testbase.cpp - messages50test.cpp - messages51test.cpp - messages51app.cpp - DEPENDS - documentapi -) -vespa_add_test(NAME documentapi_messages51_test_app COMMAND documentapi_messages51_test_app) vespa_add_executable(documentapi_messages52_test_app TEST SOURCES testbase.cpp diff --git a/documentapi/src/tests/messages/messages50app.cpp b/documentapi/src/tests/messages/messages50app.cpp deleted file mode 100644 index aa42302beba..00000000000 --- a/documentapi/src/tests/messages/messages50app.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "messages50test.h" - -TEST_APPHOOK(Messages50Test); diff --git a/documentapi/src/tests/messages/messages51app.cpp b/documentapi/src/tests/messages/messages51app.cpp deleted file mode 100644 index 654fb932568..00000000000 --- a/documentapi/src/tests/messages/messages51app.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "messages51test.h" - -TEST_APPHOOK(Messages51Test); diff --git a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp index 1a1d1d96ab6..b70a76690f9 100644 --- a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp @@ -1,7 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "routablefactories50.h" -#include "routablefactories51.h" #include "routablefactories52.h" #include "routablefactories60.h" #include "routingpolicyfactories.h" @@ -46,62 +44,49 @@ DocumentProtocol::DocumentProtocol(const LoadTypeSet& loadTypes, putRoutingPolicyFactory("LoadBalancer", IRoutingPolicyFactory::SP(new RoutingPolicyFactories::LoadBalancerPolicyFactory())); // Prepare version specifications to use when adding routable factories. - vespalib::VersionSpecification version50(5, 0); - vespalib::VersionSpecification version51(5, 1); vespalib::VersionSpecification version52(5, 115); vespalib::VersionSpecification version6(6, 221); - std::vector<vespalib::VersionSpecification> from50 = { version50, version51, version52, version6 }; - std::vector<vespalib::VersionSpecification> from51 = { version51, version52, version6 }; std::vector<vespalib::VersionSpecification> from52 = { version52, version6 }; std::vector<vespalib::VersionSpecification> from6 = { version6 }; - // Add 5.0 serialization - putRoutableFactory(MESSAGE_CREATEVISITOR, IRoutableFactory::SP(new RoutableFactories50::CreateVisitorMessageFactory(*_repo)), from50); - putRoutableFactory(MESSAGE_DESTROYVISITOR, IRoutableFactory::SP(new RoutableFactories50::DestroyVisitorMessageFactory()), from50); - putRoutableFactory(MESSAGE_DOCUMENTLIST, IRoutableFactory::SP(new RoutableFactories50::DocumentListMessageFactory(*_repo)), from50); - putRoutableFactory(MESSAGE_DOCUMENTSUMMARY, IRoutableFactory::SP(new RoutableFactories50::DocumentSummaryMessageFactory()), from50); - putRoutableFactory(MESSAGE_EMPTYBUCKETS, IRoutableFactory::SP(new RoutableFactories50::EmptyBucketsMessageFactory()), from50); - putRoutableFactory(MESSAGE_GETBUCKETLIST, IRoutableFactory::SP(new RoutableFactories50::GetBucketListMessageFactory()), from50); - putRoutableFactory(MESSAGE_GETBUCKETSTATE, IRoutableFactory::SP(new RoutableFactories50::GetBucketStateMessageFactory()), from50); - putRoutableFactory(MESSAGE_GETDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::GetDocumentMessageFactory()), from50); - putRoutableFactory(MESSAGE_MAPVISITOR, IRoutableFactory::SP(new RoutableFactories50::MapVisitorMessageFactory(*_repo)), from50); - putRoutableFactory(MESSAGE_PUTDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::PutDocumentMessageFactory(*_repo)), from50); - putRoutableFactory(MESSAGE_QUERYRESULT, IRoutableFactory::SP(new RoutableFactories50::QueryResultMessageFactory()), from50); - putRoutableFactory(MESSAGE_REMOVEDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::RemoveDocumentMessageFactory()), from50); - putRoutableFactory(MESSAGE_REMOVELOCATION, IRoutableFactory::SP(new RoutableFactories50::RemoveLocationMessageFactory(*_repo)), from50); - putRoutableFactory(MESSAGE_SEARCHRESULT, IRoutableFactory::SP(new RoutableFactories50::SearchResultMessageFactory()), from50); - putRoutableFactory(MESSAGE_STATBUCKET, IRoutableFactory::SP(new RoutableFactories50::StatBucketMessageFactory()), from50); - putRoutableFactory(MESSAGE_UPDATEDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::UpdateDocumentMessageFactory(*_repo)), from50); - putRoutableFactory(MESSAGE_VISITORINFO, IRoutableFactory::SP(new RoutableFactories50::VisitorInfoMessageFactory()), from50); - putRoutableFactory(REPLY_CREATEVISITOR, IRoutableFactory::SP(new RoutableFactories50::CreateVisitorReplyFactory()), from50); - putRoutableFactory(REPLY_DESTROYVISITOR, IRoutableFactory::SP(new RoutableFactories50::DestroyVisitorReplyFactory()), from50); - putRoutableFactory(REPLY_DOCUMENTLIST, IRoutableFactory::SP(new RoutableFactories50::DocumentListReplyFactory()), from50); - putRoutableFactory(REPLY_DOCUMENTSUMMARY, IRoutableFactory::SP(new RoutableFactories50::DocumentSummaryReplyFactory()), from50); - putRoutableFactory(REPLY_EMPTYBUCKETS, IRoutableFactory::SP(new RoutableFactories50::EmptyBucketsReplyFactory()), from50); - putRoutableFactory(REPLY_GETBUCKETLIST, IRoutableFactory::SP(new RoutableFactories50::GetBucketListReplyFactory()), from50); - putRoutableFactory(REPLY_GETBUCKETSTATE, IRoutableFactory::SP(new RoutableFactories50::GetBucketStateReplyFactory()), from50); - putRoutableFactory(REPLY_GETDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::GetDocumentReplyFactory(*_repo)), from50); - putRoutableFactory(REPLY_MAPVISITOR, IRoutableFactory::SP(new RoutableFactories50::MapVisitorReplyFactory()), from50); - putRoutableFactory(REPLY_PUTDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::PutDocumentReplyFactory()), from50); - putRoutableFactory(REPLY_QUERYRESULT, IRoutableFactory::SP(new RoutableFactories50::QueryResultReplyFactory()), from50); - putRoutableFactory(REPLY_REMOVEDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::RemoveDocumentReplyFactory()), from50); - putRoutableFactory(REPLY_REMOVELOCATION, IRoutableFactory::SP(new RoutableFactories50::RemoveLocationReplyFactory()), from50); - putRoutableFactory(REPLY_SEARCHRESULT, IRoutableFactory::SP(new RoutableFactories50::SearchResultReplyFactory()), from50); - putRoutableFactory(REPLY_STATBUCKET, IRoutableFactory::SP(new RoutableFactories50::StatBucketReplyFactory()), from50); - putRoutableFactory(REPLY_UPDATEDOCUMENT, IRoutableFactory::SP(new RoutableFactories50::UpdateDocumentReplyFactory()), from50); - putRoutableFactory(REPLY_VISITORINFO, IRoutableFactory::SP(new RoutableFactories50::VisitorInfoReplyFactory()), from50); - putRoutableFactory(REPLY_WRONGDISTRIBUTION, IRoutableFactory::SP(new RoutableFactories50::WrongDistributionReplyFactory()), from50); - - // Add 5.1 serialization - putRoutableFactory(MESSAGE_GETDOCUMENT, IRoutableFactory::SP(new RoutableFactories51::GetDocumentMessageFactory()), from51); - putRoutableFactory(MESSAGE_CREATEVISITOR, IRoutableFactory::SP(new RoutableFactories51::CreateVisitorMessageFactory(*_repo)), from51); - putRoutableFactory(REPLY_DOCUMENTIGNORED, IRoutableFactory::SP(new RoutableFactories51::DocumentIgnoredReplyFactory()), from51); - // Add 5.2 serialization + putRoutableFactory(MESSAGE_CREATEVISITOR, IRoutableFactory::SP(new RoutableFactories52::CreateVisitorMessageFactory(*_repo)), from52); + putRoutableFactory(MESSAGE_DESTROYVISITOR, IRoutableFactory::SP(new RoutableFactories52::DestroyVisitorMessageFactory()), from52); + putRoutableFactory(MESSAGE_DOCUMENTLIST, IRoutableFactory::SP(new RoutableFactories52::DocumentListMessageFactory(*_repo)), from52); + putRoutableFactory(MESSAGE_DOCUMENTSUMMARY, IRoutableFactory::SP(new RoutableFactories52::DocumentSummaryMessageFactory()), from52); + putRoutableFactory(MESSAGE_EMPTYBUCKETS, IRoutableFactory::SP(new RoutableFactories52::EmptyBucketsMessageFactory()), from52); + putRoutableFactory(MESSAGE_GETBUCKETLIST, IRoutableFactory::SP(new RoutableFactories52::GetBucketListMessageFactory()), from52); + putRoutableFactory(MESSAGE_GETBUCKETSTATE, IRoutableFactory::SP(new RoutableFactories52::GetBucketStateMessageFactory()), from52); + putRoutableFactory(MESSAGE_GETDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::GetDocumentMessageFactory()), from52); + putRoutableFactory(MESSAGE_MAPVISITOR, IRoutableFactory::SP(new RoutableFactories52::MapVisitorMessageFactory(*_repo)), from52); putRoutableFactory(MESSAGE_PUTDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::PutDocumentMessageFactory(*_repo)), from52); - putRoutableFactory(MESSAGE_UPDATEDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::UpdateDocumentMessageFactory(*_repo)), from52); + putRoutableFactory(MESSAGE_QUERYRESULT, IRoutableFactory::SP(new RoutableFactories52::QueryResultMessageFactory()), from52); putRoutableFactory(MESSAGE_REMOVEDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::RemoveDocumentMessageFactory()), from52); + putRoutableFactory(MESSAGE_REMOVELOCATION, IRoutableFactory::SP(new RoutableFactories52::RemoveLocationMessageFactory(*_repo)), from52); + putRoutableFactory(MESSAGE_SEARCHRESULT, IRoutableFactory::SP(new RoutableFactories52::SearchResultMessageFactory()), from52); + putRoutableFactory(MESSAGE_STATBUCKET, IRoutableFactory::SP(new RoutableFactories52::StatBucketMessageFactory()), from52); + putRoutableFactory(MESSAGE_UPDATEDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::UpdateDocumentMessageFactory(*_repo)), from52); + putRoutableFactory(MESSAGE_VISITORINFO, IRoutableFactory::SP(new RoutableFactories52::VisitorInfoMessageFactory()), from52); + putRoutableFactory(REPLY_CREATEVISITOR, IRoutableFactory::SP(new RoutableFactories52::CreateVisitorReplyFactory()), from52); + putRoutableFactory(REPLY_DESTROYVISITOR, IRoutableFactory::SP(new RoutableFactories52::DestroyVisitorReplyFactory()), from52); + putRoutableFactory(REPLY_DOCUMENTIGNORED, IRoutableFactory::SP(new RoutableFactories52::DocumentIgnoredReplyFactory()), from52); + putRoutableFactory(REPLY_DOCUMENTLIST, IRoutableFactory::SP(new RoutableFactories52::DocumentListReplyFactory()), from52); + putRoutableFactory(REPLY_DOCUMENTSUMMARY, IRoutableFactory::SP(new RoutableFactories52::DocumentSummaryReplyFactory()), from52); + putRoutableFactory(REPLY_EMPTYBUCKETS, IRoutableFactory::SP(new RoutableFactories52::EmptyBucketsReplyFactory()), from52); + putRoutableFactory(REPLY_GETBUCKETLIST, IRoutableFactory::SP(new RoutableFactories52::GetBucketListReplyFactory()), from52); + putRoutableFactory(REPLY_GETBUCKETSTATE, IRoutableFactory::SP(new RoutableFactories52::GetBucketStateReplyFactory()), from52); + putRoutableFactory(REPLY_GETDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::GetDocumentReplyFactory(*_repo)), from52); + putRoutableFactory(REPLY_MAPVISITOR, IRoutableFactory::SP(new RoutableFactories52::MapVisitorReplyFactory()), from52); + putRoutableFactory(REPLY_PUTDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::PutDocumentReplyFactory()), from52); + putRoutableFactory(REPLY_QUERYRESULT, IRoutableFactory::SP(new RoutableFactories52::QueryResultReplyFactory()), from52); + putRoutableFactory(REPLY_REMOVEDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::RemoveDocumentReplyFactory()), from52); + putRoutableFactory(REPLY_REMOVELOCATION, IRoutableFactory::SP(new RoutableFactories52::RemoveLocationReplyFactory()), from52); + putRoutableFactory(REPLY_SEARCHRESULT, IRoutableFactory::SP(new RoutableFactories52::SearchResultReplyFactory()), from52); + putRoutableFactory(REPLY_STATBUCKET, IRoutableFactory::SP(new RoutableFactories52::StatBucketReplyFactory()), from52); + putRoutableFactory(REPLY_UPDATEDOCUMENT, IRoutableFactory::SP(new RoutableFactories52::UpdateDocumentReplyFactory()), from52); + putRoutableFactory(REPLY_VISITORINFO, IRoutableFactory::SP(new RoutableFactories52::VisitorInfoReplyFactory()), from52); + putRoutableFactory(REPLY_WRONGDISTRIBUTION, IRoutableFactory::SP(new RoutableFactories52::WrongDistributionReplyFactory()), from52); // Add 6.x serialization (TODO finalize version) putRoutableFactory(MESSAGE_CREATEVISITOR, IRoutableFactory::SP(new RoutableFactories60::CreateVisitorMessageFactory(*_repo)), from6); diff --git a/documentapi/src/vespa/documentapi/messagebus/routablefactories51.h b/documentapi/src/vespa/documentapi/messagebus/routablefactories51.h index fc20324b418..b71c478c540 100644 --- a/documentapi/src/vespa/documentapi/messagebus/routablefactories51.h +++ b/documentapi/src/vespa/documentapi/messagebus/routablefactories51.h @@ -10,7 +10,7 @@ namespace documentapi { * This class encapsulates all the {@link RoutableFactory} classes needed to implement factories for the document * routable. When adding new factories to this class, please KEEP THE THEM ORDERED alphabetically like they are now. */ -class RoutableFactories51 { +class RoutableFactories51 : public RoutableFactories50 { public: RoutableFactories51() = delete; diff --git a/documentapi/test/crosslanguagefiles/5-cpp-BatchMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-BatchMessage.dat Binary files differdeleted file mode 100644 index c1c43e8081b..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-BatchMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-BatchReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-BatchReply.dat Binary files differdeleted file mode 100644 index be3a9ba1913..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-BatchReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-CreateVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-CreateVisitorMessage.dat Binary files differdeleted file mode 100644 index a506fc760bd..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-CreateVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-CreateVisitorReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-CreateVisitorReply.dat Binary files differdeleted file mode 100644 index e13917227d1..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-CreateVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-DestroyVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-DestroyVisitorMessage.dat Binary files differdeleted file mode 100644 index f39b31217e6..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-DestroyVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-DestroyVisitorReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-DestroyVisitorReply.dat Binary files differdeleted file mode 100644 index 1468f027b15..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-DestroyVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-DocumentListMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-DocumentListMessage.dat Binary files differdeleted file mode 100644 index 2d8d12d2704..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-DocumentListMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-DocumentListReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-DocumentListReply.dat Binary files differdeleted file mode 100644 index c8a1cd888f0..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-DocumentListReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-1.dat b/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-1.dat Binary files differdeleted file mode 100644 index 0107dd5f350..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-1.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-2.dat b/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-2.dat Binary files differdeleted file mode 100644 index 57187093f28..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-2.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-3.dat b/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-3.dat Binary files differdeleted file mode 100644 index 6a516d38d17..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryMessage-3.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryReply.dat Binary files differdeleted file mode 100644 index 16b1e4bc4ef..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-DocumentSummaryReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-EmptyBucketsMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-EmptyBucketsMessage.dat Binary files differdeleted file mode 100644 index b9df278fd7a..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-EmptyBucketsMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-EmptyBucketsReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-EmptyBucketsReply.dat Binary files differdeleted file mode 100644 index 05510dd8c1e..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-EmptyBucketsReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-GetBucketListMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-GetBucketListMessage.dat Binary files differdeleted file mode 100644 index fa3de45ac5b..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-GetBucketListMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-GetBucketListReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-GetBucketListReply.dat Binary files differdeleted file mode 100644 index 830994ed785..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-GetBucketListReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-GetBucketStateMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-GetBucketStateMessage.dat Binary files differdeleted file mode 100644 index aa2d206ca3a..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-GetBucketStateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-GetBucketStateReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-GetBucketStateReply.dat Binary files differdeleted file mode 100644 index 0f91e3759f8..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-GetBucketStateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-GetDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-GetDocumentMessage.dat Binary files differdeleted file mode 100644 index 1444d617c22..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-GetDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-GetDocumentReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-GetDocumentReply.dat Binary files differdeleted file mode 100644 index c1ad7920a2e..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-GetDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-MapVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-MapVisitorMessage.dat Binary files differdeleted file mode 100644 index 1a8a837ea16..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-MapVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-MapVisitorReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-MapVisitorReply.dat Binary files differdeleted file mode 100644 index 541cd718a66..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-MapVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationMessage.dat Binary files differdeleted file mode 100644 index 6efc54a6d09..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationReply.dat Binary files differdeleted file mode 100644 index 8ad31a95bd5..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-PutDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-PutDocumentMessage.dat Binary files differdeleted file mode 100644 index 9e4a5c5f82f..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-PutDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-PutDocumentReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-PutDocumentReply.dat Binary files differdeleted file mode 100644 index 480544045bb..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-PutDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-1.dat b/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-1.dat Binary files differdeleted file mode 100644 index dbf830c9365..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-1.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-2.dat b/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-2.dat Binary files differdeleted file mode 100644 index 094143cf78d..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-2.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-3.dat b/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-3.dat Binary files differdeleted file mode 100644 index 3341d74052b..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-3.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-4.dat b/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-4.dat Binary files differdeleted file mode 100644 index 8aaaefff491..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-4.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-5.dat b/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-5.dat Binary files differdeleted file mode 100644 index e66ed1f07d4..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultMessage-5.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-QueryResultReply.dat Binary files differdeleted file mode 100644 index 003f35d63a7..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-QueryResultReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-RemoveDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-RemoveDocumentMessage.dat Binary files differdeleted file mode 100644 index 78b7972eb5c..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-RemoveDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-RemoveDocumentReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-RemoveDocumentReply.dat Binary files differdeleted file mode 100644 index bf5db8761e2..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-RemoveDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessage.dat Binary files differdeleted file mode 100644 index 16850a6aff3..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessageGroup.dat b/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessageGroup.dat Binary files differdeleted file mode 100644 index abd648184d7..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessageGroup.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessageUser.dat b/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessageUser.dat Binary files differdeleted file mode 100644 index c2a63cb94c0..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationMessageUser.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationReply.dat Binary files differdeleted file mode 100644 index 752c4dba399..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-RemoveLocationReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-1.dat b/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-1.dat Binary files differdeleted file mode 100644 index 988f9fdab1f..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-1.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-2.dat b/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-2.dat Binary files differdeleted file mode 100644 index ac277d09643..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-2.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-3.dat b/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-3.dat Binary files differdeleted file mode 100644 index 03b49c8a0ac..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-3.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-4.dat b/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-4.dat Binary files differdeleted file mode 100644 index d52e574ea44..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-4.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-5.dat b/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-5.dat Binary files differdeleted file mode 100644 index e68654e9941..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultMessage-5.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-SearchResultReply.dat Binary files differdeleted file mode 100644 index cce9c6f8d14..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-SearchResultReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-StatBucketMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-StatBucketMessage.dat Binary files differdeleted file mode 100644 index 1fc2b1cf3c1..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-StatBucketMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-StatBucketReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-StatBucketReply.dat Binary files differdeleted file mode 100644 index 0b98e240018..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-StatBucketReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-UpdateDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-UpdateDocumentMessage.dat Binary files differdeleted file mode 100644 index f1bca25ceca..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-UpdateDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-UpdateDocumentReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-UpdateDocumentReply.dat Binary files differdeleted file mode 100644 index c7151299366..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-UpdateDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-VisitorInfoMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-VisitorInfoMessage.dat Binary files differdeleted file mode 100644 index 80b44e0c6fd..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-VisitorInfoMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-VisitorInfoReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-VisitorInfoReply.dat Binary files differdeleted file mode 100644 index 57a656c9b2d..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-VisitorInfoReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-cpp-WrongDistributionReply.dat b/documentapi/test/crosslanguagefiles/5-cpp-WrongDistributionReply.dat Binary files differdeleted file mode 100644 index 0dbe13225ae..00000000000 --- a/documentapi/test/crosslanguagefiles/5-cpp-WrongDistributionReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-BatchMessage.dat b/documentapi/test/crosslanguagefiles/5-java-BatchMessage.dat Binary files differdeleted file mode 100644 index c1c43e8081b..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-BatchMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-BatchReply.dat b/documentapi/test/crosslanguagefiles/5-java-BatchReply.dat Binary files differdeleted file mode 100644 index be3a9ba1913..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-BatchReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-CreateVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5-java-CreateVisitorMessage.dat Binary files differdeleted file mode 100644 index a506fc760bd..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-CreateVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-CreateVisitorReply.dat b/documentapi/test/crosslanguagefiles/5-java-CreateVisitorReply.dat Binary files differdeleted file mode 100644 index e13917227d1..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-CreateVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-DestroyVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5-java-DestroyVisitorMessage.dat Binary files differdeleted file mode 100644 index f39b31217e6..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-DestroyVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-DestroyVisitorReply.dat b/documentapi/test/crosslanguagefiles/5-java-DestroyVisitorReply.dat Binary files differdeleted file mode 100644 index 1468f027b15..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-DestroyVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-DocumentListMessage.dat b/documentapi/test/crosslanguagefiles/5-java-DocumentListMessage.dat Binary files differdeleted file mode 100644 index 2d8d12d2704..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-DocumentListMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-DocumentListReply.dat b/documentapi/test/crosslanguagefiles/5-java-DocumentListReply.dat Binary files differdeleted file mode 100644 index c8a1cd888f0..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-DocumentListReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-DocumentSummaryReply.dat b/documentapi/test/crosslanguagefiles/5-java-DocumentSummaryReply.dat Binary files differdeleted file mode 100644 index 16b1e4bc4ef..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-DocumentSummaryReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-EmptyBucketsMessage.dat b/documentapi/test/crosslanguagefiles/5-java-EmptyBucketsMessage.dat Binary files differdeleted file mode 100644 index b9df278fd7a..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-EmptyBucketsMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-EmptyBucketsReply.dat b/documentapi/test/crosslanguagefiles/5-java-EmptyBucketsReply.dat Binary files differdeleted file mode 100644 index 05510dd8c1e..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-EmptyBucketsReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-GetBucketListMessage.dat b/documentapi/test/crosslanguagefiles/5-java-GetBucketListMessage.dat Binary files differdeleted file mode 100644 index fa3de45ac5b..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-GetBucketListMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-GetBucketListReply.dat b/documentapi/test/crosslanguagefiles/5-java-GetBucketListReply.dat Binary files differdeleted file mode 100644 index 830994ed785..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-GetBucketListReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-GetBucketStateMessage.dat b/documentapi/test/crosslanguagefiles/5-java-GetBucketStateMessage.dat Binary files differdeleted file mode 100644 index aa2d206ca3a..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-GetBucketStateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-GetBucketStateReply.dat b/documentapi/test/crosslanguagefiles/5-java-GetBucketStateReply.dat Binary files differdeleted file mode 100644 index 0f91e3759f8..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-GetBucketStateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-GetDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5-java-GetDocumentMessage.dat Binary files differdeleted file mode 100644 index 1444d617c22..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-GetDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-GetDocumentReply.dat b/documentapi/test/crosslanguagefiles/5-java-GetDocumentReply.dat Binary files differdeleted file mode 100644 index c1ad7920a2e..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-GetDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-MapVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5-java-MapVisitorMessage.dat Binary files differdeleted file mode 100644 index 1a8a837ea16..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-MapVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-MapVisitorReply.dat b/documentapi/test/crosslanguagefiles/5-java-MapVisitorReply.dat Binary files differdeleted file mode 100644 index 541cd718a66..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-MapVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-MultiOperationMessage.dat b/documentapi/test/crosslanguagefiles/5-java-MultiOperationMessage.dat Binary files differdeleted file mode 100644 index 6efc54a6d09..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-MultiOperationMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-MultiOperationReply.dat b/documentapi/test/crosslanguagefiles/5-java-MultiOperationReply.dat Binary files differdeleted file mode 100644 index 8ad31a95bd5..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-MultiOperationReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-PutDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5-java-PutDocumentMessage.dat Binary files differdeleted file mode 100644 index 9e4a5c5f82f..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-PutDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-PutDocumentReply.dat b/documentapi/test/crosslanguagefiles/5-java-PutDocumentReply.dat Binary files differdeleted file mode 100644 index 480544045bb..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-PutDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-QueryResultReply.dat b/documentapi/test/crosslanguagefiles/5-java-QueryResultReply.dat Binary files differdeleted file mode 100644 index 003f35d63a7..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-QueryResultReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-RemoveDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5-java-RemoveDocumentMessage.dat Binary files differdeleted file mode 100644 index 78b7972eb5c..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-RemoveDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-RemoveDocumentReply.dat b/documentapi/test/crosslanguagefiles/5-java-RemoveDocumentReply.dat Binary files differdeleted file mode 100644 index bf5db8761e2..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-RemoveDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessage.dat b/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessage.dat Binary files differdeleted file mode 100644 index 16850a6aff3..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessageGroup.dat b/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessageGroup.dat Binary files differdeleted file mode 100644 index 9d7901a8b6e..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessageGroup.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessageUser.dat b/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessageUser.dat Binary files differdeleted file mode 100644 index c2a63cb94c0..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-RemoveLocationMessageUser.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-RemoveLocationReply.dat b/documentapi/test/crosslanguagefiles/5-java-RemoveLocationReply.dat Binary files differdeleted file mode 100644 index 752c4dba399..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-RemoveLocationReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-SearchResultReply.dat b/documentapi/test/crosslanguagefiles/5-java-SearchResultReply.dat Binary files differdeleted file mode 100644 index cce9c6f8d14..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-SearchResultReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-StatBucketMessage.dat b/documentapi/test/crosslanguagefiles/5-java-StatBucketMessage.dat Binary files differdeleted file mode 100644 index 1fc2b1cf3c1..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-StatBucketMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-StatBucketReply.dat b/documentapi/test/crosslanguagefiles/5-java-StatBucketReply.dat Binary files differdeleted file mode 100644 index 0b98e240018..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-StatBucketReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-UpdateDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5-java-UpdateDocumentMessage.dat Binary files differdeleted file mode 100644 index f1bca25ceca..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-UpdateDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-UpdateDocumentReply.dat b/documentapi/test/crosslanguagefiles/5-java-UpdateDocumentReply.dat Binary files differdeleted file mode 100644 index c7151299366..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-UpdateDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-VisitorInfoMessage.dat b/documentapi/test/crosslanguagefiles/5-java-VisitorInfoMessage.dat Binary files differdeleted file mode 100644 index 80b44e0c6fd..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-VisitorInfoMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-VisitorInfoReply.dat b/documentapi/test/crosslanguagefiles/5-java-VisitorInfoReply.dat Binary files differdeleted file mode 100644 index 57a656c9b2d..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-VisitorInfoReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5-java-WrongDistributionReply.dat b/documentapi/test/crosslanguagefiles/5-java-WrongDistributionReply.dat Binary files differdeleted file mode 100644 index 0dbe13225ae..00000000000 --- a/documentapi/test/crosslanguagefiles/5-java-WrongDistributionReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-BatchMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-BatchMessage.dat Binary files differdeleted file mode 100644 index c1c43e8081b..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-BatchMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-BatchReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-BatchReply.dat Binary files differdeleted file mode 100644 index be3a9ba1913..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-BatchReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-CreateVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-CreateVisitorMessage.dat Binary files differdeleted file mode 100644 index 4ca8648e702..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-CreateVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-CreateVisitorReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-CreateVisitorReply.dat Binary files differdeleted file mode 100644 index e13917227d1..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-CreateVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DestroyVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DestroyVisitorMessage.dat Binary files differdeleted file mode 100644 index f39b31217e6..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DestroyVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DestroyVisitorReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DestroyVisitorReply.dat Binary files differdeleted file mode 100644 index 1468f027b15..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DestroyVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentIgnoredReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentIgnoredReply.dat Binary files differdeleted file mode 100644 index 15a7afe2a59..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentIgnoredReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentListMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentListMessage.dat Binary files differdeleted file mode 100644 index 2d8d12d2704..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentListMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentListReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentListReply.dat Binary files differdeleted file mode 100644 index c8a1cd888f0..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentListReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-1.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-1.dat Binary files differdeleted file mode 100644 index 0107dd5f350..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-1.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-2.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-2.dat Binary files differdeleted file mode 100644 index 57187093f28..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-2.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-3.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-3.dat Binary files differdeleted file mode 100644 index 6a516d38d17..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryMessage-3.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryReply.dat Binary files differdeleted file mode 100644 index 16b1e4bc4ef..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-DocumentSummaryReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-EmptyBucketsMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-EmptyBucketsMessage.dat Binary files differdeleted file mode 100644 index b9df278fd7a..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-EmptyBucketsMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-EmptyBucketsReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-EmptyBucketsReply.dat Binary files differdeleted file mode 100644 index 05510dd8c1e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-EmptyBucketsReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketListMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketListMessage.dat Binary files differdeleted file mode 100644 index fa3de45ac5b..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketListMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketListReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketListReply.dat Binary files differdeleted file mode 100644 index 830994ed785..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketListReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketStateMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketStateMessage.dat Binary files differdeleted file mode 100644 index aa2d206ca3a..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketStateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketStateReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketStateReply.dat Binary files differdeleted file mode 100644 index 0f91e3759f8..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-GetBucketStateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-GetDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-GetDocumentMessage.dat Binary files differdeleted file mode 100644 index 3df64ed657f..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-GetDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-GetDocumentReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-GetDocumentReply.dat Binary files differdeleted file mode 100644 index c1ad7920a2e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-GetDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-MapVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-MapVisitorMessage.dat Binary files differdeleted file mode 100644 index 1a8a837ea16..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-MapVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-MapVisitorReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-MapVisitorReply.dat Binary files differdeleted file mode 100644 index 541cd718a66..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-MapVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationMessage.dat Binary files differdeleted file mode 100644 index 6efc54a6d09..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationReply.dat Binary files differdeleted file mode 100644 index 8ad31a95bd5..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-PutDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-PutDocumentMessage.dat Binary files differdeleted file mode 100644 index 9e4a5c5f82f..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-PutDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-PutDocumentReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-PutDocumentReply.dat Binary files differdeleted file mode 100644 index 480544045bb..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-PutDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-1.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-1.dat Binary files differdeleted file mode 100644 index dbf830c9365..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-1.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-2.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-2.dat Binary files differdeleted file mode 100644 index 094143cf78d..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-2.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-3.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-3.dat Binary files differdeleted file mode 100644 index 3341d74052b..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-3.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-4.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-4.dat Binary files differdeleted file mode 100644 index 8aaaefff491..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-4.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-5.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-5.dat Binary files differdeleted file mode 100644 index e66ed1f07d4..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultMessage-5.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultReply.dat Binary files differdeleted file mode 100644 index 003f35d63a7..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-QueryResultReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveDocumentMessage.dat Binary files differdeleted file mode 100644 index 78b7972eb5c..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveDocumentReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveDocumentReply.dat Binary files differdeleted file mode 100644 index bf5db8761e2..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessage.dat Binary files differdeleted file mode 100644 index 16850a6aff3..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessageGroup.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessageGroup.dat Binary files differdeleted file mode 100644 index abd648184d7..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessageGroup.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessageUser.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessageUser.dat Binary files differdeleted file mode 100644 index c2a63cb94c0..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationMessageUser.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationReply.dat Binary files differdeleted file mode 100644 index 752c4dba399..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-RemoveLocationReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-1.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-1.dat Binary files differdeleted file mode 100644 index 988f9fdab1f..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-1.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-2.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-2.dat Binary files differdeleted file mode 100644 index ac277d09643..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-2.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-3.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-3.dat Binary files differdeleted file mode 100644 index 03b49c8a0ac..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-3.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-4.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-4.dat Binary files differdeleted file mode 100644 index d52e574ea44..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-4.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-5.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-5.dat Binary files differdeleted file mode 100644 index e68654e9941..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultMessage-5.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultReply.dat Binary files differdeleted file mode 100644 index cce9c6f8d14..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-SearchResultReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-StatBucketMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-StatBucketMessage.dat Binary files differdeleted file mode 100644 index 1fc2b1cf3c1..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-StatBucketMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-StatBucketReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-StatBucketReply.dat Binary files differdeleted file mode 100644 index 0b98e240018..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-StatBucketReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-UpdateDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-UpdateDocumentMessage.dat Binary files differdeleted file mode 100644 index f1bca25ceca..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-UpdateDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-UpdateDocumentReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-UpdateDocumentReply.dat Binary files differdeleted file mode 100644 index c7151299366..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-UpdateDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-VisitorInfoMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-VisitorInfoMessage.dat Binary files differdeleted file mode 100644 index 80b44e0c6fd..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-VisitorInfoMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-VisitorInfoReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-VisitorInfoReply.dat Binary files differdeleted file mode 100644 index 57a656c9b2d..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-VisitorInfoReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-WrongDistributionReply.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-WrongDistributionReply.dat Binary files differdeleted file mode 100644 index 0dbe13225ae..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-cpp-WrongDistributionReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-BatchMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-BatchMessage.dat Binary files differdeleted file mode 100644 index c1c43e8081b..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-BatchMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-BatchReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-BatchReply.dat Binary files differdeleted file mode 100644 index be3a9ba1913..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-BatchReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-CreateVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-CreateVisitorMessage.dat Binary files differdeleted file mode 100644 index 4ca8648e702..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-CreateVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-CreateVisitorReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-CreateVisitorReply.dat Binary files differdeleted file mode 100644 index e13917227d1..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-CreateVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-DestroyVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-DestroyVisitorMessage.dat Binary files differdeleted file mode 100644 index f39b31217e6..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-DestroyVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-DestroyVisitorReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-DestroyVisitorReply.dat Binary files differdeleted file mode 100644 index 1468f027b15..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-DestroyVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-DocumentIgnoredReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-DocumentIgnoredReply.dat Binary files differdeleted file mode 100644 index 15a7afe2a59..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-DocumentIgnoredReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-DocumentListMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-DocumentListMessage.dat Binary files differdeleted file mode 100644 index 2d8d12d2704..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-DocumentListMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-DocumentListReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-DocumentListReply.dat Binary files differdeleted file mode 100644 index c8a1cd888f0..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-DocumentListReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-DocumentSummaryReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-DocumentSummaryReply.dat Binary files differdeleted file mode 100644 index 16b1e4bc4ef..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-DocumentSummaryReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-EmptyBucketsMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-EmptyBucketsMessage.dat Binary files differdeleted file mode 100644 index b9df278fd7a..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-EmptyBucketsMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-EmptyBucketsReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-EmptyBucketsReply.dat Binary files differdeleted file mode 100644 index 05510dd8c1e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-EmptyBucketsReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-GetBucketListMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-GetBucketListMessage.dat Binary files differdeleted file mode 100644 index fa3de45ac5b..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-GetBucketListMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-GetBucketListReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-GetBucketListReply.dat Binary files differdeleted file mode 100644 index 830994ed785..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-GetBucketListReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-GetBucketStateMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-GetBucketStateMessage.dat Binary files differdeleted file mode 100644 index aa2d206ca3a..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-GetBucketStateMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-GetBucketStateReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-GetBucketStateReply.dat Binary files differdeleted file mode 100644 index 0f91e3759f8..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-GetBucketStateReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-GetDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-GetDocumentMessage.dat Binary files differdeleted file mode 100644 index 3df64ed657f..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-GetDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-GetDocumentReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-GetDocumentReply.dat Binary files differdeleted file mode 100644 index c1ad7920a2e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-GetDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-MapVisitorMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-MapVisitorMessage.dat Binary files differdeleted file mode 100644 index 1a8a837ea16..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-MapVisitorMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-MapVisitorReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-MapVisitorReply.dat Binary files differdeleted file mode 100644 index 541cd718a66..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-MapVisitorReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-MultiOperationMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-MultiOperationMessage.dat Binary files differdeleted file mode 100644 index 6efc54a6d09..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-MultiOperationMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-MultiOperationReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-MultiOperationReply.dat Binary files differdeleted file mode 100644 index 8ad31a95bd5..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-MultiOperationReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-PutDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-PutDocumentMessage.dat Binary files differdeleted file mode 100644 index 9e4a5c5f82f..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-PutDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-PutDocumentReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-PutDocumentReply.dat Binary files differdeleted file mode 100644 index 480544045bb..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-PutDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-QueryResultReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-QueryResultReply.dat Binary files differdeleted file mode 100644 index 003f35d63a7..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-QueryResultReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-RemoveDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-RemoveDocumentMessage.dat Binary files differdeleted file mode 100644 index 78b7972eb5c..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-RemoveDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-RemoveDocumentReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-RemoveDocumentReply.dat Binary files differdeleted file mode 100644 index bf5db8761e2..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-RemoveDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessage.dat Binary files differdeleted file mode 100644 index 16850a6aff3..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessageGroup.dat b/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessageGroup.dat Binary files differdeleted file mode 100644 index 9d7901a8b6e..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessageGroup.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessageUser.dat b/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessageUser.dat Binary files differdeleted file mode 100644 index c2a63cb94c0..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationMessageUser.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationReply.dat Binary files differdeleted file mode 100644 index 752c4dba399..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-RemoveLocationReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-SearchResultReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-SearchResultReply.dat Binary files differdeleted file mode 100644 index cce9c6f8d14..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-SearchResultReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-StatBucketMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-StatBucketMessage.dat Binary files differdeleted file mode 100644 index 1fc2b1cf3c1..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-StatBucketMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-StatBucketReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-StatBucketReply.dat Binary files differdeleted file mode 100644 index 0b98e240018..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-StatBucketReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-UpdateDocumentMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-UpdateDocumentMessage.dat Binary files differdeleted file mode 100644 index f1bca25ceca..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-UpdateDocumentMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-UpdateDocumentReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-UpdateDocumentReply.dat Binary files differdeleted file mode 100644 index c7151299366..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-UpdateDocumentReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-VisitorInfoMessage.dat b/documentapi/test/crosslanguagefiles/5.1-java-VisitorInfoMessage.dat Binary files differdeleted file mode 100644 index 80b44e0c6fd..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-VisitorInfoMessage.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-VisitorInfoReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-VisitorInfoReply.dat Binary files differdeleted file mode 100644 index 57a656c9b2d..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-VisitorInfoReply.dat +++ /dev/null diff --git a/documentapi/test/crosslanguagefiles/5.1-java-WrongDistributionReply.dat b/documentapi/test/crosslanguagefiles/5.1-java-WrongDistributionReply.dat Binary files differdeleted file mode 100644 index 0dbe13225ae..00000000000 --- a/documentapi/test/crosslanguagefiles/5.1-java-WrongDistributionReply.dat +++ /dev/null |