Skip to content

Commit

Permalink
Add more logs and only avoid export external resources
Browse files Browse the repository at this point in the history
  • Loading branch information
zhicwu committed Oct 20, 2017
1 parent 75d8ae4 commit b95a421
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pentaho-kettle/src/main/java/org/pentaho/di/job/Job.java
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ public static String sendToSlaveServer(JobMeta jobMeta, JobExecutionConfiguratio

// Start the job
//
slaveServer.getLogChannel().logBasic(new StringBuilder()
LogChannel.GENERAL.logBasic(new StringBuilder()
.append("Starting remote job[name='").append(jobName)
.append("', id='").append(carteObjectId).append("'...").toString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,10 @@ public String exportResources(VariableSpace space, Map<String, ResourceDefinitio
JobMeta jobMeta = null;

// do NOT export external or undetermined jobs
if (!ResourceDefinitionHelper.isExternalOrUndeterminedResource(
if (ResourceDefinitionHelper.isExternalOrUndeterminedResource(
specificationMethod, space, rep, parentJob, getFilename(), getDirectory(), getJobName())) {
logBasic("Not going to export [" + getFilename() + "].");
} else {
jobMeta = getJobMeta(repository, metaStore, space);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,10 @@ public String exportResources(VariableSpace space, Map<String, ResourceDefinitio
TransMeta transMeta = null;

// do NOT export external or undetermined transformations
if (!ResourceDefinitionHelper.isExternalOrUndeterminedResource(
if (ResourceDefinitionHelper.isExternalOrUndeterminedResource(
specificationMethod, space, rep, parentJob, getFilename(), getDirectory(), getTransname())) {
logBasic("Not going to export [" + getFilename() + "].");
} else {
transMeta = getTransMeta(repository, space);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ public static boolean isExternalOrUndeterminedResource(

try {
String realFileName = null;

VariableSpace tmpSpace = null;
if (parent instanceof Job) {
tmpSpace = r.resolveCurrentDirectory(spec, space, rep, (Job) parent, fileName);
Expand All @@ -674,13 +674,13 @@ public static boolean isExternalOrUndeterminedResource(
switch (spec) {
case FILENAME:
realFileName = normalizeFileName(fileName, tmpSpace, r);
result = isURI(realFileName) || containsVariable(realFileName);
result = isURI(realFileName); // || containsVariable(realFileName);
break;
case REPOSITORY_BY_NAME:
String realDirectory = normalizeFileName(directory, tmpSpace, r);
String realTransName = tmpSpace == null ? resourceName : tmpSpace.environmentSubstitute(resourceName);
realFileName = realDirectory + '/' + realTransName;
result = isURI(realDirectory) || containsVariable(realFileName);
//String realTransName = tmpSpace == null ? resourceName : tmpSpace.environmentSubstitute(resourceName);
//realFileName = realDirectory + '/' + realTransName;
result = isURI(realDirectory); // || containsVariable(realFileName);
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4297,7 +4297,7 @@ public static String sendToSlaveServer(TransMeta transMeta, TransExecutionConfig

// Prepare the transformation
//
slaveServer.getLogChannel().logBasic(new StringBuilder()
LogChannel.GENERAL.logBasic(new StringBuilder()
.append("Prepare remote transformation[name='").append(transName)
.append("', id='").append(carteObjectId).append("'...").toString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,11 @@ public String exportResources(VariableSpace space, Map<String, ResourceDefinitio
JobMeta executorJobMeta = null;

// do NOT export external or undetermined jobs
if (!ResourceDefinitionHelper.isExternalOrUndeterminedResource(
if (ResourceDefinitionHelper.isExternalOrUndeterminedResource(
getSpecificationMethod(),
space, repository, getParentStepMeta(), getFileName(), getDirectoryPath(), getJobName())) {
LogChannel.GENERAL.logBasic("Not going to export [" + getFileName() + "].");
} else {
executorJobMeta = loadJobMeta(this, repository, space);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.pentaho.di.core.exception.KettlePluginException;
import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.logging.LogChannel;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaFactory;
Expand Down Expand Up @@ -658,9 +659,11 @@ public String exportResources(VariableSpace space, Map<String, ResourceDefinitio
TransMeta executorTransMeta = null;

// do NOT export external or undetermined transformations
if (!ResourceDefinitionHelper.isExternalOrUndeterminedResource(
if (ResourceDefinitionHelper.isExternalOrUndeterminedResource(
getSpecificationMethod(), space, repository, getParentStepMeta(),
getFileName(), getDirectoryPath(), getTransName())) {
LogChannel.GENERAL.logBasic("Not going to export [" + getFileName() + "].");
} else {
executorTransMeta = loadTransMeta(this, repository, space);
}

Expand Down

0 comments on commit b95a421

Please sign in to comment.