public static ColumnFamilyDescriptor colDescFromThrift(ColumnDescriptor in)
    throws IllegalArgument {
    Compression.Algorithm comp =
      Compression.getCompressionAlgorithmByName(in.compression.toLowerCase(Locale.ROOT));
    BloomType bt = BloomType.valueOf(in.bloomFilterType);

    if (in.name == null || !in.name.hasRemaining()) {
      throw new IllegalArgument("column name is empty");
    }
    byte[] parsedName = CellUtil.parseColumn(Bytes.getBytes(in.name))[0];
    return ColumnFamilyDescriptorBuilder.newBuilder(parsedName).setMaxVersions(in.maxVersions)
      .setCompressionType(comp).setInMemory(in.inMemory).setBlockCacheEnabled(in.blockCacheEnabled)
      .setTimeToLive(in.timeToLive > 0 ? in.timeToLive : Integer.MAX_VALUE).setBloomFilterType(bt)
      .build();
  }
This utility method creates a new Hbase HColumnDescriptor object based on a Thrift
ColumnDescriptor "struct".
@param in Thrift ColumnDescriptor object
@throws IllegalArgument if the column name is empty
hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java