Chia-Ping Tsai created HBASE-20119:

             Summary: Introduce a pojo class to carry coprocessor information 
in order to make TableDescriptorBuilder accept multiple cp at once
                 Key: HBASE-20119
             Project: HBase
          Issue Type: Task
            Reporter: Chia-Ping Tsai
            Assignee: Chia-Ping Tsai
             Fix For: 2.0.0

The way to add cp to TableDescriptorBuilder is shown below.
public TableDescriptorBuilder addCoprocessor(String className) throws 
IOException {
  return addCoprocessor(className, null, Coprocessor.PRIORITY_USER, null);

public TableDescriptorBuilder addCoprocessor(String className, Path jarFilePath,
        int priority, final Map<String, String> kvs) throws IOException {
  desc.addCoprocessor(className, jarFilePath, priority, kvs);
  return this;

public TableDescriptorBuilder addCoprocessorWithSpec(final String specStr) 
throws IOException {
  return this;
When loading our config to create table with multiple cps, we have to write the 
ugly for-loop.
val builder = TableDescriptorBuilder.newBuilde(tableName)
  .setBBB() => ColumnFamilyDescriptorBuilder.of(cf))

If we introduce a pojo to carry the cp data and add the method accepting 
multiple cps and cfs, it is easier to exercise the fluent interface of 


This message was sent by Atlassian JIRA

Reply via email to