code: public static HiveRegistrationPolicy getPolicy(State props) {
      Preconditions.checkArgument(props.contains(ConfigurationKeys.HIVE_REGISTRATION_POLICY));
  
      String policyType = props.getProp(ConfigurationKeys.HIVE_REGISTRATION_POLICY);
      try {
        return (HiveRegistrationPolicy) ConstructorUtils.invokeConstructor(Class.forName(policyType), props);
      } catch (ReflectiveOperationException e) {
        throw new RuntimeException(
            "Unable to instantiate " + HiveRegistrationPolicy.class.getSimpleName() + " with type " + policyType, e);
      }
    }
docs: Get a {@link HiveRegistrationPolicy} from a {@link State} object.
  
  @param props A {@link State} object that contains property, {@link #HIVE_REGISTRATION_POLICY},
  which is the class name of the desired policy. This policy class must have a constructor that
  takes a {@link State} object.