Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.PatternMatch.match()


  static CommonTree substBEChains(String sink, List<String> collectors)
      throws RecognitionException, FlumeSpecException {

    PatternMatch bePat = recursive(var("be", FlumePatterns.sink(AUTO_BE)));
    CommonTree sinkTree = FlumeBuilder.parseSink(sink);
    Map<String, CommonTree> beMatches = bePat.match(sinkTree);

    ArrayList<String> collSnks = new ArrayList<String>();
    for (String coll : collectors) {
      collSnks.add("{ lazyOpen => logicalSink(\"" + coll + "\") }");
    }
View Full Code Here


        sinkTree = beFailChain;
      } else {
        parent.replaceChildren(idx, idx, beFailChain);
      }
      // patern match again.
      beMatches = bePat.match(sinkTree);
    }
    return sinkTree;
  }

  /**
 
View Full Code Here

  static CommonTree substDFOChainsNoLet(String sink, List<String> collectors)
      throws RecognitionException, FlumeSpecException {
    PatternMatch dfoPat = recursive(var("dfo", FlumePatterns.sink(AUTO_DFO)));

    CommonTree sinkTree = FlumeBuilder.parseSink(sink);
    Map<String, CommonTree> dfoMatches = dfoPat.match(sinkTree);
    if (dfoMatches == null) {
      return sinkTree;
    }

    while (dfoMatches != null) {
View Full Code Here

        sinkTree = newDfoTree;
      } else {
        parent.replaceChildren(idx, idx, newDfoTree);
      }
      // pattern match again.
      dfoMatches = dfoPat.match(sinkTree);
    }
    return sinkTree;
  }

  /**
 
View Full Code Here

  static CommonTree substDFOChains(String sink, List<String> collectors)
      throws RecognitionException, FlumeSpecException {
    PatternMatch dfoPat = recursive(var("dfo", FlumePatterns.sink(AUTO_DFO)));

    CommonTree sinkTree = FlumeBuilder.parseSink(sink);
    Map<String, CommonTree> dfoMatches = dfoPat.match(sinkTree);
    if (dfoMatches == null) {
      return sinkTree;
    }

    while (dfoMatches != null) {
View Full Code Here

        sinkTree = newDfoTree;
      } else {
        parent.replaceChildren(idx, idx, newDfoTree);
      }
      // pattern match again.
      dfoMatches = dfoPat.match(sinkTree);
    }
    return sinkTree;
  }

  /**
 
View Full Code Here

  static CommonTree substE2EChains(String sink, List<String> collectors)
      throws RecognitionException, FlumeSpecException {

    PatternMatch e2ePat = recursive(var("e2e", FlumePatterns.sink(AUTO_E2E)));
    CommonTree sinkTree = FlumeBuilder.parseSink(sink);
    Map<String, CommonTree> e2eMatches = e2ePat.match(sinkTree);

    if (e2eMatches == null) {
      // bail out early.
      return sinkTree;
    }
View Full Code Here

      } else {
        parent.replaceChildren(idx, idx, beFailChain);
      }

      // pattern match again.
      e2eMatches = e2ePat.match(sinkTree);

    }

    // wrap the sink with the ackedWriteAhead
    CommonTree wrapper = FlumeBuilder
View Full Code Here

    // wrap the sink with the ackedWriteAhead
    CommonTree wrapper = FlumeBuilder
        .parseSink("{ ackedWriteAhead => { stubbornAppend => { insistentOpen => null } } }");
    PatternMatch nullPath = recursive(var("x", FlumePatterns.sink("null")));
    CommonTree replace = nullPath.match(wrapper).get("x");
    int idx = replace.getChildIndex();
    replace.parent.replaceChildren(idx, idx, sinkTree);
    return wrapper;
  }
View Full Code Here

  static CommonTree substE2EChainsSimple(String sink, List<String> collectors)
      throws RecognitionException, FlumeSpecException {

    PatternMatch e2ePat = recursive(var("e2e", FlumePatterns.sink(AUTO_E2E)));
    CommonTree sinkTree = FlumeBuilder.parseSink(sink);
    Map<String, CommonTree> e2eMatches = e2ePat.match(sinkTree);

    if (e2eMatches == null) {
      // bail out early.
      return sinkTree;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.