@Test public void testInit() throws IOException { Map<String, String> args = new HashMap<>(); args.put(AppendFileAction.FILE_PATH, "/Test"); args.put(AppendFileAction.LENGTH, "100000000000000"); AppendFileAction appendFileAction = new AppendFileAction(); appendFileAction.init(args); args.put(AppendFileAction.BUF_SIZE, "1024"); appendFileAction.init(args); }
@Override public void init(Map<String, String> args) { try { this.conf = getContext().getConf(); String nameNodeURL = this.conf.get(SmartConfKeys.SMART_DFS_NAMENODE_RPCSERVER_KEY); conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, nameNodeURL); } catch (NullPointerException e) { this.conf = new Configuration(); appendLog("Conf error!, NameNode URL is not configured!"); } super.init(args); this.srcPath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE)) { bufferSize = Integer.valueOf(args.get(BUF_SIZE)); } if (args.containsKey(LENGTH)) { length = Long.valueOf(args.get(LENGTH)); } }
AppendFileAction extends HdfsAction { @Override public void init(Map<String, String> args) { try { this.conf = getContext().getConf(); String nameNodeURL = this.conf.get(SmartConfKeys.SMART_DFS_NAMENODE_RPCSERVER_KEY); conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, nameNodeURL); } catch (NullPointerException e) { this.conf = new Configuration(); appendLog("Conf error!, NameNode URL is not configured!"); } super.init(args); this.srcPath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE)) { bufferSize = Integer.valueOf(args.get(BUF_SIZE)); } if (args.containsKey(LENGTH)) { length = Long.valueOf(args.get(LENGTH)); } } }
AppendFileAction extends HdfsAction { @Override public void init(Map<String, String> args) { try { this.conf = getContext().getConf(); String nameNodeURL = this.conf.get(SmartConfKeys.SMART_DFS_NAMENODE_RPCSERVER_KEY); conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, nameNodeURL); } catch (NullPointerException e) { this.conf = new Configuration(); appendLog("Conf error!, NameNode URL is not configured!"); } super.init(args); this.srcPath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE)) { bufferSize = Integer.valueOf(args.get(BUF_SIZE)); } if (args.containsKey(LENGTH)) { length = Long.valueOf(args.get(LENGTH)); } }  }
AppendFileAction extends HdfsAction { @Override public void init(Map<String, String> args) { try { this.conf = getContext().getConf(); String nameNodeURL = this.conf.get(SmartConfKeys.SMART_DFS_NAMENODE_RPCSERVER_KEY); conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, nameNodeURL); } catch (NullPointerException e) { this.conf = new Configuration(); appendLog("Conf error!, NameNode URL is not configured!"); } super.init(args); this.srcPath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE)) { bufferSize = Integer.valueOf(args.get(BUF_SIZE)); } if (args.containsKey(LENGTH)) { length = Long.valueOf(args.get(LENGTH)); } }  @Override void init(Map<String, String> args); }
AppendFileAction extends HdfsAction { @Override public void init(Map<String, String> args) { try { this.conf = getContext().getConf(); String nameNodeURL = this.conf.get(SmartConfKeys.SMART_DFS_NAMENODE_RPCSERVER_KEY); conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, nameNodeURL); } catch (NullPointerException e) { this.conf = new Configuration(); appendLog("Conf error!, NameNode URL is not configured!"); } super.init(args); this.srcPath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE)) { bufferSize = Integer.valueOf(args.get(BUF_SIZE)); } if (args.containsKey(LENGTH)) { length = Long.valueOf(args.get(LENGTH)); } }  @Override void init(Map<String, String> args);  }