Java Code Examples for org.apache.hadoop.hbase.HColumnDescriptor.DEFAULT_BLOOMFILTER

The following are Jave code examples for showing how to use DEFAULT_BLOOMFILTER of the org.apache.hadoop.hbase.HColumnDescriptor class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: ditb   File: HFileOutputFormat2.java   Source Code and License Vote up 6 votes
/**
 * Serialize column family to bloom type map to configuration.
 * Invoked while configuring the MR job for incremental load.
 * @param tableDescriptor to read the properties from
 * @param conf to persist serialized values into
 *
 * @throws IOException
 *           on failure to read column family descriptors
 */
@VisibleForTesting
static void configureBloomType(HTableDescriptor tableDescriptor, Configuration conf)
    throws UnsupportedEncodingException {
  if (tableDescriptor == null) {
    // could happen with mock table instance
    return;
  }
  StringBuilder bloomTypeConfigValue = new StringBuilder();
  Collection<HColumnDescriptor> families = tableDescriptor.getFamilies();
  int i = 0;
  for (HColumnDescriptor familyDescriptor : families) {
    if (i++ > 0) {
      bloomTypeConfigValue.append('&');
    }
    bloomTypeConfigValue.append(URLEncoder.encode(
      familyDescriptor.getNameAsString(), "UTF-8"));
    bloomTypeConfigValue.append('=');
    String bloomType = familyDescriptor.getBloomFilterType().toString();
    if (bloomType == null) {
      bloomType = HColumnDescriptor.DEFAULT_BLOOMFILTER;
    }
    bloomTypeConfigValue.append(URLEncoder.encode(bloomType, "UTF-8"));
  }
  conf.set(BLOOM_TYPE_FAMILIES_CONF_KEY, bloomTypeConfigValue.toString());
}
 
Example 2
Project: ditb   File: ColumnSchemaModel.java   Source Code and License Vote up 4 votes
/**
 * @return the value of the BLOOMFILTER attribute or its default if unset
 */
public String __getBloomfilter() {
  Object o = attrs.get(BLOOMFILTER);
  return o != null ? o.toString() : HColumnDescriptor.DEFAULT_BLOOMFILTER;
}