Package org.kitesdk.morphline.base

Examples of org.kitesdk.morphline.base.FaultTolerance


   
    int batchSize = SEQ_NUM2.incrementAndGet() % 2 == 0 ? 100 : 1;
    DocumentLoader testServer = new SolrServerDocumentLoader(solrServer, batchSize);
    MorphlineContext solrMorphlineContext = new SolrMorphlineContext.Builder()
      .setDocumentLoader(testServer)
      .setExceptionHandler(new FaultTolerance(false, false, SolrServerException.class.getName()))
      .setMetricRegistry(new MetricRegistry()).build();
   
    MorphlineHandlerImpl impl = new MorphlineHandlerImpl();
    impl.setMorphlineContext(solrMorphlineContext);
   
View Full Code Here


      throw new MorphlineCompilationException("Missing parameter: " + MORPHLINE_FILE_PARAM, null);
    }
    morphlineFileAndId = morphlineFile + "@" + morphlineId;
   
    if (morphlineContext == null) {
      FaultTolerance faultTolerance = new FaultTolerance(
          context.getBoolean(FaultTolerance.IS_PRODUCTION_MODE, false),
          context.getBoolean(FaultTolerance.IS_IGNORING_RECOVERABLE_EXCEPTIONS, false),
          context.getString(FaultTolerance.RECOVERABLE_EXCEPTION_CLASSES));
     
      morphlineContext = new MorphlineContext.Builder()
View Full Code Here

        if (LOG.isTraceEnabled()) {
            LOG.trace("CWD is {}", new File(".").getAbsolutePath());
            LOG.trace("Configuration:\n{}", Joiner.on("\n").join(new TreeMap(params).entrySet()));
        }

        FaultTolerance faultTolerance = new FaultTolerance(
            getBooleanParameter(FaultTolerance.IS_PRODUCTION_MODE, false, params),
            getBooleanParameter(FaultTolerance.IS_IGNORING_RECOVERABLE_EXCEPTIONS, false, params),
            getStringParameter(FaultTolerance.RECOVERABLE_EXCEPTION_CLASSES,
                               SolrServerException.class.getName(), params));
View Full Code Here

    }
  }
 
  @Test
  public void testFaultTolerance() throws Exception {
    FaultTolerance tolerance = new FaultTolerance(true, false);
    tolerance = new FaultTolerance(true, true, IOException.class.getName());
    tolerance.handleException(new IOException(), new Record());
   
    tolerance = new FaultTolerance(true, true, IOException.class.getName());
    tolerance.handleException(new RuntimeException(), new Record());

    tolerance = new FaultTolerance(true, true, IOException.class.getName());
    tolerance.handleException(new RuntimeException(new IOException()), new Record());

    tolerance = new FaultTolerance(true, false, IOException.class.getName());
    try {
      tolerance.handleException(new IOException(), new Record());
      fail();
    } catch (MorphlineRuntimeException e) {
      ; // expected
    }

    tolerance = new FaultTolerance(false, false, IOException.class.getName());
    try {
      tolerance.handleException(new IOException(), new Record());
      fail();
    } catch (MorphlineRuntimeException e) {
      ; // expected
    }

    tolerance = new FaultTolerance(false, false, IOException.class.getName());
    try {
      tolerance.handleException(new RuntimeException(), new Record());
      fail();
    } catch (MorphlineRuntimeException e) {
      ; // expected
    }
   
    tolerance = new FaultTolerance(true, true, Error.class.getName());
    try {
      tolerance.handleException(new Error(), new Record());
      fail();
    } catch (Error e) {
      ; // expected
    }
  }
View Full Code Here

  private MorphlineContext createMorphlineContext() {
    return new SolrMorphlineContext.Builder()
      .setDocumentLoader(testServer)
//      .setDocumentLoader(new CollectingDocumentLoader(100))
      .setExceptionHandler(new FaultTolerance(false, false, SolrServerException.class.getName()))
      .setMetricRegistry(new MetricRegistry())
      .build();
  }
View Full Code Here

    return new PipeBuilder().build(config, null, collector, createMorphlineContext());
  }

  private MorphlineContext createMorphlineContext() {
    return new MorphlineContext.Builder()
      .setExceptionHandler(new FaultTolerance(false, false, SolrServerException.class.getName()))
      .setMetricRegistry(new MetricRegistry())
      .build();
  }
View Full Code Here

     * Note that ReflectionUtils.newInstance() above also implicitly calls
     * resolver.configure(context.getConfiguration()) if the resolver
     * implements org.apache.hadoop.conf.Configurable
     */

    this.exceptionHandler = new FaultTolerance(
        context.getConfiguration().getBoolean(FaultTolerance.IS_PRODUCTION_MODE, false),
        context.getConfiguration().getBoolean(FaultTolerance.IS_IGNORING_RECOVERABLE_EXCEPTIONS, false),
        context.getConfiguration().get(FaultTolerance.RECOVERABLE_EXCEPTION_CLASSES, SolrServerException.class.getName()));
   
    this.heartBeater = new HeartBeater(context);
View Full Code Here

      LOG.trace("Configuration:\n{}", Joiner.on("\n").join(map.entrySet()));
    }

    String morphlineFileAndId = UUID.randomUUID() + "@" + morphlineId;

    FaultTolerance faultTolerance = new FaultTolerance(
        getConfiguration().getBoolean(FaultTolerance.IS_PRODUCTION_MODE, false),
        getConfiguration().getBoolean(FaultTolerance.IS_IGNORING_RECOVERABLE_EXCEPTIONS, false),
        getConfiguration().get(FaultTolerance.RECOVERABLE_EXCEPTION_CLASSES));

    Map<String, Object> mySettings = new HashMap(settings);
View Full Code Here

        map.put(entry.getKey(), entry.getValue());
      }
      LOG.trace("Configuration:\n{}", Joiner.on("\n").join(map.entrySet()));
    }
   
    FaultTolerance faultTolerance = new FaultTolerance(
        configuration.getBoolean(FaultTolerance.IS_PRODUCTION_MODE, false),
        configuration.getBoolean(FaultTolerance.IS_IGNORING_RECOVERABLE_EXCEPTIONS, false),
        configuration.get(FaultTolerance.RECOVERABLE_EXCEPTION_CLASSES, SolrServerException.class.getName())       
        );
   
View Full Code Here

TOP

Related Classes of org.kitesdk.morphline.base.FaultTolerance

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.