Package com.cloudera.flume.master

Examples of com.cloudera.flume.master.ConfigurationManager


  @Override
  synchronized public void refresh(String logicalNode) throws IOException {
    String oldflow = getFlowId(logicalNode);
    parent.refresh(logicalNode);
    ConfigurationManager fcfg = getCreateFlowConfigMan(oldflow);
    FlumeConfigData fcd = parent.getConfig(logicalNode);
    try {
      fcfg.setConfig(logicalNode, fcd.flowID, fcd.sourceConfig, fcd.sinkConfig);
    } catch (FlumeSpecException e) {
      throw new IOException(e.getMessage(), e);
    }

  }
View Full Code Here


  @Override
  synchronized public void removeLogicalNode(String logicNode)
      throws IOException {
    String oldflow = getFlowId(logicNode);
    parent.removeLogicalNode(logicNode);
    ConfigurationManager flowCfg = flows.get(oldflow);
    if (flowCfg != null) {
      flowCfg.removeLogicalNode(logicNode);
    }
  }
View Full Code Here

    out.close();

    retval = sh.executeLine("exec load '" + saveFile.getAbsolutePath() + "'");
    assertEquals(0, retval);

    ConfigurationManager manager = flumeMaster.getSpecMan();
    FlumeConfigData data = manager.getConfig("foo");
    assertEquals(data.getSinkConfig(), "console");
    assertEquals(data.getSourceConfig(), "null");
  }
View Full Code Here

    out.close();

    retval = sh.executeLine("exec load '" + saveFile.getAbsolutePath() + "'");
    assertEquals(0, retval);

    ConfigurationManager manager = flumeMaster.getSpecMan();
    FlumeConfigData data = manager.getConfig("foo");
    assertEquals(data.getSinkConfig(), "console");
    assertEquals(data.getSourceConfig(), "null");
  }
View Full Code Here

  /**
   * Returns a config man for a flow (never returns null). This is not thread
   * safe and must be run guarded by the this lock.
   */
  ConfigurationManager getCreateFlowConfigMan(String flowid) {
    ConfigurationManager cfg = flows.get(flowid);
    if (cfg != null) {
      return cfg;
    }

    cfg = createConfigMan();
View Full Code Here

  synchronized public boolean addLogicalNode(String physNode, String logicNode) {
    boolean result;

    result = parent.addLogicalNode(physNode, logicNode);
    String flowid = getFlowId(logicNode);
    ConfigurationManager fcfg = getCreateFlowConfigMan(flowid);
    fcfg.addLogicalNode(physNode, logicNode);

    return result;
  }
View Full Code Here

    }

    // do a bulk update for each sub flow config manager
    for (Entry<String, Map<String, FlumeConfigData>> e : flowsets.entrySet()) {
      String flow = e.getKey();
      ConfigurationManager fcfg = getCreateFlowConfigMan(flow);
      fcfg.setBulkConfig(e.getValue());
    }
  }
View Full Code Here

  }

  @Override
  synchronized public FlumeConfigData getConfig(String logicNode) {
    String flowid = getFlowId(logicNode);
    ConfigurationManager fcfg = getCreateFlowConfigMan(flowid);
    return fcfg.getConfig(logicNode);
  }
View Full Code Here

  @Override
  synchronized public void refresh(String logicalNode) throws IOException {
    String oldflow = getFlowId(logicalNode);
    parent.refresh(logicalNode);
    ConfigurationManager fcfg = getCreateFlowConfigMan(oldflow);
    FlumeConfigData fcd = parent.getConfig(logicalNode);
    try {
      fcfg.setConfig(logicalNode, fcd.flowID, fcd.sourceConfig, fcd.sinkConfig);
    } catch (FlumeSpecException e) {
      throw new IOException(e.getMessage(), e);
    }

  }
View Full Code Here

  @Override
  synchronized public void removeLogicalNode(String logicNode)
      throws IOException {
    String oldflow = getFlowId(logicNode);
    parent.removeLogicalNode(logicNode);
    ConfigurationManager flowCfg = flows.get(oldflow);
    if (flowCfg != null) {
      flowCfg.removeLogicalNode(logicNode);
    }
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.master.ConfigurationManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.