public void parseRule()

in kafka/hbase-kafka-proxy/src/main/java/org/apache/hadoop/hbase/kafka/TopicRoutingRules.java [143:162]


  public void parseRule(Element n, List<DropRule> dropRules, List<TopicRule> routeRules) {
    Rule r = null;
    if (n.getAttribute("action").equals("drop")) {
      r = new DropRule();
      dropRules.add((DropRule) r);
    } else {
      r = new TopicRule(n.getAttribute("topic"));
      routeRules.add((TopicRule) r);
    }
    if (n.hasAttribute("table")) {
      r.setTableName(TableName.valueOf(n.getAttribute("table")));
    }
    if (n.hasAttribute("columnFamily")) {
      r.setColumnFamily(Bytes.toBytes(n.getAttribute("columnFamily")));
    }
    if (n.hasAttribute("qualifier")) {
      String qual = n.getAttribute("qualifier");
      r.setQualifier(Bytes.toBytes(qual));
    }
  }