TableMeta implements ProtoObject<CatalogProtos.TableProto>, GsonObject, Cloneable { @Override public Object clone() throws CloneNotSupportedException { TableMeta meta = (TableMeta) super.clone(); meta.builder = TableProto.newBuilder(); meta.storeType = getStoreType(); meta.options = (KeyValueSet) (toMap() != null ? options.clone() : null); return meta; } private  TableMeta();  TableMeta(String storeType, KeyValueSet options);  TableMeta(TableProto proto); String getStoreType(); void setOptions(KeyValueSet options); void putOption(String key, String val); boolean containsOption(String key); String getOption(String key); String getOption(String key, String defaultValue); KeyValueSet getOptions(); Map<String,String> toMap(); boolean equals(Object object); int hashCode(); @Override Object clone(); String toString(); TableProto getProto(); @Override String toJson(); void mergeProtoToLocal();  }
@Test public final void testClone() throws CloneNotSupportedException { Schema schema1 = new Schema(); schema1.addColumn("name", Type.BLOB); schema1.addColumn("addr", Type.TEXT); TableMeta meta1 = CatalogUtil.newTableMeta("CSV"); TableMeta meta2 = (TableMeta) meta1.clone(); assertEquals(meta1.getStoreType(), meta2.getStoreType()); assertEquals(meta1, meta2); }
@Test public void testSchema() throws CloneNotSupportedException { Schema schema1 = new Schema(); schema1.addColumn("name", Type.BLOB); schema1.addColumn("addr", Type.TEXT); TableMeta meta1 = CatalogUtil.newTableMeta("CSV"); TableMeta meta2 = (TableMeta) meta1.clone(); assertEquals(meta1, meta2); }