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

Examples of org.springframework.data.hadoop.store.output.TextFileWriter.afterPropertiesSet()


    ChainedFileNamingStrategy fileNamingStrategy = new ChainedFileNamingStrategy();
    fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
    fileNamingStrategy.register(new RollingFileNamingStrategy());
    writer.setFileNamingStrategy(fileNamingStrategy);
    writer.setInWritingSuffix(".tmp");
    writer.afterPropertiesSet();
    TestUtils.writeData(writer, dataArray);

    Thread.sleep(1000);

    writer = new TextFileWriter(getConfiguration(), testDefaultPath, null);
View Full Code Here


    fileNamingStrategy = new ChainedFileNamingStrategy();
    fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
    fileNamingStrategy.register(new RollingFileNamingStrategy());
    writer.setFileNamingStrategy(fileNamingStrategy);
    writer.setInWritingSuffix(".tmp");
    writer.afterPropertiesSet();
    TestUtils.writeData(writer, dataArray);

    Thread.sleep(1000);

    writer = new TextFileWriter(getConfiguration(), testDefaultPath, null);
View Full Code Here

    fileNamingStrategy = new ChainedFileNamingStrategy();
    fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
    fileNamingStrategy.register(new RollingFileNamingStrategy());
    writer.setFileNamingStrategy(fileNamingStrategy);
    writer.setInWritingSuffix(".tmp");
    writer.afterPropertiesSet();
    TestUtils.writeData(writer, dataArray);

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

    fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
    fileNamingStrategy.register(new RollingFileNamingStrategy());
    fileNamingStrategy.register(new CodecFileNamingStrategy());
    writer.setFileNamingStrategy(fileNamingStrategy);
    writer.setInWritingSuffix(".tmp");
    writer.afterPropertiesSet();
    TestUtils.writeData(writer, dataArray);

    Thread.sleep(1000);

    writer = new TextFileWriter(getConfiguration(), testDefaultPath, Codecs.GZIP.getCodecInfo());
View Full Code Here

    fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
    fileNamingStrategy.register(new RollingFileNamingStrategy());
    fileNamingStrategy.register(new CodecFileNamingStrategy());
    writer.setFileNamingStrategy(fileNamingStrategy);
    writer.setInWritingSuffix(".tmp");
    writer.afterPropertiesSet();
    TestUtils.writeData(writer, dataArray);

    Thread.sleep(1000);

    writer = new TextFileWriter(getConfiguration(), testDefaultPath, Codecs.GZIP.getCodecInfo());
View Full Code Here

    fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
    fileNamingStrategy.register(new RollingFileNamingStrategy());
    fileNamingStrategy.register(new CodecFileNamingStrategy());
    writer.setFileNamingStrategy(fileNamingStrategy);
    writer.setInWritingSuffix(".tmp");
    writer.afterPropertiesSet();
    TestUtils.writeData(writer, dataArray);

    TextFileReader reader1 = new TextFileReader(getConfiguration(), new Path(testDefaultPath, "data-0.gzip"), Codecs.GZIP.getCodecInfo());
    List<String> splitData1 = TestUtils.readData(reader1);
View Full Code Here

    failConfiguration.set("fs.defaultFS", "hdfs://localhost:12345");
    String[] dataArray = new String[] { DATA10 };

    // use configuration which would not work for hdfs
    TextFileWriter writer = new TextFileWriter(failConfiguration, testDefaultPath, null);
    writer.afterPropertiesSet();
    writer.start();

    // restore configuration after writer lifecycle has been started
    TestUtils.setField("configuration", writer, getConfiguration());
    TestUtils.writeData(writer, dataArray);
View Full Code Here

    failConfiguration.set("fs.defaultFS", "hdfs://localhost:12345");
    String[] dataArray = new String[] { DATA10 };

    // use configuration which would not work for hdfs
    TextFileWriter writer = new TextFileWriter(failConfiguration, testDefaultPath, null);
    writer.afterPropertiesSet();
    writer.start();

    // test write exception before we switch configuration
    Exception e = null;
    try {
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.