/** * @see stream.io.Stream#init() */ @Override public void init() throws Exception { stream.init(); } }
/** * @throws Exception * @see stream.io.Source#init() */ public void init() throws Exception { stream.init(); }
/** * @see stream.io.Stream#init() */ @Override public void init() throws Exception { stream.init(); }
/** * @throws Exception * @see stream.io.Source#init() */ public void init() throws Exception { stream.init(); }
/** * @see stream.io.Stream#init() */ @Override public void init() throws Exception { stream.init(); }
/** * @see stream.io.Source#init() */ @Override public void init() throws Exception { stream.init(); }
/** * @see stream.io.Stream#init() */ @SuppressWarnings("unchecked") @Override public void init() throws Exception { Runtime runtime = Runtime.getRuntime(); process = runtime.exec(command); dataStreamClass = (Class<? extends Stream>) Class.forName(format); Constructor<? extends Stream> stream = dataStreamClass .getConstructor(InputStream.class); InputStream input = process.getInputStream(); dataStream = stream.newInstance(input); dataStream.init(); }
/** * @see stream.io.Stream#init() */ @SuppressWarnings("unchecked") @Override public void init() throws Exception { Runtime runtime = Runtime.getRuntime(); process = runtime.exec(command); dataStreamClass = (Class<? extends Stream>) Class.forName(format); Constructor<? extends Stream> stream = dataStreamClass .getConstructor(InputStream.class); InputStream input = process.getInputStream(); dataStream = stream.newInstance(input); dataStream.init(); }
/** * @see stream.io.Stream#init() */ @SuppressWarnings("unchecked") @Override public void init() throws Exception { Runtime runtime = Runtime.getRuntime(); process = runtime.exec(command); dataStreamClass = (Class<? extends Stream>) Class.forName(format); Constructor<? extends Stream> stream = dataStreamClass .getConstructor(InputStream.class); InputStream input = process.getInputStream(); dataStream = stream.newInstance(input); dataStream.init(); }
/** * @see backtype.storm.spout.ISpout#open(java.util.Map, * backtype.storm.task.TopologyContext, * backtype.storm.spout.SpoutOutputCollector) */ @SuppressWarnings("rawtypes") @Override public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { this.output = collector; try { if (stream == null) stream = createStream(); stream.init(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("Failed to open stream: " + e.getMessage()); } }
/** * @see stream.io.Stream#init() */ @Override public void init() throws Exception { for (Stream s : streams.values()) { s.init(); } log.info("initialized all Streams."); if (activate) { // TODO CentralThreadPool? this.pool = Executors.newFixedThreadPool(1); this.activeWrapper = new SimpleActiveStream(this, pool); this.activeWrapper.activate(); log.info("Activated this multiStream."); } }
/** * @see stream.io.Stream#init() */ @Override public void init() throws Exception { for (Stream s : streams.values()) { s.init(); } log.info("initialized all Streams."); if (activate) { // TODO CentralThreadPool? this.pool = Executors.newFixedThreadPool(1); this.activeWrapper = new SimpleActiveStream(this, pool); this.activeWrapper.activate(); log.info("Activated this multiStream."); } }
/** * @see stream.io.Stream#init() */ @Override public void init() throws Exception { for (Stream s : streams.values()) { s.init(); } log.info("initialized all Streams."); if (activate) { this.activeWrapper = new ActiveDataStreamImpl(this); this.activeWrapper.activate(); log.info("Activated this multiStream."); } } }
public DataStreamRecordReader(InputSplit inputSplit, JobConf conf) throws Exception { super(); this.split = (FileSplit) inputSplit; @SuppressWarnings("unchecked") Class<? extends Stream> streamClass = (Class<? extends Stream>) Class .forName(conf.get("input.stream.class", "stream.io.CsvStream")); final Path file = split.getPath(); final FileSystem fs = file.getFileSystem(conf); log.info("Creating new DataStreamRecordReader..."); log.info("...file = " + file.toString()); log.info("...streamClass = " + streamClass.getName()); log.info("...inputSplit = " + inputSplit.toString()); inputStream = fs.open(file); InputStream in = inputStream; inputStream.seek(split.getStart()); CompressionCodecFactory factory = new CompressionCodecFactory(conf); CompressionCodec codec = factory.getCodec(file); if (codec != null) { Decompressor decompressor = CodecPool.getDecompressor(codec); in = codec.createInputStream(in, decompressor); log.info("The compression codec is " + codec); } else { log.info("There is no (or no compatible) compression. Installed codecs: " + CompressionCodecFactory.getCodecClasses(conf)); } Constructor<? extends Stream> constructor = streamClass.getDeclaredConstructor(InputStream.class); stream = constructor.newInstance(in); stream.init(); }
public JsonFileRecordReader(InputSplit inputSplit, JobConf conf) throws IOException { log.debug("Creating BobStreamRecordReader for split {}", inputSplit); this.split = inputSplit; this.jobConf = conf; FileSplit fileSplit = (FileSplit) inputSplit; path = fileSplit.getPath(); final FileSystem fileSystem = path.getFileSystem(jobConf); inputStream = fileSystem.open(path); totalSize = fileSplit.getLength() * 1.0f; position = fileSplit.getStart(); log.debug("Starting to read BobRecords at {}", position); inputStream.seek(position); try { this.stream = new JSONStream(new InputStreamURL(inputStream)); this.stream.init(); } catch (Exception e) { throw new IOException(e); } }