.setExceptionHandler(faultTolerance) .setMetricRegistry(SharedMetricRegistries.getOrCreate(morphlineFileAndId)) .build();
@Override protected void setup(Context context) throws IOException, InterruptedException { File morphLineFile = new File(context.getConfiguration().get(MORPHLINE_FILE)); String morphLineId = context.getConfiguration().get(MORPHLINE_ID); RecordEmitter recordEmitter = new RecordEmitter(context); MorphlineContext morphlineContext = new MorphlineContext.Builder().build(); morphline = new org.kitesdk.morphline.base.Compiler() .compile(morphLineFile, morphLineId, morphlineContext, recordEmitter); }
@Test public void testImportSpecsWithOnlyFQCNs() { List<String> importSpecs = Arrays.asList(getClass().getName()); for (Class clazz : new MorphlineContext().getTopLevelClasses(importSpecs, CommandBuilder.class)) { //System.out.println("found " + clazz); } MorphlineContext ctx = new MorphlineContext.Builder().build(); ctx.importCommandBuilders(importSpecs); ctx.importCommandBuilders(importSpecs); }
@Test public void testCompileWithUnknownMorphlineId() throws Exception { String file = "test-morphlines/pipeWithTwoBasicCommands"; try { new Compiler().compile( new File(RESOURCES_DIR + "/" + file + ".conf"), "morphline2", new MorphlineContext.Builder().build(), null); fail(); } catch (MorphlineCompilationException e) { ; // expected } }
private MorphlineContext createMorphlineContext() { return new MorphlineContext.Builder().setMetricRegistry(new MetricRegistry()).build(); }
private MorphlineContext createMorphlineContext() { return new MorphlineContext.Builder().setMetricRegistry(new MetricRegistry()).build(); }
@Test public void testCompileWithMissingMorphline() throws Exception { String file = "test-morphlines/compileWithMissingMorphline"; try { new Compiler().compile( new File(RESOURCES_DIR + "/" + file + ".conf"), "morphline1", new MorphlineContext.Builder().build(), null); fail(); } catch (MorphlineCompilationException e) { ; // expected } }
protected Command createMorphline(Config config) { morphContext = new MorphlineContext.Builder().setMetricRegistry(new MetricRegistry()).build(); return new PipeBuilder().build(config, null, collector, morphContext); }
@Override public HBaseMorphlineContext build() { return (HBaseMorphlineContext)super.build(); }
@Override public HBaseMorphlineContext build() { return (HBaseMorphlineContext)super.build(); }
@Override public SolrMorphlineContext build() { ((SolrMorphlineContext)context).loader = loader; ((SolrMorphlineContext)context).schema = schema; return (SolrMorphlineContext) super.build(); }
@Override public SolrMorphlineContext build() { ((SolrMorphlineContext)context).loader = loader; ((SolrMorphlineContext)context).schema = schema; return (SolrMorphlineContext) super.build(); }
@Test public void testImportSpecs() { List<String> importSpecs = Arrays.asList("org.kitesdk.**", "org.apache.solr.**", "net.*", getClass().getName()); for (Class clazz : new MorphlineContext().getTopLevelClasses(importSpecs, CommandBuilder.class)) { //System.out.println("found " + clazz); } MorphlineContext ctx = new MorphlineContext.Builder().build(); ctx.importCommandBuilders(importSpecs); ctx.importCommandBuilders(importSpecs); }
@Test public void testCompileWithExplicitMorphlineId() throws Exception { String file = "test-morphlines/pipeWithTwoBasicCommands"; morphline = new Compiler().compile( new File(RESOURCES_DIR + "/" + file + ".conf"), "morphline1", new MorphlineContext.Builder().build(), null); assertNotNull(morphline); }
private MorphlineContext createMorphlineContext() { return new MorphlineContext.Builder() .setExceptionHandler(new FaultTolerance(false, false, SolrServerException.class.getName())) .setMetricRegistry(new MetricRegistry()) .build(); }
@Before public void setUp() { map = new HashMap<String, Object>(); settings = new MorphlineContext.Builder().setSettings(map).build().getTypedSettings(); }
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(); }
@Test public void testLoadSchema() throws Exception { SolrLocator locator = new SolrLocator(new MorphlineContext.Builder().build()); locator.setCollectionName("collection1"); locator.setSolrHomeDir(SOLR_INSTANCE_DIR + File.separator + "collection1"); assertNotNull(locator.getIndexSchema()); }
@Test public void testCompile() throws Exception { String file = "test-morphlines/pipeWithTwoBasicCommands"; morphline = new Compiler().compile( new File(RESOURCES_DIR + "/" + file + ".conf"), "", new MorphlineContext.Builder().build(), null); assertNotNull(morphline); new Fields(); new Metrics(); }
@Override public SolrMorphlineContext build() { ((SolrMorphlineContext)context).loader = loader; ((SolrMorphlineContext)context).schema = schema; return (SolrMorphlineContext) super.build(); }