test_class.file: smart-hadoop-support/smart-hadoop/src/test/java/org/smartdata/hdfs/action/TestCompressionAction.java
test_class.identifier: TestCompressionAction
test_class.superclass: extends MiniClusterHarness
test_case.body: @Test
    public void testInit() throws IOException {
      Map<String, String> args = new HashMap<>();
      args.put(CompressionAction.FILE_PATH, "/Test");
      args.put(CompressionAction.BUF_SIZE, "1024");
  //    args.put(CompressionAction.COMPRESS_IMPL, "Lz4");
  //    args.put(CompressionAction.COMPRESS_IMPL,"Bzip2");
  //    args.put(CompressionAction.COMPRESS_IMPL,"Zlib");
      CompressionAction compressionAction = new CompressionAction();
      compressionAction.setDfsClient(dfsClient);
      compressionAction.setContext(smartContext);
      compressionAction.init(args);
    }
test_case.class_method_signature: TestCompressionAction.testInit()
test_case.full_signature: @Test public void testInit()
test_case.identifier: testInit
test_case.invocations: put put setDfsClient setContext init
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInit()
focal_class.declarator: LOG =
        LoggerFactory.getLogger(CompressionAction.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG =
        LoggerFactory.getLogger(CompressionAction.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: BUF_SIZE = "-bufSize"
focal_class.modifier: public static final
focal_class.original_string: public static final String BUF_SIZE = "-bufSize";
focal_class.type: String
focal_class.var_name: BUF_SIZE
focal_class.declarator: CODEC = "-codec"
focal_class.modifier: public static final
focal_class.original_string: public static final String CODEC = "-codec";
focal_class.type: String
focal_class.var_name: CODEC
focal_class.declarator: compressionCodecList = CompressionCodec.CODEC_LIST
focal_class.modifier: private static
focal_class.original_string: private static List<String> compressionCodecList = CompressionCodec.CODEC_LIST;
focal_class.type: List<String>
focal_class.var_name: compressionCodecList
focal_class.declarator: filePath
focal_class.modifier: private
focal_class.original_string: private String filePath;
focal_class.type: String
focal_class.var_name: filePath
focal_class.declarator: conf
focal_class.modifier: private
focal_class.original_string: private Configuration conf;
focal_class.type: Configuration
focal_class.var_name: conf
focal_class.declarator: progress
focal_class.modifier: private
focal_class.original_string: private MutableFloat progress;
focal_class.type: MutableFloat
focal_class.var_name: progress
focal_class.declarator: bufferSize = 1024 * 1024
focal_class.modifier: private
focal_class.original_string: private int bufferSize = 1024 * 1024;
focal_class.type: int
focal_class.var_name: bufferSize
focal_class.declarator: maxSplit
focal_class.modifier: private
focal_class.original_string: private int maxSplit;
focal_class.type: int
focal_class.var_name: maxSplit
focal_class.declarator: compressCodec
focal_class.modifier: private
focal_class.original_string: private String compressCodec;
focal_class.type: String
focal_class.var_name: compressCodec
focal_class.declarator: userDefinedBufferSize
focal_class.modifier: private
focal_class.original_string: private int userDefinedBufferSize;
focal_class.type: int
focal_class.var_name: userDefinedBufferSize
focal_class.declarator: XATTR_NAME =
        SmartConstants.SMART_FILE_STATE_XATTR_NAME
focal_class.modifier: public static final
focal_class.original_string: public static final String XATTR_NAME =
        SmartConstants.SMART_FILE_STATE_XATTR_NAME;
focal_class.type: String
focal_class.var_name: XATTR_NAME
focal_class.declarator: compressionFileInfo
focal_class.modifier: private
focal_class.original_string: private CompressionFileInfo compressionFileInfo;
focal_class.type: CompressionFileInfo
focal_class.var_name: compressionFileInfo
focal_class.declarator: compressionFileState
focal_class.modifier: private
focal_class.original_string: private CompressionFileState compressionFileState;
focal_class.type: CompressionFileState
focal_class.var_name: compressionFileState
focal_class.declarator: compressTmpPath
focal_class.modifier: private
focal_class.original_string: private String compressTmpPath;
focal_class.type: String
focal_class.var_name: compressTmpPath
focal_class.declarator: COMPRESS_TMP = "-compressTmp"
focal_class.modifier: public static final
focal_class.original_string: public static final String COMPRESS_TMP = "-compressTmp";
focal_class.type: String
focal_class.var_name: COMPRESS_TMP
focal_class.file: smart-hadoop-support/smart-hadoop/src/main/java/org/smartdata/hdfs/action/CompressionAction.java
focal_class.identifier: CompressionAction
focal_class.class_method_signature: CompressionAction.init(Map<String, String> args)
focal_class.full_signature: @Override public void init(Map<String, String> args)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, String> args)
focal_class.return: void
focal_class.signature: void init(Map<String, String> args)
focal_class.class_method_signature: CompressionAction.execute()
focal_class.full_signature: @Override protected void execute()
focal_class.identifier: execute
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: CompressionAction.compress(InputStream inputStream, OutputStream outputStream)
focal_class.full_signature: private void compress(InputStream inputStream, OutputStream outputStream)
focal_class.identifier: compress
focal_class.modifiers: private
focal_class.parameters: (InputStream inputStream, OutputStream outputStream)
focal_class.return: void
focal_class.signature: void compress(InputStream inputStream, OutputStream outputStream)
focal_class.class_method_signature: CompressionAction.getActualBuffSize(long fileSize)
focal_class.full_signature: private int getActualBuffSize(long fileSize)
focal_class.identifier: getActualBuffSize
focal_class.modifiers: private
focal_class.parameters: (long fileSize)
focal_class.return: int
focal_class.signature: int getActualBuffSize(long fileSize)
focal_class.class_method_signature: CompressionAction.getProgress()
focal_class.full_signature: @Override public float getProgress()
focal_class.identifier: getProgress
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: float
focal_class.signature: float getProgress()
focal_class.superclass: extends HdfsAction
focal_method.body: @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 is a temp path for compressing a file.
      this.compressTmpPath = args.containsKey(COMPRESS_TMP) ?
          args.get(COMPRESS_TMP) : compressTmpPath;
      this.progress = new MutableFloat(0.0F);
    }
focal_method.class_method_signature: CompressionAction.init(Map<String, String> args)
focal_method.full_signature: @Override public void init(Map<String, String> args)
focal_method.identifier: init
focal_method.invocations: init getConf getContext get getInt get containsKey isEmpty get parseToByte get get get containsKey get
focal_method.modifiers: @Override public
focal_method.parameters: (Map<String, String> args)
focal_method.return: void
focal_method.signature: void init(Map<String, String> args)