Package org.springframework.data.hadoop.store.output

Examples of org.springframework.data.hadoop.store.output.TextSequenceFileWriter


  @Test
  public void testWriteReadSequenceFileOneLine() throws IOException {
    String[] dataArray = new String[] { DATA10 };

    TextSequenceFileWriter writer = new TextSequenceFileWriter(getConfiguration(), testDefaultPath, null);
    TestUtils.writeData(writer, dataArray);

    TextSequenceFileReader reader = new TextSequenceFileReader(getConfiguration(), testDefaultPath, null);
    TestUtils.readDataAndAssert(reader, dataArray);
  }
View Full Code Here


    TestUtils.readDataAndAssert(reader, dataArray);
  }

  @Test
  public void testWriteReadSequenceFileManyLines() throws IOException {
    TextSequenceFileWriter writer = new TextSequenceFileWriter(getConfiguration(), testDefaultPath, null);
    TestUtils.writeData(writer, DATA09ARRAY);

    TextSequenceFileReader reader = new TextSequenceFileReader(getConfiguration(), testDefaultPath, null);
    TestUtils.readDataAndAssert(reader, DATA09ARRAY);
  }
View Full Code Here

//    TestUtils.readDataAndAssert(reader, DATA09ARRAY);
//  }

  @Test
  public void testWriteReadManyLinesWithBzip2() throws IOException {
    TextSequenceFileWriter writer = new TextSequenceFileWriter(getConfiguration(), testDefaultPath,
        Codecs.BZIP2.getCodecInfo());
    TestUtils.writeData(writer, DATA09ARRAY);

    TextSequenceFileReader reader = new TextSequenceFileReader(getConfiguration(), testDefaultPath,
        Codecs.BZIP2.getCodecInfo());
View Full Code Here

    TestUtils.readDataAndAssert(reader, DATA09ARRAY);
  }

  @Test
  public void testWriteReadManyLinesWithNamingAndRollover() throws IOException {
    TextSequenceFileWriter writer = new TextSequenceFileWriter(getConfiguration(), testDefaultPath, null);
    writer.setFileNamingStrategy(new RollingFileNamingStrategy());
    writer.setRolloverStrategy(new SizeRolloverStrategy(150));
    writer.setIdleTimeout(10000);

    TestUtils.writeData(writer, DATA09ARRAY);

    TextSequenceFileReader reader1 = new TextSequenceFileReader(getConfiguration(), new Path(testDefaultPath, "0"), null);
    List<String> splitData1 = TestUtils.readData(reader1);
View Full Code Here

  private ApplicationContext context;

  @Test
  public void testWriteReadManyLines() throws IOException, InterruptedException {

    TextSequenceFileWriter writer = context.getBean("writer", TextSequenceFileWriter.class);
    assertNotNull(writer);

    TestUtils.writeData(writer, new String[] { DATA10 }, false);
    Thread.sleep(3000);
    TestUtils.writeData(writer, new String[] { DATA11 }, false);
View Full Code Here

TOP

Related Classes of org.springframework.data.hadoop.store.output.TextSequenceFileWriter

Copyright © 2018 www.massapicom. 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.