test_class.file: smart-hadoop-support/smart-hadoop/src/test/java/org/smartdata/hdfs/action/TestUncacheFileAction.java
test_class.identifier: TestUncacheFileAction
test_class.superclass: extends MiniClusterHarness
test_case.body: @Test
    public void testUncacheFile() throws Exception {
      final String file = "/testUncache/file";
      Path dir = new Path("/testUncache");
      dfs.mkdirs(dir);
      // write to DISK
      dfs.setStoragePolicy(dir, "HOT");
      final FSDataOutputStream out = dfs.create(new Path(file));
      out.writeChars("testUncache");
      out.close();
  
      // Create cache pool
      CacheScheduler.createCachePool(dfsClient);
  
      CacheFileAction cacheFileAction = new CacheFileAction();
      cacheFileAction.setDfsClient(dfsClient);
      cacheFileAction.setContext(smartContext);
      Map<String, String> argsCache = new HashMap();
      argsCache.put(CacheFileAction.FILE_PATH, file);
      cacheFileAction.init(argsCache);
  
      UncacheFileAction uncacheFileAction = new UncacheFileAction();
      uncacheFileAction.setDfsClient(dfsClient);
      uncacheFileAction.setContext(smartContext);
  
      Map<String, String> argsUncache = new HashMap();
      argsUncache.put(UncacheFileAction.FILE_PATH, file);
      uncacheFileAction.init(argsUncache);
  
      cacheFileAction.run();
      Assert.assertTrue(cacheFileAction.getExpectedAfterRun());
      Assert.assertTrue(cacheFileAction.isCached(file));
  
      uncacheFileAction.run();
      Assert.assertTrue(uncacheFileAction.getExpectedAfterRun());
      Assert.assertFalse(cacheFileAction.isCached(file));
    }
test_case.class_method_signature: TestUncacheFileAction.testUncacheFile()
test_case.full_signature: @Test public void testUncacheFile()
test_case.identifier: testUncacheFile
test_case.invocations: mkdirs setStoragePolicy create writeChars close createCachePool setDfsClient setContext put init setDfsClient setContext put init run assertTrue getExpectedAfterRun assertTrue isCached run assertTrue getExpectedAfterRun assertFalse isCached
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUncacheFile()
focal_class.declarator: fileName
focal_class.modifier: private
focal_class.original_string: private String fileName;
focal_class.type: String
focal_class.var_name: fileName
focal_class.file: smart-hadoop-support/smart-hadoop/src/main/java/org/smartdata/hdfs/action/UncacheFileAction.java
focal_class.identifier: UncacheFileAction
focal_class.class_method_signature: UncacheFileAction.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: UncacheFileAction.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: UncacheFileAction.getCacheId(String fileName)
focal_class.full_signature: @VisibleForTesting Long getCacheId(String fileName)
focal_class.identifier: getCacheId
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: (String fileName)
focal_class.return: Long
focal_class.signature: Long getCacheId(String fileName)
focal_class.class_method_signature: UncacheFileAction.removeDirective(String fileName)
focal_class.full_signature: private void removeDirective(String fileName)
focal_class.identifier: removeDirective
focal_class.modifiers: private
focal_class.parameters: (String fileName)
focal_class.return: void
focal_class.signature: void removeDirective(String fileName)
focal_class.superclass: extends HdfsAction
focal_method.body: @Override
    public void init(Map<String, String> args) {
      super.init(args);
      fileName = args.get(FILE_PATH);
    }
focal_method.class_method_signature: UncacheFileAction.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 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)