protected void applyColumnFamilyOptions(TableName tableName, byte[][] columnFamilies)
    throws IOException {
    try (Connection conn = ConnectionFactory.createConnection(conf);
      Admin admin = conn.getAdmin()) {
      TableDescriptor tableDesc = admin.getDescriptor(tableName);
      LOG.info("Disabling table " + tableName);
      admin.disableTable(tableName);
      for (byte[] cf : columnFamilies) {
        ColumnFamilyDescriptor columnDesc = tableDesc.getColumnFamily(cf);
        boolean isNewCf = columnDesc == null;
        ColumnFamilyDescriptorBuilder columnDescBuilder = isNewCf
          ? ColumnFamilyDescriptorBuilder.newBuilder(cf)
          : ColumnFamilyDescriptorBuilder.newBuilder(columnDesc);
        if (bloomType != null) {
          columnDescBuilder.setBloomFilterType(bloomType);
        }
        if (compressAlgo != null) {
          columnDescBuilder.setCompressionType(compressAlgo);
        }
        if (dataBlockEncodingAlgo != null) {
          columnDescBuilder.setDataBlockEncoding(dataBlockEncodingAlgo);
        }
        if (inMemoryCF) {
          columnDescBuilder.setInMemory(inMemoryCF);
        }
        if (cipher != null) {
          byte[] keyBytes = new byte[cipher.getKeyLength()];
          Bytes.secureRandom(keyBytes);
          columnDescBuilder.setEncryptionType(cipher.getName());
          columnDescBuilder.setEncryptionKey(EncryptionUtil.wrapKey(conf,
            User.getCurrent().getShortName(), new SecretKeySpec(keyBytes, cipher.getName())));
        }
        if (mobThreshold >= 0) {
          columnDescBuilder.setMobEnabled(true);
          columnDescBuilder.setMobThreshold(mobThreshold);
        }

        if (isNewCf) {
          admin.addColumnFamily(tableName, columnDescBuilder.build());
        } else {
          admin.modifyColumnFamily(tableName, columnDescBuilder.build());
        }
      }
      LOG.info("Enabling table " + tableName);
      admin.enableTable(tableName);
    }
  }
Apply column family options such as Bloom filters, compression, and data block encoding.
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/util/LoadTestTool.java