@Before public void setUp() throws Exception { collector = new Collector(); }
@Before public void setUp() throws IOException { fileSystem = FileSystem.get(new Configuration()); testDirectory = new Path(Files.createTempDir().getAbsolutePath()); collector = new Collector(); }
@Before public void setup() throws Exception { collector = new Collector(); }
public void run() { try { int iters = 0; MorphlineContext ctx = new MorphlineContext.Builder().build(); Config config = parse("test-morphlines/convertHTML"); Collector myCollector = new Collector(); Command myMorphline = new PipeBuilder().build(config, null, myCollector, ctx); long start = System.currentTimeMillis(); while (System.currentTimeMillis() < start + durationMillis) { Record record = new Record(); record.put("id", "123"); record.put(Fields.ATTACHMENT_BODY, bytes); for (int i = 0; i < 3; i++) { processAndVerifySuccess(myMorphline, myCollector, record.copy(), ImmutableMultimap.of("id", "123", Fields.MESSAGE, expected) ); } iters++; //break; } totalIters.addAndGet(iters); } catch (Exception e) { hasException.countDown(); throw new RuntimeException(e); } } });
@Before public void setUp() throws Exception { super.setUp(); collector = new Collector(); if (EXTERNAL_SOLR_SERVER_URL != null) { //solrServer = new ConcurrentUpdateSolrServer(EXTERNAL_SOLR_SERVER_URL, 2, 2); //solrServer = new SafeConcurrentUpdateSolrServer(EXTERNAL_SOLR_SERVER_URL, 2, 2); solrClient = getHttpSolrClient(EXTERNAL_SOLR_SERVER_URL); ((HttpSolrClient) solrClient).setParser(new XMLResponseParser()); } else { if (TEST_WITH_EMBEDDED_SOLR_SERVER) { solrClient = new TestEmbeddedSolrServer(h.getCoreContainer(), DEFAULT_TEST_CORENAME); } else { throw new RuntimeException("Not yet implemented"); //solrServer = new TestSolrServer(getSolrClient()); } } int batchSize = SEQ_NUM2.incrementAndGet() % 2 == 0 ? 100 : 1; //SolrInspector.DEFAULT_SOLR_SERVER_BATCH_SIZE : 1; testServer = new SolrServerDocumentLoader(solrClient, batchSize); deleteAllDocuments(); tempDir = createTempDir().toFile().getAbsolutePath(); }