Examples of SequenceFileBolt


Examples of org.apache.storm.hdfs.bolt.SequenceFileBolt

    } catch (URISyntaxException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    builder.setBolt("karma-generate-json", new KarmaBolt(basicKarmaBoltProperties)).shuffleGrouping("karma-seq-spout");
    SequenceFileBolt sequenceFileBolt = new SequenceFileBolt();
   
    KarmaSequenceFormat sequenceFormat = new KarmaSequenceFormat("id", "json");
    sequenceFileBolt.withSequenceFormat(sequenceFormat);
    DefaultFileNameFormat fileNameFormat = new DefaultFileNameFormat();
    fileNameFormat.withExtension(".seq");
    fileNameFormat.withPath("/tmp/storm");
    fileNameFormat.withPrefix("karma");
    sequenceFileBolt.withFileNameFormat(fileNameFormat);
    sequenceFileBolt.withFsUrl("file:///");
    sequenceFileBolt.withSyncPolicy(new CountSyncPolicy(1));
    sequenceFileBolt.withRotationPolicy(new FileSizeRotationPolicy(1, Units.KB));
    Set<String> sources = new HashSet<String>();
    sources.add(source);
    KarmaReducerBolt reducerBolt = new KarmaReducerBolt(sources);
    builder.setBolt("karma-reducer-json", reducerBolt).fieldsGrouping("karma-generate-json", new Fields("id"));
    builder.setBolt("karma-output-json", sequenceFileBolt).shuffleGrouping("karma-reducer-json");
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.