/** * Remove the constraint (and associated information) for the table * descriptor. * * @param desc * {@link HTableDescriptor} to modify * @param clazz * {@link Constraint} class to remove */ public static void remove(HTableDescriptor desc, Class<? extends Constraint> clazz) { String key = serializeConstraintClass(clazz); desc.remove(key); }
/** * Get the kv {@link Entry} in the descriptor for the specified class * * @param desc {@link HTableDescriptor} to read * @param clazz To search for * @return The {@link Pair} of {@literal <key, value>} in the table, if that class is * present. {@code NULL} otherwise. */ private static Pair<String, String> getKeyValueForClass( HTableDescriptor desc, Class<? extends Constraint> clazz) { // get the serialized version of the constraint String key = serializeConstraintClass(clazz); String value = desc.getValue(key); return value == null ? null : new Pair<>(key, value); }
/** * Write the raw constraint and configuration to the descriptor. * <p> * This method takes care of creating a new configuration based on the passed * in configuration and then updating that with enabled and priority of the * constraint. * <p> * When a constraint is added, it is automatically enabled. */ private static void addConstraint(HTableDescriptor desc, Class<? extends Constraint> clazz, Configuration conf, long priority) throws IOException { writeConstraint(desc, serializeConstraintClass(clazz), configure(conf, true, priority)); }
/** * Remove the constraint (and associated information) for the table * descriptor. * * @param desc * {@link HTableDescriptor} to modify * @param clazz * {@link Constraint} class to remove */ public static void remove(HTableDescriptor desc, Class<? extends Constraint> clazz) { String key = serializeConstraintClass(clazz); desc.remove(key); }
/** * Remove the constraint (and associated information) for the table * descriptor. * * @param desc * {@link HTableDescriptor} to modify * @param clazz * {@link Constraint} class to remove */ public static void remove(HTableDescriptor desc, Class<? extends Constraint> clazz) { String key = serializeConstraintClass(clazz); desc.remove(key); }
/** * Write the raw constraint and configuration to the descriptor. * <p> * This method takes care of creating a new configuration based on the passed * in configuration and then updating that with enabled and priority of the * constraint. * <p> * When a constraint is added, it is automatically enabled. */ private static void addConstraint(HTableDescriptor desc, Class<? extends Constraint> clazz, Configuration conf, long priority) throws IOException { writeConstraint(desc, serializeConstraintClass(clazz), configure(conf, true, priority)); }
/** * Write the raw constraint and configuration to the descriptor. * <p> * This method takes care of creating a new configuration based on the passed * in configuration and then updating that with enabled and priority of the * constraint. * <p> * When a constraint is added, it is automatically enabled. */ private static void addConstraint(HTableDescriptor desc, Class<? extends Constraint> clazz, Configuration conf, long priority) throws IOException { writeConstraint(desc, serializeConstraintClass(clazz), configure(conf, true, priority)); }
/** * Get the kv {@link Entry} in the descriptor for the specified class * * @param desc * {@link HTableDescriptor} to read * @param clazz * to search for * @return the {@link Pair} of <key, value> in the table, if that class is * present. <tt>null</tt> otherwise. */ private static Pair<String, String> getKeyValueForClass( HTableDescriptor desc, Class<? extends Constraint> clazz) { // get the serialized version of the constraint String key = serializeConstraintClass(clazz); String value = desc.getValue(key); return value == null ? null : new Pair<String, String>(key, value); }
/** * Get the kv {@link Entry} in the descriptor for the specified class * * @param desc * {@link HTableDescriptor} to read * @param clazz * to search for * @return the {@link Pair} of <key, value> in the table, if that class is * present. <tt>null</tt> otherwise. */ private static Pair<String, String> getKeyValueForClass( HTableDescriptor desc, Class<? extends Constraint> clazz) { // get the serialized version of the constraint String key = serializeConstraintClass(clazz); String value = desc.getValue(key); return value == null ? null : new Pair<String, String>(key, value); }