public void init() throws IOException {
super.init();
}
private Appender getAppender(String partition) throws IOException {
Appender appender = appenderMap.get(partition);
if (appender == null) {
Path dataFile = getDataFile(partition);
FileSystem fs = dataFile.getFileSystem(context.getConf());
if (fs.exists(dataFile.getParent())) {
LOG.info("Path " + dataFile.getParent() + " already exists!");
} else {
fs.mkdirs(dataFile.getParent());
LOG.info("Add subpartition path directory :" + dataFile.getParent());
}
if (fs.exists(dataFile)) {
LOG.info("File " + dataFile + " already exists!");
FileStatus status = fs.getFileStatus(dataFile);
LOG.info("File size: " + status.getLen());
}
appender = StorageManagerFactory.getStorageManager(context.getConf()).getAppender(meta, outSchema, dataFile);
appender.enableStats();
appender.init();
appenderMap.put(partition, appender);
} else {
appender = appenderMap.get(partition);
}
return appender;