@InterfaceAudience.Private public interface Constraint extends org.apache.hadoop.conf.Configurable
Constraint(in traditional database terminology) to a HTable. Any number of
Constraintscan be added to the table, in any order.
Constraint must be added to a table before the table is loaded via
Constraints.add(HTableDescriptor, Class...) or
(if you want to add a configuration with the
will be run in the order that they are added. Further, a Constraint will be
configured before it is run (on load).
Constraints.enableConstraint(HTableDescriptor, Class) and
Constraints.disableConstraint(HTableDescriptor, Class) for
enabling/disabling of a given
Constraint after it has been added.
Put is invalid, the Constraint should throw some sort of
Put has failed. When
this exception is thrown, not further retries of the
attempted nor are any other
Constraints attempted (the
Put is clearly not valid). Therefore, there are performance
implications in the order in which
Constraint fails to fail the
Put via a
ConstraintException, but instead
the entire constraint processing mechanism (
be unloaded from the table. This ensures that the region server is still
functional, but no more
Puts will be checked via
Constraints should probably not be used to
enforce cross-table references as it will cause tremendous write slowdowns,
but it is possible.
NOTE: Implementing classes must have a nullary (no-args) constructor
void check(Put p) throws ConstraintException
Putto ensure it is valid for the table. If the
Putis valid, then just return from the method. Otherwise, throw an
Exceptionspecifying what happened. This
Exceptionis propagated back to the client so you can see what caused the
Copyright © 2007–2018 Cloudera. All rights reserved.