Make entities serializable for DB validation (#1401)

* Make entities serializable for DB validation

Make entities that are asynchronously replicated between Datastore and
Cloud SQL serializable so that they may be used in BEAM pipeline based
comparison tool.

Introduced an UnsafeSerializable interface (extending Serializable) and
added to relevant classes. Implementing classes are allowed some
shortcuts as explained in the interface's Javadoc. Post migration we
will decide whether to revert this change or properly implement
serialization.

Verified with production data.
This commit is contained in:
Weimin Yu 2021-10-28 12:19:09 -04:00 committed by GitHub
parent 1e7aae26a3
commit 93a479837f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 333 additions and 62 deletions

View file

@ -65,5 +65,10 @@ public final class SerializeUtils {
}
}
/** Serializes an object then deserializes it. This is typically used in tests. */
public static Object serializeDeserialize(Object object) {
return deserialize(Object.class, serialize(object));
}
private SerializeUtils() {}
}