Package org.kitesdk.morphline.api

Examples of org.kitesdk.morphline.api.Record.replaceValues()


        try {
            Record record = new Record();
            record.put(Fields.ATTACHMENT_BODY, result);
            record.put(Fields.ATTACHMENT_MIME_TYPE, MorphlineResultToSolrMapper.OUTPUT_MIME_TYPE);
            for (Map.Entry<String, String> entry : forcedRecordFields.entrySet()) {
                record.replaceValues(entry.getKey(), entry.getValue());
            }
            collector.reset(solrUpdateWriter);
            try {
                Notifications.notifyStartSession(morphline);
                if (!morphline.process(record)) {
View Full Code Here


      while ((len = reader.read(buffer)) >= 0) {
        clob.append(buffer, 0, len);
      }
      Record outputRecord = inputRecord.copy();
      removeAttachments(outputRecord);
      outputRecord.replaceValues(outputFieldName, clob.toString());
       
      // pass record to next command in chain:
      return getChild().process(outputRecord);
    }
     
View Full Code Here

  }
 
  private Record createEvent(InputStream in, ListMultimap<String, Object> headers) {
    Record record = new Record();
    record.getFields().putAll(headers);
    record.replaceValues(Fields.ATTACHMENT_BODY, in);
    return record;
  }
 
  private String detect(Record event, boolean includeMetaData) throws IOException {
    return detect(event, includeMetaData, false);
View Full Code Here

    jdoc1.put("intField", "notAnInteger");
    collector.reset();
    assertFalse(morphline.process(jdoc1)); // can't convert

    jdoc1.replaceValues("intField", "20");
    jdoc1.put("longField", "200");
    jdoc1.put("stringField", "abc");
    jdoc1.put("boolField", "true");
    jdoc1.put("floatField", "200");
    jdoc1.put("doubleField","200");
View Full Code Here

  public void testLoadSolrWithDelete() throws Exception {
    morphline = createMorphline("test-morphlines" + File.separator + "loadSolrBasic");   

    // insert
    Record record = new Record();
    record.replaceValues(Fields.ID, "id0");
    record.replaceValues("first_name", "Nadja"); // will be sanitized
    Notifications.notifyBeginTransaction(morphline);
    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());
   
View Full Code Here

    morphline = createMorphline("test-morphlines" + File.separator + "loadSolrBasic");   

    // insert
    Record record = new Record();
    record.replaceValues(Fields.ID, "id0");
    record.replaceValues("first_name", "Nadja"); // will be sanitized
    Notifications.notifyBeginTransaction(morphline);
    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());
   
    // insert
View Full Code Here

    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());
   
    // insert
    record = new Record();
    record.replaceValues(Fields.ID, "id1");
    assertTrue(morphline.process(record.copy()));
    assertEquals(2, query("*:*").getResults().size());
   
    // deleteById
    record = new Record();
View Full Code Here

    assertTrue(morphline.process(record.copy()));
    assertEquals(2, query("*:*").getResults().size());
   
    // deleteById
    record = new Record();
    record.replaceValues(LoadSolrBuilder.LOAD_SOLR_DELETE_BY_ID, "id0");
    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());
   
    // deleteById
    record = new Record();
View Full Code Here

    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());
   
    // deleteById
    record = new Record();
    record.replaceValues(LoadSolrBuilder.LOAD_SOLR_DELETE_BY_ID, "idNonExistent");
    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());

    // insert
    record = new Record();
View Full Code Here

    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());

    // insert
    record = new Record();
    record.replaceValues(Fields.ID, "id2");
    assertTrue(morphline.process(record.copy()));
    assertEquals(2, query("*:*").getResults().size());
   
    // insert
    record = new Record();
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.