Package com.cloudera.flume.conf

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


        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

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

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

    // wrap the sink with the ackedWriteAhead
    return sinkTree;
  }
View Full Code Here

      FlumeSpecException {
    CommonTree lsnkTree = FlumeBuilder.parseSink(sink);
    LOG.debug(lsnkTree.toStringTree());
    PatternMatch p = recursive(var("lsnk", kind("SINK").child(
        kind("logicalSink"))));
    Map<String, CommonTree> matches = p.match(lsnkTree);

    if (matches == null) {
      // do nothing,
      return lsnkTree;
    }
View Full Code Here

  CommonTree substLogicalSource(String ln, String source)
      throws RecognitionException {
    CommonTree lsrcTree = FlumeBuilder.parseSource(source);
    LOG.debug(lsrcTree.toStringTree());
    PatternMatch p = FlumePatterns.source("logicalSource");
    Map<String, CommonTree> matches = p.match(lsrcTree);

    if (matches == null) {
      // if was previously a logical source, unregister it.
      nameMan.setPhysicalNode(ln, null);
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.