コード例 #1
0
 static ColumnMetadata build(TableMetadata tm, Row row) {
   try {
     String name = row.getString(COLUMN_NAME);
     AbstractType<?> t = TypeParser.parse(row.getString(VALIDATOR));
     ColumnMetadata cm = new ColumnMetadata(tm, name, Codec.rawTypeToDataType(t), row);
     tm.add(cm);
     return cm;
   } catch (RequestValidationException e) {
     // The server will have validated the type
     throw new RuntimeException(e);
   }
 }
コード例 #2
0
 static Definition fromTransportSpecification(ColumnSpecification spec) {
   return new Definition(
       spec.ksName, spec.cfName, spec.name.toString(), Codec.rawTypeToDataType(spec.type));
 }