@SuppressWarnings("unchecked")
  protected Type<T> readType(DataInput in) throws IOException {
    final Type<T> type;
    String className = "?";
    int slot = (int) in.readByte() & 0xff;
    if (slot == 255) {
      className = in.readUTF();
      type = (Type<T>) TYPES.computeIfAbsent(className, this::createType);
    } else if (slot < REGISTERED.size()) {
      type = (Type<T>) REGISTERED.get(slot);
    } else {
      type = null;
    }
    if (type == null) {
      throw new ProxyException("can not resolve class @ " + slot +", " + className);
    }
    return type;
  }
When reading an instance, fetch the type through the canonical class name that was persisted.
@param in the input
@throws IOException on read error
@throws ProxyException if class was expected to be registered but can not be found
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/SerializationProxy.java