Package org.kitesdk.morphline.api

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


    assertTrue(morphline.process(record.copy()));
    assertEquals(2, query("*:*").getResults().size());
   
    // insert
    record = new Record();
    record.replaceValues(Fields.ID, "id200");
    assertTrue(morphline.process(record.copy()));
    assertEquals(3, query("*:*").getResults().size());

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


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

    // deleteByQuery
    record = new Record();
    record.replaceValues(LoadSolrBuilder.LOAD_SOLR_DELETE_BY_QUERY, "id:id2*");
    record.put(LoadSolrBuilder.LOAD_SOLR_DELETE_BY_QUERY, "text:NonExistent");
    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());
   
    // deleteByQuery
View Full Code Here

    assertTrue(morphline.process(record.copy()));
    assertEquals(1, query("*:*").getResults().size());
   
    // insert
    record = new Record();
    record.replaceValues(Fields.ID, "id3");
    assertTrue(morphline.process(record.copy()));
    assertEquals(2, query("*:*").getResults().size());

    // verify
    SolrDocumentList docs = query("*:*").getResults();
 
View Full Code Here

    protected boolean doProcess(Record inputRecord) {
      Record outputRecord = inputRecord.copy();

      // change key
      Text myTextKey = (Text)inputRecord.getFirstValue(this.keyField);
      outputRecord.replaceValues(this.keyField, MyWritable.keyStr(myTextKey));
      // change value
      MyWritable myWritableValue = (MyWritable)inputRecord.getFirstValue(this.valueField);
      outputRecord.replaceValues(this.valueField, MyWritable.valueStr(myWritableValue));
      return super.doProcess(outputRecord);
    }
View Full Code Here

      // change key
      Text myTextKey = (Text)inputRecord.getFirstValue(this.keyField);
      outputRecord.replaceValues(this.keyField, MyWritable.keyStr(myTextKey));
      // change value
      MyWritable myWritableValue = (MyWritable)inputRecord.getFirstValue(this.valueField);
      outputRecord.replaceValues(this.valueField, MyWritable.valueStr(myWritableValue));
      return super.doProcess(outputRecord);
    }
  }

  /**
 
View Full Code Here

     
      xmlReader.parse(source); // push the HTML through tagsoup into the output byte array
     
      Record outputRecord = inputRecord.copy();
      removeAttachments(outputRecord);
      outputRecord.replaceValues(Fields.ATTACHMENT_BODY, out.toByteArray());     
      incrementNumRecords();
       
      // pass record to next command in chain:
      if (!getChild().process(outputRecord)) {
        return false;
View Full Code Here

      record = getRecord(parts);
      if (record == null) {
        return; // ignore
      }
      for (Map.Entry<String, String> entry : commandLineMorphlineHeaders.entrySet()) {
        record.replaceValues(entry.getKey(), entry.getValue());
      }
      long fileLength = parts.getFileStatus().getLen();
      if (disableFileOpen) {
        in = new ByteArrayInputStream(new byte[0]);
      } else {
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.