public static <T extends Serializable> void registerType(final int slot, Class<T> clazz) {
    synchronized (REGISTERED) {
      Type<T> ntype = new Type<>(clazz);
      ntype.slot = slot;
      if (slot >= 255) {
        throw new IllegalArgumentException(ntype + "@" + slot + ": can not register more than 254 types");
      }
      List<Type<?>> types = REGISTERED;
      while (types.size() <= slot) {
        types.add(null);
      }
      if (types.get(slot) != null) {
        throw new IllegalArgumentException(ntype + "@" + slot + ": slot already used by " + types.get(slot));
      }
      types.set(slot, ntype);
      TYPES.put(clazz.getName(), ntype);
    }
  }
Registers a pre-defined class (known to be used throughout the whole application).
@param <T> the type
@param slot the slot number
@param clazz the class
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/SerializationProxy.java