@Test public void testInit() throws IOException { Map<String, String> args = new HashMap<>(); args.put(CompressionAction.FILE_PATH, "/Test"); args.put(CompressionAction.BUF_SIZE, "1024"); CompressionAction compressionAction = new CompressionAction(); compressionAction.setDfsClient(dfsClient); compressionAction.setContext(smartContext); compressionAction.init(args); }
@Override public void init(Map<String, String> args) { super.init(args); this.conf = getContext().getConf(); this.compressCodec = conf.get( SmartConfKeys.SMART_COMPRESSION_CODEC, SmartConfKeys.SMART_COMPRESSION_CODEC_DEFAULT); this.maxSplit = conf.getInt( SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT, SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT_DEFAULT); this.filePath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty()) { this.userDefinedBufferSize = (int) StringUtil.parseToByte(args.get(BUF_SIZE)); } this.compressCodec = args.get(CODEC) != null ? args.get(CODEC) : compressCodec; this.compressTmpPath = args.containsKey(COMPRESS_TMP) ? args.get(COMPRESS_TMP) : compressTmpPath; this.progress = new MutableFloat(0.0F); }
CompressionAction extends HdfsAction { @Override public void init(Map<String, String> args) { super.init(args); this.conf = getContext().getConf(); this.compressCodec = conf.get( SmartConfKeys.SMART_COMPRESSION_CODEC, SmartConfKeys.SMART_COMPRESSION_CODEC_DEFAULT); this.maxSplit = conf.getInt( SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT, SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT_DEFAULT); this.filePath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty()) { this.userDefinedBufferSize = (int) StringUtil.parseToByte(args.get(BUF_SIZE)); } this.compressCodec = args.get(CODEC) != null ? args.get(CODEC) : compressCodec; this.compressTmpPath = args.containsKey(COMPRESS_TMP) ? args.get(COMPRESS_TMP) : compressTmpPath; this.progress = new MutableFloat(0.0F); } }
CompressionAction extends HdfsAction { @Override public void init(Map<String, String> args) { super.init(args); this.conf = getContext().getConf(); this.compressCodec = conf.get( SmartConfKeys.SMART_COMPRESSION_CODEC, SmartConfKeys.SMART_COMPRESSION_CODEC_DEFAULT); this.maxSplit = conf.getInt( SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT, SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT_DEFAULT); this.filePath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty()) { this.userDefinedBufferSize = (int) StringUtil.parseToByte(args.get(BUF_SIZE)); } this.compressCodec = args.get(CODEC) != null ? args.get(CODEC) : compressCodec; this.compressTmpPath = args.containsKey(COMPRESS_TMP) ? args.get(COMPRESS_TMP) : compressTmpPath; this.progress = new MutableFloat(0.0F); }  }
CompressionAction extends HdfsAction { @Override public void init(Map<String, String> args) { super.init(args); this.conf = getContext().getConf(); this.compressCodec = conf.get( SmartConfKeys.SMART_COMPRESSION_CODEC, SmartConfKeys.SMART_COMPRESSION_CODEC_DEFAULT); this.maxSplit = conf.getInt( SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT, SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT_DEFAULT); this.filePath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty()) { this.userDefinedBufferSize = (int) StringUtil.parseToByte(args.get(BUF_SIZE)); } this.compressCodec = args.get(CODEC) != null ? args.get(CODEC) : compressCodec; this.compressTmpPath = args.containsKey(COMPRESS_TMP) ? args.get(COMPRESS_TMP) : compressTmpPath; this.progress = new MutableFloat(0.0F); }  @Override void init(Map<String, String> args); @Override float getProgress(); }
CompressionAction extends HdfsAction { @Override public void init(Map<String, String> args) { super.init(args); this.conf = getContext().getConf(); this.compressCodec = conf.get( SmartConfKeys.SMART_COMPRESSION_CODEC, SmartConfKeys.SMART_COMPRESSION_CODEC_DEFAULT); this.maxSplit = conf.getInt( SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT, SmartConfKeys.SMART_COMPRESSION_MAX_SPLIT_DEFAULT); this.filePath = args.get(FILE_PATH); if (args.containsKey(BUF_SIZE) && !args.get(BUF_SIZE).isEmpty()) { this.userDefinedBufferSize = (int) StringUtil.parseToByte(args.get(BUF_SIZE)); } this.compressCodec = args.get(CODEC) != null ? args.get(CODEC) : compressCodec; this.compressTmpPath = args.containsKey(COMPRESS_TMP) ? args.get(COMPRESS_TMP) : compressTmpPath; this.progress = new MutableFloat(0.0F); }  @Override void init(Map<String, String> args); @Override float getProgress(); static final String BUF_SIZE; static final String CODEC; static final String XATTR_NAME; static final String COMPRESS_TMP; }