From c8b208d82ca578a3b0dcf20ba75b800deedbebeb Mon Sep 17 00:00:00 2001 From: Arnstein Ressem Date: Thu, 18 Oct 2018 09:27:03 +0200 Subject: 6-SNAPSHOT -> 7-SNAPSHOT --- document/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'document') diff --git a/document/pom.xml b/document/pom.xml index b8344391631..19f1a9470fc 100644 --- a/document/pom.xml +++ b/document/pom.xml @@ -8,11 +8,11 @@ com.yahoo.vespa parent - 6-SNAPSHOT + 7-SNAPSHOT ../parent/pom.xml document - 6-SNAPSHOT + 7-SNAPSHOT jar ${project.artifactId} -- cgit v1.2.3 From 50ed56deef4969a1a379c6e4f469adb2e7e0a910 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Mon, 29 Oct 2018 12:39:24 +0000 Subject: stop using "header" and "body" keywords --- application/src/test/resources/test.sd | 4 ---- docproc/src/test/java/com/yahoo/docproc/util/docindoc.sd | 4 ++-- docproc/src/test/java/com/yahoo/docproc/util/outerdoc.sd | 2 +- document/src/test/java/com/yahoo/document/datatypes/blog.sd | 7 ------- document/src/test/java/com/yahoo/document/docindoc.sd | 4 ++-- document/src/test/java/com/yahoo/document/outerdoc.sd | 2 +- documentgen-test/etc/complex/book.sd | 5 ----- documentgen-test/etc/complex/common.sd | 3 --- vespa-documentgen-plugin/etc/music/music.sd | 8 -------- 9 files changed, 6 insertions(+), 33 deletions(-) (limited to 'document') diff --git a/application/src/test/resources/test.sd b/application/src/test/resources/test.sd index 85600ef9546..81d10391294 100644 --- a/application/src/test/resources/test.sd +++ b/application/src/test/resources/test.sd @@ -4,19 +4,15 @@ search test { document test { field title type string { - # index-to: title, default weight: 30 stemming: none bolding: on - body } field body type string { - # index-to: body, default weight: 6 stemming: none summary: dynamic - body } } diff --git a/docproc/src/test/java/com/yahoo/docproc/util/docindoc.sd b/docproc/src/test/java/com/yahoo/docproc/util/docindoc.sd index 8b6acd71f47..b05f8d71c89 100644 --- a/docproc/src/test/java/com/yahoo/docproc/util/docindoc.sd +++ b/docproc/src/test/java/com/yahoo/docproc/util/docindoc.sd @@ -1,7 +1,7 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. search docindoc { document docindoc { - field name type string { header } - field content type string { body } + field name type string { } + field content type string { } } } diff --git a/docproc/src/test/java/com/yahoo/docproc/util/outerdoc.sd b/docproc/src/test/java/com/yahoo/docproc/util/outerdoc.sd index 6fdbd402ffe..57a1bda323a 100644 --- a/docproc/src/test/java/com/yahoo/docproc/util/outerdoc.sd +++ b/docproc/src/test/java/com/yahoo/docproc/util/outerdoc.sd @@ -1,6 +1,6 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. search outerdoc { document outerdoc { - field innerdocuments type array { body } + field innerdocuments type array { } } } diff --git a/document/src/test/java/com/yahoo/document/datatypes/blog.sd b/document/src/test/java/com/yahoo/document/datatypes/blog.sd index 545c46cb149..1723e942370 100644 --- a/document/src/test/java/com/yahoo/document/datatypes/blog.sd +++ b/document/src/test/java/com/yahoo/document/datatypes/blog.sd @@ -4,26 +4,19 @@ search blog { document blog { field title type string { - header indexing: summary | index - # index-to: default } field author type string { - header indexing: summary | index - # index-to: default } field body type string { - header indexing: summary | index } field url type uri { - header indexing: index | summary - # index-to: default } } diff --git a/document/src/test/java/com/yahoo/document/docindoc.sd b/document/src/test/java/com/yahoo/document/docindoc.sd index 8b6acd71f47..b05f8d71c89 100644 --- a/document/src/test/java/com/yahoo/document/docindoc.sd +++ b/document/src/test/java/com/yahoo/document/docindoc.sd @@ -1,7 +1,7 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. search docindoc { document docindoc { - field name type string { header } - field content type string { body } + field name type string { } + field content type string { } } } diff --git a/document/src/test/java/com/yahoo/document/outerdoc.sd b/document/src/test/java/com/yahoo/document/outerdoc.sd index 6fdbd402ffe..57a1bda323a 100644 --- a/document/src/test/java/com/yahoo/document/outerdoc.sd +++ b/document/src/test/java/com/yahoo/document/outerdoc.sd @@ -1,6 +1,6 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. search outerdoc { document outerdoc { - field innerdocuments type array { body } + field innerdocuments type array { } } } diff --git a/documentgen-test/etc/complex/book.sd b/documentgen-test/etc/complex/book.sd index 90dff0982af..872634bf53b 100644 --- a/documentgen-test/etc/complex/book.sd +++ b/documentgen-test/etc/complex/book.sd @@ -44,22 +44,17 @@ search book { } field author type string { bolding: on - # index-to: default, author indexing: summary | index - header } field isbn type string { - # index-to: default, isbn indexing: summary | index } field year type int { indexing: summary | index } field description type string { - # index-to: default, description indexing: summary | index summary: dynamic - body } field myraw type raw { diff --git a/documentgen-test/etc/complex/common.sd b/documentgen-test/etc/complex/common.sd index 017bce4f612..fb49c8b0e52 100644 --- a/documentgen-test/etc/complex/common.sd +++ b/documentgen-test/etc/complex/common.sd @@ -6,10 +6,8 @@ search common { } field title type string { bolding: on - # index-to: default, title indexing: index|summary summary-to: smallsum - body } field mid type int { indexing: attribute|index|summary @@ -33,7 +31,6 @@ search common { indexing: index|summary } field content type raw { - body } annotation date { field exacttime type long { } diff --git a/vespa-documentgen-plugin/etc/music/music.sd b/vespa-documentgen-plugin/etc/music/music.sd index 2e40523a6d9..b5083d4e490 100644 --- a/vespa-documentgen-plugin/etc/music/music.sd +++ b/vespa-documentgen-plugin/etc/music/music.sd @@ -7,33 +7,25 @@ search music { field title type string { indexing: summary | index # How this field should be indexed - # index-to: title, default # Create two indexes weight: 75 # Ranking importancy of this field, used by the built in nativeRank feature - header } field artist type string { indexing: summary | attribute | index - # index-to: artist, default - weight: 25 - header } field year type int { indexing: summary | attribute - header } # Increase query field popularity type int { indexing: summary | attribute - body } field url type uri { indexing: summary | index - header } } -- cgit v1.2.3 From 3bbd2d2c175867946945991d32395a46ea870218 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Mon, 12 Nov 2018 12:27:26 +0000 Subject: remove deprecated methods --- .../yahoo/docproc/proxy/ProxyDocumentUpdate.java | 14 ----- .../java/com/yahoo/document/DocumentUpdate.java | 67 +--------------------- 2 files changed, 1 insertion(+), 80 deletions(-) (limited to 'document') diff --git a/docproc/src/main/java/com/yahoo/docproc/proxy/ProxyDocumentUpdate.java b/docproc/src/main/java/com/yahoo/docproc/proxy/ProxyDocumentUpdate.java index 517f44cb983..088035124b7 100644 --- a/docproc/src/main/java/com/yahoo/docproc/proxy/ProxyDocumentUpdate.java +++ b/docproc/src/main/java/com/yahoo/docproc/proxy/ProxyDocumentUpdate.java @@ -19,7 +19,6 @@ import java.util.Map; * * @author vegardh */ -// TODO Vespa 7 Remove all deprecated methods public class ProxyDocumentUpdate extends DocumentUpdate implements DocumentOperationWrapper { private DocumentUpdate docU; @@ -46,13 +45,6 @@ public class ProxyDocumentUpdate extends DocumentUpdate implements DocumentOpera return docU.getFieldUpdate(field); } - @Override - @Deprecated - @SuppressWarnings( "deprecation" ) - public FieldUpdate getFieldUpdate(int index) { - return docU.getFieldUpdate(index); - } - @Override public FieldUpdate getFieldUpdate(String fieldName) { String mapped = fieldMap.get(fieldName); @@ -63,12 +55,6 @@ public class ProxyDocumentUpdate extends DocumentUpdate implements DocumentOpera return docU.getFieldUpdate(mapped); } - @Override - @Deprecated - @SuppressWarnings( "deprecation" ) - public List getFieldUpdates() { - return docU.getFieldUpdates(); - } @Override public Collection fieldUpdates() { return docU.fieldUpdates(); diff --git a/document/src/main/java/com/yahoo/document/DocumentUpdate.java b/document/src/main/java/com/yahoo/document/DocumentUpdate.java index 0bbb57ec60b..8ae8fa60861 100644 --- a/document/src/main/java/com/yahoo/document/DocumentUpdate.java +++ b/document/src/main/java/com/yahoo/document/DocumentUpdate.java @@ -38,7 +38,7 @@ import java.util.Optional; * @see com.yahoo.document.update.FieldUpdate * @see com.yahoo.document.update.ValueUpdate */ -//TODO Vespa 7 Remove all deprecated methods and use a map to avoid quadratic scaling on insert/update/remove +//TODO Vespa 7 use a map to avoid quadratic scaling on insert/update/remove public class DocumentUpdate extends DocumentOperation implements Iterable { @@ -157,17 +157,6 @@ public class DocumentUpdate extends DocumentOperation implements Iterable getFieldUpdates() { - return Collections.unmodifiableList(fieldUpdates); - } - /** * Get an unmodifiable collection of all field updates that this document update specifies. * @@ -177,17 +166,6 @@ public class DocumentUpdate extends DocumentOperation implements Iterable getFieldPathUpdates() { - return Collections.unmodifiableList(fieldPathUpdates); - } - /** * Get an unmodifiable collection of all field path updates that this document update specifies. * @@ -213,36 +191,6 @@ public class DocumentUpdate extends DocumentOperation implements Iterable it = fieldUpdates.iterator(); it.hasNext();) { FieldUpdate fieldUpdate = it.next(); -- cgit v1.2.3 From c8aca731bc743c07b3061ef34f03abf091d6c5d0 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Tue, 13 Nov 2018 16:23:58 +0100 Subject: Do TODOs --- .../searchdefinition/processing/SummaryDiskAccessValidator.java | 9 ++++----- config-model/src/main/resources/schema/services.rnc | 1 - .../test/java/com/yahoo/searchdefinition/SummaryTestCase.java | 2 +- .../src/main/resources/configdefinitions/access-log.def | 3 +-- document/src/main/java/com/yahoo/document/DocumentUpdate.java | 7 ++----- .../src/main/java/com/yahoo/vespa/http/client/FeedClient.java | 1 - vespaclient-container-plugin/pom.xml | 2 +- 7 files changed, 9 insertions(+), 16 deletions(-) (limited to 'document') diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDiskAccessValidator.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDiskAccessValidator.java index d30006a753e..8c0c6a74037 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDiskAccessValidator.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDiskAccessValidator.java @@ -42,11 +42,10 @@ public class SummaryDiskAccessValidator extends Processor { throw new IllegalArgumentException(summaryField + " in " + summary + " references " + source + ", but this field does not exist"); if ( ! isInMemory(field) && ! summary.isFromDisk()) { - // TODO: Set to warning on vespa 7 - deployLogger.log(Level.FINE, summaryField + " in " + summary + " references " + - source + ", which is not an attribute: Using this " + - "summary will cause disk accesses. " + - "Set 'from-disk' on this summary class to silence this warning."); + deployLogger.log(Level.WARNING, summaryField + " in " + summary + " references " + + source + ", which is not an attribute: Using this " + + "summary will cause disk accesses. " + + "Set 'from-disk' on this summary class to silence this warning."); } } } diff --git a/config-model/src/main/resources/schema/services.rnc b/config-model/src/main/resources/schema/services.rnc index c4eb7435ca6..fe728506124 100644 --- a/config-model/src/main/resources/schema/services.rnc +++ b/config-model/src/main/resources/schema/services.rnc @@ -11,7 +11,6 @@ include "legacygenericcluster.rnc" start = element services { attribute version { "1.0" }? & - attribute major-version { text }? & # TODO: Remove on Vespa 7 attribute application-type { "hosted-infrastructure" }? & LegacyGenericCluster* & GenericCluster* & diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java index de2a904cc48..9c0a1a209b4 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java @@ -60,7 +60,7 @@ public class SummaryTestCase { DeployLoggerStub logger = new DeployLoggerStub(); SearchBuilder.createFromString(sd, logger); assertEquals(1, logger.entries.size()); - assertEquals(Level.FINE, logger.entries.get(0).level); + assertEquals(Level.WARNING, logger.entries.get(0).level); assertEquals("summary field 'ondisk' in document summary 'default' references source field 'ondisk', " + "which is not an attribute: Using this summary will cause disk accesses. " + "Set 'from-disk' on this summary class to silence this warning.", diff --git a/container-accesslogging/src/main/resources/configdefinitions/access-log.def b/container-accesslogging/src/main/resources/configdefinitions/access-log.def index 755f7968e2e..788fadcdf90 100644 --- a/container-accesslogging/src/main/resources/configdefinitions/access-log.def +++ b/container-accesslogging/src/main/resources/configdefinitions/access-log.def @@ -14,5 +14,4 @@ fileHandler.rotation string default="0 60 ..." fileHandler.symlink string default="" # compress the previous access log after rotation -# TODO change to "true" for Vespa 7 -fileHandler.compressOnRotation bool default=false +fileHandler.compressOnRotation bool default=true diff --git a/document/src/main/java/com/yahoo/document/DocumentUpdate.java b/document/src/main/java/com/yahoo/document/DocumentUpdate.java index 8ae8fa60861..a1408fc4a46 100644 --- a/document/src/main/java/com/yahoo/document/DocumentUpdate.java +++ b/document/src/main/java/com/yahoo/document/DocumentUpdate.java @@ -38,8 +38,7 @@ import java.util.Optional; * @see com.yahoo.document.update.FieldUpdate * @see com.yahoo.document.update.ValueUpdate */ -//TODO Vespa 7 use a map to avoid quadratic scaling on insert/update/remove - +// TODO: Use a map to avoid quadratic scaling on insert/update/remove public class DocumentUpdate extends DocumentOperation implements Iterable { //see src/vespa/document/util/identifiableid.h @@ -424,7 +423,6 @@ public class DocumentUpdate extends DocumentOperation implements Iterable - + 4.0.0 -- cgit v1.2.3 From ae22dd9db46912547cd2fc8f3b2f50db04107ef4 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 26 Oct 2018 11:41:52 +0200 Subject: remove deprecated methods and switch to hashmap instead of list. --- .../yahoo/docproc/proxy/ProxyDocumentUpdate.java | 1 - .../java/com/yahoo/document/DocumentUpdate.java | 54 +++++++++------------ document/src/tests/data/serializeupdatejava.dat | Bin 112 -> 112 bytes 3 files changed, 22 insertions(+), 33 deletions(-) (limited to 'document') diff --git a/docproc/src/main/java/com/yahoo/docproc/proxy/ProxyDocumentUpdate.java b/docproc/src/main/java/com/yahoo/docproc/proxy/ProxyDocumentUpdate.java index 088035124b7..51f9afa7a2e 100644 --- a/docproc/src/main/java/com/yahoo/docproc/proxy/ProxyDocumentUpdate.java +++ b/docproc/src/main/java/com/yahoo/docproc/proxy/ProxyDocumentUpdate.java @@ -11,7 +11,6 @@ import com.yahoo.document.serialization.DocumentUpdateWriter; import com.yahoo.document.update.FieldUpdate; import java.util.Collection; -import java.util.List; import java.util.Map; /** diff --git a/document/src/main/java/com/yahoo/document/DocumentUpdate.java b/document/src/main/java/com/yahoo/document/DocumentUpdate.java index a1408fc4a46..a47f1546a75 100644 --- a/document/src/main/java/com/yahoo/document/DocumentUpdate.java +++ b/document/src/main/java/com/yahoo/document/DocumentUpdate.java @@ -15,8 +15,10 @@ import com.yahoo.io.GrowableByteBuffer; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Optional; /** @@ -38,14 +40,14 @@ import java.util.Optional; * @see com.yahoo.document.update.FieldUpdate * @see com.yahoo.document.update.ValueUpdate */ -// TODO: Use a map to avoid quadratic scaling on insert/update/remove + public class DocumentUpdate extends DocumentOperation implements Iterable { //see src/vespa/document/util/identifiableid.h public static final int CLASSID = 0x1000 + 6; private DocumentId docId; - private final List fieldUpdates; + private final Map id2FieldUpdates; private final List fieldPathUpdates; private DocumentType documentType; private Boolean createIfNonExistent; @@ -59,7 +61,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable(); + this.id2FieldUpdates = new HashMap<>(); this.fieldPathUpdates = new ArrayList<>(); } @@ -69,7 +71,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable(); + id2FieldUpdates = new HashMap<>(); fieldPathUpdates = new ArrayList<>(); reader.read(this); } @@ -112,7 +114,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable iter = fieldUpdates.iterator(); iter.hasNext();) { - FieldUpdate update = iter.next(); + for (Iterator> iter = id2FieldUpdates.entrySet().iterator(); iter.hasNext();) { + Map.Entry entry = iter.next(); + FieldUpdate update = entry.getValue(); if (!update.isEmpty()) { ValueUpdate last = update.getValueUpdate(update.size() - 1); if (last instanceof AssignValueUpdate) { @@ -162,7 +165,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable fieldUpdates() { - return Collections.unmodifiableCollection(fieldUpdates); + return Collections.unmodifiableCollection(id2FieldUpdates.values()); } /** @@ -202,7 +205,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable it = fieldUpdates.iterator(); it.hasNext();) { - FieldUpdate fieldUpdate = it.next(); - if (fieldUpdate.getField().equals(field)) { - it.remove(); - return fieldUpdate; - } - } - return null; + return id2FieldUpdates.remove(field.getId()); } public FieldUpdate removeFieldUpdate(String fieldName) { @@ -361,9 +352,8 @@ public class DocumentUpdate extends DocumentOperation implements Iterable Date: Wed, 14 Nov 2018 21:20:49 +0100 Subject: Order is changed. --- document/src/tests/documentupdatetestcase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'document') diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp index b4d98f0dd21..25c21f5c2de 100644 --- a/document/src/tests/documentupdatetestcase.cpp +++ b/document/src/tests/documentupdatetestcase.cpp @@ -553,7 +553,7 @@ void DocumentUpdateTest::testReadSerializedFile() CPPUNIT_ASSERT_EQUAL(*type, upd.getType()); // Verify assign value update. - FieldUpdate serField = upd.getUpdates()[0]; + FieldUpdate serField = upd.getUpdates()[2]; CPPUNIT_ASSERT_EQUAL(serField.getField().getId(), type->getField("intfield").getId()); const ValueUpdate* serValue = &serField[0]; @@ -571,7 +571,7 @@ void DocumentUpdateTest::testReadSerializedFile() CPPUNIT_ASSERT(serValue->inherits(ClearValueUpdate::classId)); // Verify add value update. - serField = upd.getUpdates()[2]; + serField = upd.getUpdates()[0]; CPPUNIT_ASSERT_EQUAL(serField.getField().getId(), type->getField("arrayoffloatfield").getId()); serValue = &serField[0]; -- cgit v1.2.3 From d5f4dcafde0a66969170d5e7da01b52039c0ba52 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Wed, 14 Nov 2018 21:57:12 +0100 Subject: This should be better order. --- document/src/tests/documentupdatetestcase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'document') diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp index 25c21f5c2de..4962b708ef5 100644 --- a/document/src/tests/documentupdatetestcase.cpp +++ b/document/src/tests/documentupdatetestcase.cpp @@ -553,7 +553,7 @@ void DocumentUpdateTest::testReadSerializedFile() CPPUNIT_ASSERT_EQUAL(*type, upd.getType()); // Verify assign value update. - FieldUpdate serField = upd.getUpdates()[2]; + FieldUpdate serField = upd.getUpdates()[1]; CPPUNIT_ASSERT_EQUAL(serField.getField().getId(), type->getField("intfield").getId()); const ValueUpdate* serValue = &serField[0]; @@ -563,7 +563,7 @@ void DocumentUpdateTest::testReadSerializedFile() CPPUNIT_ASSERT_EQUAL(IntFieldValue(4), static_cast(assign->getValue())); // Verify clear field update. - serField = upd.getUpdates()[1]; + serField = upd.getUpdates()[2]; CPPUNIT_ASSERT_EQUAL(serField.getField().getId(), type->getField("floatfield").getId()); serValue = &serField[0]; -- cgit v1.2.3 From 07ea1bb4cdbf7037b8465b1dec77174cc0e02a59 Mon Sep 17 00:00:00 2001 From: gjoranv Date: Tue, 20 Nov 2018 10:37:32 +0100 Subject: Move TODO to Vespa 8 --- document/src/main/java/com/yahoo/vespaxmlparser/package-info.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/package-info.java b/document/src/main/java/com/yahoo/vespaxmlparser/package-info.java index ba33b6a83ad..68116e777d6 100644 --- a/document/src/main/java/com/yahoo/vespaxmlparser/package-info.java +++ b/document/src/main/java/com/yahoo/vespaxmlparser/package-info.java @@ -1,5 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// TODO: Remove this package on Vespa 7 +// TODO: Remove this package on Vespa 8 @ExportPackage package com.yahoo.vespaxmlparser; -- cgit v1.2.3 From d052d8f6e2c6e0696bfdb487c4964fb890e012b7 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 11:44:23 +0000 Subject: update or add comments around deprecated methods --- document/src/main/java/com/yahoo/document/Document.java | 4 ++-- document/src/main/java/com/yahoo/document/Field.java | 2 +- .../com/yahoo/document/serialization/VespaDocumentDeserializer42.java | 2 +- .../com/yahoo/document/serialization/VespaDocumentSerializer42.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/Document.java b/document/src/main/java/com/yahoo/document/Document.java index 222ebe29c6d..75a331f5707 100644 --- a/document/src/main/java/com/yahoo/document/Document.java +++ b/document/src/main/java/com/yahoo/document/Document.java @@ -346,7 +346,7 @@ public class Document extends StructuredFieldValue { } @SuppressWarnings("deprecation") - @Deprecated + @Deprecated // remove before Vespa 8 public void serializeHeader(Serializer data) throws SerializationException { if (data instanceof DocumentWriter) { if (data instanceof com.yahoo.document.serialization.VespaDocumentSerializer42) { @@ -362,7 +362,7 @@ public class Document extends StructuredFieldValue { } } - @Deprecated + @Deprecated // remove before Vespa 8 public void serializeBody(Serializer data) throws SerializationException { if (getBody().getFieldCount() > 0) { if (data instanceof FieldWriter) { diff --git a/document/src/main/java/com/yahoo/document/Field.java b/document/src/main/java/com/yahoo/document/Field.java index 5d3d148d832..d0a19a50073 100644 --- a/document/src/main/java/com/yahoo/document/Field.java +++ b/document/src/main/java/com/yahoo/document/Field.java @@ -187,7 +187,7 @@ public class Field extends FieldBase implements FieldSet, Comparable, Serializab * @param type The new type of the field. * @deprecated do not use */ - @Deprecated // TODO: Remove on Vespa 8 + @Deprecated // todo - refactor SD processing to avoid needing this public void setDataType(DataType type) { dataType = type; fieldId = calculateIdV7(null); diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java index 7ff5729ca39..21f8c182eea 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java @@ -80,7 +80,7 @@ import static com.yahoo.text.Utf8.calculateStringPositions; * @deprecated Please use {@link com.yahoo.document.serialization.VespaDocumentDeserializerHead} instead for new code. * @author baldersheim */ -@Deprecated // Remove on Vespa 7 +@Deprecated // Remove on Vespa 8 // When removing: Move content of this class into VespaDocumentDeserializerHead public class VespaDocumentDeserializer42 extends VespaDocumentSerializer42 implements DocumentDeserializer { diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java index 581c7df8aee..9976c3ff6b4 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java @@ -67,7 +67,7 @@ import static com.yahoo.text.Utf8.calculateBytePositions; * @deprecated use {@link com.yahoo.document.serialization.VespaDocumentSerializerHead} instead for new code * @author baldersheim */ -@Deprecated // OK: Don't remove on Vespa 6: Mail may have documents on this format still +@Deprecated // Remove before Vespa 8 // When removing: Move content into VespaDocumentSerializerHead public class VespaDocumentSerializer42 extends BufferSerializer implements DocumentSerializer { -- cgit v1.2.3 From f565ed8391ab0fecc81601ade64bd4884ce80b36 Mon Sep 17 00:00:00 2001 From: gjoranv Date: Tue, 20 Nov 2018 13:25:02 +0100 Subject: Remove @PublicApi from package c.y.document.select --- document/src/main/java/com/yahoo/document/select/package-info.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/select/package-info.java b/document/src/main/java/com/yahoo/document/select/package-info.java index e6de6497008..813643a7f06 100644 --- a/document/src/main/java/com/yahoo/document/select/package-info.java +++ b/document/src/main/java/com/yahoo/document/select/package-info.java @@ -1,7 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. @ExportPackage -@PublicApi package com.yahoo.document.select; -import com.yahoo.api.annotations.PublicApi; import com.yahoo.osgi.annotation.ExportPackage; -- cgit v1.2.3 From d6dbd421b988f834a8f8479c3df23b519941ad07 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Tue, 20 Nov 2018 13:26:28 +0100 Subject: Deprecation cleanup --- container-search/src/main/java/com/yahoo/prelude/IndexModel.java | 3 +-- .../com/yahoo/document/serialization/VespaDocumentDeserializer42.java | 2 +- .../com/yahoo/document/serialization/VespaDocumentSerializer42.java | 2 +- documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java | 2 +- .../src/main/java/com/yahoo/documentapi/VisitorParameters.java | 4 ++-- .../src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java | 2 +- .../java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) (limited to 'document') diff --git a/container-search/src/main/java/com/yahoo/prelude/IndexModel.java b/container-search/src/main/java/com/yahoo/prelude/IndexModel.java index ab244444d01..db37922f6fb 100644 --- a/container-search/src/main/java/com/yahoo/prelude/IndexModel.java +++ b/container-search/src/main/java/com/yahoo/prelude/IndexModel.java @@ -42,8 +42,7 @@ public final class IndexModel { * * @deprecated use the constructor without the third parameter */ - // TODO: Remove Vespa 8 - @Deprecated + @Deprecated // TODO: Remove Vespa 8 public IndexModel(Map> masterClusters, Map searchDefinitions, SearchDefinition unionSearchDefinition) { diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java index 21f8c182eea..5cba0e94323 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java @@ -80,7 +80,7 @@ import static com.yahoo.text.Utf8.calculateStringPositions; * @deprecated Please use {@link com.yahoo.document.serialization.VespaDocumentDeserializerHead} instead for new code. * @author baldersheim */ -@Deprecated // Remove on Vespa 8 +@Deprecated // TODO: Remove on Vespa 8 // When removing: Move content of this class into VespaDocumentDeserializerHead public class VespaDocumentDeserializer42 extends VespaDocumentSerializer42 implements DocumentDeserializer { diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java index 9976c3ff6b4..553f05051d5 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java @@ -67,7 +67,7 @@ import static com.yahoo.text.Utf8.calculateBytePositions; * @deprecated use {@link com.yahoo.document.serialization.VespaDocumentSerializerHead} instead for new code * @author baldersheim */ -@Deprecated // Remove before Vespa 8 +@Deprecated // TODO: Remove on Vespa 8 // When removing: Move content into VespaDocumentSerializerHead public class VespaDocumentSerializer42 extends BufferSerializer implements DocumentSerializer { diff --git a/documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java b/documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java index 6aa62a0ba8b..ae1f80d8b06 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java @@ -73,7 +73,7 @@ public interface AsyncSession extends Session { * @throws UnsupportedOperationException if this access implementation does not support retrieving * @deprecated the 'headersonly' flag has no effect */ - @Deprecated + @Deprecated // TODO: Remove on Vespa 8 Result get(DocumentId id, boolean headersOnly, DocumentProtocol.Priority priority); /** diff --git a/documentapi/src/main/java/com/yahoo/documentapi/VisitorParameters.java b/documentapi/src/main/java/com/yahoo/documentapi/VisitorParameters.java index 45a2046157d..64854373e05 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/VisitorParameters.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/VisitorParameters.java @@ -231,8 +231,8 @@ public class VisitorParameters extends Parameters { public void setVisitRemoves(boolean visitRemoves) { this.visitRemoves = visitRemoves; } - /** The 'headersonly' option is removed in Vespa 7 */ - @Deprecated + /** @deprecated this option is ignored */ + @Deprecated // TODO: Remove on Vespa 8 public void setVisitHeadersOnly(boolean headersOnly) { } /** Set field set to use. */ diff --git a/documentapi/src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java b/documentapi/src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java index cb02617d5e1..00d6bb5ae33 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java @@ -74,7 +74,7 @@ public class LocalAsyncSession implements AsyncSession { } @Override - @Deprecated + @Deprecated // TODO: Remove on Vespa 8 public Result get(DocumentId id, boolean headersOnly, DocumentProtocol.Priority pri) { return get(id, pri); } diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java index 08a66cbac96..67b9444e73f 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java @@ -86,7 +86,7 @@ public class MessageBusAsyncSession implements MessageBusSession, AsyncSession { } @Override - @Deprecated + @Deprecated // TODO: Remove on Vespa 8 public Result get(DocumentId id, boolean headersOnly, DocumentProtocol.Priority pri) { return get(id, pri); } -- cgit v1.2.3 From 06dabad421c8ad354f05670b568b1f6a5bb0f68a Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Wed, 21 Nov 2018 08:51:16 +0000 Subject: minor refactoring of document serialization --- .../serialization/VespaDocumentSerializer42.java | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java index 553f05051d5..eb158c53258 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java @@ -97,41 +97,40 @@ public class VespaDocumentSerializer42 extends BufferSerializer implements Docum } public void write(FieldBase field, Document doc) { - //save the starting position in the buffer - int startPos = buf.position(); - buf.putShort(Document.SERIALIZED_VERSION); + //save the starting position in the buffer + int lenPos = buf.position(); // Temporary length, fill in after serialization is done. buf.putInt(0); doc.getId().serialize(this); + Struct head = doc.getHeader(); + Struct body = doc.getBody(); + boolean hasHead = (head.getFieldCount() != 0); + boolean hasBody = (body.getFieldCount() != 0) && !headerOnly; + byte contents = 0x01; // Indicating we have document type which we always have - if (doc.getHeader().getFieldCount() > 0) { + if (hasHead) { contents |= 0x2; // Indicate we have header } - if (!headerOnly && doc.getBody().getFieldCount() > 0) { + if (hasBody) { contents |= 0x4; // Indicate we have a body } buf.put(contents); doc.getDataType().serialize(this); - - if (doc.getHeader().getFieldCount() > 0) { - doc.getHeader().serialize(doc.getDataType().getField("header"), this); + if (hasHead) { + head.serialize(null, this); } - - if (!headerOnly && doc.getBody().getFieldCount() > 0) { - doc.getBody().serialize(doc.getDataType().getField("body"), this); + if (hasBody) { + body.serialize(null, this); } - int finalPos = buf.position(); - - buf.position(startPos + 2); - buf.putInt(finalPos - startPos - 2 - 4); // Don't include the length itself or the version + buf.position(lenPos); + buf.putInt(finalPos - lenPos - 4); // Don't include the length itself or the version buf.position(finalPos); - } /** -- cgit v1.2.3 From 8a71a052623356b4f9370ea2774c5e612d3ff51f Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 12:40:38 +0000 Subject: add class with complete serializer for 6.x format --- .../serialization/VespaDocumentSerializer6.java | 698 +++++++++++++++++++++ 1 file changed, 698 insertions(+) create mode 100644 document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java new file mode 100644 index 00000000000..a4de7a807e9 --- /dev/null +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java @@ -0,0 +1,698 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.document.serialization; + +import com.yahoo.compress.Compressor; + +import com.yahoo.document.ArrayDataType; +import com.yahoo.document.CollectionDataType; +import com.yahoo.document.DataType; +import com.yahoo.document.Document; +import com.yahoo.document.DocumentId; +import com.yahoo.document.DocumentType; +import com.yahoo.document.DocumentUpdate; +import com.yahoo.document.Field; +import com.yahoo.document.WeightedSetDataType; +import com.yahoo.document.annotation.AlternateSpanList; +import com.yahoo.document.annotation.Annotation; +import com.yahoo.document.annotation.AnnotationReference; +import com.yahoo.document.annotation.Span; +import com.yahoo.document.annotation.SpanList; +import com.yahoo.document.annotation.SpanNode; +import com.yahoo.document.annotation.SpanTree; +import com.yahoo.document.datatypes.Array; +import com.yahoo.document.datatypes.ByteFieldValue; +import com.yahoo.document.datatypes.CollectionFieldValue; +import com.yahoo.document.datatypes.DoubleFieldValue; +import com.yahoo.document.datatypes.FieldValue; +import com.yahoo.document.datatypes.FloatFieldValue; +import com.yahoo.document.datatypes.IntegerFieldValue; +import com.yahoo.document.datatypes.LongFieldValue; +import com.yahoo.document.datatypes.MapFieldValue; +import com.yahoo.document.datatypes.PredicateFieldValue; +import com.yahoo.document.datatypes.Raw; +import com.yahoo.document.datatypes.ReferenceFieldValue; +import com.yahoo.document.datatypes.StringFieldValue; +import com.yahoo.document.datatypes.Struct; +import com.yahoo.document.datatypes.StructuredFieldValue; +import com.yahoo.document.datatypes.TensorFieldValue; +import com.yahoo.document.datatypes.WeightedSet; +import com.yahoo.document.predicate.BinaryFormat; +import com.yahoo.document.update.AddValueUpdate; +import com.yahoo.document.update.ArithmeticValueUpdate; +import com.yahoo.document.update.AssignValueUpdate; +import com.yahoo.document.update.ClearValueUpdate; +import com.yahoo.document.update.FieldUpdate; +import com.yahoo.document.update.MapValueUpdate; +import com.yahoo.document.update.RemoveValueUpdate; +import com.yahoo.document.update.ValueUpdate; +import com.yahoo.io.GrowableByteBuffer; +import com.yahoo.tensor.serialization.TypedBinaryFormat; +import com.yahoo.vespa.objects.BufferSerializer; +import com.yahoo.vespa.objects.FieldBase; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import static com.yahoo.text.Utf8.calculateBytePositions; + +/** + * Class used for serializing documents on the Vespa 6.x document format. + * + * @author baldersheim + **/ +public class VespaDocumentSerializer6 extends BufferSerializer implements DocumentSerializer { + + private int spanNodeCounter = -1; + private int[] bytePositions; + + VespaDocumentSerializer6(GrowableByteBuffer buf) { + super(buf); + } + + public void write(Document doc) { + write(new Field(doc.getDataType().getName(), 0, doc.getDataType(), true), doc); + } + + public void write(FieldBase field, Document doc) { + buf.putShort(Document.SERIALIZED_VERSION); + + //save the position of the length in the buffer + int lenPos = buf.position(); + // Temporary length, fill in after serialization is done. + buf.putInt(0); + + doc.getId().serialize(this); + + Struct head = doc.getHeader(); + Struct body = doc.getBody(); + boolean hasHead = (head.getFieldCount() != 0); + boolean hasBody = (body.getFieldCount() != 0); + + byte contents = 0x01; // Indicating we have document type which we always have + if (hasHead) { + contents |= 0x2; // Indicate we have header + } + if (hasBody) { + contents |= 0x4; // Indicate we have a body + } + buf.put(contents); + + doc.getDataType().serialize(this); + if (hasHead) { + head.serialize(null, this); + } + if (hasBody) { + body.serialize(null, this); + } + int finalPos = buf.position(); + buf.position(lenPos); + buf.putInt(finalPos - lenPos - 4); // Don't include the length itself or the version + buf.position(finalPos); + } + + /** + * Write out the value of field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, FieldValue value) { + throw new IllegalArgumentException("Not Implemented"); + } + + /** + * Write out the value of array field + * + * @param field - field description (name and data type) + * @param array - field value + */ + public void write(FieldBase field, Array array) { + buf.putInt1_2_4Bytes(array.size()); + + List lst = array.getValues(); + for (FieldValue value : lst) { + value.serialize(this); + } + + } + + public void write(FieldBase field, MapFieldValue map) { + buf.putInt1_2_4Bytes(map.size()); + for (Map.Entry e : map.entrySet()) { + e.getKey().serialize(this); + e.getValue().serialize(this); + } + } + + /** + * Write out the value of byte field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, ByteFieldValue value) { + buf.put(value.getByte()); + } + + /** + * Write out the value of collection field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, CollectionFieldValue value) { + throw new IllegalArgumentException("Not Implemented"); + } + + /** + * Write out the value of double field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, DoubleFieldValue value) { + buf.putDouble(value.getDouble()); + } + + /** + * Write out the value of float field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, FloatFieldValue value) { + buf.putFloat(value.getFloat()); + } + + /** + * Write out the value of integer field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, IntegerFieldValue value) { + buf.putInt(value.getInteger()); + } + + /** + * Write out the value of long field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, LongFieldValue value) { + buf.putLong(value.getLong()); + } + + /** + * Write out the value of raw field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, Raw value) { + ByteBuffer rawBuf = value.getByteBuffer(); + int origPos = rawBuf.position(); + buf.putInt(rawBuf.remaining()); + buf.put(rawBuf); + rawBuf.position(origPos); + + } + + @Override + public void write(FieldBase field, PredicateFieldValue value) { + byte[] buf = BinaryFormat.encode(value.getPredicate()); + this.buf.putInt(buf.length); + this.buf.put(buf); + } + + /** + * Write out the value of string field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, StringFieldValue value) { + byte[] stringBytes = createUTF8CharArray(value.getString()); + + byte coding = 0; + //Use bit 6 of "coding" to say whether span tree is available or not + if (!value.getSpanTrees().isEmpty()) { + coding |= 64; + } + buf.put(coding); + buf.putInt1_4Bytes(stringBytes.length + 1); + + buf.put(stringBytes); + buf.put(((byte) 0)); + + Map trees = value.getSpanTreeMap(); + if ((trees != null) && !trees.isEmpty()) { + try { + //we don't support serialization of nested span trees, so this is safe: + bytePositions = calculateBytePositions(value.getString()); + //total length. record position and go back here if necessary: + int posBeforeSize = buf.position(); + buf.putInt(0); + buf.putInt1_2_4Bytes(trees.size()); + + for (SpanTree tree : trees.values()) { + try { + write(tree); + } catch (SerializationException e) { + throw e; + } catch (RuntimeException e) { + throw new SerializationException("Exception thrown while serializing span tree '" + + tree.getName() + "'; string='" + value.getString() + "'", e); + } + } + int endPos = buf.position(); + buf.position(posBeforeSize); + buf.putInt(endPos - posBeforeSize - 4); //length shall exclude itself + buf.position(endPos); + } finally { + bytePositions = null; + } + } + } + + @Override + public void write(FieldBase field, TensorFieldValue value) { + if (value.getTensor().isPresent()) { + byte[] encodedTensor = TypedBinaryFormat.encode(value.getTensor().get()); + buf.putInt1_4Bytes(encodedTensor.length); + buf.put(encodedTensor); + } else { + buf.putInt1_4Bytes(0); + } + } + + @Override + public void write(FieldBase field, ReferenceFieldValue value) { + if (value.getDocumentId().isPresent()) { + // We piggyback on DocumentId's existing serialization code, but need to know + // whether or not it's present or merely the empty string. + buf.put((byte)1); + write(value.getDocumentId().get()); + } else { + buf.put((byte)0); + } + } + + /** + * Write out the value of struct field + * + * @param field - field description (name and data type) + * @param s - field value + */ + public void write(FieldBase field, Struct s) { + // Serialize all parts first.. As we need to know length before starting + // Serialize all the fields. + + //keep the buffer we're serializing everything into: + GrowableByteBuffer bigBuffer = buf; + + //create a new buffer and serialize into that for a while: + GrowableByteBuffer buffer = new GrowableByteBuffer(4096, 2.0f); + buf = buffer; + + List fieldIds = new LinkedList<>(); + List fieldLengths = new LinkedList<>(); + + for (Map.Entry value : s.getFields()) { + + int startPos = buffer.position(); + value.getValue().serialize(value.getKey(), this); + + fieldLengths.add(buffer.position() - startPos); + fieldIds.add(value.getKey().getId(s.getVersion())); + } + + // Switch buffers again: + buffer.flip(); + buf = bigBuffer; + + int uncompressedSize = buffer.remaining(); + Compressor.Compression compression = + s.getDataType().getCompressor().compress(buffer.getByteBuffer().array(), buffer.remaining()); + + // Actual serialization starts here. + int lenPos = buf.position(); + putInt(null, 0); // Move back to this after compression is done. + buf.put(compression.type().getCode()); + + if (compression.data() != null && compression.type().isCompressed()) { + buf.putInt2_4_8Bytes(uncompressedSize); + } + + buf.putInt1_4Bytes(s.getFieldCount()); + + for (int i = 0; i < s.getFieldCount(); ++i) { + putInt1_4Bytes(null, fieldIds.get(i)); + putInt2_4_8Bytes(null, fieldLengths.get(i)); + } + + int pos = buf.position(); + if (compression.data() != null && compression.type().isCompressed()) { + put(null, compression.data()); + } else { + put(null, buffer.getByteBuffer()); + } + int dataLength = buf.position() - pos; + + int posNow = buf.position(); + buf.position(lenPos); + putInt(null, dataLength); + buf.position(posNow); + } + + /** + * Write out the value of structured field + * + * @param field - field description (name and data type) + * @param value - field value + */ + public void write(FieldBase field, StructuredFieldValue value) { + throw new IllegalArgumentException("Not Implemented"); + } + + /** + * Write out the value of weighted set field + * + * @param field - field description (name and data type) + * @param ws - field value + */ + public void write(FieldBase field, WeightedSet ws) { + WeightedSetDataType type = ws.getDataType(); + putInt(null, type.getNestedType().getId()); + putInt(null, ws.size()); + + Iterator it = ws.fieldValueIterator(); + while (it.hasNext()) { + FieldValue key = it.next(); + java.lang.Integer value = ws.get(key); + int sizePos = buf.position(); + putInt(null, 0); + int startPos = buf.position(); + key.serialize(this); + putInt(null, value); + int finalPos = buf.position(); + int size = finalPos - startPos; + buf.position(sizePos); + putInt(null, size); + buf.position(finalPos); + } + + } + + public void write(FieldBase field, AnnotationReference value) { + int annotationId = value.getReference().getScratchId(); + if (annotationId >= 0) { + buf.putInt1_2_4Bytes(annotationId); + } else { + throw new SerializationException("Could not serialize AnnotationReference value, reference not found (" + value + ")"); + } + } + + public void write(DocumentId id) { + put(null, id.getScheme().toUtf8().getBytes()); + putByte(null, (byte) 0); + } + + public void write(DocumentType type) { + byte[] docType = createUTF8CharArray(type.getName()); + put(null, docType); + putByte(null, ((byte) 0)); + putShort(null, (short) 0); // Used to hold the version. Is now always 0. + } + + public void write(Annotation annotation) { + buf.putInt(annotation.getType().getId()); //name hash + + byte features = 0; + if (annotation.isSpanNodeValid()) { + features |= ((byte) 1); + } + if (annotation.hasFieldValue()) { + features |= ((byte) 2); + } + buf.put(features); + + int posBeforeSize = buf.position(); + buf.putInt1_2_4BytesAs4(0); + + //write ID of span node: + if (annotation.isSpanNodeValid()) { + int spanNodeId = annotation.getSpanNode().getScratchId(); + if (spanNodeId >= 0) { + buf.putInt1_2_4Bytes(spanNodeId); + } else { + throw new SerializationException("Could not serialize annotation, associated SpanNode not found (" + annotation + ")"); + } + } + + //write annotation value: + if (annotation.hasFieldValue()) { + buf.putInt(annotation.getType().getDataType().getId()); + annotation.getFieldValue().serialize(this); + } + + int end = buf.position(); + buf.position(posBeforeSize); + buf.putInt1_2_4BytesAs4(end - posBeforeSize - 4); + buf.position(end); + } + + public void write(SpanTree tree) { + //we don't support serialization of nested span trees: + if (spanNodeCounter >= 0) { + throw new SerializationException("Serialization of nested SpanTrees is not supported."); + } + + //we're going to write a new SpanTree, create a new Map for nodes: + spanNodeCounter = 0; + + //make sure tree is consistent before continuing: + tree.cleanup(); + + try { + new StringFieldValue(tree.getName()).serialize(this); + + write(tree.getRoot()); + { + //add all annotations to temporary list and sort it, to get predictable serialization + List tmpAnnotationList = new ArrayList(tree.numAnnotations()); + for (Annotation annotation : tree) { + tmpAnnotationList.add(annotation); + } + Collections.sort(tmpAnnotationList); + + int annotationCounter = 0; + //add all annotations to map here, in case of back-references: + for (Annotation annotation : tmpAnnotationList) { + annotation.setScratchId(annotationCounter++); + } + + buf.putInt1_2_4Bytes(tmpAnnotationList.size()); + for (Annotation annotation : tmpAnnotationList) { + write(annotation); + } + } + } finally { + //we're done, let's set these to null to save memory and prevent madness: + spanNodeCounter = -1; + } + } + + public void write(SpanNode spanNode) { + if (spanNodeCounter >= 0) { + spanNode.setScratchId(spanNodeCounter++); + } + if (spanNode instanceof Span) { + write((Span) spanNode); + } else if (spanNode instanceof AlternateSpanList) { + write((AlternateSpanList) spanNode); + } else if (spanNode instanceof SpanList) { + write((SpanList) spanNode); + } else { + throw new IllegalStateException("BUG!! Unable to serialize " + spanNode); + } + } + + public void write(Span span) { + buf.put(Span.ID); + + if (bytePositions != null) { + int byteFrom = bytePositions[span.getFrom()]; + int byteLength = bytePositions[span.getFrom() + span.getLength()] - byteFrom; + + buf.putInt1_2_4Bytes(byteFrom); + buf.putInt1_2_4Bytes(byteLength); + } else { + throw new SerializationException("Cannot serialize Span " + span + ", no access to parent StringFieldValue."); + } + } + + public void write(SpanList spanList) { + buf.put(SpanList.ID); + buf.putInt1_2_4Bytes(spanList.numChildren()); + Iterator children = spanList.childIterator(); + while (children.hasNext()) { + write(children.next()); + } + } + + public void write(AlternateSpanList altSpanList) { + buf.put(AlternateSpanList.ID); + buf.putInt1_2_4Bytes(altSpanList.getNumSubTrees()); + for (int i = 0; i < altSpanList.getNumSubTrees(); i++) { + buf.putDouble(altSpanList.getProbability(i)); + buf.putInt1_2_4Bytes(altSpanList.numChildren(i)); + Iterator children = altSpanList.childIterator(i); + while (children.hasNext()) { + write(children.next()); + } + } + } + + @Override + public void write(DocumentUpdate update) { + update.getId().serialize(this); + + update.getDocumentType().serialize(this); + + putInt(null, update.fieldUpdates().size()); + + for (FieldUpdate up : update.fieldUpdates()) { + up.serialize(this); + } + + DocumentUpdateFlags flags = new DocumentUpdateFlags(); + flags.setCreateIfNonExistent(update.getCreateIfNonExistent()); + putInt(null, flags.injectInto(update.fieldPathUpdates().size())); + + for (FieldPathUpdate up : update.fieldPathUpdates()) { + up.serialize(this); + } + } + + public void write(FieldPathUpdate update) { + putByte(null, (byte)update.getUpdateType().getCode()); + put(null, update.getOriginalFieldPath()); + put(null, update.getOriginalWhereClause()); + } + + public void write(AssignFieldPathUpdate update) { + write((FieldPathUpdate)update); + byte flags = 0; + if (update.getRemoveIfZero()) { + flags |= AssignFieldPathUpdate.REMOVE_IF_ZERO; + } + if (update.getCreateMissingPath()) { + flags |= AssignFieldPathUpdate.CREATE_MISSING_PATH; + } + if (update.isArithmetic()) { + flags |= AssignFieldPathUpdate.ARITHMETIC_EXPRESSION; + putByte(null, flags); + put(null, update.getExpression()); + } else { + putByte(null, flags); + update.getFieldValue().serialize(this); + } + } + + public void write(AddFieldPathUpdate update) { + write((FieldPathUpdate)update); + update.getNewValues().serialize(this); + } + + @Override + public void write(FieldUpdate update) { + putInt(null, update.getField().getId(Document.SERIALIZED_VERSION)); + putInt(null, update.getValueUpdates().size()); + for (ValueUpdate vupd : update.getValueUpdates()) { + putInt(null, vupd.getValueUpdateClassID().id); + vupd.serialize(this, update.getField().getDataType()); + } + } + + @Override + public void write(AddValueUpdate update, DataType superType) { + writeValue(this, ((CollectionDataType)superType).getNestedType(), update.getValue()); + putInt(null, update.getWeight()); + } + + @Override + public void write(MapValueUpdate update, DataType superType) { + if (superType instanceof ArrayDataType) { + CollectionDataType type = (CollectionDataType) superType; + IntegerFieldValue index = (IntegerFieldValue) update.getValue(); + index.serialize(this); + putInt(null, update.getUpdate().getValueUpdateClassID().id); + update.getUpdate().serialize(this, type.getNestedType()); + } else if (superType instanceof WeightedSetDataType) { + writeValue(this, ((CollectionDataType)superType).getNestedType(), update.getValue()); + putInt(null, update.getUpdate().getValueUpdateClassID().id); + update.getUpdate().serialize(this, DataType.INT); + } else { + throw new SerializationException("MapValueUpdate only works for arrays and weighted sets"); + } + } + + @Override + public void write(ArithmeticValueUpdate update) { + putInt(null, update.getOperator().id); + putDouble(null, update.getOperand().doubleValue()); + } + + @Override + public void write(AssignValueUpdate update, DataType superType) { + if (update.getValue() == null) { + putByte(null, (byte) 0); + } else { + putByte(null, (byte) 1); + writeValue(this, superType, update.getValue()); + } + } + + @Override + public void write(RemoveValueUpdate update, DataType superType) { + writeValue(this, ((CollectionDataType)superType).getNestedType(), update.getValue()); + } + + @Override + public void write(ClearValueUpdate clearValueUpdate, DataType superType) { + //TODO: This has never ever been implemented. Has this ever worked? + } + + /** + * Returns the serialized size of the given {@link Document}. Please note that this method performs actual + * serialization of the document, but simply return the size of the final {@link GrowableByteBuffer}. If you need + * the buffer itself, do NOT use this method. + * + * @param doc The Document whose size to calculate. + * @return The size in bytes. + */ + public static long getSerializedSize(Document doc) { + DocumentSerializer serializer = new VespaDocumentSerializerHead(new GrowableByteBuffer()); + serializer.write(doc); + return serializer.getBuf().position(); + } + + private static void writeValue(VespaDocumentSerializer42 serializer, DataType dataType, Object value) { + FieldValue fieldValue; + if (value instanceof FieldValue) { + fieldValue = (FieldValue)value; + } else { + fieldValue = dataType.createFieldValue(value); + } + fieldValue.serialize(serializer); + } + +} -- cgit v1.2.3 From 174a95739376c4a26ebf29ae05b1c01102d61790 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 13:00:37 +0000 Subject: wire in new Serializer6 --- .../fieldpathupdate/AddFieldPathUpdate.java | 4 +- .../fieldpathupdate/AssignFieldPathUpdate.java | 4 +- .../document/fieldpathupdate/FieldPathUpdate.java | 4 +- .../serialization/VespaDocumentSerializer6.java | 8 ++- .../serialization/VespaDocumentSerializerHead.java | 65 +--------------------- 5 files changed, 13 insertions(+), 72 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/fieldpathupdate/AddFieldPathUpdate.java b/document/src/main/java/com/yahoo/document/fieldpathupdate/AddFieldPathUpdate.java index 9fac025c15e..74b94b8135e 100644 --- a/document/src/main/java/com/yahoo/document/fieldpathupdate/AddFieldPathUpdate.java +++ b/document/src/main/java/com/yahoo/document/fieldpathupdate/AddFieldPathUpdate.java @@ -8,7 +8,7 @@ import com.yahoo.document.datatypes.CollectionFieldValue; import com.yahoo.document.datatypes.FieldPathIteratorHandler; import com.yahoo.document.datatypes.FieldValue; import com.yahoo.document.serialization.DocumentUpdateReader; -import com.yahoo.document.serialization.VespaDocumentSerializerHead; +import com.yahoo.document.serialization.VespaDocumentSerializer6; /** * @author Thomas Gundersen @@ -96,7 +96,7 @@ public class AddFieldPathUpdate extends FieldPathUpdate { } @Override - public void serialize(VespaDocumentSerializerHead data) { + public void serialize(VespaDocumentSerializer6 data) { data.write(this); } diff --git a/document/src/main/java/com/yahoo/document/fieldpathupdate/AssignFieldPathUpdate.java b/document/src/main/java/com/yahoo/document/fieldpathupdate/AssignFieldPathUpdate.java index e31eefa2c00..b01742018a2 100644 --- a/document/src/main/java/com/yahoo/document/fieldpathupdate/AssignFieldPathUpdate.java +++ b/document/src/main/java/com/yahoo/document/fieldpathupdate/AssignFieldPathUpdate.java @@ -9,7 +9,7 @@ import com.yahoo.document.datatypes.FieldValue; import com.yahoo.document.datatypes.NumericFieldValue; import com.yahoo.document.select.parser.ParseException; import com.yahoo.document.serialization.DocumentUpdateReader; -import com.yahoo.document.serialization.VespaDocumentSerializerHead; +import com.yahoo.document.serialization.VespaDocumentSerializer6; import java.util.HashMap; import java.util.Map; @@ -237,7 +237,7 @@ public class AssignFieldPathUpdate extends FieldPathUpdate { } @Override - public void serialize(VespaDocumentSerializerHead data) { + public void serialize(VespaDocumentSerializer6 data) { data.write(this); } diff --git a/document/src/main/java/com/yahoo/document/fieldpathupdate/FieldPathUpdate.java b/document/src/main/java/com/yahoo/document/fieldpathupdate/FieldPathUpdate.java index 29c876b85fe..d4144116a03 100644 --- a/document/src/main/java/com/yahoo/document/fieldpathupdate/FieldPathUpdate.java +++ b/document/src/main/java/com/yahoo/document/fieldpathupdate/FieldPathUpdate.java @@ -11,7 +11,7 @@ import com.yahoo.document.select.Result; import com.yahoo.document.select.ResultList; import com.yahoo.document.select.parser.ParseException; import com.yahoo.document.serialization.DocumentUpdateReader; -import com.yahoo.document.serialization.VespaDocumentSerializerHead; +import com.yahoo.document.serialization.VespaDocumentSerializer6; import java.util.ListIterator; /** @@ -130,7 +130,7 @@ public abstract class FieldPathUpdate { } } - public void serialize(VespaDocumentSerializerHead data) { + public void serialize(VespaDocumentSerializer6 data) { data.write(this); } diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java index a4de7a807e9..2d381c23916 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java @@ -36,6 +36,9 @@ import com.yahoo.document.datatypes.Struct; import com.yahoo.document.datatypes.StructuredFieldValue; import com.yahoo.document.datatypes.TensorFieldValue; import com.yahoo.document.datatypes.WeightedSet; +import com.yahoo.document.fieldpathupdate.AddFieldPathUpdate; +import com.yahoo.document.fieldpathupdate.AssignFieldPathUpdate; +import com.yahoo.document.fieldpathupdate.FieldPathUpdate; import com.yahoo.document.predicate.BinaryFormat; import com.yahoo.document.update.AddValueUpdate; import com.yahoo.document.update.ArithmeticValueUpdate; @@ -79,6 +82,7 @@ public class VespaDocumentSerializer6 extends BufferSerializer implements Docume write(new Field(doc.getDataType().getName(), 0, doc.getDataType(), true), doc); } + @SuppressWarnings("deprecation") public void write(FieldBase field, Document doc) { buf.putShort(Document.SERIALIZED_VERSION); @@ -680,12 +684,12 @@ public class VespaDocumentSerializer6 extends BufferSerializer implements Docume * @return The size in bytes. */ public static long getSerializedSize(Document doc) { - DocumentSerializer serializer = new VespaDocumentSerializerHead(new GrowableByteBuffer()); + DocumentSerializer serializer = new VespaDocumentSerializer6(new GrowableByteBuffer()); serializer.write(doc); return serializer.getBuf().position(); } - private static void writeValue(VespaDocumentSerializer42 serializer, DataType dataType, Object value) { + private static void writeValue(VespaDocumentSerializer6 serializer, DataType dataType, Object value) { FieldValue fieldValue; if (value instanceof FieldValue) { fieldValue = (FieldValue)value; diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializerHead.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializerHead.java index 92bce41ba8c..bfa746a02b1 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializerHead.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializerHead.java @@ -1,80 +1,17 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document.serialization; -import com.yahoo.document.DocumentUpdate; -import com.yahoo.document.datatypes.ByteFieldValue; -import com.yahoo.document.fieldpathupdate.AddFieldPathUpdate; -import com.yahoo.document.fieldpathupdate.AssignFieldPathUpdate; -import com.yahoo.document.fieldpathupdate.FieldPathUpdate; -import com.yahoo.document.update.FieldUpdate; import com.yahoo.io.GrowableByteBuffer; -import com.yahoo.vespa.objects.FieldBase; /** * Class used for serializing documents on the current head document format. * * @author baldersheim */ -@SuppressWarnings("deprecation") -public class VespaDocumentSerializerHead extends VespaDocumentSerializer42 { +public class VespaDocumentSerializerHead extends VespaDocumentSerializer6 { public VespaDocumentSerializerHead(GrowableByteBuffer buf) { super(buf); } - @Override - public void write(DocumentUpdate update) { - update.getId().serialize(this); - - update.getDocumentType().serialize(this); - - putInt(null, update.fieldUpdates().size()); - - for (FieldUpdate up : update.fieldUpdates()) { - up.serialize(this); - } - - DocumentUpdateFlags flags = new DocumentUpdateFlags(); - flags.setCreateIfNonExistent(update.getCreateIfNonExistent()); - putInt(null, flags.injectInto(update.fieldPathUpdates().size())); - - for (FieldPathUpdate up : update.fieldPathUpdates()) { - up.serialize(this); - } - } - - public void write(FieldPathUpdate update) { - putByte(null, (byte)update.getUpdateType().getCode()); - put(null, update.getOriginalFieldPath()); - put(null, update.getOriginalWhereClause()); - } - - public void write(AssignFieldPathUpdate update) { - write((FieldPathUpdate)update); - byte flags = 0; - if (update.getRemoveIfZero()) { - flags |= AssignFieldPathUpdate.REMOVE_IF_ZERO; - } - if (update.getCreateMissingPath()) { - flags |= AssignFieldPathUpdate.CREATE_MISSING_PATH; - } - if (update.isArithmetic()) { - flags |= AssignFieldPathUpdate.ARITHMETIC_EXPRESSION; - putByte(null, flags); - put(null, update.getExpression()); - } else { - putByte(null, flags); - update.getFieldValue().serialize(this); - } - } - - public void write(AddFieldPathUpdate update) { - write((FieldPathUpdate)update); - update.getNewValues().serialize(this); - } - - @Override - public void write(FieldBase field, ByteFieldValue value) { - buf.put(value.getByte()); - } } -- cgit v1.2.3 From da4e3fa51c40bc0edb4a2ee638f37f4196db1adc Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 13:10:37 +0000 Subject: actually use Serializer6 --- .../src/main/java/com/yahoo/document/Document.java | 4 ++-- .../main/java/com/yahoo/document/DocumentUpdate.java | 2 +- .../java/com/yahoo/document/datatypes/FieldValue.java | 6 +++--- .../serialization/DocumentSerializerFactory.java | 18 +++++++++++++++++- .../java/com/yahoo/document/update/FieldUpdate.java | 2 +- .../java/com/yahoo/document/DocInDocTestCase.java | 2 +- .../yahoo/document/DocumentPathUpdateTestCase.java | 8 ++++---- .../yahoo/document/DocumentSerializationTestCase.java | 2 +- .../java/com/yahoo/document/DocumentTestCase.java | 2 +- .../com/yahoo/document/DocumentUpdateTestCase.java | 4 ++-- .../annotation/AlternateSpanListTestCase.java | 2 +- .../yahoo/document/annotation/AnnotationTestCase.java | 2 +- .../yahoo/document/annotation/Bug6394548TestCase.java | 2 +- .../yahoo/document/annotation/Bug6425939TestCase.java | 2 +- .../yahoo/document/annotation/SpanListTestCase.java | 2 +- .../com/yahoo/document/annotation/SpanTestCase.java | 2 +- .../yahoo/document/annotation/SpanTreeTestCase.java | 2 +- .../com/yahoo/document/annotation/SystemTestCase.java | 2 +- .../com/yahoo/document/datatypes/MapTestCase.java | 2 +- .../com/yahoo/document/datatypes/StringTestCase.java | 6 +++--- .../com/yahoo/document/json/JsonReaderTestCase.java | 4 ++-- .../serialization/SerializationTestUtils.java | 2 +- .../VespaDocumentSerializerTestCase.java | 2 +- .../yahoo/document/update/FieldUpdateTestCase.java | 2 +- .../yahoo/document/update/SerializationTestCase.java | 4 ++-- document/src/tests/data/serializeupdatejava.dat | Bin 112 -> 113 bytes 26 files changed, 52 insertions(+), 36 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/Document.java b/document/src/main/java/com/yahoo/document/Document.java index 75a331f5707..ab602880453 100644 --- a/document/src/main/java/com/yahoo/document/Document.java +++ b/document/src/main/java/com/yahoo/document/Document.java @@ -137,7 +137,7 @@ public class Document extends StructuredFieldValue { } public int getSerializedSize() throws SerializationException { - DocumentSerializer data = DocumentSerializerFactory.create42(new GrowableByteBuffer(64 * 1024, 2.0f)); + DocumentSerializer data = DocumentSerializerFactory.create6(new GrowableByteBuffer(64 * 1024, 2.0f)); data.write(this); return data.getBuf().position(); } @@ -149,7 +149,7 @@ public class Document extends StructuredFieldValue { public final int getApproxSize() { return 4096; } public void serialize(OutputStream out) throws SerializationException { - DocumentSerializer writer = DocumentSerializerFactory.create42(new GrowableByteBuffer(64 * 1024, 2.0f)); + DocumentSerializer writer = DocumentSerializerFactory.create6(new GrowableByteBuffer(64 * 1024, 2.0f)); writer.write(this); GrowableByteBuffer data = writer.getBuf(); byte[] array; diff --git a/document/src/main/java/com/yahoo/document/DocumentUpdate.java b/document/src/main/java/com/yahoo/document/DocumentUpdate.java index a47f1546a75..ef075662ee7 100644 --- a/document/src/main/java/com/yahoo/document/DocumentUpdate.java +++ b/document/src/main/java/com/yahoo/document/DocumentUpdate.java @@ -336,7 +336,7 @@ public class DocumentUpdate extends DocumentOperation implements Iterable Date: Tue, 20 Nov 2018 14:08:47 +0000 Subject: just confusing to have Deserializer extend Serializer --- .../document/serialization/VespaDocumentDeserializer42.java | 3 ++- .../java/com/yahoo/document/DocumentUpdateTestCase.java | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java index 5cba0e94323..7ec4433a24f 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer42.java @@ -63,6 +63,7 @@ import com.yahoo.tensor.serialization.TypedBinaryFormat; import com.yahoo.text.Utf8; import com.yahoo.text.Utf8Array; import com.yahoo.text.Utf8String; +import com.yahoo.vespa.objects.BufferSerializer; import com.yahoo.vespa.objects.FieldBase; import java.nio.ByteBuffer; @@ -82,7 +83,7 @@ import static com.yahoo.text.Utf8.calculateStringPositions; */ @Deprecated // TODO: Remove on Vespa 8 // When removing: Move content of this class into VespaDocumentDeserializerHead -public class VespaDocumentDeserializer42 extends VespaDocumentSerializer42 implements DocumentDeserializer { +public class VespaDocumentDeserializer42 extends BufferSerializer implements DocumentDeserializer { private final Compressor compressor = new Compressor(); private DocumentTypeManager manager; diff --git a/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java b/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java index e39008cfc91..6af5dc8d28b 100644 --- a/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java @@ -299,13 +299,13 @@ public class DocumentUpdateTestCase { docUp.addFieldUpdate(assignSingle); docUp.addFieldUpdate(addMultiList); - DocumentDeserializer buf = DocumentDeserializerFactory.create42(docMan, new GrowableByteBuffer()); - docUp.serialize((DocumentUpdateWriter)buf); - buf.getBuf().flip(); + GrowableByteBuffer buf = new GrowableByteBuffer(); + docUp.serialize(DocumentSerializerFactory.create42(buf)); + buf.flip(); try { FileOutputStream fos = new FileOutputStream("src/test/files/updateser.dat"); - fos.write(buf.getBuf().array(), 0, buf.getBuf().remaining()); + fos.write(buf.array(), 0, buf.remaining()); fos.close(); } catch (Exception e) { } @@ -330,10 +330,9 @@ public class DocumentUpdateTestCase { + (4 //valueUpdateClassID + (4 + 4 + 4 + (1 + 1 + 2 + 1) + 4 + (1 + 1 + 2 + 1) + 4 + (1 + 1 + 2 + 1))))) //value - , buf.getBuf().remaining()); - - DocumentUpdate docUpDeser = new DocumentUpdate(buf); + , buf.remaining()); + DocumentUpdate docUpDeser = new DocumentUpdate(DocumentDeserializerFactory.create42(docMan, buf)); assertEquals(docUp.getDocumentType(), docUpDeser.getDocumentType()); assertEquals(docUp, docUpDeser); } -- cgit v1.2.3 From 53561f38c8bb02027dd3eb691293e5b31922cadf Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 14:16:01 +0000 Subject: add class with complete deserializer for the 6.x format --- .../serialization/VespaDocumentDeserializer6.java | 890 +++++++++++++++++++++ 1 file changed, 890 insertions(+) create mode 100644 document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java new file mode 100644 index 00000000000..8af16895019 --- /dev/null +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java @@ -0,0 +1,890 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.document.serialization; + +import com.yahoo.collections.Tuple2; +import com.yahoo.compress.CompressionType; +import com.yahoo.compress.Compressor; +import com.yahoo.document.annotation.AlternateSpanList; +import com.yahoo.document.annotation.Annotation; +import com.yahoo.document.annotation.AnnotationReference; +import com.yahoo.document.annotation.AnnotationType; +import com.yahoo.document.annotation.Span; +import com.yahoo.document.annotation.SpanList; +import com.yahoo.document.annotation.SpanNode; +import com.yahoo.document.annotation.SpanNodeParent; +import com.yahoo.document.annotation.SpanTree; +import com.yahoo.document.ArrayDataType; +import com.yahoo.document.CollectionDataType; +import com.yahoo.document.DataType; +import com.yahoo.document.DataTypeName; +import com.yahoo.document.datatypes.Array; +import com.yahoo.document.datatypes.ByteFieldValue; +import com.yahoo.document.datatypes.CollectionFieldValue; +import com.yahoo.document.datatypes.DoubleFieldValue; +import com.yahoo.document.datatypes.FieldValue; +import com.yahoo.document.datatypes.FloatFieldValue; +import com.yahoo.document.datatypes.IntegerFieldValue; +import com.yahoo.document.datatypes.LongFieldValue; +import com.yahoo.document.datatypes.MapFieldValue; +import com.yahoo.document.datatypes.PredicateFieldValue; +import com.yahoo.document.datatypes.Raw; +import com.yahoo.document.datatypes.ReferenceFieldValue; +import com.yahoo.document.datatypes.StringFieldValue; +import com.yahoo.document.datatypes.Struct; +import com.yahoo.document.datatypes.StructuredFieldValue; +import com.yahoo.document.datatypes.TensorFieldValue; +import com.yahoo.document.datatypes.WeightedSet; +import com.yahoo.document.Document; +import com.yahoo.document.DocumentId; +import com.yahoo.document.DocumentType; +import com.yahoo.document.DocumentTypeManager; +import com.yahoo.document.DocumentUpdate; +import com.yahoo.document.Field; +import com.yahoo.document.fieldpathupdate.AddFieldPathUpdate; +import com.yahoo.document.fieldpathupdate.AssignFieldPathUpdate; +import com.yahoo.document.fieldpathupdate.FieldPathUpdate; +import com.yahoo.document.fieldpathupdate.RemoveFieldPathUpdate; +import com.yahoo.document.MapDataType; +import com.yahoo.document.predicate.BinaryFormat; +import com.yahoo.document.select.parser.ParseException; +import com.yahoo.document.StructDataType; +import com.yahoo.document.update.AddValueUpdate; +import com.yahoo.document.update.ArithmeticValueUpdate; +import com.yahoo.document.update.AssignValueUpdate; +import com.yahoo.document.update.ClearValueUpdate; +import com.yahoo.document.update.FieldUpdate; +import com.yahoo.document.update.MapValueUpdate; +import com.yahoo.document.update.RemoveValueUpdate; +import com.yahoo.document.update.ValueUpdate; +import com.yahoo.document.WeightedSetDataType; +import com.yahoo.io.GrowableByteBuffer; +import com.yahoo.tensor.serialization.TypedBinaryFormat; +import com.yahoo.text.Utf8; +import com.yahoo.text.Utf8Array; +import com.yahoo.text.Utf8String; +import com.yahoo.vespa.objects.BufferSerializer; +import com.yahoo.vespa.objects.FieldBase; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static com.yahoo.text.Utf8.calculateStringPositions; + +/** + * Class used for de-serializing documents on the Vespa 6.x document format. + * + * @author baldersheim + */ +public class VespaDocumentDeserializer6 extends BufferSerializer implements DocumentDeserializer { + + private final Compressor compressor = new Compressor(); + private DocumentTypeManager manager; + GrowableByteBuffer body; + private short version; + private List spanNodes; + private List annotations; + private int[] stringPositions; + + VespaDocumentDeserializer6(DocumentTypeManager manager, GrowableByteBuffer header, GrowableByteBuffer body, short version) { + super(header); + this.manager = manager; + this.body = body; + this.version = version; + } + + VespaDocumentDeserializer6(DocumentTypeManager manager, GrowableByteBuffer buf) { + this(manager, buf, null, Document.SERIALIZED_VERSION); + } + + VespaDocumentDeserializer6(DocumentTypeManager manager, GrowableByteBuffer buf, GrowableByteBuffer body) { + this(manager, buf, body, Document.SERIALIZED_VERSION); + } + + final public DocumentTypeManager getDocumentTypeManager() { return manager; } + + public void read(Document document) { + read(null, document); + } + + @SuppressWarnings("deprecation") + public void read(FieldBase field, Document doc) { + // Verify that we have correct version + version = getShort(null); + if (version < 6 || version > Document.SERIALIZED_VERSION) { + throw new DeserializationException("Unknown version " + version + ", expected " + + Document.SERIALIZED_VERSION + "."); + } + + int dataLength = 0; + int dataPos = 0; + + if (version < 7) { + getInt2_4_8Bytes(null); // Total document size.. Ignore + } else { + dataLength = getInt(null); + dataPos = position(); + } + + doc.setId(readDocumentId()); + + Byte content = getByte(null); + + doc.setDataType(readDocumentType()); + + Struct h = doc.getHeader(); + Struct b = doc.getBody(); + h.clear(); + b.clear(); + if ((content & 0x2) != 0) { + readHeaderBody(h, b); + } + if ((content & 0x4) != 0) { + readHeaderBody(b, h); + } else if (body != null) { + GrowableByteBuffer header = getBuf(); + setBuf(body); + body = null; + readHeaderBody(b, h); + body = getBuf(); + setBuf(header); + } + + if (version < 8) { + int crcVal = getInt(null); + } + + if (version > 6) { + if (dataLength != (position() - dataPos)) { + throw new DeserializationException("Length mismatch"); + } + } + } + public void read(FieldBase field, FieldValue value) { + throw new IllegalArgumentException("read not implemented yet."); + } + + public void read(FieldBase field, Array array) { + int numElements = getNumCollectionElems(); + ArrayList list = new ArrayList(numElements); + ArrayDataType type = array.getDataType(); + for (int i = 0; i < numElements; i++) { + if (version < 7) { + getInt(null); // We don't need size for anything + } + FieldValue fv = type.getNestedType().createFieldValue(); + fv.deserialize(null, this); + list.add((T) fv); + } + array.clear(); + array.addAll(list); + } + + public void read(FieldBase field, MapFieldValue map) { + int numElements = getNumCollectionElems(); + Map hash = new HashMap<>(); + MapDataType type = map.getDataType(); + for (int i = 0; i < numElements; i++) { + if (version < 7) { + getInt(null); // We don't need size for anything + } + K key = (K) type.getKeyType().createFieldValue(); + V val = (V) type.getValueType().createFieldValue(); + key.deserialize(null, this); + val.deserialize(null, this); + hash.put(key, val); + } + map.clear(); + map.putAll(hash); + } + + private int getNumCollectionElems() { + int numElements; + if (version < 7) { + getInt(null); // We already know the nested type, so ignore that.. + numElements = getInt(null); + } else { + numElements = getInt1_2_4Bytes(null); + } + if (numElements < 0) { + throw new DeserializationException("Bad number of array/map elements, " + numElements); + } + return numElements; + } + + public void read(FieldBase field, CollectionFieldValue value) { + throw new IllegalArgumentException("read not implemented yet."); + } + public void read(FieldBase field, ByteFieldValue value) { value.assign(getByte(null)); } + public void read(FieldBase field, DoubleFieldValue value) { value.assign(getDouble(null)); } + public void read(FieldBase field, FloatFieldValue value) { value.assign(getFloat(null)); } + public void read(FieldBase field, IntegerFieldValue value) { value.assign(getInt(null)); } + public void read(FieldBase field, LongFieldValue value) { value.assign(getLong(null)); } + + public void read(FieldBase field, Raw value) { + int rawsize = getInt(null); + byte[] rawBytes = getBytes(null, rawsize); + value.assign(rawBytes); + } + + @Override + public void read(FieldBase field, PredicateFieldValue value) { + int len = getInt(null); + byte[] buf = getBytes(null, len); + value.assign(BinaryFormat.decode(buf)); + } + + public void read(FieldBase field, StringFieldValue value) { + byte coding = getByte(null); + + int length = getInt1_4Bytes(null); + + //OK, it seems that this length includes null termination. + //NOTE: the following four lines are basically parseNullTerminatedString() inlined, + //but we need to use the UTF-8 buffer below, so not using that method... + byte[] stringArray = new byte[length - 1]; + buf.get(stringArray); + buf.get(); //move past 0-termination + value.setUnChecked(Utf8.toString(stringArray)); + + if ((coding & 64) == 64) { + //we have a span tree! + try { + //we don't support serialization of nested span trees, so this is safe: + stringPositions = calculateStringPositions(stringArray); + //total length: + int size = buf.getInt(); + int startPos = buf.position(); + + int numSpanTrees = buf.getInt1_2_4Bytes(); + + for (int i = 0; i < numSpanTrees; i++) { + SpanTree tree = new SpanTree(); + StringFieldValue treeName = new StringFieldValue(); + treeName.deserialize(this); + tree.setName(treeName.getString()); + value.setSpanTree(tree); + readSpanTree(tree, false); + } + + buf.position(startPos + size); + } finally { + stringPositions = null; + } + } + } + + @Override + public void read(FieldBase field, TensorFieldValue value) { + int encodedTensorLength = buf.getInt1_4Bytes(); + if (encodedTensorLength > 0) { + byte[] encodedTensor = getBytes(null, encodedTensorLength); + value.assign(TypedBinaryFormat.decode(Optional.of(value.getDataType().getTensorType()), + GrowableByteBuffer.wrap(encodedTensor))); + } else { + value.clear(); + } + } + + @Override + public void read(FieldBase field, ReferenceFieldValue value) { + final boolean documentIdPresent = (buf.get() != 0); + if (documentIdPresent) { + value.assign(readDocumentId()); + } else { + value.clear(); + } + } + + public void read(FieldBase fieldDef, Struct s) { + s.setVersion(version); + int startPos = position(); + + if (version < 6) { + throw new DeserializationException("Illegal document serialization version " + version); + } + + int dataSize; + if (version < 7) { + long rSize = getInt2_4_8Bytes(null); + //TODO: Look into how to support data segments larger than INT_MAX bytes + if (rSize > Integer.MAX_VALUE) { + throw new DeserializationException("Raw size of data block is too large."); + } + dataSize = (int)rSize; + } else { + dataSize = getInt(null); + } + + byte comprCode = getByte(null); + CompressionType compression = CompressionType.valueOf(comprCode); + + int uncompressedSize = 0; + if (compression != CompressionType.NONE && + compression != CompressionType.INCOMPRESSIBLE) + { + // uncompressedsize (full size of FIELDS only, after decompression) + long pSize = getInt2_4_8Bytes(null); + //TODO: Look into how to support data segments larger than INT_MAX bytes + if (pSize > Integer.MAX_VALUE) { + throw new DeserializationException("Uncompressed size of data block is too large."); + } + uncompressedSize = (int) pSize; + } + + int numberOfFields = getInt1_4Bytes(null); + + List> fieldIdsAndLengths = new ArrayList<>(numberOfFields); + for (int i=0; i(getInt1_4Bytes(null), getInt2_4_8Bytes(null))); + } + + // save a reference to the big buffer we're reading from: + GrowableByteBuffer bigBuf = buf; + + if (version < 7) { + // In V6 and earlier, the length included the header. + int headerSize = position() - startPos; + dataSize -= headerSize; + } + byte[] destination = compressor.decompress(compression, getBuf().array(), position(), uncompressedSize, Optional.of(dataSize)); + + // set position in original buffer to after data + position(position() + dataSize); + + // for a while: deserialize from this buffer instead: + buf = GrowableByteBuffer.wrap(destination); + + s.clear(); + StructDataType type = s.getDataType(); + for (int i=0; i Integer.MAX_VALUE) { + throw new DeserializationException("Raw size of data block is too large."); + } + dataSize = (int)rSize; + } else { + dataSize = getInt(null); + } + + byte comprCode = getByte(null); + CompressionType compression = CompressionType.valueOf(comprCode); + + int uncompressedSize = 0; + if (compression != CompressionType.NONE && + compression != CompressionType.INCOMPRESSIBLE) + { + // uncompressedsize (full size of FIELDS only, after decompression) + long pSize = getInt2_4_8Bytes(null); + //TODO: Look into how to support data segments larger than INT_MAX bytes + if (pSize > Integer.MAX_VALUE) { + throw new DeserializationException("Uncompressed size of data block is too large."); + } + uncompressedSize = (int) pSize; + } + + int numberOfFields = getInt1_4Bytes(null); + + List> fieldIdsAndLengths = new ArrayList<>(numberOfFields); + for (int i=0; i(getInt1_4Bytes(null), getInt2_4_8Bytes(null))); + } + + // save a reference to the big buffer we're reading from: + GrowableByteBuffer bigBuf = buf; + + if (version < 7) { + // In V6 and earlier, the length included the header. + int headerSize = position() - startPos; + dataSize -= headerSize; + } + byte[] destination = compressor.decompress(compression, getBuf().array(), position(), uncompressedSize, Optional.of(dataSize)); + + // set position in original buffer to after data + position(position() + dataSize); + + // for a while: deserialize from this buffer instead: + buf = GrowableByteBuffer.wrap(destination); + + StructDataType priType = primary.getDataType(); + StructDataType altType = alternate.getDataType(); + for (int i=0; i void read(FieldBase field, WeightedSet ws) { + WeightedSetDataType type = ws.getDataType(); + getInt(null); // Have no need for type + + int numElements = getInt(null); + if (numElements < 0) { + throw new DeserializationException("Bad number of weighted set elements, " + numElements); + } + + ws.clearAndReserve(numElements * 2); // Avoid resizing + for (int i = 0; i < numElements; i++) { + int size = getInt(null); + FieldValue value = type.getNestedType().createFieldValue(); + value.deserialize(null, this); + IntegerFieldValue weight = new IntegerFieldValue(getInt(null)); + ws.putUnChecked((T) value, weight); + } + + } + + public void read(FieldBase field, AnnotationReference value) { + int seqId = buf.getInt1_2_4Bytes(); + try { + Annotation a = annotations.get(seqId); + value.setReferenceNoCompatibilityCheck(a); + } catch (IndexOutOfBoundsException iiobe) { + throw new SerializationException("Could not serialize AnnotationReference value, reference not found.", iiobe); + } + } + + private Utf8String deserializeAttributeString() throws DeserializationException { + int length = getByte(null); + return new Utf8String(parseNullTerminatedString(length)); + } + + private Utf8Array parseNullTerminatedString() { return parseNullTerminatedString(getBuf().getByteBuffer()); } + private Utf8Array parseNullTerminatedString(int lengthExcludingNull) { return parseNullTerminatedString(getBuf().getByteBuffer(), lengthExcludingNull); } + + static Utf8Array parseNullTerminatedString(ByteBuffer buf, int lengthExcludingNull) throws DeserializationException { + Utf8Array utf8 = new Utf8Array(buf, lengthExcludingNull); + buf.get(); //move past 0-termination + return utf8; + } + + static Utf8Array parseNullTerminatedString(ByteBuffer buf) throws DeserializationException { + //search for 0-byte + int end = getFirstNullByte(buf); + + if (end == -1) { + throw new DeserializationException("Could not locate terminating 0-byte for string"); + } + + return parseNullTerminatedString(buf, end - buf.position()); + } + + private static int getFirstNullByte(ByteBuffer buf) { + int end = -1; + int start = buf.position(); + + while (true) { + try { + byte dataByte = buf.get(); + if (dataByte == (byte) 0) { + end = buf.position() - 1; + break; + } + } catch (Exception e) { + break; + } + } + + buf.position(start); + return end; + } + + public void read(DocumentUpdate update) { + update.setId(new DocumentId(this)); + update.setDocumentType(readDocumentType()); + + int size = getInt(null); + + for (int i = 0; i < size; i++) { + update.addFieldUpdate(new FieldUpdate(this, update.getDocumentType(), 8)); + } + + int sizeAndFlags = getInt(null); + update.setCreateIfNonExistent(DocumentUpdateFlags.extractFlags(sizeAndFlags).getCreateIfNonExistent()); + size = DocumentUpdateFlags.extractValue(sizeAndFlags); + + for (int i = 0; i < size; i++) { + int type = getByte(null); + update.addFieldPathUpdate(FieldPathUpdate.create(FieldPathUpdate.Type.valueOf(type), + update.getDocumentType(), this)); + } + } + + + public void read(FieldPathUpdate update) { + String fieldPath = getString(null); + String whereClause = getString(null); + update.setFieldPath(fieldPath); + + try { + update.setWhereClause(whereClause); + } catch (ParseException e) { + throw new DeserializationException(e); + } + } + + public void read(AssignFieldPathUpdate update) { + byte flags = getByte(null); + update.setRemoveIfZero((flags & AssignFieldPathUpdate.REMOVE_IF_ZERO) != 0); + update.setCreateMissingPath((flags & AssignFieldPathUpdate.CREATE_MISSING_PATH) != 0); + if ((flags & AssignFieldPathUpdate.ARITHMETIC_EXPRESSION) != 0) { + update.setExpression(getString(null)); + } else { + DataType dt = update.getFieldPath().getResultingDataType(); + FieldValue fv = dt.createFieldValue(); + fv.deserialize(this); + update.setNewValue(fv); + } + } + + public void read(RemoveFieldPathUpdate update) { + + } + + public void read(AddFieldPathUpdate update) { + DataType dt = update.getFieldPath().getResultingDataType(); + FieldValue fv = dt.createFieldValue(); + dt.createFieldValue(); + fv.deserialize(this); + + if (!(fv instanceof Array)) { + throw new DeserializationException("Add only applicable to array types"); + } + update.setNewValues((Array)fv); + } + + public ValueUpdate getValueUpdate(DataType superType, DataType subType) { + int vuTypeId = getInt(null); + + ValueUpdate.ValueUpdateClassID op = ValueUpdate.ValueUpdateClassID.getID(vuTypeId); + if (op == null) { + throw new IllegalArgumentException("Read type "+vuTypeId+" of bytebuffer, but this is not a legal value update type."); + } + + switch (op) { + case ADD: + { + FieldValue fval = subType.createFieldValue(); + fval.deserialize(this); + int weight = getInt(null); + return new AddValueUpdate(fval, weight); + } + case ARITHMETIC: + int opId = getInt(null); + ArithmeticValueUpdate.Operator operator = ArithmeticValueUpdate.Operator.getID(opId); + double operand = getDouble(null); + return new ArithmeticValueUpdate(operator, operand); + case ASSIGN: + { + byte contents = getByte(null); + FieldValue fval = null; + if (contents == (byte) 1) { + fval = superType.createFieldValue(); + fval.deserialize(this); + } + return new AssignValueUpdate(fval); + } + case CLEAR: + return new ClearValueUpdate(); + case MAP: + if (superType instanceof ArrayDataType) { + CollectionDataType type = (CollectionDataType) superType; + IntegerFieldValue index = new IntegerFieldValue(); + index.deserialize(this); + ValueUpdate update = getValueUpdate(type.getNestedType(), null); + return new MapValueUpdate(index, update); + } else if (superType instanceof WeightedSetDataType) { + CollectionDataType type = (CollectionDataType) superType; + FieldValue fval = type.getNestedType().createFieldValue(); + fval.deserialize(this); + ValueUpdate update = getValueUpdate(DataType.INT, null); + return new MapValueUpdate(fval, update); + } else { + throw new DeserializationException("MapValueUpdate only works for arrays and weighted sets"); + } + case REMOVE: + FieldValue fval = ((CollectionDataType) superType).getNestedType().createFieldValue(); + fval.deserialize(this); + return new RemoveValueUpdate(fval); + default: + throw new DeserializationException( + "Could not deserialize ValueUpdate, unknown valueUpdateClassID type " + vuTypeId); + } + } + + public void read(FieldUpdate fieldUpdate) { + int fieldId = getInt(null); + Field field = fieldUpdate.getDocumentType().getField(fieldId, fieldUpdate.getSerializationVersion()); + if (field == null) { + throw new DeserializationException( + "Cannot deserialize FieldUpdate, field fieldId " + fieldId + " not found in " + fieldUpdate.getDocumentType()); + } + + fieldUpdate.setField(field); + int size = getInt(null); + + for (int i = 0; i < size; i++) { + if (field.getDataType() instanceof CollectionDataType) { + CollectionDataType collType = (CollectionDataType) field.getDataType(); + fieldUpdate.addValueUpdate(getValueUpdate(collType, collType.getNestedType())); + } else { + fieldUpdate.addValueUpdate(getValueUpdate(field.getDataType(), null)); + } + } + } + + public DocumentId readDocumentId() { + Utf8String uri = new Utf8String(parseNullTerminatedString(getBuf().getByteBuffer())); + return DocumentId.createFromSerialized(uri.toString()); + } + + public DocumentType readDocumentType() { + Utf8Array docTypeName = parseNullTerminatedString(); + int ignored = getShort(null); // used to hold the version + + DocumentType docType = manager.getDocumentType(new DataTypeName(docTypeName)); + if (docType == null) { + throw new DeserializationException("No known document type with name " + + new Utf8String(docTypeName).toString()); + } + return docType; + } + + private SpanNode readSpanNode() { + byte type = buf.get(); + buf.position(buf.position() - 1); + + SpanNode retval; + if ((type & Span.ID) == Span.ID) { + retval = new Span(); + if (spanNodes != null) { + spanNodes.add(retval); + } + read((Span) retval); + } else if ((type & SpanList.ID) == SpanList.ID) { + retval = new SpanList(); + if (spanNodes != null) { + spanNodes.add(retval); + } + read((SpanList) retval); + } else if ((type & AlternateSpanList.ID) == AlternateSpanList.ID) { + retval = new AlternateSpanList(); + if (spanNodes != null) { + spanNodes.add(retval); + } + read((AlternateSpanList) retval); + } else { + throw new DeserializationException("Cannot read SpanNode of type " + type); + } + return retval; + } + + private void readSpanTree(SpanTree tree, boolean readName) { + //we don't support serialization of nested span trees: + if (spanNodes != null || annotations != null) { + throw new SerializationException("Deserialization of nested SpanTrees is not supported."); + } + + //we're going to write a new SpanTree, create a new Map for nodes: + spanNodes = new ArrayList(); + annotations = new ArrayList(); + + try { + if (readName) { + StringFieldValue treeName = new StringFieldValue(); + treeName.deserialize(this); + tree.setName(treeName.getString()); + } + + SpanNode root = readSpanNode(); + tree.setRoot(root); + + int numAnnotations = buf.getInt1_2_4Bytes(); + + for (int i = 0; i < numAnnotations; i++) { + Annotation a = new Annotation(); + annotations.add(a); + } + for (int i = 0; i < numAnnotations; i++) { + read(annotations.get(i)); + } + for (Annotation a : annotations) { + tree.annotate(a); + } + + for (SpanNode node: spanNodes) { + if (node instanceof Span) { + correctIndexes((Span) node); + } + } + } finally { + //we're done, let's set this to null to save memory and prevent madness: + spanNodes = null; + annotations = null; + } + } + + public void read(SpanTree tree) { + readSpanTree(tree, true); + } + + public void read(Annotation annotation) { + int annotationTypeId = buf.getInt(); + AnnotationType type = manager.getAnnotationTypeRegistry().getType(annotationTypeId); + + if (type == null) { + throw new DeserializationException("Cannot deserialize annotation of type " + annotationTypeId + " (unknown type)"); + } + + annotation.setType(type); + + byte features = buf.get(); + int length = buf.getInt1_2_4Bytes(); + + if ((features & (byte) 1) == (byte) 1) { + //we have a span node + int spanNodeId = buf.getInt1_2_4Bytes(); + try { + SpanNode node = spanNodes.get(spanNodeId); + annotation.setSpanNode(node); + } catch (IndexOutOfBoundsException ioobe) { + throw new DeserializationException("Could not deserialize annotation, associated span node not found ", ioobe); + } + } + if ((features & (byte) 2) == (byte) 2) { + //we have a value: + int dataTypeId = buf.getInt(); + + //if this data type ID the same as the one in our config? + if (dataTypeId != type.getDataType().getId()) { + //not the same, but we will handle it gracefully, and just skip past the data: + buf.position(buf.position() + length - 4); + } else { + FieldValue value = type.getDataType().createFieldValue(); + value.deserialize(this); + annotation.setFieldValue(value); + } + } + } + + public void read(Span span) { + byte type = buf.get(); + if ((type & Span.ID) != Span.ID) { + throw new DeserializationException("Cannot deserialize Span with type " + type); + } + span.setFrom(buf.getInt1_2_4Bytes()); + span.setLength(buf.getInt1_2_4Bytes()); + } + + private void correctIndexes(Span span) { + if (stringPositions == null) { + throw new DeserializationException("Cannot deserialize Span, no access to parent StringFieldValue."); + } + int fromIndex = stringPositions[span.getFrom()]; + int toIndex = stringPositions[span.getTo()]; + int length = toIndex - fromIndex; + + span.setFrom(fromIndex); + span.setLength(length); + } + + public void read(SpanList spanList) { + byte type = buf.get(); + if ((type & SpanList.ID) != SpanList.ID) { + throw new DeserializationException("Cannot deserialize SpanList with type " + type); + } + List nodes = readSpanList(spanList); + for (SpanNode node : nodes) { + spanList.add(node); + } + } + + public void read(AlternateSpanList altSpanList) { + byte type = buf.get(); + if ((type & AlternateSpanList.ID) != AlternateSpanList.ID) { + throw new DeserializationException("Cannot deserialize AlternateSpanList with type " + type); + } + int numSubTrees = buf.getInt1_2_4Bytes(); + + for (int i = 0; i < numSubTrees; i++) { + double prob = buf.getDouble(); + List list = readSpanList(altSpanList); + + if (i == 0) { + for (SpanNode node : list) { + altSpanList.add(node); + } + altSpanList.setProbability(0, prob); + } else { + altSpanList.addChildren(i, list, prob); + } + } + } + + private List readSpanList(SpanNodeParent parent) { + int size = buf.getInt1_2_4Bytes(); + List spanList = new ArrayList(); + for (int i = 0; i < size; i++) { + spanList.add(readSpanNode()); + } + return spanList; + } + +} -- cgit v1.2.3 From cdc218a7eb16f0617c14be7b023933666f7b97a0 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 14:30:58 +0000 Subject: remove split header/body buffers support --- .../serialization/VespaDocumentDeserializer6.java | 23 +++------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java index 8af16895019..624a074421e 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java @@ -83,25 +83,15 @@ public class VespaDocumentDeserializer6 extends BufferSerializer implements Docu private final Compressor compressor = new Compressor(); private DocumentTypeManager manager; - GrowableByteBuffer body; private short version; private List spanNodes; private List annotations; private int[] stringPositions; - VespaDocumentDeserializer6(DocumentTypeManager manager, GrowableByteBuffer header, GrowableByteBuffer body, short version) { - super(header); - this.manager = manager; - this.body = body; - this.version = version; - } - VespaDocumentDeserializer6(DocumentTypeManager manager, GrowableByteBuffer buf) { - this(manager, buf, null, Document.SERIALIZED_VERSION); - } - - VespaDocumentDeserializer6(DocumentTypeManager manager, GrowableByteBuffer buf, GrowableByteBuffer body) { - this(manager, buf, body, Document.SERIALIZED_VERSION); + super(buf); + this.manager = manager; + this.version = Document.SERIALIZED_VERSION; } final public DocumentTypeManager getDocumentTypeManager() { return manager; } @@ -144,13 +134,6 @@ public class VespaDocumentDeserializer6 extends BufferSerializer implements Docu } if ((content & 0x4) != 0) { readHeaderBody(b, h); - } else if (body != null) { - GrowableByteBuffer header = getBuf(); - setBuf(body); - body = null; - readHeaderBody(b, h); - body = getBuf(); - setBuf(header); } if (version < 8) { -- cgit v1.2.3 From 9421feeb51b1907f35296ed4f649bcc2074a9dd7 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 14:31:11 +0000 Subject: wire in Deserializer6 --- .../com/yahoo/document/DocumentTypeManager.java | 2 +- .../serialization/DocumentDeserializerFactory.java | 10 ++++++- .../VespaDocumentDeserializerHead.java | 34 +--------------------- .../java/com/yahoo/document/DocInDocTestCase.java | 2 +- .../document/DocumentSerializationTestCase.java | 4 +-- .../java/com/yahoo/document/DocumentTestCase.java | 4 +-- .../annotation/AlternateSpanListTestCase.java | 2 +- .../document/annotation/AnnotationTestCase.java | 2 +- .../document/annotation/Bug6394548TestCase.java | 2 +- .../document/annotation/Bug6425939TestCase.java | 2 +- .../document/annotation/SpanListTestCase.java | 2 +- .../yahoo/document/annotation/SpanTestCase.java | 2 +- .../document/annotation/SpanTreeTestCase.java | 2 +- .../yahoo/document/annotation/SystemTestCase.java | 2 +- .../com/yahoo/document/datatypes/MapTestCase.java | 2 +- .../yahoo/document/datatypes/StringTestCase.java | 10 +++---- .../serialization/SerializationTestUtils.java | 2 +- .../SerializeAnnotationsTestCase.java | 4 +-- .../yahoo/document/update/FieldUpdateTestCase.java | 2 +- .../document/update/SerializationTestCase.java | 4 +-- 20 files changed, 36 insertions(+), 60 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java index 5fad35a2287..405587c2ec5 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java @@ -266,7 +266,7 @@ public class DocumentTypeManager { } final public Document createDocument(GrowableByteBuffer buf) { - DocumentDeserializer data = DocumentDeserializerFactory.create42(this, buf); + DocumentDeserializer data = DocumentDeserializerFactory.create6(this, buf); return new Document(data); } public Document createDocument(DocumentDeserializer data) { diff --git a/document/src/main/java/com/yahoo/document/serialization/DocumentDeserializerFactory.java b/document/src/main/java/com/yahoo/document/serialization/DocumentDeserializerFactory.java index 072f11f5f22..9cd11ad2499 100644 --- a/document/src/main/java/com/yahoo/document/serialization/DocumentDeserializerFactory.java +++ b/document/src/main/java/com/yahoo/document/serialization/DocumentDeserializerFactory.java @@ -13,12 +13,20 @@ public class DocumentDeserializerFactory { /** * Creates a de-serializer for the current head document format. - * This format is an extension of the 4.2 format. + * This format is an extension of the 6.x format. */ public static DocumentDeserializer createHead(DocumentTypeManager manager, GrowableByteBuffer buf) { return new VespaDocumentDeserializerHead(manager, buf); } + /** + * Creates a de-serializer for the 6.x document format. + * This format is an extension of the 4.2 format. + */ + public static DocumentDeserializer create6(DocumentTypeManager manager, GrowableByteBuffer buf) { + return new VespaDocumentDeserializer6(manager, buf); + } + /** * Creates a de-serializer for the document format that was created on Vespa 4.2. */ diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java index 40aec94aec6..1e90395a153 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializerHead.java @@ -1,14 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document.serialization; -import com.yahoo.document.DocumentId; import com.yahoo.document.DocumentTypeManager; -import com.yahoo.document.DocumentUpdate; -import com.yahoo.document.datatypes.BoolFieldValue; -import com.yahoo.document.fieldpathupdate.FieldPathUpdate; -import com.yahoo.document.update.FieldUpdate; import com.yahoo.io.GrowableByteBuffer; -import com.yahoo.vespa.objects.FieldBase; /** * Class used for de-serializing documents on the current head document format. @@ -16,36 +10,10 @@ import com.yahoo.vespa.objects.FieldBase; * @author baldersheim */ @SuppressWarnings("deprecation") -public class VespaDocumentDeserializerHead extends VespaDocumentDeserializer42 { +public class VespaDocumentDeserializerHead extends VespaDocumentDeserializer6 { public VespaDocumentDeserializerHead(DocumentTypeManager manager, GrowableByteBuffer buffer) { super(manager, buffer); } - @Override - public void read(DocumentUpdate update) { - update.setId(new DocumentId(this)); - update.setDocumentType(readDocumentType()); - - int size = getInt(null); - - for (int i = 0; i < size; i++) { - update.addFieldUpdate(new FieldUpdate(this, update.getDocumentType(), 8)); - } - - int sizeAndFlags = getInt(null); - update.setCreateIfNonExistent(DocumentUpdateFlags.extractFlags(sizeAndFlags).getCreateIfNonExistent()); - size = DocumentUpdateFlags.extractValue(sizeAndFlags); - - for (int i = 0; i < size; i++) { - int type = getByte(null); - update.addFieldPathUpdate(FieldPathUpdate.create(FieldPathUpdate.Type.valueOf(type), - update.getDocumentType(), this)); - } - } - - @Override - public void read(FieldBase field, BoolFieldValue value) { - value.setBoolean((getByte(null) != 0)); - } } diff --git a/document/src/test/java/com/yahoo/document/DocInDocTestCase.java b/document/src/test/java/com/yahoo/document/DocInDocTestCase.java index cd9a15db2e3..f5c158595d2 100644 --- a/document/src/test/java/com/yahoo/document/DocInDocTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocInDocTestCase.java @@ -43,7 +43,7 @@ public class DocInDocTestCase { GrowableByteBuffer buf = serializer.getBuf(); buf.flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(manager, buf); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(manager, buf); Document outerDeserialized = new Document(deserializer); assertEquals(outer, outerDeserialized); diff --git a/document/src/test/java/com/yahoo/document/DocumentSerializationTestCase.java b/document/src/test/java/com/yahoo/document/DocumentSerializationTestCase.java index 4d813fed788..8ff168adc4b 100644 --- a/document/src/test/java/com/yahoo/document/DocumentSerializationTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentSerializationTestCase.java @@ -170,7 +170,7 @@ public class DocumentSerializationTestCase extends AbstractTypesTest { } System.err.println("Checking doc from file " + test.testFile); - Document doc = new Document(DocumentDeserializerFactory.create42(docMan, GrowableByteBuffer.wrap(buffer))); + Document doc = new Document(DocumentDeserializerFactory.create6(docMan, GrowableByteBuffer.wrap(buffer))); System.err.println("Id: " + doc.getId()); @@ -222,7 +222,7 @@ public class DocumentSerializationTestCase extends AbstractTypesTest { fos.write(buffer.array(), 0, buffer.limit()); fos.close(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(man, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(man, buffer); Document doc2 = new Document(deserializer); assertEquals(doc, doc2); diff --git a/document/src/test/java/com/yahoo/document/DocumentTestCase.java b/document/src/test/java/com/yahoo/document/DocumentTestCase.java index 098bc59b5ae..76174ee60fd 100644 --- a/document/src/test/java/com/yahoo/document/DocumentTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentTestCase.java @@ -1000,7 +1000,7 @@ public class DocumentTestCase extends DocumentTestCaseBase { BufferSerializer buf = new BufferSerializer(); try { - new Document(DocumentDeserializerFactory.create42(docMan, buf.getBuf())); + new Document(DocumentDeserializerFactory.create6(docMan, buf.getBuf())); assertTrue(false); } catch (Exception e) { assertTrue(true); @@ -1008,7 +1008,7 @@ public class DocumentTestCase extends DocumentTestCaseBase { buf = BufferSerializer.wrap("Hello world".getBytes()); try { - new Document(DocumentDeserializerFactory.create42(docMan, buf.getBuf())); + new Document(DocumentDeserializerFactory.create6(docMan, buf.getBuf())); assertTrue(false); } catch (Exception e) { assertTrue(true); diff --git a/document/src/test/java/com/yahoo/document/annotation/AlternateSpanListTestCase.java b/document/src/test/java/com/yahoo/document/annotation/AlternateSpanListTestCase.java index e491d271d96..186766f799b 100755 --- a/document/src/test/java/com/yahoo/document/annotation/AlternateSpanListTestCase.java +++ b/document/src/test/java/com/yahoo/document/annotation/AlternateSpanListTestCase.java @@ -66,7 +66,7 @@ public class AlternateSpanListTestCase extends AbstractTypesTest { } AlternateSpanList alternateSpanList2; { - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(man, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(man, buffer); StringFieldValue value = new StringFieldValue(); deserializer.read(null, value); alternateSpanList2 = (AlternateSpanList)value.getSpanTree("bababa").getRoot(); diff --git a/document/src/test/java/com/yahoo/document/annotation/AnnotationTestCase.java b/document/src/test/java/com/yahoo/document/annotation/AnnotationTestCase.java index a21bd44e03f..cb04ca1de62 100644 --- a/document/src/test/java/com/yahoo/document/annotation/AnnotationTestCase.java +++ b/document/src/test/java/com/yahoo/document/annotation/AnnotationTestCase.java @@ -119,7 +119,7 @@ public class AnnotationTestCase extends AbstractTypesTest { serializer.write(annotation); buffer.flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(man, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(man, buffer); Annotation annotation2 = new Annotation(); deserializer.read(annotation2); diff --git a/document/src/test/java/com/yahoo/document/annotation/Bug6394548TestCase.java b/document/src/test/java/com/yahoo/document/annotation/Bug6394548TestCase.java index 131a6255b66..8b9649d697f 100644 --- a/document/src/test/java/com/yahoo/document/annotation/Bug6394548TestCase.java +++ b/document/src/test/java/com/yahoo/document/annotation/Bug6394548TestCase.java @@ -47,7 +47,7 @@ public class Bug6394548TestCase { serializer.write(doc); buffer.flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(manager, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(manager, buffer); Document doc2 = new Document(deserializer); System.out.println(doc2.toXml()); diff --git a/document/src/test/java/com/yahoo/document/annotation/Bug6425939TestCase.java b/document/src/test/java/com/yahoo/document/annotation/Bug6425939TestCase.java index 24525b84fb7..82b730ae4ca 100644 --- a/document/src/test/java/com/yahoo/document/annotation/Bug6425939TestCase.java +++ b/document/src/test/java/com/yahoo/document/annotation/Bug6425939TestCase.java @@ -43,7 +43,7 @@ public class Bug6425939TestCase { buffer.flip(); // Should not throw exception if bug 6425939 is fixed: - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(man, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(man, buffer); StringFieldValue deserializedString = new StringFieldValue(); deserializer.read(strField, deserializedString); diff --git a/document/src/test/java/com/yahoo/document/annotation/SpanListTestCase.java b/document/src/test/java/com/yahoo/document/annotation/SpanListTestCase.java index b8994140522..6f338fc47a3 100755 --- a/document/src/test/java/com/yahoo/document/annotation/SpanListTestCase.java +++ b/document/src/test/java/com/yahoo/document/annotation/SpanListTestCase.java @@ -55,7 +55,7 @@ public class SpanListTestCase extends AbstractTypesTest { } SpanList spanList2; { - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(man, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(man, buffer); StringFieldValue value = new StringFieldValue(); deserializer.read(null, value); spanList2 = (SpanList)value.getSpanTree("bababa").getRoot(); diff --git a/document/src/test/java/com/yahoo/document/annotation/SpanTestCase.java b/document/src/test/java/com/yahoo/document/annotation/SpanTestCase.java index 88604768a42..23d62cae239 100755 --- a/document/src/test/java/com/yahoo/document/annotation/SpanTestCase.java +++ b/document/src/test/java/com/yahoo/document/annotation/SpanTestCase.java @@ -88,7 +88,7 @@ public class SpanTestCase extends AbstractTypesTest { } Span span2; { - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(man, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(man, buffer); StringFieldValue value = new StringFieldValue(); deserializer.read(null, value); span2 = (Span)value.getSpanTree("bababa").getRoot(); diff --git a/document/src/test/java/com/yahoo/document/annotation/SpanTreeTestCase.java b/document/src/test/java/com/yahoo/document/annotation/SpanTreeTestCase.java index 380f157c680..b200e72514d 100755 --- a/document/src/test/java/com/yahoo/document/annotation/SpanTreeTestCase.java +++ b/document/src/test/java/com/yahoo/document/annotation/SpanTreeTestCase.java @@ -870,7 +870,7 @@ public class SpanTreeTestCase extends AbstractTypesTest { serializer.write(new Field("stringfield", DataType.STRING), strfval); buffer.flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(docMan, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(docMan, buffer); StringFieldValue stringFieldValue2 = new StringFieldValue(); deserializer.read(new Field("stringfield", DataType.STRING), stringFieldValue2); diff --git a/document/src/test/java/com/yahoo/document/annotation/SystemTestCase.java b/document/src/test/java/com/yahoo/document/annotation/SystemTestCase.java index a122df16018..9163b773bcf 100755 --- a/document/src/test/java/com/yahoo/document/annotation/SystemTestCase.java +++ b/document/src/test/java/com/yahoo/document/annotation/SystemTestCase.java @@ -127,7 +127,7 @@ public class SystemTestCase { DocumentSerializer serializer = DocumentSerializerFactory.create6(buffer); serializer.write(inDocument); buffer.flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(manager, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(manager, buffer); Document outDocument = new Document(deserializer); consume(outDocument); diff --git a/document/src/test/java/com/yahoo/document/datatypes/MapTestCase.java b/document/src/test/java/com/yahoo/document/datatypes/MapTestCase.java index 01f917e163c..eb47fb1425d 100644 --- a/document/src/test/java/com/yahoo/document/datatypes/MapTestCase.java +++ b/document/src/test/java/com/yahoo/document/datatypes/MapTestCase.java @@ -147,7 +147,7 @@ public class MapTestCase { DocumentSerializer serializer = DocumentSerializerFactory.create6(buffer); serializer.write(f, map); buffer.flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(man, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(man, buffer); MapFieldValue map2 = new MapFieldValue(mapType); deserializer.read(f, map2); assertNotSame(map, map2); diff --git a/document/src/test/java/com/yahoo/document/datatypes/StringTestCase.java b/document/src/test/java/com/yahoo/document/datatypes/StringTestCase.java index 3b46a5518d9..296ab1ac3fc 100644 --- a/document/src/test/java/com/yahoo/document/datatypes/StringTestCase.java +++ b/document/src/test/java/com/yahoo/document/datatypes/StringTestCase.java @@ -50,7 +50,7 @@ public class StringTestCase extends AbstractTypesTest { data.position(0); StringFieldValue tmp = new StringFieldValue(); - DocumentDeserializer deser = DocumentDeserializerFactory.create42(null, data); + DocumentDeserializer deser = DocumentDeserializerFactory.create6(null, data); tmp.deserialize(deser); java.lang.String foo2 = tmp.getString(); @@ -111,7 +111,7 @@ public class StringTestCase extends AbstractTypesTest { tmp = new StringFieldValue(); - deser = DocumentDeserializerFactory.create42(null, data); + deser = DocumentDeserializerFactory.create6(null, data); tmp.deserialize(deser); java.lang.String blah2 = tmp.getString(); @@ -129,7 +129,7 @@ public class StringTestCase extends AbstractTypesTest { data.getBuf().position(0); StringFieldValue tmp = new StringFieldValue(); - DocumentDeserializer deser = DocumentDeserializerFactory.create42(null, data.getBuf()); + DocumentDeserializer deser = DocumentDeserializerFactory.create6(null, data.getBuf()); tmp.deserialize(deser); java.lang.String test2 = tmp.getString(); assertEquals(test, test2); @@ -150,7 +150,7 @@ public class StringTestCase extends AbstractTypesTest { serializer.write(f, stringFieldValue); buffer.flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(man, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(man, buffer); StringFieldValue stringFieldValue2 = new StringFieldValue(); deserializer.read(f, stringFieldValue2); @@ -220,7 +220,7 @@ public class StringTestCase extends AbstractTypesTest { serializer.write(doc); buffer.flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(manager, buffer); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(manager, buffer); return new Document(deserializer); } diff --git a/document/src/test/java/com/yahoo/document/serialization/SerializationTestUtils.java b/document/src/test/java/com/yahoo/document/serialization/SerializationTestUtils.java index debd565d7e7..25021b0d2f8 100644 --- a/document/src/test/java/com/yahoo/document/serialization/SerializationTestUtils.java +++ b/document/src/test/java/com/yahoo/document/serialization/SerializationTestUtils.java @@ -33,7 +33,7 @@ public class SerializationTestUtils { public static Document deserializeDocument(byte[] buf, TestDocumentFactory factory) { Document document = factory.createDocument(); - DocumentDeserializerFactory.create42(factory.typeManager(), new GrowableByteBuffer(ByteBuffer.wrap(buf))).read(document); + DocumentDeserializerFactory.create6(factory.typeManager(), new GrowableByteBuffer(ByteBuffer.wrap(buf))).read(document); return document; } diff --git a/document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java b/document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java index 30db0af6607..653f121b2d4 100644 --- a/document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java +++ b/document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java @@ -79,7 +79,7 @@ public class SerializeAnnotationsTestCase { assertEquals(serialized.limit(), serializedFromFile.limit()); StringFieldValue valueFromFile = new StringFieldValue(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(docMan, new GrowableByteBuffer(serializedFromFile)); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(docMan, new GrowableByteBuffer(serializedFromFile)); deserializer.read(null, valueFromFile); assertEquals(value, valueFromFile); } @@ -182,7 +182,7 @@ public class SerializeAnnotationsTestCase { assertEquals(serialized.limit(), serializedFromFile.limit()); StringFieldValue valueFromFile = new StringFieldValue(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.create42(docMan, new GrowableByteBuffer(serializedFromFile)); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(docMan, new GrowableByteBuffer(serializedFromFile)); deserializer.read(null, valueFromFile); assertEquals(value, valueFromFile); } diff --git a/document/src/test/java/com/yahoo/document/update/FieldUpdateTestCase.java b/document/src/test/java/com/yahoo/document/update/FieldUpdateTestCase.java index ea497cd6340..11e0cc783af 100644 --- a/document/src/test/java/com/yahoo/document/update/FieldUpdateTestCase.java +++ b/document/src/test/java/com/yahoo/document/update/FieldUpdateTestCase.java @@ -189,7 +189,7 @@ public class FieldUpdateTestCase { DocumentSerializer buffer = DocumentSerializerFactory.create6(); source.serialize(buffer); buffer.getBuf().flip(); - FieldUpdate copy = new FieldUpdate(DocumentDeserializerFactory.create42(docman, buffer.getBuf()), docType, Document.SERIALIZED_VERSION); + FieldUpdate copy = new FieldUpdate(DocumentDeserializerFactory.create6(docman, buffer.getBuf()), docType, Document.SERIALIZED_VERSION); assertEquals(source, copy); return copy; } diff --git a/document/src/test/java/com/yahoo/document/update/SerializationTestCase.java b/document/src/test/java/com/yahoo/document/update/SerializationTestCase.java index 9be3c12bee0..05492d41b09 100644 --- a/document/src/test/java/com/yahoo/document/update/SerializationTestCase.java +++ b/document/src/test/java/com/yahoo/document/update/SerializationTestCase.java @@ -41,7 +41,7 @@ public class SerializationTestCase { fos.close(); } catch (Exception e) {} - FieldUpdate deserializedUpdate = new FieldUpdate(DocumentDeserializerFactory.create42(new DocumentTypeManager(), buffer.getBuf()), documentType, Document.SERIALIZED_VERSION); + FieldUpdate deserializedUpdate = new FieldUpdate(DocumentDeserializerFactory.create6(new DocumentTypeManager(), buffer.getBuf()), documentType, Document.SERIALIZED_VERSION); assertEquals("'field1' [add value1 1]", deserializedUpdate.toString()); } @@ -52,7 +52,7 @@ public class SerializationTestCase { update.serialize(buffer); buffer.getBuf().rewind(); - FieldUpdate deserializedUpdate = new FieldUpdate(DocumentDeserializerFactory.create42(new DocumentTypeManager(), buffer.getBuf()), documentType, Document.SERIALIZED_VERSION); + FieldUpdate deserializedUpdate = new FieldUpdate(DocumentDeserializerFactory.create6(new DocumentTypeManager(), buffer.getBuf()), documentType, Document.SERIALIZED_VERSION); assertEquals("'field1' [clear]", deserializedUpdate.toString()); } -- cgit v1.2.3 From 1a4d690234b1d709b2b085b0460dba7060bbf806 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 14:32:52 +0000 Subject: test Deserializer6 more --- .../test/java/com/yahoo/document/DocumentPathUpdateTestCase.java | 8 ++++---- document/src/test/java/com/yahoo/document/DocumentTestCase.java | 2 +- .../src/test/java/com/yahoo/document/DocumentUpdateTestCase.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'document') diff --git a/document/src/test/java/com/yahoo/document/DocumentPathUpdateTestCase.java b/document/src/test/java/com/yahoo/document/DocumentPathUpdateTestCase.java index 68e8e984e4a..d5fc1386900 100755 --- a/document/src/test/java/com/yahoo/document/DocumentPathUpdateTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentPathUpdateTestCase.java @@ -583,7 +583,7 @@ public class DocumentPathUpdateTestCase { GrowableByteBuffer buffer = new GrowableByteBuffer(); docUp.serialize(DocumentSerializerFactory.create6(buffer)); buffer.flip(); - DocumentUpdate docUp2 = new DocumentUpdate(DocumentDeserializerFactory.createHead(docMan, buffer)); + DocumentUpdate docUp2 = new DocumentUpdate(DocumentDeserializerFactory.create6(docMan, buffer)); assertEquals(docUp, docUp2); } @@ -601,7 +601,7 @@ public class DocumentPathUpdateTestCase { GrowableByteBuffer buffer = new GrowableByteBuffer(); docUp.serialize(DocumentSerializerFactory.create6(buffer)); buffer.flip(); - DocumentUpdate docUp2 = new DocumentUpdate(DocumentDeserializerFactory.createHead(docMan, buffer)); + DocumentUpdate docUp2 = new DocumentUpdate(DocumentDeserializerFactory.create6(docMan, buffer)); assertEquals(docUp, docUp2); } @@ -615,7 +615,7 @@ public class DocumentPathUpdateTestCase { GrowableByteBuffer buffer = new GrowableByteBuffer(); docUp.serialize(DocumentSerializerFactory.create6(buffer)); buffer.flip(); - DocumentUpdate docUp2 = new DocumentUpdate(DocumentDeserializerFactory.createHead(docMan, buffer)); + DocumentUpdate docUp2 = new DocumentUpdate(DocumentDeserializerFactory.create6(docMan, buffer)); assertEquals(docUp, docUp2); } @@ -672,7 +672,7 @@ public class DocumentPathUpdateTestCase { public void testReadSerializedFile() throws IOException { docMan = DocumentTestCase.setUpCppDocType(); byte[] data = DocumentTestCase.readFile("src/tests/data/serialize-fieldpathupdate-cpp.dat"); - DocumentDeserializer buf = DocumentDeserializerFactory.createHead(docMan, GrowableByteBuffer.wrap(data)); + DocumentDeserializer buf = DocumentDeserializerFactory.create6(docMan, GrowableByteBuffer.wrap(data)); DocumentUpdate upd = new DocumentUpdate(buf); diff --git a/document/src/test/java/com/yahoo/document/DocumentTestCase.java b/document/src/test/java/com/yahoo/document/DocumentTestCase.java index 76174ee60fd..6cdd2a9f8fb 100644 --- a/document/src/test/java/com/yahoo/document/DocumentTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentTestCase.java @@ -1454,7 +1454,7 @@ public class DocumentTestCase extends DocumentTestCaseBase { buffer.flip(); } public Document deserialize() { - return new Document(DocumentDeserializerFactory.createHead(docMan, buffer)); + return new Document(DocumentDeserializerFactory.create6(docMan, buffer)); } } diff --git a/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java b/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java index 6af5dc8d28b..1c6364af608 100644 --- a/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java @@ -633,7 +633,7 @@ public class DocumentUpdateTestCase { docUp.serialize(serializer); serializer.getBuf().flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.createHead(docMan, serializer.getBuf()); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(docMan, serializer.getBuf()); DocumentUpdate deserialized = new DocumentUpdate(deserializer); assertEquals(docUp, deserialized); assertTrue(deserialized.getCreateIfNonExistent()); @@ -658,7 +658,7 @@ public class DocumentUpdateTestCase { serializedUpdate.serialize(serializer); serializer.getBuf().flip(); - DocumentDeserializer deserializer = DocumentDeserializerFactory.createHead(docMan, serializer.getBuf()); + DocumentDeserializer deserializer = DocumentDeserializerFactory.create6(docMan, serializer.getBuf()); DocumentUpdate deserializedUpdate = new DocumentUpdate(deserializer); assertEquals(serializedUpdate, deserializedUpdate); } -- cgit v1.2.3 From cbfcaccfafe767f55a0879483af41eee93af8016 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 14:35:25 +0000 Subject: split header/body is very deprecated --- document/src/main/java/com/yahoo/document/DocumentTypeManager.java | 1 + 1 file changed, 1 insertion(+) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java index 405587c2ec5..0bcc94ad86b 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java @@ -273,6 +273,7 @@ public class DocumentTypeManager { return new Document(data); } + @Deprecated // TODO remove before Vespa 8 public Document createDocument(GrowableByteBuffer header, GrowableByteBuffer body) { DocumentDeserializer data = DocumentDeserializerFactory.create42(this, header, body); return new Document(data); -- cgit v1.2.3 From da88cf82f4a5c51bf5dda9531c8655a6eb90a380 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Wed, 21 Nov 2018 11:48:58 +0000 Subject: generate "serializeupdatejava.dat" in old format for now --- .../java/com/yahoo/document/DocumentUpdateTestCase.java | 2 +- document/src/tests/data/serializeupdatejava.dat | Bin 113 -> 112 bytes 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'document') diff --git a/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java b/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java index 1c6364af608..b86094e5a4d 100644 --- a/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentUpdateTestCase.java @@ -401,7 +401,7 @@ public class DocumentUpdateTestCase { upd.addFieldUpdate(serAdd); GrowableByteBuffer buf = new GrowableByteBuffer(100, 2.0f); - upd.serialize(buf); + upd.serialize(DocumentSerializerFactory.create42(buf)); int size = buf.position(); buf.position(0); diff --git a/document/src/tests/data/serializeupdatejava.dat b/document/src/tests/data/serializeupdatejava.dat index 1ca17d1d451..20c56228bde 100644 Binary files a/document/src/tests/data/serializeupdatejava.dat and b/document/src/tests/data/serializeupdatejava.dat differ -- cgit v1.2.3 From 791dd80ea050b3aa8edcf7e3ea38aba36b54f2d9 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 20 Nov 2018 14:38:58 +0000 Subject: remove split header/body methods --- .../src/main/java/com/yahoo/document/Document.java | 32 ----- .../com/yahoo/document/DocumentTypeManager.java | 6 - .../serialization/DocumentDeserializerFactory.java | 7 -- .../java/com/yahoo/document/DocumentTestCase.java | 129 --------------------- 4 files changed, 174 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/Document.java b/document/src/main/java/com/yahoo/document/Document.java index ab602880453..cf0951fb035 100644 --- a/document/src/main/java/com/yahoo/document/Document.java +++ b/document/src/main/java/com/yahoo/document/Document.java @@ -345,38 +345,6 @@ public class Document extends StructuredFieldValue { serialize((DocumentWriter)data); } - @SuppressWarnings("deprecation") - @Deprecated // remove before Vespa 8 - public void serializeHeader(Serializer data) throws SerializationException { - if (data instanceof DocumentWriter) { - if (data instanceof com.yahoo.document.serialization.VespaDocumentSerializer42) { - ((com.yahoo.document.serialization.VespaDocumentSerializer42)data).setHeaderOnly(true); - } - serialize((DocumentWriter)data); - } else if (data instanceof BufferSerializer) { - serialize(DocumentSerializerFactory.create42(((BufferSerializer) data).getBuf(), true)); - } else { - DocumentSerializer fw = DocumentSerializerFactory.create42(new GrowableByteBuffer(), true); - serialize(fw); - data.put(null, fw.getBuf().getByteBuffer()); - } - } - - @Deprecated // remove before Vespa 8 - public void serializeBody(Serializer data) throws SerializationException { - if (getBody().getFieldCount() > 0) { - if (data instanceof FieldWriter) { - getBody().serialize(new Field("body", getBody().getDataType()), (FieldWriter) data); - } else if (data instanceof BufferSerializer) { - getBody().serialize(new Field("body", getBody().getDataType()), DocumentSerializerFactory.create42(((BufferSerializer) data).getBuf())); - } else { - DocumentSerializer fw = DocumentSerializerFactory.create42(new GrowableByteBuffer()); - getBody().serialize(new Field("body", getBody().getDataType()), fw); - data.put(null, fw.getBuf().getByteBuffer()); - } - } - } - @Override public DocumentType getDataType() { return (DocumentType)super.getDataType(); diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java index 0bcc94ad86b..a3ba27b640f 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java @@ -273,12 +273,6 @@ public class DocumentTypeManager { return new Document(data); } - @Deprecated // TODO remove before Vespa 8 - public Document createDocument(GrowableByteBuffer header, GrowableByteBuffer body) { - DocumentDeserializer data = DocumentDeserializerFactory.create42(this, header, body); - return new Document(data); - } - /** * Returns a read only view of the registered data types * diff --git a/document/src/main/java/com/yahoo/document/serialization/DocumentDeserializerFactory.java b/document/src/main/java/com/yahoo/document/serialization/DocumentDeserializerFactory.java index 9cd11ad2499..03aa409ee8d 100644 --- a/document/src/main/java/com/yahoo/document/serialization/DocumentDeserializerFactory.java +++ b/document/src/main/java/com/yahoo/document/serialization/DocumentDeserializerFactory.java @@ -35,11 +35,4 @@ public class DocumentDeserializerFactory { return new VespaDocumentDeserializer42(manager, buf); } - /** - * Creates a de-serializer for the document format that was created on Vespa 4.2. - */ - @SuppressWarnings("deprecation") - public static DocumentDeserializer create42(DocumentTypeManager manager, GrowableByteBuffer buf, GrowableByteBuffer body) { - return new VespaDocumentDeserializer42(manager, buf, body); - } } diff --git a/document/src/test/java/com/yahoo/document/DocumentTestCase.java b/document/src/test/java/com/yahoo/document/DocumentTestCase.java index 6cdd2a9f8fb..28267a22a56 100644 --- a/document/src/test/java/com/yahoo/document/DocumentTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentTestCase.java @@ -707,54 +707,6 @@ public class DocumentTestCase extends DocumentTestCaseBase { assertEquals(Integer.valueOf(199), wset.get(new StringFieldValue("Weighted 1"))); } - @Test - public void testCppDocSplit() throws IOException { - docMan = setUpCppDocType(); - byte[] headerData = readFile("src/test/document/serializecppsplit_header.dat"); - byte[] bodyData = readFile("src/test/document/serializecppsplit_body.dat"); - - DocumentDeserializer header = DocumentDeserializerFactory.create42(docMan, GrowableByteBuffer.wrap(headerData), - GrowableByteBuffer.wrap(bodyData)); - - Document doc = new Document(header); - - assertEquals("doc:serializetest:http://test.doc.id/", doc.getId().toString()); - assertEquals(new IntegerFieldValue(5), doc.getFieldValue("intfield")); - assertEquals(new FloatFieldValue((float)-9.23), doc.getFieldValue("floatfield")); - assertEquals(new StringFieldValue("This is a string."), doc.getFieldValue("stringfield")); - assertEquals(new LongFieldValue(398420092938472983L), doc.getFieldValue("longfield")); - assertEquals(new DoubleFieldValue(98374532.398820d), doc.getFieldValue("doublefield")); - assertEquals(new StringFieldValue("http://this.is.a.test/"), doc.getFieldValue("urifield")); - //NOTE: The value really is unsigned 254, which becomes signed -2: - assertEquals(new ByteFieldValue((byte)-2), doc.getFieldValue("bytefield")); - ByteBuffer raw = ByteBuffer.wrap("RAW DATA".getBytes()); - assertEquals(new Raw(raw), doc.getFieldValue("rawfield")); - - Document docindoc = (Document)doc.getFieldValue("docfield"); - assertEquals(docMan.getDocumentType("docindoc"), docindoc.getDataType()); - assertEquals(new DocumentId("doc:docindoc:http://embedded"), docindoc.getId()); - - WeightedSet wset = (WeightedSet)doc.getFieldValue("wsfield"); - assertEquals(Integer.valueOf(50), wset.get(new StringFieldValue("Weighted 0"))); - assertEquals(Integer.valueOf(199), wset.get(new StringFieldValue("Weighted 1"))); - } - - @Test - public void testCppDocSplitNoBody() throws IOException { - docMan = setUpCppDocType(); - byte[] headerData = readFile("src/test/document/serializecppsplit_header.dat"); - - DocumentDeserializer header = DocumentDeserializerFactory.create42(docMan, GrowableByteBuffer.wrap(headerData)); - - Document doc = new Document(header); - - assertEquals("doc:serializetest:http://test.doc.id/", doc.getId().toString()); - assertEquals(new FloatFieldValue((float)-9.23), doc.getFieldValue("floatfield")); - assertEquals(new StringFieldValue("This is a string."), doc.getFieldValue("stringfield")); - assertEquals(new LongFieldValue(398420092938472983L), doc.getFieldValue("longfield")); - assertEquals(new StringFieldValue("http://this.is.a.test/"), doc.getFieldValue("urifield")); - } - @Test @SuppressWarnings("deprecation") public void testGenerateSerializedFile() throws IOException { @@ -862,48 +814,6 @@ public class DocumentTestCase extends DocumentTestCaseBase { } assertEquals(doc.getFieldValue("weightedfield"), doc2.getFieldValue("weightedfield")); assertEquals(doc.getFieldValue("mapfield"), doc2.getFieldValue("mapfield")); - // Do the same thing, splitting document in two - DocumentSerializer header = DocumentSerializerFactory.create42(new GrowableByteBuffer(), true); - DocumentSerializer body = DocumentSerializerFactory.create42(new GrowableByteBuffer()); - doc.serializeHeader(header); - doc.serializeBody(body); - header.getBuf().flip(); - body.getBuf().flip(); - - try { - FileOutputStream fos = new FileOutputStream("src/test/files/testser-split.header.dat"); - fos.write(header.getBuf().array(), 0, header.getBuf().remaining()); - fos.close(); - fos = new FileOutputStream("src/test/files/testser-split.body.dat"); - fos.write(body.getBuf().array(), 0, body.getBuf().remaining()); - fos.close(); - } catch (Exception e) { - } - - DocumentDeserializer deser = DocumentDeserializerFactory.create42(docMan, header.getBuf(), body.getBuf()); - - doc2 = new Document(deser); - - assertEquals(doc.getFieldValue("mailid"), doc2.getFieldValue("mailid")); - assertEquals(doc.getFieldValue("date"), doc2.getFieldValue("date")); - assertEquals(doc.getFieldValue("from"), doc2.getFieldValue("from")); - assertEquals(doc.getFieldValue("to"), doc2.getFieldValue("to")); - assertEquals(doc.getFieldValue("subject"), doc2.getFieldValue("subject")); - assertEquals(doc.getFieldValue("body"), doc2.getFieldValue("body")); - assertEquals(doc.getFieldValue("attachmentcount"), doc2.getFieldValue("attachmentcount")); - assertEquals(doc.getFieldValue("attachments"), doc2.getFieldValue("attachments")); - docRawBytes = ((Raw)doc.getFieldValue("rawfield")).getByteBuffer().array(); - doc2RawBytes = ((Raw)doc2.getFieldValue("rawfield")).getByteBuffer().array(); - assertEquals(docRawBytes.length, doc2RawBytes.length); - for (int i = 0; i < docRawBytes.length; i++) { - assertEquals(docRawBytes[i], doc2RawBytes[i]); - } - assertEquals(doc.getFieldValue("weightedfield"), doc2.getFieldValue("weightedfield")); - assertEquals(doc.getFieldValue("mapfield"), doc2.getFieldValue("mapfield")); - - Document docInDoc = (Document)doc.getFieldValue("docindoc"); - assert (docInDoc != null); - assertEquals(new StringFieldValue("ball"), docInDoc.getFieldValue("tull")); } @Test @@ -953,45 +863,6 @@ public class DocumentTestCase extends DocumentTestCaseBase { } assertEquals(doc.getFieldValue("weightedfield"), doc2.getFieldValue("weightedfield")); assertEquals(doc.getFieldValue("mapfield"), doc2.getFieldValue("mapfield")); - - // Do the same thing, splitting document in two - BufferSerializer header = new BufferSerializer(new GrowableByteBuffer()); - BufferSerializer body = new BufferSerializer(new GrowableByteBuffer()); - doc.serializeHeader(header); - doc.serializeBody(body); - header.getBuf().flip(); - body.getBuf().flip(); - - try { - FileOutputStream fos = new FileOutputStream("src/test/files/testser-split.header.dat"); - fos.write(header.getBuf().array(), 0, header.getBuf().remaining()); - fos.close(); - fos = new FileOutputStream("src/test/files/testser-split.body.dat"); - fos.write(body.getBuf().array(), 0, body.getBuf().remaining()); - fos.close(); - } catch (Exception e) { - } - - DocumentDeserializer deser = DocumentDeserializerFactory.create42(docMan, header.getBuf(), body.getBuf()); - - doc2 = new Document(deser); - - assertEquals(doc.getFieldValue("mailid"), doc2.getFieldValue("mailid")); - assertEquals(doc.getFieldValue("date"), doc2.getFieldValue("date")); - assertEquals(doc.getFieldValue("from"), doc2.getFieldValue("from")); - assertEquals(doc.getFieldValue("to"), doc2.getFieldValue("to")); - assertEquals(doc.getFieldValue("subject"), doc2.getFieldValue("subject")); - assertEquals(doc.getFieldValue("body"), doc2.getFieldValue("body")); - assertEquals(doc.getFieldValue("attachmentcount"), doc2.getFieldValue("attachmentcount")); - assertEquals(doc.getFieldValue("attachments"), doc2.getFieldValue("attachments")); - docRawBytes = ((Raw)doc.getFieldValue("rawfield")).getByteBuffer().array(); - doc2RawBytes = ((Raw)doc2.getFieldValue("rawfield")).getByteBuffer().array(); - assertEquals(docRawBytes.length, doc2RawBytes.length); - for (int i = 0; i < docRawBytes.length; i++) { - assertEquals(docRawBytes[i], doc2RawBytes[i]); - } - assertEquals(doc.getFieldValue("weightedfield"), doc2.getFieldValue("weightedfield")); - assertEquals(doc.getFieldValue("mapfield"), doc2.getFieldValue("mapfield")); } @Test -- cgit v1.2.3 From 140404118894f07990652de456b0a1ed0b623d27 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Wed, 21 Nov 2018 08:21:19 +0000 Subject: remove "headerOnly" serialization --- .../document/serialization/DocumentSerializerFactory.java | 8 -------- .../document/serialization/VespaDocumentSerializer42.java | 12 +----------- 2 files changed, 1 insertion(+), 19 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java b/document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java index 05f9fbbda04..54ec4e2fcca 100644 --- a/document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java +++ b/document/src/main/java/com/yahoo/document/serialization/DocumentSerializerFactory.java @@ -42,14 +42,6 @@ public class DocumentSerializerFactory { return new VespaDocumentSerializer42(buf); } - /** - * Creates a serializer for the document format that was created on Vespa 4.2. - */ - @SuppressWarnings("deprecation") - public static DocumentSerializer create42(GrowableByteBuffer buf, boolean headerOnly) { - return new VespaDocumentSerializer42(buf, headerOnly); - } - /** * Creates a serializer for the document format that was created on Vespa 4.2. */ diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java index eb158c53258..ebe9a124033 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer42.java @@ -71,7 +71,6 @@ import static com.yahoo.text.Utf8.calculateBytePositions; // When removing: Move content into VespaDocumentSerializerHead public class VespaDocumentSerializer42 extends BufferSerializer implements DocumentSerializer { - private boolean headerOnly; private int spanNodeCounter = -1; private int[] bytePositions; @@ -83,15 +82,6 @@ public class VespaDocumentSerializer42 extends BufferSerializer implements Docum super(); } - VespaDocumentSerializer42(GrowableByteBuffer buf, boolean headerOnly) { - this(buf); - this.headerOnly = headerOnly; - } - - public void setHeaderOnly(boolean headerOnly) { - this.headerOnly = headerOnly; - } - public void write(Document doc) { write(new Field(doc.getDataType().getName(), 0, doc.getDataType(), true), doc); } @@ -109,7 +99,7 @@ public class VespaDocumentSerializer42 extends BufferSerializer implements Docum Struct head = doc.getHeader(); Struct body = doc.getBody(); boolean hasHead = (head.getFieldCount() != 0); - boolean hasBody = (body.getFieldCount() != 0) && !headerOnly; + boolean hasBody = (body.getFieldCount() != 0); byte contents = 0x01; // Indicating we have document type which we always have if (hasHead) { -- cgit v1.2.3 From ae0d33626a0017e11509fc331391183a66f3ec30 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Fri, 23 Nov 2018 11:53:49 +0000 Subject: bump version in TODOs into the future --- document/src/main/java/com/yahoo/document/PositionDataType.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/PositionDataType.java b/document/src/main/java/com/yahoo/document/PositionDataType.java index bb110ee7219..0e69171c106 100644 --- a/document/src/main/java/com/yahoo/document/PositionDataType.java +++ b/document/src/main/java/com/yahoo/document/PositionDataType.java @@ -100,12 +100,12 @@ public final class PositionDataType { } public static String getPositionSummaryFieldName(String fieldName) { - // TODO for 6.0, rename to _position to use a field name that is actually legal + // TODO for Vespa 8, consider renaming to _position to use a field name that is actually legal return fieldName + ".position"; } public static String getDistanceSummaryFieldName(String fieldName) { - // TODO for 6.0, rename to _distance to use a field name that is actually legal + // TODO for Vespa 8, consider renaming to _distance to use a field name that is actually legal return fieldName + ".distance"; } -- cgit v1.2.3 From 78d3b485ebc152b238c6c910fc262fa93561aff9 Mon Sep 17 00:00:00 2001 From: gjoranv Date: Wed, 9 Jan 2019 14:15:41 +0100 Subject: Update abi specs for 7. --- component/abi-spec.json | 31 +-- config-model-api/abi-spec.json | 6 +- config-provisioning/abi-spec.json | 26 --- container-core/abi-spec.json | 50 ---- container-search/abi-spec.json | 467 +------------------------------------- docproc/abi-spec.json | 4 +- document/abi-spec.json | 341 +++++++++------------------- documentapi/abi-spec.json | 234 ++++++++----------- jdisc_http_service/abi-spec.json | 292 ++---------------------- linguistics/abi-spec.json | 11 +- searchlib/abi-spec.json | 1 - vespa-hadoop/abi-spec.json | 79 +------ vespa-http-client/abi-spec.json | 4 - vespajlib/abi-spec.json | 44 +--- 14 files changed, 235 insertions(+), 1355 deletions(-) (limited to 'document') diff --git a/component/abi-spec.json b/component/abi-spec.json index e71171c2a18..8e4442ea199 100644 --- a/component/abi-spec.json +++ b/component/abi-spec.json @@ -8,8 +8,8 @@ "public" ], "methods": [ - "protected void (com.yahoo.component.ComponentId)", "protected void ()", + "protected void (com.yahoo.component.ComponentId)", "public final void initId(com.yahoo.component.ComponentId)", "public final com.yahoo.component.ComponentId getId()", "public final boolean hasInitializedId()", @@ -201,35 +201,6 @@ "public static final com.yahoo.component.Version currentVersion" ] }, - "com.yahoo.component.provider.ComponentClass$ComponentConstructor": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (java.lang.reflect.Constructor)", - "public java.lang.reflect.Constructor getConstructor()", - "public boolean preferredTo(com.yahoo.component.provider.ComponentClass$ComponentConstructor)" - ], - "fields": [ - "public final boolean isLegal", - "public final boolean hasComponentId" - ] - }, - "com.yahoo.component.provider.ComponentClass": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (java.lang.Class)", - "public com.yahoo.component.AbstractComponent createComponent(com.yahoo.component.ComponentId, java.util.Map, java.lang.String)", - "public com.yahoo.component.provider.ComponentClass$ComponentConstructor getPreferredConstructor()" - ], - "fields": [] - }, "com.yahoo.component.provider.ComponentRegistry": { "superClass": "java.lang.Object", "interfaces": [], diff --git a/config-model-api/abi-spec.json b/config-model-api/abi-spec.json index 5c5ed0a5ece..c932958b58b 100644 --- a/config-model-api/abi-spec.json +++ b/config-model-api/abi-spec.json @@ -115,20 +115,16 @@ "public abstract java.lang.String getServicesSource()", "public abstract java.util.Optional getDeployment()", "public abstract java.util.Optional getValidationOverrides()", - "public java.util.List getComponentsInfo(com.yahoo.config.provision.Version)", - "public java.util.List getComponentsInfo(com.yahoo.component.Version)", + "public abstract java.util.List getComponentsInfo(com.yahoo.component.Version)", "public abstract java.io.Reader getRankingExpression(java.lang.String)", "public static java.util.Map getBundleSdFiles(java.lang.String, java.util.jar.JarFile)", "public static java.lang.String getFileName(java.util.jar.JarEntry)", "public abstract com.yahoo.config.application.api.ApplicationMetaData getMetaData()", "public abstract java.io.File getFileReference(com.yahoo.path.Path)", "public void validateXML()", - "public void validateXML(java.util.Optional)", "public void validateXMLFor(java.util.Optional)", "public void writeMetaData()", - "public java.util.Map getProvisionInfoMap()", "public java.util.Optional getAllocatedHosts()", - "public java.util.Map getFileRegistryMap()", "public java.util.Map getFileRegistries()", "public abstract java.util.Collection getSearchDefinitions()", "public com.yahoo.config.application.api.ApplicationPackage preprocess(com.yahoo.config.provision.Zone, com.yahoo.config.application.api.DeployLogger)" diff --git a/config-provisioning/abi-spec.json b/config-provisioning/abi-spec.json index 9d5c1a0d798..7b8207700a3 100644 --- a/config-provisioning/abi-spec.json +++ b/config-provisioning/abi-spec.json @@ -628,32 +628,6 @@ ], "fields": [] }, - "com.yahoo.config.provision.Version": { - "superClass": "java.lang.Object", - "interfaces": [ - "java.lang.Comparable" - ], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public com.yahoo.component.Version toVersion()", - "public java.lang.String toSerializedForm()", - "public static com.yahoo.config.provision.Version fromIntValues(int, int, int)", - "public static com.yahoo.config.provision.Version fromString(java.lang.String)", - "public static com.yahoo.config.provision.Version from(com.yahoo.component.Version)", - "public java.lang.String toString()", - "public int getMajor()", - "public int getMinor()", - "public int getMicro()", - "public int hashCode()", - "public boolean equals(java.lang.Object)", - "public int compareTo(com.yahoo.config.provision.Version)", - "public bridge synthetic int compareTo(java.lang.Object)" - ], - "fields": [] - }, "com.yahoo.config.provision.Zone": { "superClass": "java.lang.Object", "interfaces": [], diff --git a/container-core/abi-spec.json b/container-core/abi-spec.json index 8c8c241a5dd..dc13bd1807d 100644 --- a/container-core/abi-spec.json +++ b/container-core/abi-spec.json @@ -595,7 +595,6 @@ ], "fields": [ "public static final java.lang.String CONTENT_TYPE", - "public static final java.lang.String DATE", "protected final java.util.logging.Logger log" ] }, @@ -671,21 +670,6 @@ "public final int code" ] }, - "com.yahoo.container.protect.FreezeDetector": { - "superClass": "com.yahoo.component.AbstractComponent", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (com.yahoo.container.core.DiagnosticsConfig)", - "public void register(com.yahoo.concurrent.ThreadLocalDirectory)", - "public boolean isBreakdown()", - "public void unRegister(com.yahoo.concurrent.ThreadLocalDirectory)", - "public void deconstruct()" - ], - "fields": [] - }, "com.yahoo.container.protect.ProcessTerminator": { "superClass": "java.lang.Object", "interfaces": [], @@ -699,40 +683,6 @@ ], "fields": [] }, - "com.yahoo.container.protect.TimeoutCollector": { - "superClass": "java.lang.Object", - "interfaces": [ - "com.yahoo.concurrent.ThreadLocalDirectory$Updater" - ], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public com.yahoo.container.protect.TimeoutRate createGenerationInstance(com.yahoo.container.protect.TimeoutRate)", - "public com.yahoo.container.protect.TimeoutRate update(com.yahoo.container.protect.TimeoutRate, java.lang.Boolean)", - "public bridge synthetic java.lang.Object update(java.lang.Object, java.lang.Object)", - "public bridge synthetic java.lang.Object createGenerationInstance(java.lang.Object)" - ], - "fields": [] - }, - "com.yahoo.container.protect.TimeoutRate": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public void addQuery(java.lang.Boolean)", - "public void merge(com.yahoo.container.protect.TimeoutRate)", - "public double timeoutFraction()", - "public int getTotal()" - ], - "fields": [] - }, "com.yahoo.processing.handler.AbstractProcessingHandler": { "superClass": "com.yahoo.container.jdisc.LoggingRequestHandler", "interfaces": [], diff --git a/container-search/abi-spec.json b/container-search/abi-spec.json index 829c86711ef..e37836a5f06 100644 --- a/container-search/abi-spec.json +++ b/container-search/abi-spec.json @@ -1653,347 +1653,6 @@ ], "fields": [] }, - "com.yahoo.prelude.templates.Context": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public", - "abstract" - ], - "methods": [ - "public void setXmlEscape(boolean)", - "public boolean getXmlEscape()", - "public abstract java.lang.Object put(java.lang.String, java.lang.Object)", - "public abstract java.lang.Object get(java.lang.String)", - "public abstract java.lang.Object remove(java.lang.Object)", - "public void setBoldOpenTag(java.lang.String)", - "public void setBoldCloseTag(java.lang.String)", - "public void setSeparatorTag(java.lang.String)", - "protected java.lang.Object normalizeValue(java.lang.Object)", - "public java.lang.String getBoldOpenTag()", - "public java.lang.String getBoldCloseTag()", - "public java.lang.String getSeparatorTag()", - "public abstract java.util.Collection getKeys()", - "public boolean isUtf8Output()", - "public void setUtf8Output(boolean)" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.DefaultTemplateSet": { - "superClass": "com.yahoo.prelude.templates.UserTemplate", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "protected void (java.lang.String)", - "public void ()", - "public com.yahoo.text.XMLWriter wrapWriter(java.io.Writer)", - "public void header(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "public void footer(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "public void hit(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "public void hitFooter(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "public void error(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "public void noHits(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "protected static void renderCoverageAttributes(com.yahoo.search.result.Coverage, com.yahoo.text.XMLWriter)", - "protected void renderHitAttributes(com.yahoo.search.result.Hit, com.yahoo.text.XMLWriter)", - "protected void renderHitGroup(com.yahoo.search.result.HitGroup, com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "protected void renderGroup(com.yahoo.search.result.HitGroup, com.yahoo.text.XMLWriter)", - "protected void renderHitGroupOfTypeGroupHit(com.yahoo.prelude.templates.Context, com.yahoo.search.result.HitGroup, com.yahoo.text.XMLWriter)", - "protected void renderId(com.yahoo.net.URI, com.yahoo.text.XMLWriter)", - "protected void renderHitFields(com.yahoo.prelude.templates.Context, com.yahoo.search.result.Hit, com.yahoo.text.XMLWriter)", - "protected void renderField(com.yahoo.prelude.templates.Context, com.yahoo.search.result.Hit, java.util.Map$Entry, com.yahoo.text.XMLWriter)", - "protected void renderFieldContent(com.yahoo.prelude.templates.Context, com.yahoo.search.result.Hit, java.lang.String, com.yahoo.text.XMLWriter)", - "protected boolean shouldRenderField(com.yahoo.search.result.Hit, java.lang.String)", - "public bridge synthetic void noHits(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void error(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void hitFooter(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void hit(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void footer(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void header(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic java.io.Writer wrapWriter(java.io.Writer)" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.FormattingOptions": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void formatFieldAsAttribute(java.lang.String, java.lang.String)", - "public java.util.Set fieldsAsAttributes()", - "public java.lang.String getAttributeName(java.lang.String)", - "public void formatFieldWithSubtype(java.lang.String, java.lang.String, java.lang.String, java.lang.String)", - "public com.yahoo.prelude.templates.FormattingOptions$SubtypeField getSubtype(java.lang.String)", - "public void formatFieldWithSubtype(java.lang.String, java.lang.String, java.lang.String)", - "public com.yahoo.prelude.templates.FormattingOptions$SubtypeFieldWithPrefix getSubtypeWithPrefix(java.lang.String)", - "public boolean shouldRenderField(java.lang.String)", - "public void setFieldToRender(java.lang.String)", - "public void setFieldNotToRender(java.lang.String)" - ], - "fields": [ - "public static final java.lang.String DEFAULT_TYPE_ATTRIBUTE_NAME" - ] - }, - "com.yahoo.prelude.templates.GenericTemplateSet": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (java.lang.String, java.lang.String, java.lang.String)", - "public java.lang.String getName()", - "public java.lang.String getMimeType()", - "public java.lang.String getEncoding()", - "public final java.lang.String getRequestedEncoding(com.yahoo.search.Query)", - "public com.yahoo.prelude.templates.Template getTemplate(java.lang.String)", - "public void setTemplate(java.lang.String, com.yahoo.prelude.templates.Template)", - "public void setTemplateNotNull(java.lang.String, com.yahoo.prelude.templates.Template)", - "public void setHighlightTags(java.lang.String, java.lang.String, java.lang.String)", - "public java.lang.String getBoldOpenTag()", - "public java.lang.String getBoldCloseTag()", - "public java.lang.String getSeparatorTag()", - "public void setSummaryClass(java.lang.String)", - "public java.lang.String getSummaryClass()" - ], - "fields": [ - "public static final java.lang.String DEFAULT_MIMETYPE", - "public static final java.lang.String DEFAULT_ENCODING" - ] - }, - "com.yahoo.prelude.templates.HitContext": { - "superClass": "com.yahoo.prelude.templates.Context", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (com.yahoo.search.result.Hit, com.yahoo.prelude.templates.Context)", - "public java.lang.Object put(java.lang.String, java.lang.Object)", - "public java.lang.Object get(java.lang.String)", - "public java.lang.Object remove(java.lang.Object)", - "public java.util.Collection getKeys()", - "public void setBoldOpenTag(java.lang.String)", - "public void setBoldCloseTag(java.lang.String)", - "public void setSeparatorTag(java.lang.String)", - "public java.lang.String getBoldOpenTag()", - "public java.lang.String getBoldCloseTag()", - "public java.lang.String getSeparatorTag()", - "public boolean isUtf8Output()", - "public void setUtf8Output(boolean)", - "public void setXmlEscape(boolean)", - "public boolean getXmlEscape()", - "protected java.lang.Object normalizeValue(java.lang.Object)" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.LogExceptionUserTemplateDelegator": { - "superClass": "com.yahoo.prelude.templates.UserTemplate", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (com.yahoo.prelude.templates.UserTemplate)", - "public com.yahoo.prelude.templates.Context createContext()", - "public java.io.Writer wrapWriter(java.io.Writer)", - "public boolean isDefaultTemplateSet()", - "public java.lang.String getSummaryClass()", - "public java.lang.String getBoldOpenTag()", - "public java.lang.String getBoldCloseTag()", - "public java.lang.String getSeparatorTag()", - "public void setSummaryClass(java.lang.String)", - "public void setHighlightTags(java.lang.String, java.lang.String, java.lang.String)", - "public java.lang.String getName()", - "public java.lang.String getMimeType()", - "public java.lang.String getEncoding()", - "public com.yahoo.prelude.templates.Template getTemplate(java.lang.String)", - "public void setTemplate(java.lang.String, com.yahoo.prelude.templates.Template)", - "public void setTemplateNotNull(java.lang.String, com.yahoo.prelude.templates.Template)", - "public void header(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void footer(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void hit(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void hitFooter(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void error(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void noHits(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void queryContext(com.yahoo.prelude.templates.Context, java.io.Writer)" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.MapContext": { - "superClass": "com.yahoo.prelude.templates.Context", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public java.lang.Object get(java.lang.String)", - "public java.lang.Object put(java.lang.String, java.lang.Object)", - "public java.lang.Object remove(java.lang.Object)", - "public java.util.Collection getKeys()" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.PageTemplateSet": { - "superClass": "com.yahoo.prelude.templates.TiledTemplateSet", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public com.yahoo.text.XMLWriter wrapWriter(java.io.Writer)", - "public void header(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "public void footer(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "protected void renderSection(com.yahoo.search.result.HitGroup, com.yahoo.text.XMLWriter)", - "public void hit(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "public void hitFooter(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "public java.lang.String toString()", - "public bridge synthetic void hitFooter(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void hit(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void footer(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void header(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic java.io.Writer wrapWriter(java.io.Writer)" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.SearchRendererAdaptor": { - "superClass": "com.yahoo.search.rendering.Renderer", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void (com.yahoo.prelude.templates.UserTemplate)", - "public void init()", - "public static void callRender(java.io.OutputStream, com.yahoo.search.Result)", - "public java.lang.String getEncoding()", - "public java.lang.String getMimeType()", - "public java.lang.String getDefaultSummaryClass()", - "public void render(java.io.Writer, com.yahoo.search.Result)", - "public java.io.Writer wrapWriter(java.io.Writer)", - "public void beginResult(java.io.Writer, com.yahoo.search.Result)", - "public void endResult(java.io.Writer, com.yahoo.search.Result)", - "public void error(java.io.Writer, java.util.Collection)", - "public void emptyResult(java.io.Writer, com.yahoo.search.Result)", - "public void queryContext(java.io.Writer, com.yahoo.search.query.context.QueryContext)", - "public void renderHit(java.io.Writer, com.yahoo.search.result.Hit, int)", - "public static boolean simpleRenderDefaultErrorHit(java.io.Writer, com.yahoo.search.result.ErrorHit)", - "public static void renderMessageDefaultErrorHit(com.yahoo.text.XMLWriter, com.yahoo.processing.request.ErrorMessage)", - "public boolean simpleRenderErrorHit(java.io.Writer, com.yahoo.search.result.ErrorHit)", - "public static void rendererErrorHitMessageMessage(com.yahoo.text.XMLWriter, com.yahoo.search.result.ErrorHit, com.yahoo.processing.request.ErrorMessage)", - "public com.yahoo.prelude.templates.UserTemplate getAdaptee()" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.Template": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public", - "abstract" - ], - "methods": [ - "public void ()", - "public abstract void render(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public abstract java.lang.String getName()" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.TemplateSet": { - "superClass": "com.yahoo.prelude.templates.UserTemplate", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (java.lang.String, java.lang.String, java.lang.String)", - "public static com.yahoo.prelude.templates.UserTemplate getDefault()", - "public com.yahoo.prelude.templates.Template getHeader(com.yahoo.search.Result)", - "public void setHeader(com.yahoo.prelude.templates.Template)", - "public com.yahoo.prelude.templates.Template getFooter(com.yahoo.search.Result)", - "public void setFooter(com.yahoo.prelude.templates.Template)", - "public com.yahoo.prelude.templates.Template getNohits(com.yahoo.search.Result)", - "public com.yahoo.prelude.templates.Template getQueryContext(com.yahoo.search.Result)", - "public void setQueryContext(com.yahoo.prelude.templates.Template)", - "public void setNohits(com.yahoo.prelude.templates.Template)", - "public com.yahoo.prelude.templates.Template getError(com.yahoo.search.Result)", - "public void setError(com.yahoo.prelude.templates.Template)", - "public com.yahoo.prelude.templates.Template getHit(com.yahoo.search.result.Hit)", - "public void setHit(com.yahoo.prelude.templates.Template)", - "public com.yahoo.prelude.templates.Template getHitFooter(com.yahoo.search.result.Hit)", - "public java.lang.String toString()", - "public void header(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void footer(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void hit(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void error(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void hitFooter(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void noHits(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void queryContext(com.yahoo.prelude.templates.Context, java.io.Writer)" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.TiledTemplateSet": { - "superClass": "com.yahoo.prelude.templates.DefaultTemplateSet", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (java.lang.String)", - "public com.yahoo.text.XMLWriter wrapWriter(java.io.Writer)", - "public void header(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "protected void renderHitAttributes(com.yahoo.search.result.Hit, com.yahoo.text.XMLWriter)", - "protected void renderField(com.yahoo.prelude.templates.Context, com.yahoo.search.result.Hit, java.util.Map$Entry, com.yahoo.text.XMLWriter)", - "protected void renderHitFields(com.yahoo.prelude.templates.Context, com.yahoo.search.result.Hit, com.yahoo.text.XMLWriter)", - "protected boolean shouldRenderField(com.yahoo.search.result.Hit, java.lang.String)", - "public void hit(com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "protected void renderHitGroup(com.yahoo.search.result.HitGroup, com.yahoo.prelude.templates.Context, com.yahoo.text.XMLWriter)", - "protected void renderSection(com.yahoo.search.result.HitGroup, com.yahoo.text.XMLWriter)", - "protected void renderSectionContent(com.yahoo.search.result.HitGroup, com.yahoo.text.XMLWriter)", - "protected void renderProvider(com.yahoo.prelude.templates.Context, com.yahoo.search.result.Hit, com.yahoo.text.XMLWriter)", - "protected void renderProviderHitAttributes(com.yahoo.search.result.Hit, com.yahoo.text.XMLWriter)", - "protected void renderProviderHitFields(com.yahoo.prelude.templates.Context, com.yahoo.search.result.Hit, com.yahoo.text.XMLWriter)", - "protected void renderProviderField(com.yahoo.prelude.templates.Context, com.yahoo.search.result.Hit, java.util.Map$Entry, com.yahoo.text.XMLWriter)", - "public java.lang.String toString()", - "public bridge synthetic void hit(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic void header(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public bridge synthetic java.io.Writer wrapWriter(java.io.Writer)" - ], - "fields": [] - }, - "com.yahoo.prelude.templates.UserTemplate": { - "superClass": "com.yahoo.prelude.templates.GenericTemplateSet", - "interfaces": [], - "attributes": [ - "public", - "abstract" - ], - "methods": [ - "public void (java.lang.String, java.lang.String, java.lang.String)", - "public void (java.lang.String)", - "public java.io.Writer wrapWriter(java.io.Writer)", - "public com.yahoo.prelude.templates.Context createContext()", - "public boolean isDefaultTemplateSet()", - "public abstract void header(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public abstract void footer(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public abstract void hit(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public abstract void hitFooter(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public abstract void error(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public abstract void noHits(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public void queryContext(com.yahoo.prelude.templates.Context, java.io.Writer)", - "public static void dumpAndXMLQuoteUTF8(com.yahoo.io.ByteWriter, byte[])", - "public static boolean dumpBytes(com.yahoo.io.ByteWriter, com.yahoo.prelude.fastsearch.FastHit, java.lang.String)" - ], - "fields": [] - }, "com.yahoo.search.Query$Type": { "superClass": "java.lang.Enum", "interfaces": [], @@ -2044,7 +1703,6 @@ "public long getStartTime()", "public long getDurationTime()", "public long getTimeLeft()", - "public boolean requestHasProperty(java.lang.String)", "public long getTimeout()", "public void setTimeout(long)", "public void setTimeout(java.lang.String)", @@ -2061,8 +1719,6 @@ "public void setHits(int)", "public void setOffset(int)", "public void setWindow(int, int)", - "public void setCompress(boolean)", - "public boolean getCompress()", "public java.lang.String toString()", "public java.lang.String toDetailString()", "public int encode(java.nio.ByteBuffer)", @@ -2081,7 +1737,6 @@ "public com.yahoo.search.query.Ranking getRanking()", "public com.yahoo.search.query.Model getModel()", "public com.yahoo.container.jdisc.HttpRequest getHttpRequest()", - "public com.yahoo.search.query.SessionId getSessionId(boolean)", "public com.yahoo.search.query.SessionId getSessionId()", "public com.yahoo.search.query.SessionId getSessionId(java.lang.String)", "public boolean hasEncodableProperties()", @@ -2146,7 +1801,6 @@ "public void setCoverage(com.yahoo.search.result.Coverage)", "public com.yahoo.search.result.Coverage getCoverage(boolean)", "public com.yahoo.collections.ListMap getHeaders(boolean)", - "public com.yahoo.search.result.Templating getTemplating()", "public bridge synthetic com.yahoo.component.provider.ListenableFreezableClass clone()", "public bridge synthetic com.yahoo.component.provider.FreezableClass clone()", "public bridge synthetic java.lang.Object clone()" @@ -2209,7 +1863,6 @@ "public" ], "methods": [ - "public void (com.yahoo.search.cluster.NodeManager, java.lang.String)", "public void (com.yahoo.search.cluster.NodeManager)", "public com.yahoo.search.cluster.MonitorConfiguration getConfiguration()", "public void add(java.lang.Object, boolean)", @@ -2445,10 +2098,8 @@ "public java.util.TimeZone getTimeZone()", "public com.yahoo.search.grouping.GroupingRequest setTimeZone(java.util.TimeZone)", "public com.yahoo.search.grouping.result.RootGroup getResultGroup(com.yahoo.search.Result)", - "public com.yahoo.search.grouping.GroupingRequest setResultGroup(com.yahoo.search.grouping.result.RootGroup)", "public java.util.List continuations()", "public static com.yahoo.search.grouping.GroupingRequest newInstance(com.yahoo.search.Query)", - "public static java.util.List getRequests(com.yahoo.search.Query)", "public java.lang.String toString()" ], "fields": [] @@ -4138,19 +3789,6 @@ ], "fields": [] }, - "com.yahoo.search.grouping.request.YmumValue": { - "superClass": "com.yahoo.search.grouping.request.DocumentValue", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public com.yahoo.search.grouping.request.YmumValue copy()", - "public bridge synthetic com.yahoo.search.grouping.request.GroupingExpression copy()" - ], - "fields": [] - }, "com.yahoo.search.grouping.request.ZCurveXFunction": { "superClass": "com.yahoo.search.grouping.request.FunctionNode", "interfaces": [], @@ -4449,8 +4087,6 @@ ], "methods": [ "public void (com.yahoo.container.core.ChainsConfig, com.yahoo.search.config.IndexInfoConfig, com.yahoo.container.QrSearchersConfig, com.yahoo.vespa.configdefinition.SpecialtokensConfig, com.yahoo.statistics.Statistics, com.yahoo.language.Linguistics, com.yahoo.jdisc.Metric, com.yahoo.component.provider.ComponentRegistry, java.util.concurrent.Executor, com.yahoo.container.logging.AccessLog, com.yahoo.search.query.profile.config.QueryProfilesConfig, com.yahoo.component.provider.ComponentRegistry, com.yahoo.container.core.ContainerHttpConfig)", - "public void (com.yahoo.container.core.ChainsConfig, com.yahoo.search.config.IndexInfoConfig, com.yahoo.container.QrSearchersConfig, com.yahoo.vespa.configdefinition.SpecialtokensConfig, com.yahoo.statistics.Statistics, com.yahoo.language.Linguistics, com.yahoo.jdisc.Metric, com.yahoo.component.provider.ComponentRegistry, java.util.concurrent.Executor, com.yahoo.container.logging.AccessLog, com.yahoo.search.query.profile.config.QueryProfilesConfig, com.yahoo.component.provider.ComponentRegistry)", - "public void (com.yahoo.container.core.ChainsConfig, com.yahoo.search.config.IndexInfoConfig, com.yahoo.container.QrSearchersConfig, com.yahoo.vespa.configdefinition.SpecialtokensConfig, com.yahoo.container.core.QrTemplatesConfig, com.yahoo.container.protect.FreezeDetector, com.yahoo.statistics.Statistics, com.yahoo.language.Linguistics, com.yahoo.jdisc.Metric, com.yahoo.component.provider.ComponentRegistry, java.util.concurrent.Executor, com.yahoo.container.logging.AccessLog, com.yahoo.search.query.profile.config.QueryProfilesConfig, com.yahoo.component.provider.ComponentRegistry)", "protected void destroy()", "public final com.yahoo.container.jdisc.HttpResponse handle(com.yahoo.container.jdisc.HttpRequest)", "public com.yahoo.search.Result searchAndFill(com.yahoo.search.Query, com.yahoo.component.chain.Chain, com.yahoo.search.searchchain.SearchChainRegistry)", @@ -5249,7 +4885,6 @@ "methods": [ "public static com.yahoo.search.query.profile.types.QueryProfileType getArgumentType()", "public void (com.yahoo.search.Query)", - "public void traceLanguage()", "public com.yahoo.language.Language getParsingLanguage()", "public com.yahoo.language.Language getParsingLanguage(java.lang.String)", "public com.yahoo.language.Language getLanguage()", @@ -5289,9 +4924,7 @@ "public com.yahoo.search.searchchain.Execution getExecution()", "public static com.yahoo.search.query.Model getFrom(com.yahoo.search.Query)", "public java.lang.String toString()", - "public void prepare(com.yahoo.search.query.Ranking)", - "public void setYTraceHeaderToNext(java.lang.String)", - "public java.lang.String getYTraceHeaderToNext()" + "public void prepare(com.yahoo.search.query.Ranking)" ], "fields": [ "public static final java.lang.String MODEL", @@ -5337,8 +4970,6 @@ "public void setSummary(java.lang.String)", "public boolean getBolding()", "public void setBolding(boolean)", - "public boolean getReportCoverage()", - "public void setReportCoverage(boolean)", "public com.yahoo.component.ComponentSpecification getRenderer()", "public void setRenderer(com.yahoo.component.ComponentSpecification)", "public java.lang.String getFormat()", @@ -5357,7 +4988,6 @@ "public static final java.lang.String BOLDING", "public static final java.lang.String TIMING", "public static final java.lang.String SUMMARY", - "public static final java.lang.String REPORT_COVERAGE", "public static final java.lang.String SUMMARY_FIELDS", "public static final java.lang.String FORMAT" ] @@ -5694,7 +5324,6 @@ ], "methods": [ "public java.lang.String toString()", - "public static com.yahoo.search.query.UniqueRequestId next()", "public static com.yahoo.search.query.UniqueRequestId next(java.lang.String)" ], "fields": [] @@ -6587,9 +6216,7 @@ "public java.util.Map listProperties(com.yahoo.processing.request.CompoundName, java.util.Map, com.yahoo.processing.request.Properties)", "public final com.yahoo.search.Query getParentQuery()" ], - "fields": [ - "public static final com.yahoo.processing.request.CompoundName[] PER_SOURCE_QUERY_PROPERTIES" - ] + "fields": [] }, "com.yahoo.search.query.properties.QueryPropertyAliases": { "superClass": "com.yahoo.search.query.properties.PropertyAliases", @@ -6830,7 +6457,7 @@ "public static final java.lang.String ENABLE", "public static final java.lang.String FACTOR", "public static final java.lang.String TAILCOST", - "public java.lang.Boolean enable" + "public static final com.yahoo.processing.request.CompoundName enableProperty" ] }, "com.yahoo.search.query.rewrite.QueryRewriteSearcher": { @@ -7110,50 +6737,6 @@ ], "fields": [] }, - "com.yahoo.search.rendering.DefaultRenderer$RenderingVisitor": { - "superClass": "com.yahoo.yolean.trace.TraceVisitor", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void (com.yahoo.text.XMLWriter, long)", - "public void entering(com.yahoo.yolean.trace.TraceNode)", - "public void leaving(com.yahoo.yolean.trace.TraceNode)", - "public void visit(com.yahoo.yolean.trace.TraceNode)" - ], - "fields": [] - }, - "com.yahoo.search.rendering.DefaultRenderer": { - "superClass": "com.yahoo.processing.rendering.AsynchronousSectionedRenderer", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public void (java.util.concurrent.Executor)", - "public void init()", - "public java.lang.String getEncoding()", - "public java.lang.String getMimeType()", - "public void error(com.yahoo.text.XMLWriter, com.yahoo.search.Result)", - "public void queryContext(com.yahoo.text.XMLWriter, com.yahoo.search.query.context.QueryContext, com.yahoo.search.Query)", - "public static boolean simpleRenderDefaultErrorHit(com.yahoo.text.XMLWriter, com.yahoo.search.result.ErrorHit)", - "public static void renderMessageDefaultErrorHit(com.yahoo.text.XMLWriter, com.yahoo.search.result.ErrorMessage)", - "public void beginResponse(java.io.OutputStream)", - "public final java.lang.String getRequestedEncoding(com.yahoo.search.Query)", - "public void beginList(com.yahoo.processing.response.DataList)", - "public void data(com.yahoo.processing.response.Data)", - "public void endList(com.yahoo.processing.response.DataList)", - "public void endResponse()" - ], - "fields": [ - "public static final java.lang.String DEFAULT_MIMETYPE", - "public static final java.lang.String DEFAULT_ENCODING" - ] - }, "com.yahoo.search.rendering.JsonRenderer": { "superClass": "com.yahoo.processing.rendering.AsynchronousSectionedRenderer", "interfaces": [], @@ -7216,6 +6799,7 @@ ], "fields": [ "public static final com.yahoo.component.ComponentId xmlRendererId", + "public static final com.yahoo.component.ComponentId pageRendererId", "public static final com.yahoo.component.ComponentId jsonRendererId", "public static final com.yahoo.component.ComponentId defaultRendererId" ] @@ -7361,8 +6945,6 @@ "public void (long, long)", "public void (long, long, int)", "public void (long, long, int, int)", - "public void (long, int, boolean)", - "public void (long, int, boolean, int)", "public com.yahoo.search.result.Coverage setSoonActive(long)", "public com.yahoo.search.result.Coverage setDegradedReason(int)", "public com.yahoo.search.result.Coverage setNodesTried(int)", @@ -7400,7 +6982,6 @@ "public void (java.lang.String, com.yahoo.search.result.ErrorMessage)", "public void (java.lang.String, java.util.List)", "public void setSource(java.lang.String)", - "public com.yahoo.search.result.ErrorMessage getMainError()", "public void addError(com.yahoo.search.result.ErrorMessage)", "public void addErrors(com.yahoo.search.result.ErrorHit)", "public java.util.Iterator errorIterator()", @@ -7428,7 +7009,6 @@ ], "methods": [ "public abstract void setSource(java.lang.String)", - "public abstract com.yahoo.search.result.ErrorMessage getMainError()", "public abstract void addError(com.yahoo.search.result.ErrorMessage)", "public abstract void addErrors(com.yahoo.search.result.ErrorHit)", "public abstract java.util.Iterator errorIterator()", @@ -7587,30 +7167,17 @@ "public java.lang.Object removeField(java.lang.String)", "protected boolean hasField(java.lang.String)", "protected boolean hasFields()", - "public void changeFieldKey(java.lang.String, java.lang.String)", - "public com.yahoo.prelude.hitfield.HitField buildHitField(java.lang.String)", "public com.yahoo.prelude.hitfield.HitField buildHitField(java.lang.String, boolean)", - "public com.yahoo.prelude.hitfield.HitField buildHitField(java.lang.String, boolean, boolean)", "public java.util.Set types()", - "public java.lang.String getTypeString()", - "public int getAddNumber()", - "public void setAddNumber(int)", "public boolean isMeta()", "public void setMeta(boolean)", "public boolean isAuxiliary()", "public void setAuxiliary(boolean)", - "public int getSourceNumber()", - "public void setSourceNumber(int)", "public com.yahoo.search.Query getQuery()", "public com.yahoo.processing.Request request()", "public final void setQuery(com.yahoo.search.Query)", - "public java.lang.String getFieldXML(java.lang.String)", - "public java.lang.String getUnboldedField(java.lang.String, boolean)", "public void setSearcherSpecificMetaData(com.yahoo.search.Searcher, java.lang.Object)", "public java.lang.Object getSearcherSpecificMetaData(com.yahoo.search.Searcher)", - "protected final void setFilledInternal(java.util.Set)", - "protected final java.util.Set getFilledInternal()", - "public static java.lang.String stripCharacter(char, java.lang.String)", "protected void close()", "public boolean equals(java.lang.Object)", "public int hashCode()", @@ -7662,7 +7229,6 @@ "public com.yahoo.search.result.Hit remove(java.lang.String)", "public com.yahoo.search.result.Hit remove(com.yahoo.net.URI)", "public com.yahoo.search.result.Hit remove(int)", - "public void setError(com.yahoo.search.result.ErrorMessage)", "public void addError(com.yahoo.search.result.ErrorMessage)", "public com.yahoo.search.result.ErrorHit getErrorHit()", "public com.yahoo.search.result.DefaultErrorHit removeErrorHit()", @@ -7853,31 +7419,6 @@ ], "fields": [] }, - "com.yahoo.search.result.Templating": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (com.yahoo.search.Result)", - "public int getFirstHitNo()", - "public long getNextFirstHitNo()", - "public long getNextLastHitNo()", - "public int getLastHitNo()", - "public int getPrevFirstHitNo()", - "public int getPrevLastHitNo()", - "public java.lang.String getNextResultURL()", - "public java.lang.String getPreviousResultURL()", - "public java.lang.String getCurrentResultURL()", - "public com.yahoo.prelude.templates.UserTemplate getTemplates()", - "public void setTemplates(com.yahoo.prelude.templates.UserTemplate)", - "public com.yahoo.processing.rendering.Renderer getRenderer()", - "public void setRenderer(com.yahoo.processing.rendering.Renderer)", - "public boolean usesDefaultTemplate()" - ], - "fields": [] - }, "com.yahoo.search.searchchain.AsyncExecution": { "superClass": "java.lang.Object", "interfaces": [], diff --git a/docproc/abi-spec.json b/docproc/abi-spec.json index bc76aefb958..65ca886efaf 100644 --- a/docproc/abi-spec.json +++ b/docproc/abi-spec.json @@ -11,7 +11,7 @@ "public abstract java.util.Map documentTypes()", "public abstract java.util.Map structTypes()", "public abstract java.util.Map annotationTypes()", - "public com.yahoo.document.Document getDocumentCopy(java.lang.String, com.yahoo.document.datatypes.StructuredFieldValue, com.yahoo.document.DocumentId)" + "public abstract com.yahoo.document.Document getDocumentCopy(java.lang.String, com.yahoo.document.datatypes.StructuredFieldValue, com.yahoo.document.DocumentId)" ], "fields": [] }, @@ -269,7 +269,6 @@ "methods": [ "public void ()", "public static com.yahoo.docproc.Processing of(com.yahoo.document.DocumentOperation)", - "public static com.yahoo.docproc.Processing fromDocumentOperation(com.yahoo.document.DocumentOperation)", "public void (java.lang.String, com.yahoo.document.DocumentOperation, com.yahoo.docproc.CallStack)", "public static com.yahoo.docproc.Processing createProcessingFromDocumentOperations(java.lang.String, java.util.List, com.yahoo.docproc.CallStack)", "public com.yahoo.component.provider.ComponentRegistry getDocprocServiceRegistry()", @@ -312,7 +311,6 @@ ], "methods": [ "public void ()", - "public void process(com.yahoo.document.Document)", "public void process(com.yahoo.document.DocumentPut)", "public void process(com.yahoo.document.DocumentUpdate)", "public void process(com.yahoo.document.DocumentRemove)", diff --git a/document/abi-spec.json b/document/abi-spec.json index 79e0cdc34d0..c5a88ac9a41 100644 --- a/document/abi-spec.json +++ b/document/abi-spec.json @@ -295,8 +295,6 @@ "public java.lang.Long getLastModified()", "public void setLastModified(java.lang.Long)", "public void onSerialize(com.yahoo.vespa.objects.Serializer)", - "public void serializeHeader(com.yahoo.vespa.objects.Serializer)", - "public void serializeBody(com.yahoo.vespa.objects.Serializer)", "public com.yahoo.document.DocumentType getDataType()", "public int getFieldCount()", "public void serialize(com.yahoo.document.serialization.DocumentWriter)", @@ -508,7 +506,6 @@ "public com.yahoo.document.DocumentType getDocumentType(java.lang.String)", "public final com.yahoo.document.Document createDocument(com.yahoo.io.GrowableByteBuffer)", "public com.yahoo.document.Document createDocument(com.yahoo.document.serialization.DocumentDeserializer)", - "public com.yahoo.document.Document createDocument(com.yahoo.io.GrowableByteBuffer, com.yahoo.io.GrowableByteBuffer)", "public java.util.Collection getDataTypes()", "public java.util.Map getDocumentTypes()", "public java.util.Iterator documentTypeIterator()", @@ -553,14 +550,10 @@ "public void setId(com.yahoo.document.DocumentId)", "public com.yahoo.document.DocumentUpdate applyTo(com.yahoo.document.Document)", "public com.yahoo.document.DocumentUpdate prune(com.yahoo.document.Document)", - "public java.util.List getFieldUpdates()", "public java.util.Collection fieldUpdates()", - "public java.util.List getFieldPathUpdates()", "public java.util.Collection fieldPathUpdates()", "public com.yahoo.document.DocumentType getDocumentType()", "public void setDocumentType(com.yahoo.document.DocumentType)", - "public com.yahoo.document.update.FieldUpdate getFieldUpdate(int)", - "public com.yahoo.document.update.FieldUpdate setFieldUpdate(int, com.yahoo.document.update.FieldUpdate)", "public com.yahoo.document.update.FieldUpdate getFieldUpdate(com.yahoo.document.Field)", "public void clearFieldUpdates()", "public com.yahoo.document.update.FieldUpdate getFieldUpdate(java.lang.String)", @@ -571,7 +564,6 @@ "public com.yahoo.document.DocumentUpdate addFieldUpdate(com.yahoo.document.update.FieldUpdate)", "public com.yahoo.document.DocumentUpdate addFieldPathUpdate(com.yahoo.document.fieldpathupdate.FieldPathUpdate)", "public void addAll(com.yahoo.document.DocumentUpdate)", - "public com.yahoo.document.update.FieldUpdate removeFieldUpdate(int)", "public com.yahoo.document.update.FieldUpdate removeFieldUpdate(com.yahoo.document.Field)", "public com.yahoo.document.update.FieldUpdate removeFieldUpdate(java.lang.String)", "public com.yahoo.document.DocumentType getType()", @@ -3227,7 +3219,7 @@ "public void setNewValues(com.yahoo.document.datatypes.Array)", "public com.yahoo.document.datatypes.Array getNewValues()", "public com.yahoo.document.datatypes.FieldPathIteratorHandler getIteratorHandler(com.yahoo.document.Document)", - "public void serialize(com.yahoo.document.serialization.VespaDocumentSerializerHead)", + "public void serialize(com.yahoo.document.serialization.VespaDocumentSerializer6)", "public boolean equals(java.lang.Object)", "public int hashCode()", "public java.lang.String toString()" @@ -3253,7 +3245,7 @@ "public void setRemoveIfZero(boolean)", "public void setCreateMissingPath(boolean)", "public boolean isArithmetic()", - "public void serialize(com.yahoo.document.serialization.VespaDocumentSerializerHead)", + "public void serialize(com.yahoo.document.serialization.VespaDocumentSerializer6)", "public boolean equals(java.lang.Object)", "public int hashCode()", "public java.lang.String toString()", @@ -3307,7 +3299,7 @@ "public com.yahoo.document.select.DocumentSelector getWhereClause()", "public java.lang.String getOriginalWhereClause()", "public void applyTo(com.yahoo.document.Document)", - "public void serialize(com.yahoo.document.serialization.VespaDocumentSerializerHead)", + "public void serialize(com.yahoo.document.serialization.VespaDocumentSerializer6)", "public static com.yahoo.document.fieldpathupdate.FieldPathUpdate create(com.yahoo.document.fieldpathupdate.FieldPathUpdate$Type, com.yahoo.document.DocumentType, com.yahoo.document.serialization.DocumentUpdateReader)", "public boolean equals(java.lang.Object)", "public int hashCode()", @@ -3608,211 +3600,6 @@ ], "fields": [] }, - "com.yahoo.document.select.BucketSelector": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (com.yahoo.document.BucketIdFactory)", - "public com.yahoo.document.select.BucketSet getBucketList(java.lang.String)" - ], - "fields": [] - }, - "com.yahoo.document.select.BucketSet": { - "superClass": "java.util.HashSet", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.document.BucketId)", - "public void (com.yahoo.document.select.BucketSet)", - "public com.yahoo.document.select.BucketSet intersection(com.yahoo.document.select.BucketSet)", - "public com.yahoo.document.select.BucketSet union(com.yahoo.document.select.BucketSet)" - ], - "fields": [] - }, - "com.yahoo.document.select.Context": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (com.yahoo.document.DocumentOperation)", - "public com.yahoo.document.DocumentOperation getDocumentOperation()", - "public void setDocumentOperation(com.yahoo.document.DocumentOperation)", - "public java.util.Map getVariables()", - "public void setVariables(java.util.Map)" - ], - "fields": [] - }, - "com.yahoo.document.select.DocumentSelector": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (java.lang.String)", - "public com.yahoo.document.select.Result accepts(com.yahoo.document.DocumentOperation)", - "public com.yahoo.document.select.Result accepts(com.yahoo.document.select.Context)", - "public com.yahoo.document.select.ResultList getMatchingResultList(com.yahoo.document.DocumentOperation)", - "public com.yahoo.document.select.ResultList getMatchingResultList(com.yahoo.document.select.Context)", - "public java.lang.String toString()", - "public com.yahoo.document.select.OrderingSpecification getOrdering(int)", - "public void visit(com.yahoo.document.select.Visitor)" - ], - "fields": [] - }, - "com.yahoo.document.select.NowCheckVisitor": { - "superClass": "java.lang.Object", - "interfaces": [ - "com.yahoo.document.select.Visitor" - ], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public boolean requiresConversion()", - "public void visit(com.yahoo.document.select.rule.ArithmeticNode)", - "public void visit(com.yahoo.document.select.rule.AttributeNode)", - "public void visit(com.yahoo.document.select.rule.ComparisonNode)", - "public void visit(com.yahoo.document.select.rule.DocumentNode)", - "public void visit(com.yahoo.document.select.rule.EmbracedNode)", - "public void visit(com.yahoo.document.select.rule.IdNode)", - "public void visit(com.yahoo.document.select.rule.LiteralNode)", - "public void visit(com.yahoo.document.select.rule.LogicNode)", - "public void visit(com.yahoo.document.select.rule.NegationNode)", - "public void visit(com.yahoo.document.select.rule.NowNode)", - "public void visit(com.yahoo.document.select.rule.SearchColumnNode)", - "public void visit(com.yahoo.document.select.rule.VariableNode)" - ], - "fields": [] - }, - "com.yahoo.document.select.OrderingSpecification": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (int)", - "public void (int, long, short, short)", - "public int getOrder()", - "public long getOrderingStart()", - "public short getWidthBits()", - "public short getDivisionBits()", - "public boolean equals(java.lang.Object)", - "public int hashCode()", - "public java.lang.String toString()" - ], - "fields": [ - "public static int ASCENDING", - "public static int DESCENDING", - "public final int order", - "public final long orderingStart", - "public final short widthBits", - "public final short divisionBits" - ] - }, - "com.yahoo.document.select.Result": { - "superClass": "java.lang.Enum", - "interfaces": [], - "attributes": [ - "public", - "final", - "enum" - ], - "methods": [ - "public static com.yahoo.document.select.Result[] values()", - "public static com.yahoo.document.select.Result valueOf(java.lang.String)", - "public java.lang.String toString()", - "public static com.yahoo.document.select.Result invert(com.yahoo.document.select.Result)", - "public static com.yahoo.document.select.Result toResult(java.lang.Object)" - ], - "fields": [ - "public static final enum com.yahoo.document.select.Result TRUE", - "public static final enum com.yahoo.document.select.Result FALSE", - "public static final enum com.yahoo.document.select.Result INVALID" - ] - }, - "com.yahoo.document.select.ResultList$ResultPair": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public com.yahoo.document.datatypes.FieldPathIteratorHandler$VariableMap getVariables()", - "public com.yahoo.document.select.Result getResult()", - "public java.lang.String toString()" - ], - "fields": [] - }, - "com.yahoo.document.select.ResultList$VariableValue": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (com.yahoo.document.datatypes.FieldPathIteratorHandler$VariableMap, java.lang.Object)", - "public com.yahoo.document.datatypes.FieldPathIteratorHandler$VariableMap getVariables()", - "public java.lang.Object getValue()", - "public java.lang.String toString()" - ], - "fields": [] - }, - "com.yahoo.document.select.ResultList": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.document.select.Result)", - "public void add(com.yahoo.document.datatypes.FieldPathIteratorHandler$VariableMap, com.yahoo.document.select.Result)", - "public java.util.List getResults()", - "public static com.yahoo.document.select.ResultList fromBoolean(boolean)", - "public com.yahoo.document.select.Result toResult()", - "public com.yahoo.document.select.ResultList combineAND(com.yahoo.document.select.ResultList)", - "public com.yahoo.document.select.ResultList combineOR(com.yahoo.document.select.ResultList)", - "public static com.yahoo.document.select.ResultList toResultList(java.lang.Object)", - "public java.lang.String toString()" - ], - "fields": [] - }, - "com.yahoo.document.select.Visitor": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public", - "interface", - "abstract" - ], - "methods": [ - "public abstract void visit(com.yahoo.document.select.rule.ArithmeticNode)", - "public abstract void visit(com.yahoo.document.select.rule.AttributeNode)", - "public abstract void visit(com.yahoo.document.select.rule.ComparisonNode)", - "public abstract void visit(com.yahoo.document.select.rule.DocumentNode)", - "public abstract void visit(com.yahoo.document.select.rule.EmbracedNode)", - "public abstract void visit(com.yahoo.document.select.rule.IdNode)", - "public abstract void visit(com.yahoo.document.select.rule.LiteralNode)", - "public abstract void visit(com.yahoo.document.select.rule.LogicNode)", - "public abstract void visit(com.yahoo.document.select.rule.NegationNode)", - "public abstract void visit(com.yahoo.document.select.rule.NowNode)", - "public abstract void visit(com.yahoo.document.select.rule.SearchColumnNode)", - "public abstract void visit(com.yahoo.document.select.rule.VariableNode)" - ], - "fields": [] - }, "com.yahoo.document.select.convert.NowQueryExpression": { "superClass": "java.lang.Object", "interfaces": [], @@ -4598,8 +4385,8 @@ "methods": [ "public void ()", "public static com.yahoo.document.serialization.DocumentDeserializer createHead(com.yahoo.document.DocumentTypeManager, com.yahoo.io.GrowableByteBuffer)", - "public static com.yahoo.document.serialization.DocumentDeserializer create42(com.yahoo.document.DocumentTypeManager, com.yahoo.io.GrowableByteBuffer)", - "public static com.yahoo.document.serialization.DocumentDeserializer create42(com.yahoo.document.DocumentTypeManager, com.yahoo.io.GrowableByteBuffer, com.yahoo.io.GrowableByteBuffer)" + "public static com.yahoo.document.serialization.DocumentDeserializer create6(com.yahoo.document.DocumentTypeManager, com.yahoo.io.GrowableByteBuffer)", + "public static com.yahoo.document.serialization.DocumentDeserializer create42(com.yahoo.document.DocumentTypeManager, com.yahoo.io.GrowableByteBuffer)" ], "fields": [] }, @@ -4646,8 +4433,9 @@ "methods": [ "public void ()", "public static com.yahoo.document.serialization.DocumentSerializer createHead(com.yahoo.io.GrowableByteBuffer)", + "public static com.yahoo.document.serialization.DocumentSerializer create6(com.yahoo.io.GrowableByteBuffer)", + "public static com.yahoo.document.serialization.DocumentSerializer create6()", "public static com.yahoo.document.serialization.DocumentSerializer create42(com.yahoo.io.GrowableByteBuffer)", - "public static com.yahoo.document.serialization.DocumentSerializer create42(com.yahoo.io.GrowableByteBuffer, boolean)", "public static com.yahoo.document.serialization.DocumentSerializer create42()" ], "fields": [] @@ -4866,7 +4654,54 @@ "fields": [] }, "com.yahoo.document.serialization.VespaDocumentDeserializer42": { - "superClass": "com.yahoo.document.serialization.VespaDocumentSerializer42", + "superClass": "com.yahoo.vespa.objects.BufferSerializer", + "interfaces": [ + "com.yahoo.document.serialization.DocumentDeserializer" + ], + "attributes": [ + "public" + ], + "methods": [ + "public final com.yahoo.document.DocumentTypeManager getDocumentTypeManager()", + "public void read(com.yahoo.document.Document)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.Document)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.FieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Array)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.MapFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.CollectionFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.ByteFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.DoubleFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.FloatFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.IntegerFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.LongFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Raw)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.PredicateFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.StringFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.TensorFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.ReferenceFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Struct)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.StructuredFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.WeightedSet)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.annotation.AnnotationReference)", + "public void read(com.yahoo.document.DocumentUpdate)", + "public void read(com.yahoo.document.fieldpathupdate.FieldPathUpdate)", + "public void read(com.yahoo.document.fieldpathupdate.AssignFieldPathUpdate)", + "public void read(com.yahoo.document.fieldpathupdate.RemoveFieldPathUpdate)", + "public void read(com.yahoo.document.fieldpathupdate.AddFieldPathUpdate)", + "public com.yahoo.document.update.ValueUpdate getValueUpdate(com.yahoo.document.DataType, com.yahoo.document.DataType)", + "public void read(com.yahoo.document.update.FieldUpdate)", + "public com.yahoo.document.DocumentId readDocumentId()", + "public com.yahoo.document.DocumentType readDocumentType()", + "public void read(com.yahoo.document.annotation.SpanTree)", + "public void read(com.yahoo.document.annotation.Annotation)", + "public void read(com.yahoo.document.annotation.Span)", + "public void read(com.yahoo.document.annotation.SpanList)", + "public void read(com.yahoo.document.annotation.AlternateSpanList)" + ], + "fields": [] + }, + "com.yahoo.document.serialization.VespaDocumentDeserializer6": { + "superClass": "com.yahoo.vespa.objects.BufferSerializer", "interfaces": [ "com.yahoo.document.serialization.DocumentDeserializer" ], @@ -4914,15 +4749,13 @@ "fields": [] }, "com.yahoo.document.serialization.VespaDocumentDeserializerHead": { - "superClass": "com.yahoo.document.serialization.VespaDocumentDeserializer42", + "superClass": "com.yahoo.document.serialization.VespaDocumentDeserializer6", "interfaces": [], "attributes": [ "public" ], "methods": [ - "public void (com.yahoo.document.DocumentTypeManager, com.yahoo.io.GrowableByteBuffer)", - "public void read(com.yahoo.document.DocumentUpdate)", - "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.BoolFieldValue)" + "public void (com.yahoo.document.DocumentTypeManager, com.yahoo.io.GrowableByteBuffer)" ], "fields": [] }, @@ -4935,7 +4768,6 @@ "public" ], "methods": [ - "public void setHeaderOnly(boolean)", "public void write(com.yahoo.document.Document)", "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.Document)", "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.FieldValue)", @@ -4977,19 +4809,66 @@ ], "fields": [] }, - "com.yahoo.document.serialization.VespaDocumentSerializerHead": { - "superClass": "com.yahoo.document.serialization.VespaDocumentSerializer42", - "interfaces": [], + "com.yahoo.document.serialization.VespaDocumentSerializer6": { + "superClass": "com.yahoo.vespa.objects.BufferSerializer", + "interfaces": [ + "com.yahoo.document.serialization.DocumentSerializer" + ], "attributes": [ "public" ], "methods": [ - "public void (com.yahoo.io.GrowableByteBuffer)", + "public void write(com.yahoo.document.Document)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.Document)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.FieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Array)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.MapFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.ByteFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.CollectionFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.DoubleFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.FloatFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.IntegerFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.LongFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Raw)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.PredicateFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.StringFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.TensorFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.ReferenceFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Struct)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.StructuredFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.WeightedSet)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.annotation.AnnotationReference)", + "public void write(com.yahoo.document.DocumentId)", + "public void write(com.yahoo.document.DocumentType)", + "public void write(com.yahoo.document.annotation.Annotation)", + "public void write(com.yahoo.document.annotation.SpanTree)", + "public void write(com.yahoo.document.annotation.SpanNode)", + "public void write(com.yahoo.document.annotation.Span)", + "public void write(com.yahoo.document.annotation.SpanList)", + "public void write(com.yahoo.document.annotation.AlternateSpanList)", "public void write(com.yahoo.document.DocumentUpdate)", "public void write(com.yahoo.document.fieldpathupdate.FieldPathUpdate)", "public void write(com.yahoo.document.fieldpathupdate.AssignFieldPathUpdate)", "public void write(com.yahoo.document.fieldpathupdate.AddFieldPathUpdate)", - "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.ByteFieldValue)" + "public void write(com.yahoo.document.update.FieldUpdate)", + "public void write(com.yahoo.document.update.AddValueUpdate, com.yahoo.document.DataType)", + "public void write(com.yahoo.document.update.MapValueUpdate, com.yahoo.document.DataType)", + "public void write(com.yahoo.document.update.ArithmeticValueUpdate)", + "public void write(com.yahoo.document.update.AssignValueUpdate, com.yahoo.document.DataType)", + "public void write(com.yahoo.document.update.RemoveValueUpdate, com.yahoo.document.DataType)", + "public void write(com.yahoo.document.update.ClearValueUpdate, com.yahoo.document.DataType)", + "public static long getSerializedSize(com.yahoo.document.Document)" + ], + "fields": [] + }, + "com.yahoo.document.serialization.VespaDocumentSerializerHead": { + "superClass": "com.yahoo.document.serialization.VespaDocumentSerializer6", + "interfaces": [], + "attributes": [ + "public" + ], + "methods": [ + "public void (com.yahoo.io.GrowableByteBuffer)" ], "fields": [] }, @@ -5359,4 +5238,4 @@ "protected com.yahoo.document.update.ValueUpdate$ValueUpdateClassID valueUpdateClassID" ] } -} \ No newline at end of file +} diff --git a/documentapi/abi-spec.json b/documentapi/abi-spec.json index 9f1384570d2..e1cdc6747e3 100644 --- a/documentapi/abi-spec.json +++ b/documentapi/abi-spec.json @@ -37,13 +37,14 @@ ], "methods": [ "public abstract com.yahoo.documentapi.Result put(com.yahoo.document.Document)", - "public abstract com.yahoo.documentapi.Result put(com.yahoo.document.Document, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.documentapi.Result put(com.yahoo.document.Document, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public abstract com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId)", - "public abstract com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId, boolean, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId, boolean, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public abstract com.yahoo.documentapi.Result remove(com.yahoo.document.DocumentId)", - "public abstract com.yahoo.documentapi.Result remove(com.yahoo.document.DocumentId, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.documentapi.Result remove(com.yahoo.document.DocumentId, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public abstract com.yahoo.documentapi.Result update(com.yahoo.document.DocumentUpdate)", - "public abstract com.yahoo.documentapi.Result update(com.yahoo.document.DocumentUpdate, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.documentapi.Result update(com.yahoo.document.DocumentUpdate, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public abstract double getCurrentWindowSize()" ], "fields": [] @@ -132,15 +133,15 @@ ], "fields": [] }, - "com.yahoo.documentapi.DocumentListVisitorResponse": { + "com.yahoo.documentapi.DocumentOpVisitorResponse": { "superClass": "com.yahoo.documentapi.VisitorResponse", "interfaces": [], "attributes": [ "public" ], "methods": [ - "public void (com.yahoo.vdslib.DocumentList, com.yahoo.documentapi.AckToken)", - "public com.yahoo.vdslib.DocumentList getDocumentList()" + "public void (com.yahoo.document.DocumentOperation, com.yahoo.documentapi.AckToken)", + "public com.yahoo.document.DocumentOperation getDocumentOperation()" ], "fields": [] }, @@ -415,7 +416,6 @@ "public boolean isSuccess()", "public java.lang.Error getError()", "public long getRequestId()", - "public com.yahoo.documentapi.Result$ResultType getType()", "public com.yahoo.documentapi.Result$ResultType type()" ], "fields": [] @@ -496,7 +496,6 @@ "public" ], "methods": [ - "public void ()", "public java.util.Optional defaultTimeout()" ], "fields": [] @@ -513,11 +512,11 @@ ], "methods": [ "public abstract void put(com.yahoo.document.DocumentPut)", - "public abstract void put(com.yahoo.document.DocumentPut, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", - "public abstract com.yahoo.document.Document get(com.yahoo.document.DocumentId)", - "public abstract com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.lang.String, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", - "public com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.time.Duration)", - "public com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.lang.String, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority, java.time.Duration)", + "public void put(com.yahoo.document.DocumentPut, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.document.Document get(com.yahoo.document.DocumentId)", + "public com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.lang.String, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public abstract com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.time.Duration)", + "public abstract com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.lang.String, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority, java.time.Duration)", "public abstract boolean remove(com.yahoo.document.DocumentRemove)", "public abstract boolean remove(com.yahoo.document.DocumentRemove, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public abstract boolean update(com.yahoo.document.DocumentUpdate)", @@ -672,7 +671,6 @@ "public void ()", "public void reset()", "public void onMessage(com.yahoo.messagebus.Message, com.yahoo.documentapi.AckToken)", - "public void onDocuments(com.yahoo.vdslib.DocumentList, com.yahoo.documentapi.AckToken)", "public com.yahoo.documentapi.VisitorResponse getNext()", "public com.yahoo.documentapi.VisitorResponse getNext(int)" ], @@ -931,6 +929,7 @@ "public com.yahoo.documentapi.Result put(com.yahoo.document.Document, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId)", "public com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId, boolean, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public com.yahoo.documentapi.Result remove(com.yahoo.document.DocumentId)", "public com.yahoo.documentapi.Result remove(com.yahoo.document.DocumentId, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public com.yahoo.documentapi.Result update(com.yahoo.document.DocumentUpdate)", @@ -970,8 +969,8 @@ "public void (com.yahoo.documentapi.local.LocalDocumentAccess)", "public void put(com.yahoo.document.DocumentPut)", "public void put(com.yahoo.document.DocumentPut, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", - "public com.yahoo.document.Document get(com.yahoo.document.DocumentId)", - "public com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.lang.String, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.time.Duration)", + "public com.yahoo.document.Document get(com.yahoo.document.DocumentId, java.lang.String, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority, java.time.Duration)", "public boolean remove(com.yahoo.document.DocumentRemove)", "public boolean remove(com.yahoo.document.DocumentRemove, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public boolean update(com.yahoo.document.DocumentUpdate)", @@ -996,6 +995,7 @@ "public com.yahoo.documentapi.Result put(com.yahoo.document.Document, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId)", "public com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId, boolean, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", + "public com.yahoo.documentapi.Result get(com.yahoo.document.DocumentId, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public com.yahoo.documentapi.Result remove(com.yahoo.document.DocumentId)", "public com.yahoo.documentapi.Result remove(com.yahoo.document.DocumentId, com.yahoo.documentapi.messagebus.protocol.DocumentProtocol$Priority)", "public com.yahoo.documentapi.Result update(com.yahoo.document.DocumentUpdate)", @@ -2405,8 +2405,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$CreateVisitorMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$CreateVisitorMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2420,8 +2420,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$CreateVisitorReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$CreateVisitorReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2433,8 +2433,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DestroyVisitorMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DestroyVisitorMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2446,8 +2446,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DestroyVisitorReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DestroyVisitorReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2459,8 +2459,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentIgnoredReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentIgnoredReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2472,8 +2472,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentListMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentListMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2485,8 +2485,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentListReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentListReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2498,7 +2498,7 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory": { + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory": { "superClass": "com.yahoo.documentapi.messagebus.protocol.AbstractRoutableFactory", "interfaces": [], "attributes": [ @@ -2514,7 +2514,7 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory": { + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory": { "superClass": "com.yahoo.documentapi.messagebus.protocol.AbstractRoutableFactory", "interfaces": [], "attributes": [ @@ -2530,8 +2530,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentSummaryMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentSummaryMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2543,8 +2543,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentSummaryReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentSummaryReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2556,8 +2556,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$EmptyBucketsMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$EmptyBucketsMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2569,8 +2569,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$EmptyBucketsReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$EmptyBucketsReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2582,8 +2582,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$GetBucketListMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$GetBucketListMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2597,8 +2597,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$GetBucketListReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$GetBucketListReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2610,8 +2610,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$GetBucketStateMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$GetBucketStateMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2623,8 +2623,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$GetBucketStateReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$GetBucketStateReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2636,8 +2636,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$GetDocumentMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$GetDocumentMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2649,8 +2649,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$GetDocumentReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$GetDocumentReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2662,8 +2662,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$MapVisitorMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$MapVisitorMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2675,8 +2675,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$MapVisitorReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$MapVisitorReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2688,8 +2688,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$PutDocumentMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$PutDocumentMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2702,8 +2702,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$PutDocumentReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$PutDocumentReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2715,8 +2715,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$QueryResultMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$QueryResultMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2728,8 +2728,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$QueryResultReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$QueryResultReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2741,8 +2741,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$RemoveDocumentMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$RemoveDocumentMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2755,8 +2755,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$RemoveDocumentReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$RemoveDocumentReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2768,8 +2768,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$RemoveLocationMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$RemoveLocationMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2781,8 +2781,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$RemoveLocationReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$RemoveLocationReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2794,8 +2794,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$SearchResultMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$SearchResultMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2807,8 +2807,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$SearchResultReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$SearchResultReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2820,8 +2820,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$StatBucketMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$StatBucketMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2835,8 +2835,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$StatBucketReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$StatBucketReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2848,8 +2848,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$UpdateDocumentMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$UpdateDocumentMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2862,8 +2862,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$UpdateDocumentReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$UpdateDocumentReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2875,8 +2875,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$VisitorInfoMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentMessageFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$VisitorInfoMessageFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentMessageFactory", "interfaces": [], "attributes": [ "public" @@ -2888,8 +2888,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$VisitorInfoReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$VisitorInfoReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2901,8 +2901,8 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$WrongDistributionReplyFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$DocumentReplyFactory", + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$WrongDistributionReplyFactory": { + "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$DocumentReplyFactory", "interfaces": [], "attributes": [ "public" @@ -2914,7 +2914,7 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52": { + "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60": { "superClass": "java.lang.Object", "interfaces": [], "attributes": [ @@ -2926,56 +2926,6 @@ ], "fields": [] }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$CreateVisitorMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$CreateVisitorMessageFactory", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "protected java.lang.String decodeBucketSpace(com.yahoo.vespa.objects.Deserializer)", - "protected boolean encodeBucketSpace(java.lang.String, com.yahoo.document.serialization.DocumentSerializer)" - ], - "fields": [] - }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$GetBucketListMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$GetBucketListMessageFactory", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "protected java.lang.String decodeBucketSpace(com.yahoo.vespa.objects.Deserializer)", - "protected boolean encodeBucketSpace(java.lang.String, com.yahoo.document.serialization.DocumentSerializer)" - ], - "fields": [] - }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60$StatBucketMessageFactory": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52$StatBucketMessageFactory", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "protected java.lang.String decodeBucketSpace(com.yahoo.vespa.objects.Deserializer)", - "protected boolean encodeBucketSpace(java.lang.String, com.yahoo.document.serialization.DocumentSerializer)" - ], - "fields": [] - }, - "com.yahoo.documentapi.messagebus.protocol.RoutableFactories60": { - "superClass": "com.yahoo.documentapi.messagebus.protocol.RoutableFactories52", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()" - ], - "fields": [] - }, "com.yahoo.documentapi.messagebus.protocol.RoutableFactory": { "superClass": "java.lang.Object", "interfaces": [], diff --git a/jdisc_http_service/abi-spec.json b/jdisc_http_service/abi-spec.json index 8fe945267ec..099b009fba5 100644 --- a/jdisc_http_service/abi-spec.json +++ b/jdisc_http_service/abi-spec.json @@ -33,7 +33,6 @@ "public com.yahoo.jdisc.http.ConnectorConfig$Builder responseHeaderSize(int)", "public com.yahoo.jdisc.http.ConnectorConfig$Builder acceptQueueSize(int)", "public com.yahoo.jdisc.http.ConnectorConfig$Builder reuseAddress(boolean)", - "public com.yahoo.jdisc.http.ConnectorConfig$Builder soLingerTime(double)", "public com.yahoo.jdisc.http.ConnectorConfig$Builder idleTimeout(double)", "public com.yahoo.jdisc.http.ConnectorConfig$Builder stopTimeout(double)", "public com.yahoo.jdisc.http.ConnectorConfig$Builder tcpKeepAliveEnabled(boolean)", @@ -82,33 +81,9 @@ "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder certificateFile(java.lang.String)", "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder caCertificateFile(java.lang.String)", "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder clientAuth(com.yahoo.jdisc.http.ConnectorConfig$Ssl$ClientAuth$Enum)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder keyDbKey(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder excludeProtocol(com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeProtocol$Builder)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder excludeProtocol(java.util.List)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder includeProtocol(com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeProtocol$Builder)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder includeProtocol(java.util.List)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder excludeCipherSuite(com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeCipherSuite$Builder)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder excludeCipherSuite(java.util.List)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder includeCipherSuite(com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeCipherSuite$Builder)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder includeCipherSuite(java.util.List)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder keyStoreType(com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder keyStorePath(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder pemKeyStore(com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore$Builder)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder trustStoreType(com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType$Enum)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder trustStorePath(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder useTrustStorePassword(boolean)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder sslKeyManagerFactoryAlgorithm(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder protocol(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$Builder prng(java.lang.String)", "public com.yahoo.jdisc.http.ConnectorConfig$Ssl build()" ], - "fields": [ - "public java.util.List excludeProtocol", - "public java.util.List includeProtocol", - "public java.util.List excludeCipherSuite", - "public java.util.List includeCipherSuite", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore$Builder pemKeyStore" - ] + "fields": [] }, "com.yahoo.jdisc.http.ConnectorConfig$Ssl$ClientAuth$Enum": { "superClass": "java.lang.Enum", @@ -145,217 +120,6 @@ "public static final com.yahoo.jdisc.http.ConnectorConfig$Ssl$ClientAuth$Enum NEED_AUTH" ] }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeCipherSuite$Builder": { - "superClass": "java.lang.Object", - "interfaces": [ - "com.yahoo.config.ConfigBuilder" - ], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeCipherSuite)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeCipherSuite$Builder name(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeCipherSuite build()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeCipherSuite": { - "superClass": "com.yahoo.config.InnerNode", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeCipherSuite$Builder)", - "public java.lang.String name()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeProtocol$Builder": { - "superClass": "java.lang.Object", - "interfaces": [ - "com.yahoo.config.ConfigBuilder" - ], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeProtocol)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeProtocol$Builder name(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeProtocol build()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeProtocol": { - "superClass": "com.yahoo.config.InnerNode", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeProtocol$Builder)", - "public java.lang.String name()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeCipherSuite$Builder": { - "superClass": "java.lang.Object", - "interfaces": [ - "com.yahoo.config.ConfigBuilder" - ], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeCipherSuite)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeCipherSuite$Builder name(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeCipherSuite build()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeCipherSuite": { - "superClass": "com.yahoo.config.InnerNode", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeCipherSuite$Builder)", - "public java.lang.String name()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeProtocol$Builder": { - "superClass": "java.lang.Object", - "interfaces": [ - "com.yahoo.config.ConfigBuilder" - ], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeProtocol)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeProtocol$Builder name(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeProtocol build()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeProtocol": { - "superClass": "com.yahoo.config.InnerNode", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeProtocol$Builder)", - "public java.lang.String name()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum": { - "superClass": "java.lang.Enum", - "interfaces": [], - "attributes": [ - "public", - "final", - "enum" - ], - "methods": [ - "public static com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum[] values()", - "public static com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum valueOf(java.lang.String)" - ], - "fields": [ - "public static final enum com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum JKS", - "public static final enum com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum PEM" - ] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType": { - "superClass": "com.yahoo.config.EnumNode", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum)" - ], - "fields": [ - "public static final com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum JKS", - "public static final com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum PEM" - ] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore$Builder": { - "superClass": "java.lang.Object", - "interfaces": [ - "com.yahoo.config.ConfigBuilder" - ], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore$Builder keyPath(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore$Builder certificatePath(java.lang.String)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore build()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore": { - "superClass": "com.yahoo.config.InnerNode", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore$Builder)", - "public java.lang.String keyPath()", - "public java.lang.String certificatePath()" - ], - "fields": [] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType$Enum": { - "superClass": "java.lang.Enum", - "interfaces": [], - "attributes": [ - "public", - "final", - "enum" - ], - "methods": [ - "public static com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType$Enum[] values()", - "public static com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType$Enum valueOf(java.lang.String)" - ], - "fields": [ - "public static final enum com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType$Enum JKS" - ] - }, - "com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType": { - "superClass": "com.yahoo.config.EnumNode", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public void (com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType$Enum)" - ], - "fields": [ - "public static final com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType$Enum JKS" - ] - }, "com.yahoo.jdisc.http.ConnectorConfig$Ssl": { "superClass": "com.yahoo.config.InnerNode", "interfaces": [], @@ -369,25 +133,7 @@ "public java.lang.String privateKeyFile()", "public java.lang.String certificateFile()", "public java.lang.String caCertificateFile()", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$ClientAuth$Enum clientAuth()", - "public java.lang.String keyDbKey()", - "public java.util.List excludeProtocol()", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeProtocol excludeProtocol(int)", - "public java.util.List includeProtocol()", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeProtocol includeProtocol(int)", - "public java.util.List excludeCipherSuite()", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$ExcludeCipherSuite excludeCipherSuite(int)", - "public java.util.List includeCipherSuite()", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$IncludeCipherSuite includeCipherSuite(int)", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$KeyStoreType$Enum keyStoreType()", - "public java.lang.String keyStorePath()", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$PemKeyStore pemKeyStore()", - "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$TrustStoreType$Enum trustStoreType()", - "public java.lang.String trustStorePath()", - "public boolean useTrustStorePassword()", - "public java.lang.String sslKeyManagerFactoryAlgorithm()", - "public java.lang.String protocol()", - "public java.lang.String prng()" + "public com.yahoo.jdisc.http.ConnectorConfig$Ssl$ClientAuth$Enum clientAuth()" ], "fields": [] }, @@ -449,7 +195,6 @@ "public int responseHeaderSize()", "public int acceptQueueSize()", "public boolean reuseAddress()", - "public double soLingerTime()", "public double idleTimeout()", "public double stopTimeout()", "public boolean tcpKeepAliveEnabled()", @@ -483,31 +228,20 @@ "public com.yahoo.jdisc.http.Cookie setDomain(java.lang.String)", "public java.lang.String getPath()", "public com.yahoo.jdisc.http.Cookie setPath(java.lang.String)", - "public java.lang.String getComment()", - "public com.yahoo.jdisc.http.Cookie setComment(java.lang.String)", - "public java.lang.String getCommentURL()", - "public com.yahoo.jdisc.http.Cookie setCommentURL(java.lang.String)", - "public java.lang.String getCommentUrl()", - "public com.yahoo.jdisc.http.Cookie setCommentUrl(java.lang.String)", "public int getMaxAge(java.util.concurrent.TimeUnit)", "public com.yahoo.jdisc.http.Cookie setMaxAge(int, java.util.concurrent.TimeUnit)", - "public int getVersion()", - "public com.yahoo.jdisc.http.Cookie setVersion(int)", "public boolean isSecure()", "public com.yahoo.jdisc.http.Cookie setSecure(boolean)", "public boolean isHttpOnly()", "public com.yahoo.jdisc.http.Cookie setHttpOnly(boolean)", - "public boolean isDiscard()", - "public com.yahoo.jdisc.http.Cookie setDiscard(boolean)", - "public java.util.Set ports()", "public boolean equals(java.lang.Object)", "public int hashCode()", "public java.lang.String toString()", "public static java.lang.String toCookieHeader(java.lang.Iterable)", "public static java.util.List fromCookieHeader(java.lang.String)", - "public static java.lang.String toSetCookieHeader(java.lang.Iterable)", + "public static java.util.List toSetCookieHeaders(java.lang.Iterable)", "public static java.util.List toSetCookieHeaderAll(java.lang.Iterable)", - "public static java.util.List fromSetCookieHeader(java.lang.String)" + "public static com.yahoo.jdisc.http.Cookie fromSetCookieHeader(java.lang.String)" ], "fields": [] }, @@ -1168,21 +902,17 @@ "methods": [ "protected void (com.yahoo.jdisc.http.Cookie)", "public static com.yahoo.jdisc.http.filter.JDiscCookieWrapper wrap(com.yahoo.jdisc.http.Cookie)", - "public java.lang.String getComment()", "public java.lang.String getDomain()", "public int getMaxAge()", "public java.lang.String getName()", "public java.lang.String getPath()", "public boolean getSecure()", "public java.lang.String getValue()", - "public int getVersion()", - "public void setComment(java.lang.String)", "public void setDomain(java.lang.String)", "public void setMaxAge(int)", "public void setPath(java.lang.String)", "public void setSecure(boolean)", "public void setValue(java.lang.String)", - "public void setVersion(int)", "public com.yahoo.jdisc.http.Cookie getCookie()" ], "fields": [] @@ -1398,5 +1128,19 @@ "public abstract org.eclipse.jetty.util.ssl.SslContextFactory getInstance(java.lang.String, int)" ], "fields": [] + }, + "com.yahoo.jdisc.http.ssl.ThrowingSslContextFactoryProvider": { + "superClass": "java.lang.Object", + "interfaces": [ + "com.yahoo.jdisc.http.ssl.SslContextFactoryProvider" + ], + "attributes": [ + "public" + ], + "methods": [ + "public void ()", + "public org.eclipse.jetty.util.ssl.SslContextFactory getInstance(java.lang.String, int)" + ], + "fields": [] } } \ No newline at end of file diff --git a/linguistics/abi-spec.json b/linguistics/abi-spec.json index df8d008ec42..d56e56e23b5 100644 --- a/linguistics/abi-spec.json +++ b/linguistics/abi-spec.json @@ -210,12 +210,9 @@ "public abstract com.yahoo.language.process.Segmenter getSegmenter()", "public abstract com.yahoo.language.detect.Detector getDetector()", "public abstract com.yahoo.language.process.GramSplitter getGramSplitter()", - "public abstract com.yahoo.language.process.CharacterClasses getCharacterClasses()", - "public abstract com.yahoo.collections.Tuple2 getVersion(com.yahoo.language.Linguistics$Component)" + "public abstract com.yahoo.language.process.CharacterClasses getCharacterClasses()" ], - "fields": [ - "public static final com.yahoo.language.Linguistics SIMPLE" - ] + "fields": [] }, "com.yahoo.language.LinguisticsCase": { "superClass": "java.lang.Object", @@ -460,9 +457,7 @@ ], "methods": [ "public static com.yahoo.language.process.StemMode[] values()", - "public static com.yahoo.language.process.StemMode valueOf(java.lang.String)", - "public int getValue()", - "public static com.yahoo.language.process.StemMode valueOf(int)" + "public static com.yahoo.language.process.StemMode valueOf(java.lang.String)" ], "fields": [ "public static final enum com.yahoo.language.process.StemMode NONE", diff --git a/searchlib/abi-spec.json b/searchlib/abi-spec.json index 39bf1603e58..79c633b9617 100644 --- a/searchlib/abi-spec.json +++ b/searchlib/abi-spec.json @@ -1294,7 +1294,6 @@ "public final boolean equals(java.lang.Object)", "public final java.lang.String toString()", "public abstract java.lang.StringBuilder toString(java.lang.StringBuilder, com.yahoo.searchlib.rankingexpression.rule.SerializationContext, java.util.Deque, com.yahoo.searchlib.rankingexpression.rule.CompositeNode)", - "public java.lang.String toString(com.yahoo.searchlib.rankingexpression.rule.SerializationContext, java.util.Deque, com.yahoo.searchlib.rankingexpression.rule.CompositeNode)", "public abstract com.yahoo.tensor.TensorType type(com.yahoo.tensor.evaluation.TypeContext)", "public abstract com.yahoo.searchlib.rankingexpression.evaluation.Value evaluate(com.yahoo.searchlib.rankingexpression.evaluation.Context)" ], diff --git a/vespa-hadoop/abi-spec.json b/vespa-hadoop/abi-spec.json index 40c624d2577..c6174aca970 100644 --- a/vespa-hadoop/abi-spec.json +++ b/vespa-hadoop/abi-spec.json @@ -36,8 +36,8 @@ "public" ], "methods": [ - "protected void (com.yahoo.component.ComponentId)", "protected void ()", + "protected void (com.yahoo.component.ComponentId)", "public final void initId(com.yahoo.component.ComponentId)", "public final com.yahoo.component.ComponentId getId()", "public final boolean hasInitializedId()", @@ -229,35 +229,6 @@ "public static final com.yahoo.component.Version currentVersion" ] }, - "com.yahoo.component.provider.ComponentClass$ComponentConstructor": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (java.lang.reflect.Constructor)", - "public java.lang.reflect.Constructor getConstructor()", - "public boolean preferredTo(com.yahoo.component.provider.ComponentClass$ComponentConstructor)" - ], - "fields": [ - "public final boolean isLegal", - "public final boolean hasComponentId" - ] - }, - "com.yahoo.component.provider.ComponentClass": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void (java.lang.Class)", - "public com.yahoo.component.AbstractComponent createComponent(com.yahoo.component.ComponentId, java.util.Map, java.lang.String)", - "public com.yahoo.component.provider.ComponentClass$ComponentConstructor getPreferredConstructor()" - ], - "fields": [] - }, "com.yahoo.component.provider.ComponentRegistry": { "superClass": "java.lang.Object", "interfaces": [], @@ -711,6 +682,7 @@ "public java.lang.String getName()", "public java.io.Reader getReader()", "public java.lang.String toString()", + "public static java.io.Reader nullReader()", "public int read(java.nio.CharBuffer)", "public int read()", "public int read(char[])", @@ -721,6 +693,7 @@ "public void mark(int)", "public void reset()", "public void close()", + "public long transferTo(java.io.Writer)", "public static void closeAll(java.util.List)" ], "fields": [] @@ -2880,35 +2853,6 @@ ], "fields": [] }, - "com.yahoo.text.DoubleFormatter": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public static java.lang.StringBuilder fmt(java.lang.StringBuilder, double)", - "public static java.lang.String stringValue(double)", - "public static void append(java.lang.StringBuilder, double)", - "public static void append(java.lang.StringBuilder, int)" - ], - "fields": [] - }, - "com.yahoo.text.DoubleParser": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public static double parse(java.lang.String)" - ], - "fields": [] - }, "com.yahoo.text.ForwardWriter": { "superClass": "com.yahoo.text.GenericWriter", "interfaces": [], @@ -3034,19 +2978,6 @@ ], "fields": [] }, - "com.yahoo.text.LanguageHacks": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public static boolean isCJK(java.lang.String)", - "public static boolean yellDesegments(java.lang.String)" - ], - "fields": [] - }, "com.yahoo.text.Lowercase": { "superClass": "java.lang.Object", "interfaces": [], @@ -3589,7 +3520,6 @@ "public void (com.yahoo.vespa.http.client.config.Endpoint)", "public com.yahoo.vespa.http.client.config.Endpoint getEndpoint()", "public boolean isSuccess()", - "public boolean isTransient()", "public com.yahoo.vespa.http.client.Result$ResultType getResultType()", "public java.lang.Exception getException()", "public java.lang.String getTraceMessage()", @@ -3628,7 +3558,6 @@ "public java.lang.CharSequence getDocumentDataAsCharSequence()", "public java.lang.Object getContext()", "public boolean isSuccess()", - "public boolean isTransient()", "public java.util.List getDetails()", "public boolean hasLocalTrace()", "public java.lang.String toString()" @@ -3773,7 +3702,6 @@ "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setUseCompression(boolean)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setMaxRetries(int)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setDryRun(boolean)", - "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setEnableV3Protocol(boolean)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setMinTimeBetweenRetries(long, java.util.concurrent.TimeUnit)", "public long getMinTimeBetweenRetriesMs()", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setTraceLevel(int)", @@ -3825,7 +3753,6 @@ "public int getMaxRetries()", "public long getMinTimeBetweenRetriesMs()", "public boolean isDryRun()", - "public boolean isEnableV3Protocol()", "public int getTraceLevel()", "public int getTraceEveryXOperation()", "public boolean getPrintTraceToStdErr()" diff --git a/vespa-http-client/abi-spec.json b/vespa-http-client/abi-spec.json index 72ae6588d8f..22c8ce9b7fc 100644 --- a/vespa-http-client/abi-spec.json +++ b/vespa-http-client/abi-spec.json @@ -94,7 +94,6 @@ "public void (com.yahoo.vespa.http.client.config.Endpoint)", "public com.yahoo.vespa.http.client.config.Endpoint getEndpoint()", "public boolean isSuccess()", - "public boolean isTransient()", "public com.yahoo.vespa.http.client.Result$ResultType getResultType()", "public java.lang.Exception getException()", "public java.lang.String getTraceMessage()", @@ -133,7 +132,6 @@ "public java.lang.CharSequence getDocumentDataAsCharSequence()", "public java.lang.Object getContext()", "public boolean isSuccess()", - "public boolean isTransient()", "public java.util.List getDetails()", "public boolean hasLocalTrace()", "public java.lang.String toString()" @@ -278,7 +276,6 @@ "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setUseCompression(boolean)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setMaxRetries(int)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setDryRun(boolean)", - "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setEnableV3Protocol(boolean)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setMinTimeBetweenRetries(long, java.util.concurrent.TimeUnit)", "public long getMinTimeBetweenRetriesMs()", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setTraceLevel(int)", @@ -330,7 +327,6 @@ "public int getMaxRetries()", "public long getMinTimeBetweenRetriesMs()", "public boolean isDryRun()", - "public boolean isEnableV3Protocol()", "public int getTraceLevel()", "public int getTraceEveryXOperation()", "public boolean getPrintTraceToStdErr()" diff --git a/vespajlib/abi-spec.json b/vespajlib/abi-spec.json index 48f2a4af4ad..70383e8aabf 100644 --- a/vespajlib/abi-spec.json +++ b/vespajlib/abi-spec.json @@ -324,6 +324,7 @@ "public java.lang.String getName()", "public java.io.Reader getReader()", "public java.lang.String toString()", + "public static java.io.Reader nullReader()", "public int read(java.nio.CharBuffer)", "public int read()", "public int read(char[])", @@ -334,6 +335,7 @@ "public void mark(int)", "public void reset()", "public void close()", + "public long transferTo(java.io.Writer)", "public static void closeAll(java.util.List)" ], "fields": [] @@ -2458,35 +2460,6 @@ ], "fields": [] }, - "com.yahoo.text.DoubleFormatter": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public static java.lang.StringBuilder fmt(java.lang.StringBuilder, double)", - "public static java.lang.String stringValue(double)", - "public static void append(java.lang.StringBuilder, double)", - "public static void append(java.lang.StringBuilder, int)" - ], - "fields": [] - }, - "com.yahoo.text.DoubleParser": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public", - "final" - ], - "methods": [ - "public void ()", - "public static double parse(java.lang.String)" - ], - "fields": [] - }, "com.yahoo.text.ForwardWriter": { "superClass": "com.yahoo.text.GenericWriter", "interfaces": [], @@ -2612,19 +2585,6 @@ ], "fields": [] }, - "com.yahoo.text.LanguageHacks": { - "superClass": "java.lang.Object", - "interfaces": [], - "attributes": [ - "public" - ], - "methods": [ - "public void ()", - "public static boolean isCJK(java.lang.String)", - "public static boolean yellDesegments(java.lang.String)" - ], - "fields": [] - }, "com.yahoo.text.Lowercase": { "superClass": "java.lang.Object", "interfaces": [], -- cgit v1.2.3 From 87f79861f042b6467350f720e82267994d3bf267 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Mon, 14 Jan 2019 00:00:20 +0100 Subject: Follow api change --- document/abi-spec.json | 4 +++- .../yahoo/document/serialization/VespaDocumentDeserializer6.java | 8 ++++++++ .../yahoo/document/serialization/VespaDocumentSerializer6.java | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'document') diff --git a/document/abi-spec.json b/document/abi-spec.json index c5a88ac9a41..a17bc298289 100644 --- a/document/abi-spec.json +++ b/document/abi-spec.json @@ -4669,6 +4669,7 @@ "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Array)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.MapFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.CollectionFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.BoolFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.ByteFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.DoubleFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.FloatFieldValue)", @@ -4716,8 +4717,8 @@ "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Array)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.MapFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.CollectionFieldValue)", - "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.BoolFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.ByteFieldValue)", + "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.BoolFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.DoubleFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.FloatFieldValue)", "public void read(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.IntegerFieldValue)", @@ -4824,6 +4825,7 @@ "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.Array)", "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.MapFieldValue)", "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.ByteFieldValue)", + "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.BoolFieldValue)", "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.CollectionFieldValue)", "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.DoubleFieldValue)", "public void write(com.yahoo.vespa.objects.FieldBase, com.yahoo.document.datatypes.FloatFieldValue)", diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java index 624a074421e..e8da3d66611 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java @@ -18,6 +18,7 @@ import com.yahoo.document.CollectionDataType; import com.yahoo.document.DataType; import com.yahoo.document.DataTypeName; import com.yahoo.document.datatypes.Array; +import com.yahoo.document.datatypes.BoolFieldValue; import com.yahoo.document.datatypes.ByteFieldValue; import com.yahoo.document.datatypes.CollectionFieldValue; import com.yahoo.document.datatypes.DoubleFieldValue; @@ -202,6 +203,13 @@ public class VespaDocumentDeserializer6 extends BufferSerializer implements Docu throw new IllegalArgumentException("read not implemented yet."); } public void read(FieldBase field, ByteFieldValue value) { value.assign(getByte(null)); } + + @Override + public void read(FieldBase field, BoolFieldValue value) { + byte asByte = value.getBoolean() ? (byte)1 : (byte)0; + buf.put(asByte); + } + public void read(FieldBase field, DoubleFieldValue value) { value.assign(getDouble(null)); } public void read(FieldBase field, FloatFieldValue value) { value.assign(getFloat(null)); } public void read(FieldBase field, IntegerFieldValue value) { value.assign(getInt(null)); } diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java index 2d381c23916..dab94906c39 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java @@ -20,6 +20,7 @@ import com.yahoo.document.annotation.SpanList; import com.yahoo.document.annotation.SpanNode; import com.yahoo.document.annotation.SpanTree; import com.yahoo.document.datatypes.Array; +import com.yahoo.document.datatypes.BoolFieldValue; import com.yahoo.document.datatypes.ByteFieldValue; import com.yahoo.document.datatypes.CollectionFieldValue; import com.yahoo.document.datatypes.DoubleFieldValue; @@ -164,6 +165,11 @@ public class VespaDocumentSerializer6 extends BufferSerializer implements Docume buf.put(value.getByte()); } + @Override + public void write(FieldBase field, BoolFieldValue value) { + value.setBoolean((getByte(null) != 0)); + } + /** * Write out the value of collection field * -- cgit v1.2.3 From 87fc9dd7319da4cff9d96e769c5375cb220a0d23 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Mon, 14 Jan 2019 15:09:25 +0100 Subject: Repair serialization of boolean fields. --- .../com/yahoo/document/serialization/VespaDocumentDeserializer6.java | 3 +-- .../com/yahoo/document/serialization/VespaDocumentSerializer6.java | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java index e8da3d66611..5424798110c 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java @@ -206,8 +206,7 @@ public class VespaDocumentDeserializer6 extends BufferSerializer implements Docu @Override public void read(FieldBase field, BoolFieldValue value) { - byte asByte = value.getBoolean() ? (byte)1 : (byte)0; - buf.put(asByte); + value.setBoolean((getByte(null) != 0)); } public void read(FieldBase field, DoubleFieldValue value) { value.assign(getDouble(null)); } diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java index dab94906c39..7b7878083a2 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentSerializer6.java @@ -167,7 +167,8 @@ public class VespaDocumentSerializer6 extends BufferSerializer implements Docume @Override public void write(FieldBase field, BoolFieldValue value) { - value.setBoolean((getByte(null) != 0)); + byte asByte = value.getBoolean() ? (byte)1 : (byte)0; + buf.put(asByte); } /** -- cgit v1.2.3