Package com.mozilla.grouperfish.base.json

Examples of com.mozilla.grouperfish.base.json.TsvJsonWriter


    @Override
    public Task handle(final Task task) throws Fail {
        Index index = indexes.index(task.namespace().bucket(Type.DOCUMENT));
        Assert.nonNull(task);
        try {
            final TsvJsonWriter tsvWriter = new TsvJsonWriter(writer(fs, task, inputFilename(task)));
            for (final Document doc : index.find(task.query())) tsvWriter.write(doc);
            tsvWriter.close();

            final Writer parametersWriter = writer(fs, task, parametersFilename(task));
            parametersWriter.write(task.transform().parametersJson());
            parametersWriter.close();
        }
View Full Code Here


*/
public class TsvJsonFromInputTsv {

    public static void main(String[] args) throws IOException {

        TsvJsonWriter writer =
            new TsvJsonWriter(
                new BufferedWriter(
                        new OutputStreamWriter(System.out, StreamTool.UTF8)));


        for (final Document doc : new OpinionStream(System.in)) {
            writer.write(doc);
        };

        writer.flush();
    }
View Full Code Here

TOP

Related Classes of com.mozilla.grouperfish.base.json.TsvJsonWriter

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.