From 52c82c7e3ea410c1798c1832af47fbf0acd4e052 Mon Sep 17 00:00:00 2001 From: Jim Hughes Date: Tue, 16 Nov 2021 16:46:48 -0500 Subject: [PATCH] I think this ought to work. Signed-off-by: Jim Hughes --- .../geomesa/accumulo/iterators/KryoVisibilityRowEncoder.scala | 4 ++-- .../kryo/serialization/KryoUserDataSerialization.scala | 2 +- .../scala/org/locationtech/geomesa/index/api/QueryPlan.scala | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/iterators/KryoVisibilityRowEncoder.scala b/geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/iterators/KryoVisibilityRowEncoder.scala index b232ecec1adf..32fc651b4f3e 100644 --- a/geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/iterators/KryoVisibilityRowEncoder.scala +++ b/geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/iterators/KryoVisibilityRowEncoder.scala @@ -112,7 +112,7 @@ class KryoVisibilityRowEncoder extends RowEncodingIterator { // TODO: Calculate size of userData for vis. - length += 54 // 2 ($s) + 26 "geomesa.feature.visibility" + 2 "$s" + 19 "user,user,user,user" + 4 for two string sizes + length += 60 // 2 ($s) + 26 "geomesa.feature.visibility" + 2 "$s" + 19 "user,user,user,user" + 4 for two string sizes val value = Array.ofDim[Byte](length) val output = new Output(value) @@ -149,7 +149,7 @@ class KryoVisibilityRowEncoder extends RowEncodingIterator { // write nulls - we should already be in the right position nulls.serialize(output) println(s"Output at position after null writer: ${output.position()}") - output.setPosition(valueCursor-3) + output.setPosition(valueCursor-4) println(s"Output at position before userdata: ${output.position()}") KryoUserDataSerialization.serialize(output, map) diff --git a/geomesa-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/serialization/KryoUserDataSerialization.scala b/geomesa-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/serialization/KryoUserDataSerialization.scala index 582fc274cf6b..1404e14a8b49 100644 --- a/geomesa-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/serialization/KryoUserDataSerialization.scala +++ b/geomesa-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/serialization/KryoUserDataSerialization.scala @@ -97,7 +97,7 @@ object KryoUserDataSerialization extends LazyLogging { map } catch { case NonFatal(e) => - logger.error("Error reading serialized kryo user data:", e) + logger.error(s"Error reading serialized kryo user data at ${in.position()}:", e) new java.util.HashMap[AnyRef, AnyRef]() } } diff --git a/geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/api/QueryPlan.scala b/geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/api/QueryPlan.scala index 3bc64e23a43e..fd0f27b1106c 100644 --- a/geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/api/QueryPlan.scala +++ b/geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/api/QueryPlan.scala @@ -285,6 +285,7 @@ object QueryPlan { override def schema: SimpleFeatureType = sft protected def createSerializer: KryoFeatureSerializer = { + println(s"Creating serializer for sft: $sft") val builder = KryoFeatureSerializer.builder(sft) if (index.serializedWithId) { builder.withId.withUserData.build() } else { builder.withoutId.withUserData.build() } }