Preconditions.checkNotNull(config.getLocation(), "Location for stream {} is unknown.", config.getName());
Location baseLocation = StreamUtils.createGenerationLocation(config.getLocation(), generation);
Locations.mkdirsIfNotExists(baseLocation);
return new TimePartitionedStreamFileWriter(baseLocation, config.getPartitionDuration(),
filePrefix, config.getIndexInterval());
} catch (Exception e) {
Throwables.propagateIfPossible(e, IOException.class);
throw new IOException(e);