formatSpec, streamInput.getStartTime(), streamInput.getEndTime(), StructuredRecord.class); return (JavaPairRDD<K, V>) sec.fromStream(streamInput.getName(), streamInput.getStartTime(), streamInput.getEndTime(), valueClass); } else { return sec.fromStream(streamInput.getName(), streamInput.getStartTime(), streamInput.getEndTime(), decoderClass, keyClass, valueClass); } catch (Exception e) {
@Override public Map<String, String> getInputFormatConfiguration() { try { StreamConfig streamConfig = streamAdmin.getConfig(streamId); Location streamPath = StreamUtils.createGenerationLocation(streamConfig.getLocation(), StreamUtils.getGeneration(streamConfig)); Configuration hConf = new Configuration(); hConf.clear(); AbstractStreamInputFormat.setStreamId(hConf, streamId); AbstractStreamInputFormat.setTTL(hConf, streamConfig.getTTL()); AbstractStreamInputFormat.setStreamPath(hConf, streamPath.toURI()); AbstractStreamInputFormat.setTimeRange(hConf, streamInput.getStartTime(), streamInput.getEndTime()); FormatSpecification formatSpec = streamInput.getBodyFormatSpec(); if (formatSpec != null) { AbstractStreamInputFormat.setBodyFormatSpecification(hConf, formatSpec); } else { String decoderType = streamInput.getDecoderType(); if (decoderType != null) { AbstractStreamInputFormat.setDecoderClassName(hConf, decoderType); } } return ConfigurationUtil.toMap(hConf); } catch (IOException e) { throw Throwables.propagate(e); } } }