@Test public void testGetProto() throws CloneNotSupportedException, IOException { Path path = new Path(CommonTestingUtil.getTestDir(), "tajo"); TableDesc desc = new TableDesc("table1", schema, info, path); desc.setStats(stats); CatalogProtos.TableDescProto proto = desc.getProto(); TableDesc fromProto = new TableDesc(proto); assertEquals("equality check the object deserialized from json", desc, fromProto); }
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(); }
TableDesc implements ProtoObject<TableDescProto>, GsonObject, Cloneable { 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(); } }
TableDesc implements ProtoObject<TableDescProto>, GsonObject, Cloneable { 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(); } TableDesc();  TableDesc(String tableName, Schema schema, TableMeta info, Path path);  TableDesc(String tableName, Schema schema, StoreType type, Options options, Path path);  TableDesc(TableDescProto proto); }
TableDesc implements ProtoObject<TableDescProto>, GsonObject, Cloneable { 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(); } TableDesc();  TableDesc(String tableName, Schema schema, TableMeta info, Path path);  TableDesc(String tableName, Schema schema, StoreType type, Options options, Path path);  TableDesc(TableDescProto proto); void setName(String tableId); String getName(); void setPath(Path uri); Path getPath(); void setMeta(TableMeta info); TableMeta getMeta(); void setSchema(Schema schem); Schema getSchema(); Schema getLogicalSchema(); void setStats(TableStats stats); boolean hasStats(); TableStats getStats(); boolean hasPartition(); PartitionMethodDesc getPartitionMethod(); void setPartitionMethod(PartitionMethodDesc partitionMethodDesc); int hashCode(); boolean equals(Object object); Object clone(); String toString(); String toJson(); TableDescProto getProto(); }
TableDesc implements ProtoObject<TableDescProto>, GsonObject, Cloneable { 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(); } TableDesc();  TableDesc(String tableName, Schema schema, TableMeta info, Path path);  TableDesc(String tableName, Schema schema, StoreType type, Options options, Path path);  TableDesc(TableDescProto proto); void setName(String tableId); String getName(); void setPath(Path uri); Path getPath(); void setMeta(TableMeta info); TableMeta getMeta(); void setSchema(Schema schem); Schema getSchema(); Schema getLogicalSchema(); void setStats(TableStats stats); boolean hasStats(); TableStats getStats(); boolean hasPartition(); PartitionMethodDesc getPartitionMethod(); void setPartitionMethod(PartitionMethodDesc partitionMethodDesc); int hashCode(); boolean equals(Object object); Object clone(); String toString(); String toJson(); TableDescProto getProto();  }