diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-06-02 12:52:12 +0000 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-06-08 11:45:25 +0200 |
commit | f2d548b013350a99c02604020eb1bfc4c2a7bf1f (patch) | |
tree | 4e9d4f25114403a5510b75cb9f4ede3996fd9548 /document/src | |
parent | cf964397ea89d06916658df9b3c1c548a8960380 (diff) |
remove more deprecated APIs
Diffstat (limited to 'document/src')
9 files changed, 8 insertions, 120 deletions
diff --git a/document/src/main/java/com/yahoo/document/CollectionDataType.java b/document/src/main/java/com/yahoo/document/CollectionDataType.java index de2aa0cff19..1aeccb7e2fa 100644 --- a/document/src/main/java/com/yahoo/document/CollectionDataType.java +++ b/document/src/main/java/com/yahoo/document/CollectionDataType.java @@ -40,16 +40,6 @@ public abstract class CollectionDataType extends DataType { @Override protected FieldValue createByReflection(Object arg) { return null; } - /** - * WARNING! Do not use! Only to be used by config system! - * Sets the nested type of this CollectionDataType. - * @deprecated // TODO Vespa 8 remove - */ - @Deprecated(forRemoval = true, since = "7") - public void setNestedType(DataType nestedType) { - this.nestedType = nestedType; - } - @Override public PrimitiveDataType getPrimitiveType() { return nestedType.getPrimitiveType(); diff --git a/document/src/main/java/com/yahoo/document/Document.java b/document/src/main/java/com/yahoo/document/Document.java index 1a29bf29191..5937ba00292 100644 --- a/document/src/main/java/com/yahoo/document/Document.java +++ b/document/src/main/java/com/yahoo/document/Document.java @@ -96,14 +96,6 @@ public class Document extends StructuredFieldValue { docId = id; } - /** @deprecated do not use: Use getField(), getFieldValue() or iterator() instead */ - @Deprecated // TODO: Remove on Vespa 8 - public Struct getHeader() { return header; } - - /** @deprecated do not use: Use getField(), getFieldValue() or iterator() instead */ - @Deprecated // TODO: Remove on Vespa 8 - public Struct getBody() { return null; } - @Override public void assign(Object o) { throw new IllegalArgumentException("Assign not implemented for " + getClass() + " objects"); diff --git a/document/src/main/java/com/yahoo/document/DocumentType.java b/document/src/main/java/com/yahoo/document/DocumentType.java index 4fb50f48688..447baacac54 100644 --- a/document/src/main/java/com/yahoo/document/DocumentType.java +++ b/document/src/main/java/com/yahoo/document/DocumentType.java @@ -67,29 +67,12 @@ public class DocumentType extends StructuredDataType { this(name, headerType, Collections.emptySet()); } - /** - * @deprecated //TODO Will be removed on Vespa 8 - */ - @Deprecated - public DocumentType(String name, StructDataType headerType, StructDataType bodyType) { - this(name, headerType, Collections.emptySet()); - } - public DocumentType(String name, StructDataType headerType, Set<String> importedFieldNames) { super(name); this.headerType = headerType; this.importedFieldNames = Collections.unmodifiableSet(importedFieldNames); } - /** - * @deprecated //TODO Will be removed on Vespa 8 - */ - @Deprecated - public DocumentType(String name, StructDataType headerType, - StructDataType bodyType, Set<String> importedFieldNames) { - this(name, headerType, importedFieldNames); - } - public DocumentType(String name, Set<String> importedFieldNames) { this(name, createHeaderStructType(name), importedFieldNames); } @@ -185,12 +168,6 @@ public class DocumentType extends StructuredDataType { } } - /** @deprecated use contentStruct instead */ - @Deprecated // TODO: Remove on Vespa 8 - public StructDataType getHeaderType() { - return contentStruct(); - } - @Override protected void register(DocumentTypeManager manager, List<DataType> seenTypes) { seenTypes.add(this); diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java index 880d8f3fab0..f1203323cad 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java @@ -40,7 +40,6 @@ public class DocumentTypeManager { private final static Logger log = Logger.getLogger(DocumentTypeManager.class.getName()); - private ConfigSubscriber subscriber; // *Configured data types* (not built-in/primitive) indexed by their id // @@ -72,16 +71,6 @@ public class DocumentTypeManager { annotationTypeRegistry = other.annotationTypeRegistry; } - /** - * For testing, use fromFile factory method instead - * @deprecated //TODO Will be package-private or removed on Vespa 8 - */ - @Deprecated - public DocumentTypeManager configure(String configId) { - subscriber = DocumentTypeManagerConfigurer.configure(this, configId); - return this; - } - /** Only for unit tests */ public static DocumentTypeManager fromFile(String fileName) { var manager = new DocumentTypeManager(); @@ -126,21 +115,12 @@ public class DocumentTypeManager { /** * @deprecated //TODO Will be package-private or removed on Vespa 8 - */ - @Deprecated - public boolean hasDataType(int code) { - if (code == DataType.tensorDataTypeCode) return true; // built-in dynamic: Always present - return dataTypes.containsKey(code); - } - - /** - * @deprecated //TODO Will be package-private or removed on Vespa 8 * Use constants and factories in DataType instead. * For structs, use getStructType() in DocumentType. * For annotation payloads, use getDataType() in AnnotationType. **/ @Deprecated - public DataType getDataType(String name) { + DataType getDataType(String name) { var type = getDataTypeInternal(name); if (type == null) { throw new IllegalArgumentException("No datatype named " + name); @@ -189,7 +169,7 @@ public class DocumentTypeManager { * @deprecated //TODO Will be package-private or removed on Vespa 8 */ @Deprecated - public DataType getDataType(int code) { return getDataType(code, ""); } + DataType getDataType(int code) { return getDataType(code, ""); } /** * Return a data type instance @@ -201,7 +181,7 @@ public class DocumentTypeManager { * @deprecated //TODO Will be package-private or removed on Vespa 8 */ @Deprecated - public DataType getDataType(int code, String detailedType) { + DataType getDataType(int code, String detailedType) { if (code == DataType.tensorDataTypeCode) // built-in dynamic return new TensorDataType(TensorType.fromSpec(detailedType)); @@ -325,7 +305,7 @@ public class DocumentTypeManager { * @deprecated //TODO Will be package-private or removed on Vespa 8 */ @Deprecated - public void clear() { + void clear() { documentTypes.clear(); dataTypes.clear(); registerDefaultDataTypes(); @@ -335,11 +315,4 @@ public class DocumentTypeManager { return annotationTypeRegistry; } - /** - * @deprecated //TODO Will be package-private or removed on Vespa 8 - */ - @Deprecated - public void shutdown() { - if (subscriber!=null) subscriber.close(); - } } diff --git a/document/src/main/java/com/yahoo/document/Field.java b/document/src/main/java/com/yahoo/document/Field.java index a45afea6747..4d508bdc586 100644 --- a/document/src/main/java/com/yahoo/document/Field.java +++ b/document/src/main/java/com/yahoo/document/Field.java @@ -201,16 +201,6 @@ public class Field extends FieldBase implements FieldSet, Comparable, Serializab return forcedId; } - /** @deprecated this has no longer any semantic meaning as this is no longer an aspect with a field */ - @Deprecated // TODO: Remove on Vespa 8 - public boolean isHeader() { - return true; - } - - /** @deprecated this has no longer any semantic meaning as this is no longer an aspect with a field */ - @Deprecated // TODO: Remove on Vespa 8 - public void setHeader(boolean header) { } - /** Two fields are equal if they have the same name and the same data type */ @Override public boolean equals(Object o) { diff --git a/document/src/main/java/com/yahoo/document/MapDataType.java b/document/src/main/java/com/yahoo/document/MapDataType.java index 97a533def8d..457ae084107 100644 --- a/document/src/main/java/com/yahoo/document/MapDataType.java +++ b/document/src/main/java/com/yahoo/document/MapDataType.java @@ -52,26 +52,6 @@ public class MapDataType extends DataType { return valueType; } - /** - * WARNING! Do not use! Only to be used by config system! - * Sets the key type of this MapDataType. - * @deprecated // TODO Vespa 8 remove - */ - @Deprecated(forRemoval = true, since = "7") - public void setKeyType(DataType keyType) { - this.keyType = keyType; - } - - /** - * WARNING! Do not use! Only to be used by config system! - * Sets the value type of this MapDataType. - * @deprecated // TODO Vespa 8 remove - */ - @Deprecated(forRemoval = true, since = "7") - public void setValueType(DataType valueType) { - this.valueType = valueType; - } - @Override public MapFieldValue createFieldValue() { return new MapFieldValue(this); diff --git a/document/src/main/java/com/yahoo/document/PositionDataType.java b/document/src/main/java/com/yahoo/document/PositionDataType.java index f81dffa3837..80c33b4f475 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 Vespa 8, consider renaming to _position to use a field name that is actually legal + // Only used in v7 legacy mode, remove in Vespa 9 return fieldName + ".position"; } public static String getDistanceSummaryFieldName(String fieldName) { - // TODO for Vespa 8, consider renaming to _distance to use a field name that is actually legal + // Only used in v7 legacy mode, remove in Vespa 9 return fieldName + ".distance"; } diff --git a/document/src/main/java/com/yahoo/document/WeightedSetDataType.java b/document/src/main/java/com/yahoo/document/WeightedSetDataType.java index b21f059bd7d..04ec779bc16 100644 --- a/document/src/main/java/com/yahoo/document/WeightedSetDataType.java +++ b/document/src/main/java/com/yahoo/document/WeightedSetDataType.java @@ -43,16 +43,6 @@ public class WeightedSetDataType extends CollectionDataType { } } - /* - * @deprecated // TODO remove on Vespa 8 - * Do not use - use one of the constructors above. - * Note: ignores typeName argument. - */ - @Deprecated - public WeightedSetDataType(String typeName, int code, DataType nestedType, boolean createIfNonExistent, boolean removeIfZero) { - this(nestedType, createIfNonExistent, removeIfZero, code); - } - @Override public WeightedSetDataType clone() { return (WeightedSetDataType) super.clone(); diff --git a/document/src/test/java/com/yahoo/document/DocumentTestCase.java b/document/src/test/java/com/yahoo/document/DocumentTestCase.java index 47605264d44..3c1c7ae86e5 100644 --- a/document/src/test/java/com/yahoo/document/DocumentTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentTestCase.java @@ -884,9 +884,7 @@ public class DocumentTestCase extends DocumentTestCaseBase { int size_uncompressed; { - DocumentTypeManager docMan = new DocumentTypeManager(); - docMan.configure("file:src/tests/data/cppdocument.cfg"); - + DocumentTypeManager docMan = DocumentTypeManager.fromFile("src/tests/data/cppdocument.cfg"); Document doc = new Document(docMan.getDocumentType("serializetest"), new DocumentId("id:ns:serializetest::test")); doc.setFieldValue("stringfield", @@ -897,9 +895,7 @@ public class DocumentTestCase extends DocumentTestCaseBase { size_uncompressed = data.position(); } - DocumentTypeManager docMan = new DocumentTypeManager(); - docMan.configure("file:src/tests/data/compressed.cfg"); - + DocumentTypeManager docMan = DocumentTypeManager.fromFile("src/tests/data/compressed.cfg"); Document doc = new Document(docMan.getDocumentType("serializetest"), new DocumentId("id:ns:serializetest::test")); doc.setFieldValue("stringfield", |