Tabnine Logo
Constraints.disable
Code IndexAdd Tabnine to your IDE (free)

How to use
disable
method
in
org.apache.hadoop.hbase.constraint.Constraints

Best Java code snippets using org.apache.hadoop.hbase.constraint.Constraints.disable (Showing top 7 results out of 315)

origin: apache/hbase

/**
 * Remove all {@link Constraint Constraints} that have been added to the table
 * and turn off the constraint processing.
 * <p>
 * All {@link Configuration Configurations} and their associated
 * {@link Constraint} are removed.
 * 
 * @param desc
 *          {@link HTableDescriptor} to remove {@link Constraint Constraints}
 *          from.
 */
public static void remove(HTableDescriptor desc) {
 // disable constraints
 disable(desc);
 // remove all the constraint settings
 List<Bytes> keys = new ArrayList<>();
 // loop through all the key, values looking for constraints
 for (Map.Entry<Bytes, Bytes> e : desc
   .getValues().entrySet()) {
  String key = Bytes.toString((e.getKey().get()));
  String[] className = CONSTRAINT_HTD_ATTR_KEY_PATTERN.split(key);
  if (className.length == 2) {
   keys.add(e.getKey());
  }
 }
 // now remove all the keys we found
 for (Bytes key : keys) {
  desc.remove(key);
 }
}
origin: apache/hbase

Constraints.disable(desc);
origin: apache/hbase

/**
 * Test that Constraints are properly enabled, disabled, and removed
 *
 * @throws Exception
 */
@SuppressWarnings("unchecked")
@Test
public void testEnableDisableRemove() throws Exception {
 HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
 // check general enabling/disabling of constraints
 // first add a constraint
 Constraints.add(desc, AllPassConstraint.class);
 // make sure everything is enabled
 assertTrue(Constraints.enabled(desc, AllPassConstraint.class));
 assertTrue(desc.hasCoprocessor(ConstraintProcessor.class.getName()));
 // check disabling
 Constraints.disable(desc);
 assertFalse(desc.hasCoprocessor(ConstraintProcessor.class.getName()));
 // make sure the added constraints are still present
 assertTrue(Constraints.enabled(desc, AllPassConstraint.class));
 // check just removing the single constraint
 Constraints.remove(desc, AllPassConstraint.class);
 assertFalse(Constraints.has(desc, AllPassConstraint.class));
 // Add back the single constraint
 Constraints.add(desc, AllPassConstraint.class);
 // and now check that when we remove constraints, all are gone
 Constraints.remove(desc);
 assertFalse(desc.hasCoprocessor(ConstraintProcessor.class.getName()));
 assertFalse(Constraints.has(desc, AllPassConstraint.class));
}
origin: harbby/presto-connectors

/**
 * Remove all {@link Constraint Constraints} that have been added to the table
 * and turn off the constraint processing.
 * <p>
 * All {@link Configuration Configurations} and their associated
 * {@link Constraint} are removed.
 * 
 * @param desc
 *          {@link HTableDescriptor} to remove {@link Constraint Constraints}
 *          from.
 */
public static void remove(HTableDescriptor desc) {
 // disable constraints
 disable(desc);
 // remove all the constraint settings
 List<ImmutableBytesWritable> keys = new ArrayList<ImmutableBytesWritable>();
 // loop through all the key, values looking for constraints
 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e : desc
   .getValues().entrySet()) {
  String key = Bytes.toString((e.getKey().get()));
  String[] className = CONSTRAINT_HTD_ATTR_KEY_PATTERN.split(key);
  if (className.length == 2) {
   keys.add(e.getKey());
  }
 }
 // now remove all the keys we found
 for (ImmutableBytesWritable key : keys) {
  desc.remove(key);
 }
}
origin: co.cask.hbase/hbase

/**
 * Remove all {@link Constraint Constraints} that have been added to the table
 * and turn off the constraint processing.
 * <p>
 * All {@link Configuration Configurations} and their associated
 * {@link Constraint} are removed.
 * 
 * @param desc
 *          {@link HTableDescriptor} to remove {@link Constraint Constraints}
 *          from.
 */
public static void remove(HTableDescriptor desc) {
 // disable constraints
 disable(desc);
 // remove all the constraint settings
 List<ImmutableBytesWritable> keys = new ArrayList<ImmutableBytesWritable>();
 // loop through all the key, values looking for constraints
 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e : desc
   .getValues().entrySet()) {
  String key = Bytes.toString((e.getKey().get()));
  String[] className = CONSTRAINT_HTD_ATTR_KEY_PATTERN.split(key);
  if (className.length == 2) {
   keys.add(e.getKey());
  }
 }
 // now remove all the keys we found
 for (ImmutableBytesWritable key : keys) {
  desc.remove(key.get());
 }
}
origin: org.apache.hbase/hbase-server

Constraints.disable(desc);
origin: org.apache.hbase/hbase-server

/**
 * Test that Constraints are properly enabled, disabled, and removed
 *
 * @throws Exception
 */
@SuppressWarnings("unchecked")
@Test
public void testEnableDisableRemove() throws Exception {
 HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
 // check general enabling/disabling of constraints
 // first add a constraint
 Constraints.add(desc, AllPassConstraint.class);
 // make sure everything is enabled
 assertTrue(Constraints.enabled(desc, AllPassConstraint.class));
 assertTrue(desc.hasCoprocessor(ConstraintProcessor.class.getName()));
 // check disabling
 Constraints.disable(desc);
 assertFalse(desc.hasCoprocessor(ConstraintProcessor.class.getName()));
 // make sure the added constraints are still present
 assertTrue(Constraints.enabled(desc, AllPassConstraint.class));
 // check just removing the single constraint
 Constraints.remove(desc, AllPassConstraint.class);
 assertFalse(Constraints.has(desc, AllPassConstraint.class));
 // Add back the single constraint
 Constraints.add(desc, AllPassConstraint.class);
 // and now check that when we remove constraints, all are gone
 Constraints.remove(desc);
 assertFalse(desc.hasCoprocessor(ConstraintProcessor.class.getName()));
 assertFalse(Constraints.has(desc, AllPassConstraint.class));
}
org.apache.hadoop.hbase.constraintConstraintsdisable

Javadoc

Turn off processing constraints for a given table, even if constraints have been turned on or added.

Popular methods of Constraints

  • getConstraints
  • addConstraint
    Write the raw constraint and configuration to the descriptor. This method takes care of creating a n
  • changeConstraintEnabled
    Change the whether the constraint (if it is already present) is enabled or disabled.
  • configure
    Setup the configuration for a constraint as to whether it is enabled and its priority
  • enable
    Enable constraints on a table. Currently, if you attempt to add a constraint to the table, then Cons
  • getKeyValueForClass
    Get the kv Entry in the descriptor for the specified class
  • getNextPriority
  • readConfiguration
    Read the Configuration stored in the byte stream.
  • serializeConfiguration
    Write the configuration to a String
  • serializeConstraintClass
    Just write the class to a String representation of the class as a key for the HTableDescriptor
  • updateLatestPriority
  • writeConstraint
    Write the given key and associated configuration to the HTableDescriptor
  • updateLatestPriority,
  • writeConstraint,
  • add,
  • disableConstraint,
  • enabled,
  • has,
  • remove,
  • setConfiguration

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now