コード例 #1
0
ファイル: CatalogServer.java プロジェクト: RonyMin/tajo
    @Override
    public ReturnState createTable(RpcController controller, TableDescProto request) {

      String[] splitted = CatalogUtil.splitFQTableName(request.getTableName());

      String dbName = splitted[0];
      String tbName = splitted[1];

      if (linkedMetadataManager.existsDatabase(dbName)) {
        return errInsufficientPrivilege("drop a table in database '" + dbName + "'");
      }

      if (metaDictionary.isSystemDatabase(dbName)) {
        return errInsufficientPrivilege("create a table in database '" + dbName + "'");
      }

      wlock.lock();
      try {
        store.createTable(request);
        LOG.info(
            String.format(
                "relation \"%s\" is added to the catalog (%s)",
                CatalogUtil.getCanonicalTableName(dbName, tbName), bindAddressStr));
        return OK;

      } catch (Throwable t) {
        printStackTraceIfError(LOG, t);
        return returnError(t);

      } finally {
        wlock.unlock();
      }
    }
コード例 #2
0
ファイル: TableDesc.java プロジェクト: hyunsik/incubator-tajo
 public TableDesc(TableDescProto proto) {
   this(
       proto.getId(),
       new Schema(proto.getSchema()),
       new TableMeta(proto.getMeta()),
       new Path(proto.getPath()));
   if (proto.hasStats()) {
     this.stats = new TableStats(proto.getStats());
   }
   if (proto.hasPartition()) {
     this.partitionMethodDesc = new PartitionMethodDesc(proto.getPartition());
   }
 }
コード例 #3
0
ファイル: TableDesc.java プロジェクト: hyunsik/incubator-tajo
 public Object clone() throws CloneNotSupportedException {
   TableDesc desc = (TableDesc) super.clone();
   desc.builder = TableDescProto.newBuilder();
   desc.tableName = tableName;
   desc.schema = (Schema) schema.clone();
   desc.meta = (TableMeta) meta.clone();
   desc.uri = uri;
   desc.stats = stats != null ? (TableStats) stats.clone() : null;
   desc.partitionMethodDesc =
       partitionMethodDesc != null ? (PartitionMethodDesc) partitionMethodDesc.clone() : null;
   return desc;
 }
コード例 #4
0
ファイル: TableDesc.java プロジェクト: hyunsik/incubator-tajo
 public TableDesc() {
   builder = TableDescProto.newBuilder();
 }
コード例 #5
-1
ファイル: TableDesc.java プロジェクト: hyunsik/incubator-tajo
  public TableDescProto getProto() {
    if (builder == null) {
      builder = TableDescProto.newBuilder();
    }
    if (this.tableName != null) {
      builder.setId(this.tableName);
    }
    if (this.schema != null) {
      builder.setSchema(schema.getProto());
    }
    if (this.meta != null) {
      builder.setMeta(meta.getProto());
    }
    if (this.uri != null) {
      builder.setPath(this.uri.toString());
    }
    if (this.stats != null) {
      builder.setStats(this.stats.getProto());
    }
    if (this.partitionMethodDesc != null) {
      builder.setPartition(this.partitionMethodDesc.getProto());
    }

    return builder.build();
  }