From e905a40f377d98beaef8fb76018dc75e82d9f643 Mon Sep 17 00:00:00 2001 From: foster33 Date: Mon, 22 Jul 2024 13:18:35 +0000 Subject: [PATCH 1/3] Add more descriptive types to the data dictionary --- pom.xml | 6 ++++++ .../java/datawave/data/type/AbstractGeometryType.java | 11 +++++++++-- src/main/java/datawave/data/type/DateType.java | 9 ++++++++- src/main/java/datawave/data/type/GeoLatType.java | 9 ++++++++- src/main/java/datawave/data/type/GeoLonType.java | 9 ++++++++- src/main/java/datawave/data/type/GeoType.java | 9 ++++++++- src/main/java/datawave/data/type/GeometryType.java | 9 ++++++++- src/main/java/datawave/data/type/HexStringType.java | 9 ++++++++- src/main/java/datawave/data/type/IpAddressType.java | 9 ++++++++- src/main/java/datawave/data/type/IpV4AddressType.java | 9 ++++++++- .../datawave/data/type/LcNoDiacriticsListType.java | 9 ++++++++- .../java/datawave/data/type/LcNoDiacriticsType.java | 9 ++++++++- src/main/java/datawave/data/type/LcType.java | 9 ++++++++- src/main/java/datawave/data/type/ListType.java | 10 +++++++++- src/main/java/datawave/data/type/MacAddressType.java | 9 ++++++++- src/main/java/datawave/data/type/NumberListType.java | 10 +++++++++- src/main/java/datawave/data/type/NumberType.java | 9 ++++++++- src/main/java/datawave/data/type/PointType.java | 10 +++++++++- src/main/java/datawave/data/type/RawDateType.java | 9 ++++++++- src/main/java/datawave/data/type/StringType.java | 9 ++++++++- .../java/datawave/data/type/TrimLeadingZerosType.java | 9 ++++++++- .../data/type/util/TypePrettyNameSupplier.java | 7 +++++++ 22 files changed, 177 insertions(+), 21 deletions(-) create mode 100644 src/main/java/datawave/data/type/util/TypePrettyNameSupplier.java diff --git a/pom.xml b/pom.xml index 28c63a3..8db5969 100644 --- a/pom.xml +++ b/pom.xml @@ -148,6 +148,12 @@ org.locationtech.geowave geowave-core-geotime + + + slf4j-reload4j + org.slf4j + + org.locationtech.jts diff --git a/src/main/java/datawave/data/type/AbstractGeometryType.java b/src/main/java/datawave/data/type/AbstractGeometryType.java index 27970ca..0698b33 100644 --- a/src/main/java/datawave/data/type/AbstractGeometryType.java +++ b/src/main/java/datawave/data/type/AbstractGeometryType.java @@ -9,8 +9,8 @@ import datawave.data.normalizer.DiscreteIndexNormalizer; import datawave.data.normalizer.Normalizer; -import datawave.data.normalizer.OneToManyNormalizer; import datawave.data.type.util.AbstractGeometry; +import datawave.data.type.util.TypePrettyNameSupplier; /** * The base GeoWave geometry type, which provides an implementation for the discrete index type interface. @@ -18,12 +18,14 @@ * @param * The underlying geometry type */ -public abstract class AbstractGeometryType> extends BaseType implements DiscreteIndexType { +public abstract class AbstractGeometryType> extends BaseType + implements DiscreteIndexType, TypePrettyNameSupplier { private static final long GEOMETRY_FACTORY_SIZE = 120; private static final long ENVELOPE_SIZE = 45; private static final long GEOMETRY_BASE_SIZE = ENVELOPE_SIZE + 20; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF + Sizer.REFERENCE + GEOMETRY_FACTORY_SIZE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Abstract Geometry"; public AbstractGeometryType(Normalizer normalizer) { super(normalizer); @@ -96,4 +98,9 @@ public long sizeInBytes() { } return size; } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/DateType.java b/src/main/java/datawave/data/type/DateType.java index 2659ef0..d80191d 100644 --- a/src/main/java/datawave/data/type/DateType.java +++ b/src/main/java/datawave/data/type/DateType.java @@ -3,11 +3,13 @@ import java.util.Date; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class DateType extends BaseType { +public class DateType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = 936566410691643144L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF + PrecomputedSizes.DATE_STATIC_REF + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Date"; public DateType() { super(Normalizer.DATE_NORMALIZER); @@ -33,4 +35,9 @@ public String getDelegateAsString() { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/GeoLatType.java b/src/main/java/datawave/data/type/GeoLatType.java index e292c00..dc3d4a6 100644 --- a/src/main/java/datawave/data/type/GeoLatType.java +++ b/src/main/java/datawave/data/type/GeoLatType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class GeoLatType extends BaseType { +public class GeoLatType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = -2775239290833908032L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Latitude"; public GeoLatType() { super(Normalizer.GEO_LAT_NORMALIZER); @@ -20,4 +22,9 @@ public GeoLatType() { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/GeoLonType.java b/src/main/java/datawave/data/type/GeoLonType.java index 2d34ff5..b94a0d4 100644 --- a/src/main/java/datawave/data/type/GeoLonType.java +++ b/src/main/java/datawave/data/type/GeoLonType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class GeoLonType extends BaseType { +public class GeoLonType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = 8912983433360105604L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Longitude"; public GeoLonType() { super(Normalizer.GEO_LON_NORMALIZER); @@ -20,4 +22,9 @@ public GeoLonType() { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/GeoType.java b/src/main/java/datawave/data/type/GeoType.java index 85d1419..fee8121 100644 --- a/src/main/java/datawave/data/type/GeoType.java +++ b/src/main/java/datawave/data/type/GeoType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class GeoType extends BaseType { +public class GeoType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = 8429780512238258642L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Geo"; public GeoType() { super(Normalizer.GEO_NORMALIZER); @@ -20,4 +22,9 @@ public GeoType() { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/GeometryType.java b/src/main/java/datawave/data/type/GeometryType.java index 23e6e69..60abeb0 100644 --- a/src/main/java/datawave/data/type/GeometryType.java +++ b/src/main/java/datawave/data/type/GeometryType.java @@ -5,14 +5,16 @@ import datawave.data.normalizer.Normalizer; import datawave.data.normalizer.OneToManyNormalizer; import datawave.data.type.util.Geometry; +import datawave.data.type.util.TypePrettyNameSupplier; /** * Provides inclusive support for all geometry types. OneToManyNormalizer support is needed as lines and polygons are likely to produce multiple normalized * values during ingest. */ -public class GeometryType extends AbstractGeometryType implements OneToManyNormalizerType { +public class GeometryType extends AbstractGeometryType implements OneToManyNormalizerType, TypePrettyNameSupplier { protected List normalizedValues; + private static final String DATA_DICTIONARY_TYPE_NAME = "Geometry"; public GeometryType() { super(Normalizer.GEOMETRY_NORMALIZER); @@ -40,4 +42,9 @@ public List getNormalizedValues() { public boolean expandAtQueryTime() { return false; } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/HexStringType.java b/src/main/java/datawave/data/type/HexStringType.java index 6528a5b..b7c6bd0 100644 --- a/src/main/java/datawave/data/type/HexStringType.java +++ b/src/main/java/datawave/data/type/HexStringType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class HexStringType extends BaseType { +public class HexStringType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = -3480716807342380164L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Hex String"; public HexStringType() { super(Normalizer.HEX_STRING_NORMALIZER); @@ -20,4 +22,9 @@ public HexStringType() { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/IpAddressType.java b/src/main/java/datawave/data/type/IpAddressType.java index b0337b3..43c372d 100644 --- a/src/main/java/datawave/data/type/IpAddressType.java +++ b/src/main/java/datawave/data/type/IpAddressType.java @@ -5,11 +5,13 @@ import datawave.data.type.util.IpAddress; import datawave.data.type.util.IpV4Address; import datawave.data.type.util.IpV6Address; +import datawave.data.type.util.TypePrettyNameSupplier; -public class IpAddressType extends BaseType { +public class IpAddressType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = -6512690642978201801L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "IP Address"; public IpAddressType() { super(Normalizer.IP_ADDRESS_NORMALIZER); @@ -42,4 +44,9 @@ public long sizeInBytes() { } return base + ipSize; } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/IpV4AddressType.java b/src/main/java/datawave/data/type/IpV4AddressType.java index 199e560..6aed9a3 100644 --- a/src/main/java/datawave/data/type/IpV4AddressType.java +++ b/src/main/java/datawave/data/type/IpV4AddressType.java @@ -4,11 +4,13 @@ import datawave.data.type.util.IpAddress; import datawave.data.type.util.IpV4Address; import datawave.data.type.util.IpV6Address; +import datawave.data.type.util.TypePrettyNameSupplier; -public class IpV4AddressType extends BaseType { +public class IpV4AddressType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = 7214683578627273557L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "IPv4 Address"; public IpV4AddressType() { super(Normalizer.IP_ADDRESS_NORMALIZER); @@ -33,4 +35,9 @@ public long sizeInBytes() { } return base + ipSize; } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/LcNoDiacriticsListType.java b/src/main/java/datawave/data/type/LcNoDiacriticsListType.java index d9f33b2..36768dc 100644 --- a/src/main/java/datawave/data/type/LcNoDiacriticsListType.java +++ b/src/main/java/datawave/data/type/LcNoDiacriticsListType.java @@ -1,8 +1,11 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class LcNoDiacriticsListType extends ListType { +public class LcNoDiacriticsListType extends ListType implements TypePrettyNameSupplier { + + private static final String DATA_DICTIONARY_TYPE_NAME = "Text List"; public LcNoDiacriticsListType() { super(Normalizer.LC_NO_DIACRITICS_NORMALIZER); @@ -12,4 +15,8 @@ public LcNoDiacriticsListType(String delegateString) { super(delegateString, Normalizer.LC_NO_DIACRITICS_NORMALIZER); } + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/LcNoDiacriticsType.java b/src/main/java/datawave/data/type/LcNoDiacriticsType.java index 5f60475..1ad30e4 100644 --- a/src/main/java/datawave/data/type/LcNoDiacriticsType.java +++ b/src/main/java/datawave/data/type/LcNoDiacriticsType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class LcNoDiacriticsType extends BaseType { +public class LcNoDiacriticsType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = -6219894926244790742L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Text"; public LcNoDiacriticsType() { super(Normalizer.LC_NO_DIACRITICS_NORMALIZER); @@ -24,4 +26,9 @@ public LcNoDiacriticsType(String delegateString) { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/LcType.java b/src/main/java/datawave/data/type/LcType.java index 7b2d3e4..4772479 100644 --- a/src/main/java/datawave/data/type/LcType.java +++ b/src/main/java/datawave/data/type/LcType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class LcType extends BaseType { +public class LcType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = -5102714749195917406L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Lower Case Text"; public LcType() { super(Normalizer.LC_NORMALIZER); @@ -24,4 +26,9 @@ public LcType(String delegateString) { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/ListType.java b/src/main/java/datawave/data/type/ListType.java index e9a9a06..713513a 100644 --- a/src/main/java/datawave/data/type/ListType.java +++ b/src/main/java/datawave/data/type/ListType.java @@ -4,11 +4,14 @@ import java.util.List; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; import datawave.util.StringUtils; -public abstract class ListType extends BaseType implements OneToManyNormalizerType { +public abstract class ListType extends BaseType implements OneToManyNormalizerType, TypePrettyNameSupplier { + protected static final String delimiter = ",|;"; List normalizedValues; + private static final String DATA_DICTIONARY_TYPE_NAME = "List"; public ListType(Normalizer normalizer) { super(normalizer); @@ -48,4 +51,9 @@ public List getNormalizedValues() { public boolean expandAtQueryTime() { return false; } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/MacAddressType.java b/src/main/java/datawave/data/type/MacAddressType.java index 5095b8b..cf51734 100644 --- a/src/main/java/datawave/data/type/MacAddressType.java +++ b/src/main/java/datawave/data/type/MacAddressType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class MacAddressType extends BaseType { +public class MacAddressType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = -6743560287574389073L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "MAC Address"; public MacAddressType() { super(Normalizer.MAC_ADDRESS_NORMALIZER); @@ -20,4 +22,9 @@ public MacAddressType() { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/NumberListType.java b/src/main/java/datawave/data/type/NumberListType.java index 1331d95..f6edb69 100644 --- a/src/main/java/datawave/data/type/NumberListType.java +++ b/src/main/java/datawave/data/type/NumberListType.java @@ -1,8 +1,11 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class NumberListType extends ListType { +public class NumberListType extends ListType implements TypePrettyNameSupplier { + + private static final String DATA_DICTIONARY_TYPE_NAME = "Number List"; public NumberListType() { super(Normalizer.NUMBER_NORMALIZER); @@ -12,4 +15,9 @@ public NumberListType() { public boolean expandAtQueryTime() { return true; } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/NumberType.java b/src/main/java/datawave/data/type/NumberType.java index 8fdf359..e031d12 100644 --- a/src/main/java/datawave/data/type/NumberType.java +++ b/src/main/java/datawave/data/type/NumberType.java @@ -3,11 +3,13 @@ import java.math.BigDecimal; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class NumberType extends BaseType { +public class NumberType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = 1398451215614987988L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF + PrecomputedSizes.BIGDECIMAL_STATIC_REF + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Number"; public NumberType() { super(Normalizer.NUMBER_NORMALIZER); @@ -24,4 +26,9 @@ public NumberType(String delegateString) { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/PointType.java b/src/main/java/datawave/data/type/PointType.java index 36a3d01..3d6cf94 100644 --- a/src/main/java/datawave/data/type/PointType.java +++ b/src/main/java/datawave/data/type/PointType.java @@ -2,13 +2,21 @@ import datawave.data.normalizer.Normalizer; import datawave.data.type.util.Point; +import datawave.data.type.util.TypePrettyNameSupplier; /** * Provides support for point geometry types. Other geometry types are not compatible with this type. */ -public class PointType extends AbstractGeometryType { +public class PointType extends AbstractGeometryType implements TypePrettyNameSupplier { + + private static final String DATA_DICTIONARY_TYPE_NAME = "Point"; public PointType() { super(Normalizer.POINT_NORMALIZER); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/RawDateType.java b/src/main/java/datawave/data/type/RawDateType.java index e1b8946..b765b4b 100644 --- a/src/main/java/datawave/data/type/RawDateType.java +++ b/src/main/java/datawave/data/type/RawDateType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class RawDateType extends BaseType { +public class RawDateType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = 936566410691643144L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Raw Date"; public RawDateType() { super(Normalizer.RAW_DATE_NORMALIZER); @@ -25,4 +27,9 @@ public RawDateType(String dateString) { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/StringType.java b/src/main/java/datawave/data/type/StringType.java index fee9a90..9529a3d 100644 --- a/src/main/java/datawave/data/type/StringType.java +++ b/src/main/java/datawave/data/type/StringType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class StringType extends BaseType { +public class StringType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = 8143572646109171126L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "String"; public StringType() { super(Normalizer.LC_NO_DIACRITICS_NORMALIZER); @@ -20,4 +22,9 @@ public StringType() { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/TrimLeadingZerosType.java b/src/main/java/datawave/data/type/TrimLeadingZerosType.java index 3237bb1..f5095bc 100644 --- a/src/main/java/datawave/data/type/TrimLeadingZerosType.java +++ b/src/main/java/datawave/data/type/TrimLeadingZerosType.java @@ -1,11 +1,13 @@ package datawave.data.type; import datawave.data.normalizer.Normalizer; +import datawave.data.type.util.TypePrettyNameSupplier; -public class TrimLeadingZerosType extends BaseType { +public class TrimLeadingZerosType extends BaseType implements TypePrettyNameSupplier { private static final long serialVersionUID = -7425014359719165469L; private static final long STATIC_SIZE = PrecomputedSizes.STRING_STATIC_REF * 2 + Sizer.REFERENCE; + private static final String DATA_DICTIONARY_TYPE_NAME = "Trimmed Number"; public TrimLeadingZerosType() { super(Normalizer.TRIM_LEADING_ZEROS_NORMALIZER); @@ -20,4 +22,9 @@ public TrimLeadingZerosType() { public long sizeInBytes() { return STATIC_SIZE + (2 * normalizedValue.length()) + (2 * delegate.length()); } + + @Override + public String getDataDictionaryTypeValue() { + return DATA_DICTIONARY_TYPE_NAME; + } } diff --git a/src/main/java/datawave/data/type/util/TypePrettyNameSupplier.java b/src/main/java/datawave/data/type/util/TypePrettyNameSupplier.java new file mode 100644 index 0000000..f16f4ad --- /dev/null +++ b/src/main/java/datawave/data/type/util/TypePrettyNameSupplier.java @@ -0,0 +1,7 @@ +package datawave.data.type.util; + +public interface TypePrettyNameSupplier { + String getDataDictionaryTypeValue(); + + public static final String DEFAULT_DATA_DICTIONARY_NAME = "Default"; +} From 7404129705d9edf7ef3007ceecc94e5fac8b3846 Mon Sep 17 00:00:00 2001 From: foster33 <84727868+foster33@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:21:53 +0000 Subject: [PATCH 2/3] bump version & dependency change --- pom.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 4ae3961..3d1ab15 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ ../../../microservices/microservice-parent/pom.xml type-utils - 3.1.2-SNAPSHOT + 3.1.3-SNAPSHOT https://code.nsa.gov/datawave-type-utils @@ -148,12 +148,6 @@ org.locationtech.geowave geowave-core-geotime - - - slf4j-reload4j - org.slf4j - - org.locationtech.jts From 5303965a31a96bc27120833e2c696491b101352a Mon Sep 17 00:00:00 2001 From: foster33 <84727868+foster33@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:59:28 +0000 Subject: [PATCH 3/3] Update the default value to Unknown --- .../java/datawave/data/type/util/TypePrettyNameSupplier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/datawave/data/type/util/TypePrettyNameSupplier.java b/src/main/java/datawave/data/type/util/TypePrettyNameSupplier.java index f16f4ad..f367852 100644 --- a/src/main/java/datawave/data/type/util/TypePrettyNameSupplier.java +++ b/src/main/java/datawave/data/type/util/TypePrettyNameSupplier.java @@ -3,5 +3,5 @@ public interface TypePrettyNameSupplier { String getDataDictionaryTypeValue(); - public static final String DEFAULT_DATA_DICTIONARY_NAME = "Default"; + public static final String DEFAULT_DATA_DICTIONARY_NAME = "Unknown"; }