Package com.cloudera.cdk.morphline.api

Examples of com.cloudera.cdk.morphline.api.Record.copy()


         
          if (doPrevious) { // do previous
            lines.append('\n');
            lines.append(line);
          } else {          // do next
            if (lines.length() > 0 && !flushRecord(template.copy(), lines.toString())) {
              return false;
            }
            lines.setLength(0);
            lines.append(line);             
          }
View Full Code Here


            lines.append(line);             
          }
        }         
      }
      if (lines != null && lines.length() > 0) {
        return flushRecord(template.copy(), lines.toString());
      }
      return true;
    }

    private boolean flushRecord(Record outputRecord, String lines) {
View Full Code Here

    byte[] bytes = Files.toByteArray(new File(RESOURCES_DIR + "/test-documents/blog.html"));
    Record record = new Record();
    record.put("id", "123");
    record.put(Fields.ATTACHMENT_BODY, bytes);
    for (int i = 0; i < 3; i++) {
      assertTrue(morphline.process(record.copy())); // TODO check details
    }
  } 

  @Test
  public void testConvertHTMLAndExtractLinks() throws Exception {
View Full Code Here

              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;
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.