static List<? extends Constraint> getConstraints(TableDescriptor desc, ClassLoader classloader)
    throws IOException {
    List<Constraint> constraints = new ArrayList<>();
    // loop through all the key, values looking for constraints
    for (Map.Entry<Bytes, Bytes> e : desc.getValues().entrySet()) {
      // read out the constraint
      String key = Bytes.toString(e.getKey().get()).trim();
      String[] className = CONSTRAINT_HTD_ATTR_KEY_PATTERN.split(key);
      if (className.length == 2) {
        key = className[1];
        if (LOG.isDebugEnabled()) {
          LOG.debug("Loading constraint:" + key);
        }

        // read in the rest of the constraint
        Configuration conf;
        try {
          conf = readConfiguration(e.getValue().get());
        } catch (IOException e1) {
          // long that we don't have a valid configuration stored, and move on.
          LOG.warn("Corrupted configuration found for key:" + key + ",  skipping it.");
          continue;
        }
        // if it is not enabled, skip it
        if (!conf.getBoolean(ENABLED_KEY, false)) {
          LOG.debug("Constraint: {} is DISABLED - skipping it", key);
          // go to the next constraint
          continue;
        }

        try {
          // add the constraint, now that we expect it to be valid.
          Class<? extends Constraint> clazz =
            classloader.loadClass(key).asSubclass(Constraint.class);
          Constraint constraint = clazz.getDeclaredConstructor().newInstance();
          constraint.setConf(conf);
          constraints.add(constraint);
        } catch (InvocationTargetException | NoSuchMethodException | ClassNotFoundException
          | InstantiationException | IllegalAccessException e1) {
          throw new IOException(e1);
        }
      }
    }
    // sort them, based on the priorities
    Collections.sort(constraints, constraintComparator);
    return constraints;
  }
Get the constraints stored in the table descriptor
@param desc        To read from
@param classloader To use when loading classes. If a special classloader is used on a region,
                   for instance, then that should be the classloader used to load the
                   constraints. This could also apply to unit-testing situation, where want to
                   ensure that class is reloaded or not.
@return List of configured {@link Constraint Constraints}
@throws IOException if any part of reading/arguments fails
hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/Constraints.java