incubator-hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Yoon (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HAMA-473) Local files should be deleted when task is completed or killed
Date Wed, 21 Dec 2011 06:05:30 GMT

     [ https://issues.apache.org/jira/browse/HAMA-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Edward J. Yoon resolved HAMA-473.
---------------------------------

    Resolution: Fixed

I'm committing below small patch and close this.

{code}
Index: core/src/main/java/org/apache/hama/bsp/GroomServer.java
===================================================================
--- core/src/main/java/org/apache/hama/bsp/GroomServer.java     (revision 1221542)
+++ core/src/main/java/org/apache/hama/bsp/GroomServer.java     (working copy)
@@ -521,6 +521,17 @@

     synchronized (rjob) {
       if (!rjob.localized) {
+
+        FileSystem localFs = FileSystem.getLocal(conf);
+        Path jobDir = localJobFile.getParent();
+        if (localFs.exists(jobDir)){
+          localFs.delete(jobDir, true);
+          boolean b = localFs.mkdirs(jobDir);
+          if (!b)
+            throw new IOException("Not able to create job directory "
+                                  + jobDir.toString());
+        }
+
         Path localJarFile = defaultJobConf.getLocalPath(SUBDIR + "/"
             + task.getTaskID() + "/" + "job.jar");
         systemFS.copyToLocalFile(new Path(task.getJobFile()), localJobFile);
{code}
                
> Local files should be deleted when task is completed or killed
> --------------------------------------------------------------
>
>                 Key: HAMA-473
>                 URL: https://issues.apache.org/jira/browse/HAMA-473
>             Project: Hama
>          Issue Type: Bug
>          Components: bsp
>    Affects Versions: 0.3.0
>            Reporter: Edward J. Yoon
>            Assignee: Edward J. Yoon
>             Fix For: 0.4.0
>
>
> I think, below codes should be just moved into Child.done() method.
> {code}
>           if (taskStatus.getRunState() == TaskStatus.State.RUNNING) {
>             if (!tip.runner.isAlive()) {
>               if (taskStatus.getRunState() != TaskStatus.State.FAILED) {
>                 taskStatus.setRunState(TaskStatus.State.SUCCEEDED);
>                 LOG.info("Task '" + taskStatus.getTaskId().toString()
>                     + "' has completed.");
>               }
>               taskStatus.setPhase(TaskStatus.Phase.CLEANUP);
>             }
>           }
> {code}
> and, local files should be deleted when task is completed, or killed.
> {code}
>             // TODO Use the cleanup thread
>             // tasksToCleanup.put(action);
>             KillTaskAction killAction = (KillTaskAction) action;
>             if (tasks.containsKey(killAction.getTaskID())) {
>               TaskInProgress tip = tasks.get(killAction.getTaskID());
>               tip.taskStatus.setRunState(TaskStatus.State.FAILED);
>               try {
>                 tip.killAndCleanup(true);
>               } catch (IOException ioe) {
>                 throw new DirectiveException("Error when killing a "
>                     + "TaskInProgress.", ioe);
>               }
>             }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message