@Test public void testConstructorAbsolutePath() throws Exception { String file = "simple.file"; String dir = File.separator + "directory1" + File.separator + "directory2"; String filename = dir + File.separator + file; FileSinkBolt bolt = new FileSinkBolt(filename); Config stormConf = new Config(); bolt.prepare(stormConf, null, null); PowerMockito.verifyNew(FileWriter.class).withArguments(filename); }
@SuppressWarnings("unchecked") @Override public void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector) { HashMap<Object, Object> conf = new HashMap<Object, Object>(stormConf); String fileName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_FILE_NAME); if(fileName == null) { conf.put(AbstractFileOutputBolt.OUTPUT_FILE_NAME, this.outputFileName); } String dirName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_DIR_NAME); if(dirName == null && this.outputDirName != null) { conf.put(AbstractFileOutputBolt.OUTPUT_DIR_NAME, this.outputDirName); } super.prepare(conf, context, collector); }
FileSinkBolt extends AbstractFileOutputBolt { @SuppressWarnings("unchecked") @Override public void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector) { HashMap<Object, Object> conf = new HashMap<Object, Object>(stormConf); String fileName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_FILE_NAME); if(fileName == null) { conf.put(AbstractFileOutputBolt.OUTPUT_FILE_NAME, this.outputFileName); } String dirName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_DIR_NAME); if(dirName == null && this.outputDirName != null) { conf.put(AbstractFileOutputBolt.OUTPUT_DIR_NAME, this.outputDirName); } super.prepare(conf, context, collector); } }
FileSinkBolt extends AbstractFileOutputBolt { @SuppressWarnings("unchecked") @Override public void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector) { HashMap<Object, Object> conf = new HashMap<Object, Object>(stormConf); String fileName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_FILE_NAME); if(fileName == null) { conf.put(AbstractFileOutputBolt.OUTPUT_FILE_NAME, this.outputFileName); } String dirName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_DIR_NAME); if(dirName == null && this.outputDirName != null) { conf.put(AbstractFileOutputBolt.OUTPUT_DIR_NAME, this.outputDirName); } super.prepare(conf, context, collector); } FileSinkBolt(String filename); }
FileSinkBolt extends AbstractFileOutputBolt { @SuppressWarnings("unchecked") @Override public void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector) { HashMap<Object, Object> conf = new HashMap<Object, Object>(stormConf); String fileName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_FILE_NAME); if(fileName == null) { conf.put(AbstractFileOutputBolt.OUTPUT_FILE_NAME, this.outputFileName); } String dirName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_DIR_NAME); if(dirName == null && this.outputDirName != null) { conf.put(AbstractFileOutputBolt.OUTPUT_DIR_NAME, this.outputDirName); } super.prepare(conf, context, collector); } FileSinkBolt(String filename); @SuppressWarnings("unchecked") @Override void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector); @Override String tupleToString(Tuple input); }
FileSinkBolt extends AbstractFileOutputBolt { @SuppressWarnings("unchecked") @Override public void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector) { HashMap<Object, Object> conf = new HashMap<Object, Object>(stormConf); String fileName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_FILE_NAME); if(fileName == null) { conf.put(AbstractFileOutputBolt.OUTPUT_FILE_NAME, this.outputFileName); } String dirName = (String)conf.get(AbstractFileOutputBolt.OUTPUT_DIR_NAME); if(dirName == null && this.outputDirName != null) { conf.put(AbstractFileOutputBolt.OUTPUT_DIR_NAME, this.outputDirName); } super.prepare(conf, context, collector); } FileSinkBolt(String filename); @SuppressWarnings("unchecked") @Override void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector); @Override String tupleToString(Tuple input);  }