diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-06-02 10:40:41 +0000 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-06-08 11:45:24 +0200 |
commit | 338d383d81ee6b142b308ef8798b44374b480838 (patch) | |
tree | 0af5af65e84a05fb2f8fbdcb1050b9d5db793937 /document/src/main/java | |
parent | 9e330c98d573866f162ef76207a8699d76d634c4 (diff) |
remove TemporaryStructuredDataType
Diffstat (limited to 'document/src/main/java')
3 files changed, 0 insertions, 75 deletions
diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java index 42bc27e485b..277f0927be1 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java @@ -235,9 +235,6 @@ public class DocumentTypeManager { @SuppressWarnings("deprecation") void registerSingleType(DataType type) { if (type instanceof TensorDataType) return; // built-in dynamic: Created on the fly - if (type instanceof TemporaryStructuredDataType) { - throw new IllegalArgumentException("TemporaryStructuredDataType no longer supported: " + type); - } if (dataTypes.containsKey(type.getId())) { DataType existingType = dataTypes.get(type.getId()); if ((existingType == type) || existingType.equals(type)) { diff --git a/document/src/main/java/com/yahoo/document/ReferenceDataType.java b/document/src/main/java/com/yahoo/document/ReferenceDataType.java index c3b5f6590b6..8cf6b665acf 100644 --- a/document/src/main/java/com/yahoo/document/ReferenceDataType.java +++ b/document/src/main/java/com/yahoo/document/ReferenceDataType.java @@ -22,16 +22,6 @@ public class ReferenceDataType extends DataType { this((StructuredDataType)targetType, id); } - /** - * Constructor used when building a multi document type model where the concrete instance - * of the target document type might not yet be known. The temporary data type should be - * replaced later using setTargetType(). - */ - @SuppressWarnings("deprecation") - public ReferenceDataType(TemporaryStructuredDataType temporaryTargetType, int id) { - this((StructuredDataType) temporaryTargetType, id); - } - private ReferenceDataType(StructuredDataType targetType, int id) { super(buildTypeName(targetType), id); this.targetType = targetType; @@ -52,34 +42,8 @@ public class ReferenceDataType extends DataType { return new ReferenceDataType(targetType); } - /** - * Creates a new type where the numeric ID is based on the hash of targetType - */ - @SuppressWarnings("deprecation") - public static ReferenceDataType createWithInferredId(TemporaryStructuredDataType targetType) { - return new ReferenceDataType(targetType); - } - public StructuredDataType getTargetType() { return targetType; } - /** - * Overrides the stored temporary data type with a concrete StructuredDataType instance. Should only - * be invoked from configuration or model code when resolving temporary types. - * - * @throws IllegalStateException if the previously stored target type is already a concrete - * instance (not TemporaryStructuredDataType). - */ - @SuppressWarnings("deprecation") - public void setTargetType(StructuredDataType targetType) { - if (! (this.targetType instanceof TemporaryStructuredDataType)) { - throw new IllegalStateException(String.format( - "Unexpected attempt to replace already concrete target " + - "type in ReferenceDataType instance (type is '%s')", this.targetType.getName())); - } - this.targetType = targetType; - setName(buildTypeName(targetType)); - } - @Override public ReferenceFieldValue createFieldValue() { return new ReferenceFieldValue(this); diff --git a/document/src/main/java/com/yahoo/document/TemporaryStructuredDataType.java b/document/src/main/java/com/yahoo/document/TemporaryStructuredDataType.java deleted file mode 100644 index 865310e7009..00000000000 --- a/document/src/main/java/com/yahoo/document/TemporaryStructuredDataType.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.document; - -/** - * Internal class, DO NOT USE!! - * Only public because it must be used from com.yahoo.searchdefinition.parser. - * - * @deprecated will be removed soon - * @author Einar M R Rosenvinge - */ -@Deprecated // TODO: Remove on Vespa 8 -public class TemporaryStructuredDataType extends StructDataType { - - TemporaryStructuredDataType(String name) { - super(name); - } - - private TemporaryStructuredDataType(int id) { - super(id, "temporary_struct_" + id); - } - - public static TemporaryStructuredDataType create(String name) { - return new TemporaryStructuredDataType(name); - } - - public static TemporaryStructuredDataType createById(int id) { - return new TemporaryStructuredDataType(id); - } - - @Override - protected void setName(String name) { - super.setName(name); - setId(createId(getName())); - } - -} |