Configure columns to store MOBs

You can configure a column to store MOBs using the HBase Shell or the Java API.

Use the following options in the HBase Shell or Java API to configure a column to store MOBs:

  • IS_MOB specifies whether or not the column can store MOBs. This is a Boolean option where you can set it to true or false.

  • MOB_THRESHOLD configures the number of bytes at which an object is considered to be a MOB. If you do not specify a value for MOB_THRESHOLD, the default is 100 KB. If you write a value larger than this threshold, it is treated as a MOB.

  • Using the HBase Shell:
    hbase> create 't1', {NAME => 'f1', IS_MOB => true, MOB_THRESHOLD => 102400}
    hbase> alter 't1', {NAME => 'f1', IS_MOB => true, MOB_THRESHOLD => 102400}
    
  • Usin the Java API:
    HColumnDescriptor hcd = new HColumnDescriptor(“f”);
    hcd.setMobEnabled(true);
    hcd.setMobThreshold(102400L);