Examples of ConstraintException


Examples of grails.validation.exceptions.ConstraintException

            return c != null && c.supports(propertyType);
        }
        catch (Exception e) {
            LOG.error("Exception thrown instantiating constraint [" + constraintName +
                    "] to class [" + owningClass + "]", e);
            throw new ConstraintException("Exception thrown instantiating  constraint [" + constraintName +
                    "] to class [" + owningClass + "]", e);
        }
    }
View Full Code Here

Examples of grails.validation.exceptions.ConstraintException

                    }
                }
                catch (Exception e) {
                    LOG.error("Exception thrown applying constraint [" + constraintName +
                            "] to class [" + owningClass + "] for value [" + constrainingValue + "]: " + e.getMessage(), e);
                    throw new ConstraintException("Exception thrown applying constraint [" + constraintName +
                            "] to class [" + owningClass + "] for value [" + constrainingValue + "]: " + e.getMessage(), e);
                }
            }
        }
        else if (bean.isWritableProperty(constraintName)) {
            bean.setPropertyValue(constraintName, constrainingValue);
        }
        else {
            throw new ConstraintException("Constraint [" + constraintName + "] is not supported for property [" +
                    propertyName + "] of class [" + owningClass + "] with type [" + propertyType + "]");
        }
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.constraint.ConstraintException

  public synchronized void remove(String name) throws IOException {
    if (get(name) == null) {
      throw new NamespaceNotFoundException(name);
    }
    if (NamespaceDescriptor.RESERVED_NAMESPACES.contains(name)) {
      throw new ConstraintException("Reserved namespace "+name+" cannot be removed.");
    }
    int tableCount;
    try {
      tableCount = masterServices.listTableDescriptorsByNamespace(name).size();
    } catch (FileNotFoundException fnfe) {
      throw new NamespaceNotFoundException(name);
    }
    if (tableCount > 0) {
      throw new ConstraintException("Only empty namespaces can be removed. " +
          "Namespace "+name+" has "+tableCount+" tables");
    }
    Delete d = new Delete(Bytes.toBytes(name));
    getNamespaceTable().delete(d);
    //don't abort if cleanup isn't complete
View Full Code Here

Examples of org.apache.hadoop.hbase.constraint.ConstraintException

  public synchronized void remove(String name) throws IOException {
    if (get(name) == null) {
      throw new NamespaceNotFoundException(name);
    }
    if (NamespaceDescriptor.RESERVED_NAMESPACES.contains(name)) {
      throw new ConstraintException("Reserved namespace "+name+" cannot be removed.");
    }
    int tableCount;
    try {
      tableCount = masterServices.listTableDescriptorsByNamespace(name).size();
    } catch (FileNotFoundException fnfe) {
      throw new NamespaceNotFoundException(name);
    }
    if (tableCount > 0) {
      throw new ConstraintException("Only empty namespaces can be removed. " +
          "Namespace "+name+" has "+tableCount+" tables");
    }
    Delete d = new Delete(Bytes.toBytes(name));
    getNamespaceTable().delete(d);
    //don't abort if cleanup isn't complete
View Full Code Here

Examples of org.apache.hadoop.hbase.constraint.ConstraintException

                    HTableDescriptor.NAMESPACE_COL_DESC_BYTES).getValue()));
  }

  public synchronized void create(NamespaceDescriptor ns) throws IOException {
    if (get(ns.getName()) != null) {
      throw new ConstraintException("Namespace "+ns.getName()+" already exists");
    }
    FileSystem fs = masterServices.getMasterFileSystem().getFileSystem();
    fs.mkdirs(FSUtils.getNamespaceDir(
        masterServices.getMasterFileSystem().getRootDir(), ns.getName()));
    upsert(ns);
View Full Code Here

Examples of org.apache.hadoop.hbase.constraint.ConstraintException

    upsert(ns);
  }

  public synchronized void update(NamespaceDescriptor ns) throws IOException {
    if (get(ns.getName()) == null) {
      throw new ConstraintException("Namespace "+ns.getName()+" does not exist");
    }
    upsert(ns);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.constraint.ConstraintException

    }
  }

  public synchronized void remove(String name) throws IOException {
    if (NamespaceDescriptor.RESERVED_NAMESPACES.contains(name)) {
      throw new ConstraintException("Reserved namespace "+name+" cannot be removed.");
    }
    int tableCount = masterServices.listTableDescriptorsByNamespace(name).size();
    if (tableCount > 0) {
      throw new ConstraintException("Only empty namespaces can be removed. " +
          "Namespace "+name+" has "+tableCount+" tables");
    }
    Delete d = new Delete(Bytes.toBytes(name));
    table.delete(d);
    //don't abort if cleanup isn't complete
View Full Code Here

Examples of org.apache.hadoop.hbase.constraint.ConstraintException

      throw new MasterNotRunningException();
    }

    String namespace = hTableDescriptor.getTableName().getNamespaceAsString();
    if (getNamespaceDescriptor(namespace) == null) {
      throw new ConstraintException("Namespace " + namespace + " does not exist");
    }
   
    HRegionInfo[] newRegions = getHRegionInfos(hTableDescriptor, splitKeys);
    checkInitialized();
    checkCompression(hTableDescriptor);
View Full Code Here

Examples of org.apache.hadoop.hbase.constraint.ConstraintException

  @Override
  public void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
      TableName tableName, HTableDescriptor htd) throws IOException {
    if (LABELS_TABLE_NAME.equals(tableName)) {
      throw new ConstraintException("Cannot alter " + LABELS_TABLE_NAME);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.constraint.ConstraintException

  @Override
  public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName,
      HColumnDescriptor column) throws IOException {
    if (LABELS_TABLE_NAME.equals(tableName)) {
      throw new ConstraintException("Cannot alter " + LABELS_TABLE_NAME);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.