Skip to content

Commit

Permalink
I think this ought to work.
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Hughes <[email protected]>
  • Loading branch information
Jim Hughes committed Nov 16, 2021
1 parent e25c3dd commit 52c82c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
}
Expand Down

0 comments on commit 52c82c7

Please sign in to comment.