@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);
}
}
}