Examples of Sink


Examples of org.apache.flume.Sink

      ComponentConfiguration comp = compMap.get(groupName);
      if(comp != null) {
        SinkGroupConfiguration groupConf = (SinkGroupConfiguration) comp;
        List<Sink> groupSinks = new ArrayList<Sink>();
        for (String sink : groupConf.getSinks()) {
          Sink s = sinks.remove(sink);
          if (s == null) {
            String sinkUser = usedSinks.get(sink);
            if (sinkUser != null) {
              throw new InstantiationException(String.format(
                  "Sink %s of group %s already " +
View Full Code Here

Examples of org.apache.flume.Sink

    Preconditions.checkNotNull(name, "name");
    Preconditions.checkNotNull(type, "type");
    logger.info("Creating instance of sink: {}, type: {}", name, type);
    Class<? extends Sink> sinkClass = getClass(type);
    try {
      Sink sink = sinkClass.newInstance();
      sink.setName(name);
      return sink;
    } catch (Exception ex) {
      throw new FlumeException("Unable to create sink: " + name
          + ", type: " + type + ", class: " + sinkClass.getName(), ex);
    }
View Full Code Here

Examples of org.apache.flume.Sink

  public Status process() throws EventDeliveryException {
    Status status = null;

    Iterator<Sink> sinkIterator = selector.createSinkIterator();
    while (sinkIterator.hasNext()) {
      Sink sink = sinkIterator.next();
      try {
        status = sink.process();
        break;
      } catch (Exception ex) {
        LOGGER.warn("Sink failed to consume event. "
            + "Attempting next sink if available.", ex);
      }
View Full Code Here

Examples of org.apache.flume.Sink

    for (Map<String, Object> sinkDef : defs) {
      logger.debug("sink:{}", sinkDef);

      if (sinkDef.containsKey("type")) {
        Sink sink =
            getSinkFactory().create((String) sinkDef.get("type"));
        Channel channel = conf.getChannels().get(sinkDef.get("channel"));

        Context context = new Context();
        context.setParameters(sinkDef);

        Configurables.configure(sink, context);

        if (channel != null) {
          sink.setChannel(channel);
        } else {
          logger.warn(
              "No channel named {} - sink:{} is likely non-functional.", sink,
              sinkDef.get("channel"));
        }
View Full Code Here

Examples of org.apache.maven.doxia.sink.Sink

    public void parse(Reader input, Writer output) throws IOException, SlingAptParseException {
        parse(input, output, null);
    }

    public void parse(Reader input, Writer output, Map<String, Object> options) throws IOException, SlingAptParseException {
        final Sink sink = new CustomAptSink(output, options);
        final AptParser parser = new CustomAptParser(macroProvider);
        try {
            parser.parse(input, sink);
        } catch(AptParseException ape) {
            throw new SlingAptParseExceptionImpl(ape);
View Full Code Here

Examples of org.apache.maven.doxia.sink.Sink

            catch ( ComponentLookupException e )
            {
                throw new ConverterException( "ComponentLookupException: " + e.getMessage(), e );
            }

            Sink sink;
            try
            {
                sink = sinkFactory.createSink( output.getOutputStream(), output.getEncoding() );
            }
            catch ( IOException e )
            {
                throw new ConverterException( "IOException: " + e.getMessage(), e );
            }
            sink.enableLogging( log );

            if ( getLog().isDebugEnabled() )
            {
                getLog().debug( "Sink used: " + sink.getClass().getName() );
            }

            parse( parser, input.getReader(), sink );
        }
        finally
View Full Code Here

Examples of org.apache.maven.doxia.sink.Sink

        catch ( ComponentLookupException e )
        {
            throw new ConverterException( "ComponentLookupException: " + e.getMessage(), e );
        }

        Sink sink;
        try
        {
            String outputEncoding;
            if ( StringUtils.isEmpty( output.getEncoding() )
                || output.getEncoding().equals( OutputFileWrapper.AUTO_ENCODING ) )
            {
                outputEncoding = inputEncoding;
            }
            else
            {
                outputEncoding = output.getEncoding();
            }

            OutputStream out = new FileOutputStream( outputFile );
            sink = sinkFactory.createSink( out, outputEncoding );
        }
        catch ( IOException e )
        {
            throw new ConverterException( "IOException: " + e.getMessage(), e );
        }

        sink.enableLogging( log );

        if ( getLog().isDebugEnabled() )
        {
            getLog().debug( "Sink used: " + sink.getClass().getName() );
        }

        parse( parser, reader, sink );

        if ( formatOutput && ( output.getFormat().equals( DOCBOOK_SINK ) || output.getFormat().equals( FO_SINK )
View Full Code Here

Examples of org.apache.maven.doxia.sink.Sink

    protected void executeReport(final Locale locale) throws MavenReportException {
        try {
            this.execute(this.outputDirectory, locale);

            Sink kitchenSink = getSink();
            if (kitchenSink != null) {
                kitchenSink.rawText(indexHtmlContent);
            } else {
                writeIndexHtmlFile(outputDirectory, "index.html", indexHtmlContent);
            }
        } catch (Exception e) {
            final MavenReportException ex = new MavenReportException(e.getMessage());
View Full Code Here

Examples of org.apache.maven.doxia.sink.Sink

    protected void executeReport(final Locale locale) throws MavenReportException {
        try {
            this.execute(this.outputDirectory, locale);

            Sink kitchenSink = getSink();
            if (kitchenSink != null) {
                kitchenSink.rawText(indexHtmlContent);
            } else {
                writeIndexHtmlFile(outputDirectory, "index.html", indexHtmlContent);
            }
        } catch (Exception e) {
            final MavenReportException ex = new MavenReportException(e.getMessage());
View Full Code Here

Examples of org.apache.maven.doxia.sink.Sink

        try {
      String[] reports = this.reportsDir.list(HtmlFilter.INSTANCE);
      //boolean styleDone = false;
       
      ResourceBundle bundle = getBundle( locale );
      Sink sink = this.getSink();
            sinkBeginReport(sink, bundle);
            sink.sectionTitle1();
          sink.text( bundle.getString( "report.fitnesse.name" ) );
          sink.sectionTitle1_();
      for(String report : reports) {
                //String html = html(report);
                Document document = Jsoup.parse(new File(this.reportsDir, report), null);
                Elements tables = document.getElementsByTag("table");
                // Is it a top-level index page?
                if(tables.size() == 1 &&
                    testTdElements(tables.get(0).getElementsByTag("td"), "name", "right", "wrong", "exceptions")) {
                     
                  Elements hrefs = document.getElementsByTag("a");
                  for(Element href : hrefs) {
                    String extant = href.attr("href");
                    href.attr("href", OUTPUT_NAME + "." + extant);
                  }
                    sink.rawText(document.html());
          /*
                  if(!styleDone) {
                        addElements(sink, document.head().getElementsByTag("link"));
                        addElements(sink, document.head().getElementsByTag("script"));
                        styleDone = true;
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.