Package org.springframework.data.hadoop.store.strategy.rollover

Examples of org.springframework.data.hadoop.store.strategy.rollover.SizeRolloverStrategy


  @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);
View Full Code Here


    PartitionTextFileWriter<Message<?>> writer =
        new PartitionTextFileWriter<Message<?>>(getConfiguration(), testDefaultPath, null, strategy);

    writer.setFileNamingStrategyFactory(new RollingFileNamingStrategy());
    writer.setRolloverStrategyFactory(new SizeRolloverStrategy(40));

    for (String data : DATA09ARRAY) {
      Map<String, Object> headers = new HashMap<String, Object>();
      headers.put("region", "foo");
      Message<String> message = MessageBuilder.withPayload(data).copyHeaders(headers).build();
View Full Code Here

  @Test
  public void testWriteReadManyLinesWithNamingAndRollover() throws IOException {

    TextFileWriter writer = new TextFileWriter(getConfiguration(), testDefaultPath, null);
    writer.setFileNamingStrategy(new RollingFileNamingStrategy());
    writer.setRolloverStrategy(new SizeRolloverStrategy(40));
    writer.setIdleTimeout(10000);

    TestUtils.writeData(writer, DATA09ARRAY);

    TextFileReader reader1 = new TextFileReader(getConfiguration(), new Path(testDefaultPath, "0"), null);
View Full Code Here

  @Test
  public void testWriteReadManyLinesWithNamingAndRolloverWithGzip() throws IOException {

    TextFileWriter writer = new TextFileWriter(getConfiguration(), testDefaultPath, Codecs.GZIP.getCodecInfo());
    writer.setFileNamingStrategy(new RollingFileNamingStrategy());
    writer.setRolloverStrategy(new SizeRolloverStrategy(40));

    // codec is buffering so we need to write some amount of
    // data before anything is actually written into a file/stream
    // writing same data over and over again is compressing a lot
    for (int i = 0; i<45000; i++) {
View Full Code Here

TOP

Related Classes of org.springframework.data.hadoop.store.strategy.rollover.SizeRolloverStrategy

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.