public static TableDescriptor toTableDescriptor(final TableSchema ts) {
    TableDescriptorBuilder builder =
      TableDescriptorBuilder.newBuilder(ProtobufUtil.toTableName(ts.getTableName()));
    ts.getColumnFamiliesList().stream().map(ProtobufUtil::toColumnFamilyDescriptor)
      .forEach(builder::setColumnFamily);
    ts.getAttributesList()
      .forEach(a -> builder.setValue(a.getFirst().toByteArray(), a.getSecond().toByteArray()));
    ts.getConfigurationList().forEach(a -> builder.setValue(a.getName(), a.getValue()));
    return builder.build();
  }
Converts a TableSchema to TableDescriptor
@param ts A pb TableSchema instance.
@return An {@link TableDescriptor} made from the passed in pb <code>ts</code>.
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java