/** * 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)); }
/** * Change the whether the constraint (if it is already present) is enabled or * disabled. */ private static void changeConstraintEnabled(HTableDescriptor desc, Class<? extends Constraint> clazz, boolean enabled) throws IOException { // get the original constraint Pair<String, String> entry = getKeyValueForClass(desc, clazz); if (entry == null) { throw new IllegalArgumentException("Constraint: " + clazz.getName() + " is not associated with this table. You can't enable it!"); } // create a new configuration from that conf Configuration conf = readConfiguration(entry.getSecond()); // set that it is enabled conf.setBoolean(ENABLED_KEY, enabled); // write it back out writeConstraint(desc, entry.getFirst(), conf); }
writeConstraint(desc, e.getFirst(), conf);
/** * 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)); }
/** * Change the whether the constraint (if it is already present) is enabled or * disabled. */ private static void changeConstraintEnabled(HTableDescriptor desc, Class<? extends Constraint> clazz, boolean enabled) throws IOException { // get the original constraint Pair<String, String> entry = getKeyValueForClass(desc, clazz); if (entry == null) { throw new IllegalArgumentException("Constraint: " + clazz.getName() + " is not associated with this table. You can't enable it!"); } // create a new configuration from that conf Configuration conf = readConfiguration(entry.getSecond()); // set that it is enabled conf.setBoolean(ENABLED_KEY, enabled); // write it back out writeConstraint(desc, entry.getFirst(), conf); }
/** * Change the whether the constraint (if it is already present) is enabled or * disabled. */ private static void changeConstraintEnabled(HTableDescriptor desc, Class<? extends Constraint> clazz, boolean enabled) throws IOException { // get the original constraint Pair<String, String> entry = getKeyValueForClass(desc, clazz); if (entry == null) { throw new IllegalArgumentException("Constraint: " + clazz.getName() + " is not associated with this table. You can't enable it!"); } // create a new configuration from that conf Configuration conf = readConfiguration(entry.getSecond()); // set that it is enabled conf.setBoolean(ENABLED_KEY, enabled); // write it back out writeConstraint(desc, entry.getFirst(), conf); }
writeConstraint(desc, e.getFirst(), conf);
writeConstraint(desc, e.getFirst(), conf);