示例#1
0
 // column_path_or_parent is a ColumnPath for remove, where the "column" is optional even for a
 // standard CF
 static void validateColumnPathOrParent(String tablename, ColumnPath column_path_or_parent)
     throws InvalidRequestException {
   validateTable(tablename);
   ColumnFamilyType cfType = validateColumnFamily(tablename, column_path_or_parent.column_family);
   if (cfType == ColumnFamilyType.Standard) {
     if (column_path_or_parent.super_column != null) {
       throw new InvalidRequestException(
           "supercolumn may not be specified for standard CF "
               + column_path_or_parent.column_family);
     }
   }
   if (column_path_or_parent.column != null) {
     validateColumns(
         tablename,
         column_path_or_parent.column_family,
         column_path_or_parent.super_column,
         Arrays.asList(column_path_or_parent.column));
   }
   if (column_path_or_parent.super_column != null) {
     validateColumns(
         tablename,
         column_path_or_parent.column_family,
         null,
         Arrays.asList(column_path_or_parent.super_column));
   }
 }
示例#2
0
 static void validateColumnPath(String tablename, ColumnPath column_path)
     throws InvalidRequestException {
   validateTable(tablename);
   ColumnFamilyType cfType = validateColumnFamily(tablename, column_path.column_family);
   if (cfType == ColumnFamilyType.Standard) {
     if (column_path.super_column != null) {
       throw new InvalidRequestException(
           "supercolumn parameter is invalid for standard CF " + column_path.column_family);
     }
     if (column_path.column == null) {
       throw new InvalidRequestException(
           "column parameter is not optional for standard CF " + column_path.column_family);
     }
   } else {
     if (column_path.super_column == null)
       throw new InvalidRequestException(
           "supercolumn parameter is not optional for super CF " + column_path.column_family);
   }
   if (column_path.column != null) {
     validateColumns(
         tablename,
         column_path.column_family,
         column_path.super_column,
         Arrays.asList(column_path.column));
   }
   if (column_path.super_column != null) {
     validateColumns(
         tablename, column_path.column_family, null, Arrays.asList(column_path.super_column));
   }
 }
示例#3
0
 static void validateColumnParent(String tablename, ColumnParent column_parent)
     throws InvalidRequestException {
   validateTable(tablename);
   ColumnFamilyType cfType = validateColumnFamily(tablename, column_parent.column_family);
   if (cfType == ColumnFamilyType.Standard) {
     if (column_parent.super_column != null) {
       throw new InvalidRequestException(
           "columnfamily alone is required for standard CF " + column_parent.column_family);
     }
   }
   if (column_parent.super_column != null) {
     validateColumns(
         tablename, column_parent.column_family, null, Arrays.asList(column_parent.super_column));
   }
 }