public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step)
      throws KettleException {
    if (!Const.isEmpty(m_zookeeperHosts)) {
      rep.saveStepAttribute(id_transformation, id_step, 0, "zookeeper_hosts", m_zookeeperHosts);
    }
    if (!Const.isEmpty(m_zookeeperPort)) {
      rep.saveStepAttribute(id_transformation, id_step, 0, "zookeeper_port", m_zookeeperPort);
    }
    if (!Const.isEmpty(m_coreConfigURL)) {
      rep.saveStepAttribute(id_transformation, id_step, 0, "core_config_url", m_coreConfigURL);
    }
    if (!Const.isEmpty(m_defaultConfigURL)) {
      rep.saveStepAttribute(
          id_transformation, id_step, 0, "default_config_url", m_defaultConfigURL);
    }
    if (!Const.isEmpty(m_targetTableName)) {
      rep.saveStepAttribute(id_transformation, id_step, 0, "target_table_name", m_targetTableName);
    }
    if (!Const.isEmpty(m_targetMappingName)) {
      rep.saveStepAttribute(
          id_transformation, id_step, 0, "target_mapping_name", m_targetMappingName);
    }
    if (!Const.isEmpty(m_writeBufferSize)) {
      rep.saveStepAttribute(id_transformation, id_step, 0, "write_buffer_size", m_writeBufferSize);
    }
    rep.saveStepAttribute(id_transformation, id_step, 0, "disable_wal", m_disableWriteToWAL);

    if (m_mapping != null) {
      m_mapping.saveRep(rep, id_transformation, id_step);
    }
  }
  public void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String, Counter> counters)
      throws KettleXMLException {

    m_zookeeperHosts = XMLHandler.getTagValue(stepnode, "zookeeper_hosts");
    m_zookeeperPort = XMLHandler.getTagValue(stepnode, "zookeeper_port");
    m_coreConfigURL = XMLHandler.getTagValue(stepnode, "core_config_url");
    m_defaultConfigURL = XMLHandler.getTagValue(stepnode, "default_config_url");
    m_targetTableName = XMLHandler.getTagValue(stepnode, "target_table_name");
    m_targetMappingName = XMLHandler.getTagValue(stepnode, "target_mapping_name");
    m_writeBufferSize = XMLHandler.getTagValue(stepnode, "write_buffer_size");
    String disableWAL = XMLHandler.getTagValue(stepnode, "disable_wal");
    m_disableWriteToWAL = disableWAL.equalsIgnoreCase("Y");

    Mapping tempMapping = new Mapping();
    if (tempMapping.loadXML(stepnode)) {
      m_mapping = tempMapping;
    } else {
      m_mapping = null;
    }
  }
  public void readRep(
      Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters)
      throws KettleException {

    m_zookeeperHosts = rep.getStepAttributeString(id_step, 0, "zookeeper_hosts");
    m_zookeeperPort = rep.getStepAttributeString(id_step, 0, "zookeeper_port");
    m_coreConfigURL = rep.getStepAttributeString(id_step, 0, "core_config_url");
    m_defaultConfigURL = rep.getStepAttributeString(id_step, 0, "default_config_url");
    m_targetTableName = rep.getStepAttributeString(id_step, 0, "target_table_name");
    m_targetMappingName = rep.getStepAttributeString(id_step, 0, "target_mapping_name");
    m_writeBufferSize = rep.getStepAttributeString(id_step, 0, "write_buffer_size");
    m_disableWriteToWAL = rep.getStepAttributeBoolean(id_step, 0, "disable_wal");

    Mapping tempMapping = new Mapping();
    if (tempMapping.readRep(rep, id_step)) {
      m_mapping = tempMapping;
    } else {
      m_mapping = null;
    }
  }
  @Override
  public String getXML() {
    StringBuffer retval = new StringBuffer();

    if (!Const.isEmpty(m_zookeeperHosts)) {
      retval.append("\n    ").append(XMLHandler.addTagValue("zookeeper_hosts", m_zookeeperHosts));
    }
    if (!Const.isEmpty(m_zookeeperPort)) {
      retval.append("\n    ").append(XMLHandler.addTagValue("zookeeper_port", m_zookeeperPort));
    }
    if (!Const.isEmpty(m_coreConfigURL)) {
      retval.append("\n    ").append(XMLHandler.addTagValue("core_config_url", m_coreConfigURL));
    }
    if (!Const.isEmpty(m_defaultConfigURL)) {
      retval
          .append("\n    ")
          .append(XMLHandler.addTagValue("default_config_url", m_defaultConfigURL));
    }
    if (!Const.isEmpty(m_targetTableName)) {
      retval
          .append("\n    ")
          .append(XMLHandler.addTagValue("target_table_name", m_targetTableName));
    }
    if (!Const.isEmpty(m_targetMappingName)) {
      retval
          .append("\n    ")
          .append(XMLHandler.addTagValue("target_mapping_name", m_targetMappingName));
    }
    if (!Const.isEmpty(m_writeBufferSize)) {
      retval
          .append("\n    ")
          .append(XMLHandler.addTagValue("write_buffer_size", m_writeBufferSize));
    }
    retval.append("\n    ").append(XMLHandler.addTagValue("disable_wal", m_disableWriteToWAL));

    if (m_mapping != null) {
      retval.append(m_mapping.getXML());
    }

    return retval.toString();
  }