Skip to content

Commit

Permalink
Feed log mover fix and late rerun file deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
shaikidris committed Oct 25, 2012
1 parent 73074dd commit a42042c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 2 additions & 3 deletions oozie/src/main/java/org/apache/ivory/logging/LogMover.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,15 @@ public int run(String[] arguments) throws Exception {
FileSystem fs = path.getFileSystem(getConf());

if (args.entityType.equalsIgnoreCase(EntityType.FEED.name())) {
// if replication wf
copyTTlogs(args, fs, path, jobInfo.getActions().get(1));
// if replication wf
copyTTlogs(args, fs, path, jobInfo.getActions().get(2));
copyOozieLog(client, fs, path, jobInfo.getId());
} else {
// if process wf
String subflowId = jobInfo.getExternalId();
WorkflowJob subflowInfo = client.getJobInfo(subflowId);
List<WorkflowAction> actions = subflowInfo.getActions();
for (WorkflowAction action : actions) {

if (action.getType().equals("pig")
|| action.getType().equals("java")) {
copyTTlogs(args, fs, path, action);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
import org.apache.hadoop.util.ToolRunner;
import org.apache.ivory.logging.LogMover;
import org.apache.ivory.messaging.MessageProducer;
import org.apache.log4j.Logger;
import org.mortbay.log.Log;

public class IvoryPostProcessing extends Configured implements Tool{
private static final Logger LOG = Logger.getLogger(IvoryPostProcessing.class);

public enum Arg{
CLUSTER("cluster","name of the current cluster"),
Expand Down Expand Up @@ -87,9 +90,12 @@ public int run(String[] args) throws Exception {

CommandLine cmd = getCommand(args);

LOG.info("Sending user message "+cmd);
invokeUserMessageProducer(cmd);
//LogMover doesnt throw exception, a failed logmover will not fail the user workflow
LOG.info("Moving logs "+cmd);
invokeLogProducer(cmd);
LOG.info("Sending ivory message "+cmd);
invokeIvoryMessageProducer(cmd);

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package org.apache.ivory.rerun.handler;

import java.io.IOException;
import java.util.Date;

import org.apache.hadoop.conf.Configuration;
Expand Down Expand Up @@ -70,12 +69,14 @@ public void handleRerun(String cluster, String entityType,
Date msgInsertTime = EntityUtil.parseDateUTC(nominalTime);
Long wait = getEventDelay(entity, nominalTime);
if (wait == -1) {
LOG.info("Late rerun expired for entity: "+entityType+"("+entityName+")");
String logDir = this.getWfEngine().getWorkflowProperty(cluster,
wfId, "logDir");
String srcClusterName = this.getWfEngine().getWorkflowProperty(
cluster, wfId, "srcClusterName");
Path lateLogPath = this.getLateLogPath(logDir, nominalTime,
srcClusterName);
Path lateLogPath = this.getLateLogPath(logDir,
EntityUtil.UTCtoURIDate(nominalTime), srcClusterName);
LOG.info("Going to delete path:" +lateLogPath);
FileSystem fs = FileSystem.get(getConfiguration(cluster,
wfId));
if (fs.exists(lateLogPath)) {
Expand Down

0 comments on commit a42042c

Please sign in to comment.