Skip to content

Commit

Permalink
Revert "[BACKLOG-18169] Added pentaho server to run configuration"
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Maring committed Sep 1, 2017
1 parent 58f767b commit e131649
Show file tree
Hide file tree
Showing 40 changed files with 816 additions and 1,229 deletions.
Expand Up @@ -2,7 +2,7 @@
* *
* Pentaho Data Integration * Pentaho Data Integration
* *
* Copyright (C) 2002-2017 by Pentaho : http://www.pentaho.com * Copyright (C) 2002-2016 by Pentaho : http://www.pentaho.com
* *
******************************************************************************* *******************************************************************************
* *
Expand Down Expand Up @@ -108,8 +108,4 @@ public Repository connectRepository( RepositoriesMeta repositoriesMeta, String r
public boolean isSafeModeEnabled(); public boolean isSafeModeEnabled();


public void setSafeModeEnabled( boolean usingSafeMode ); public void setSafeModeEnabled( boolean usingSafeMode );

String getRunConfiguration();

void setRunConfiguration( String runConfiguration );
} }
Expand Up @@ -2,7 +2,7 @@
* *
* Pentaho Data Integration * Pentaho Data Integration
* *
* Copyright (C) 2002-2017 by Pentaho : http://www.pentaho.com * Copyright (C) 2002-2016 by Pentaho : http://www.pentaho.com
* *
******************************************************************************* *******************************************************************************
* *
Expand Down Expand Up @@ -100,8 +100,6 @@ public class JobExecutionConfiguration implements ExecutionConfiguration {


private Long passedBatchId; private Long passedBatchId;


private String runConfiguration;

public JobExecutionConfiguration() { public JobExecutionConfiguration() {
executingLocally = true; executingLocally = true;
executingRemotely = false; executingRemotely = false;
Expand Down Expand Up @@ -306,14 +304,6 @@ public void setSafeModeEnabled( boolean usingSafeMode ) {
this.safeModeEnabled = usingSafeMode; this.safeModeEnabled = usingSafeMode;
} }


@Override public String getRunConfiguration() {
return runConfiguration;
}

@Override public void setRunConfiguration( String runConfiguration ) {
this.runConfiguration = runConfiguration;
}

/** /**
* @return the logLevel * @return the logLevel
*/ */
Expand Down
Expand Up @@ -22,10 +22,19 @@


package org.pentaho.di.job.entries.job; package org.pentaho.di.job.entries.job;


import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileObject;
import org.pentaho.di.cluster.SlaveServer; import org.pentaho.di.cluster.SlaveServer;
import org.pentaho.di.core.CheckResultInterface; import org.pentaho.di.core.CheckResultInterface;
import org.pentaho.di.core.Const; import org.pentaho.di.core.Const;
import org.pentaho.di.core.util.Utils;
import org.pentaho.di.core.ObjectLocationSpecificationMethod; import org.pentaho.di.core.ObjectLocationSpecificationMethod;
import org.pentaho.di.core.Result; import org.pentaho.di.core.Result;
import org.pentaho.di.core.ResultFile; import org.pentaho.di.core.ResultFile;
Expand All @@ -35,15 +44,12 @@
import org.pentaho.di.core.exception.KettleDatabaseException; import org.pentaho.di.core.exception.KettleDatabaseException;
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleXMLException; import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.extension.ExtensionPointHandler;
import org.pentaho.di.core.extension.KettleExtensionPoint;
import org.pentaho.di.core.logging.LogChannelFileWriter; import org.pentaho.di.core.logging.LogChannelFileWriter;
import org.pentaho.di.core.logging.LogLevel; import org.pentaho.di.core.logging.LogLevel;
import org.pentaho.di.core.parameters.DuplicateParamException; import org.pentaho.di.core.parameters.DuplicateParamException;
import org.pentaho.di.core.parameters.NamedParams; import org.pentaho.di.core.parameters.NamedParams;
import org.pentaho.di.core.parameters.NamedParamsDefault; import org.pentaho.di.core.parameters.NamedParamsDefault;
import org.pentaho.di.core.util.CurrentDirectoryResolver; import org.pentaho.di.core.util.CurrentDirectoryResolver;
import org.pentaho.di.core.util.Utils;
import org.pentaho.di.core.variables.VariableSpace; import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.variables.Variables; import org.pentaho.di.core.variables.Variables;
import org.pentaho.di.core.vfs.KettleVFS; import org.pentaho.di.core.vfs.KettleVFS;
Expand Down Expand Up @@ -74,14 +80,6 @@
import org.pentaho.metastore.api.IMetaStore; import org.pentaho.metastore.api.IMetaStore;
import org.w3c.dom.Node; import org.w3c.dom.Node;


import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/** /**
* Recursive definition of a Job. This step means that an entire Job has to be executed. It can be the same Job, but * Recursive definition of a Job. This step means that an entire Job has to be executed. It can be the same Job, but
* just make sure that you don't get an endless loop. Provide an escape routine using JobEval. * just make sure that you don't get an endless loop. Provide an escape routine using JobEval.
Expand Down Expand Up @@ -128,8 +126,6 @@ public class JobEntryJob extends JobEntryBase implements Cloneable, JobEntryInte


private boolean passingExport; private boolean passingExport;


private String runConfiguration;

public static final LogLevel DEFAULT_LOG_LEVEL = LogLevel.NOTHING; public static final LogLevel DEFAULT_LOG_LEVEL = LogLevel.NOTHING;


private Job job; private Job job;
Expand Down Expand Up @@ -218,15 +214,6 @@ public void setPassingExport( boolean passingExport ) {
this.passingExport = passingExport; this.passingExport = passingExport;
} }


public String getRunConfiguration() {
return runConfiguration;
}

public void setRunConfiguration( String runConfiguration ) {
this.runConfiguration = runConfiguration;
}


public String getLogFilename() { public String getLogFilename() {
String retval = ""; String retval = "";
if ( setLogfile ) { if ( setLogfile ) {
Expand Down Expand Up @@ -596,6 +583,17 @@ public Result execute( Result result, int nr ) throws KettleException {
jobLogLevel = logFileLevel; jobLogLevel = logFileLevel;
} }


// Figure out the remote slave server...
//
SlaveServer remoteSlaveServer = null;
if ( !Utils.isEmpty( remoteSlaveServerName ) ) {
String realRemoteSlaveServerName = environmentSubstitute( remoteSlaveServerName );
remoteSlaveServer = parentJob.getJobMeta().findSlaveServer( realRemoteSlaveServerName );
if ( remoteSlaveServer == null ) {
throw new KettleException( BaseMessages.getString(
PKG, "JobJob.Exception.UnableToFindRemoteSlaveServer", realRemoteSlaveServerName ) );
}
}
try { try {
// First load the job, outside of the loop... // First load the job, outside of the loop...
if ( parentJob.getJobMeta() != null ) { if ( parentJob.getJobMeta() != null ) {
Expand Down Expand Up @@ -820,40 +818,6 @@ public Result execute( Result result, int nr ) throws KettleException {
} }
} }


boolean doFallback = true;
SlaveServer remoteSlaveServer = null;
JobExecutionConfiguration executionConfiguration = new JobExecutionConfiguration();
if ( !Utils.isEmpty( runConfiguration ) ) {
log.logBasic( BaseMessages.getString( PKG, "JobTrans.RunConfig.Message" ), runConfiguration );
runConfiguration = environmentSubstitute( runConfiguration );
executionConfiguration.setRunConfiguration( runConfiguration );
try {
ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.SpoonTransBeforeStart.id, new Object[] {
executionConfiguration, parentJob.getJobMeta(), jobMeta
} );
remoteSlaveServer = executionConfiguration.getRemoteServer();
doFallback = false;
} catch ( KettleException e ) {
log.logError( e.getMessage(), getName() );
result.setNrErrors( 1 );
result.setResult( false );
return result;
}
}

if ( doFallback ) {
// Figure out the remote slave server...
//
if ( !Utils.isEmpty( remoteSlaveServerName ) ) {
String realRemoteSlaveServerName = environmentSubstitute( remoteSlaveServerName );
remoteSlaveServer = parentJob.getJobMeta().findSlaveServer( realRemoteSlaveServerName );
if ( remoteSlaveServer == null ) {
throw new KettleException( BaseMessages.getString(
PKG, "JobTrans.Exception.UnableToFindRemoteSlaveServer", realRemoteSlaveServerName ) );
}
}
}

if ( remoteSlaveServer == null ) { if ( remoteSlaveServer == null ) {
// Local execution... // Local execution...
// //
Expand Down
Expand Up @@ -29,7 +29,7 @@ JobJob.ErrorReadingJob.Text=Warning\!
JobJob.PassAllParameters.Label=Pass parameter values to sub job JobJob.PassAllParameters.Label=Pass parameter values to sub job
JobJob.Filename.Label=Job filename\: JobJob.Filename.Label=Job filename\:
JobJob.LogSettings.Group.Label=Logging settings JobJob.LogSettings.Group.Label=Logging settings
JobJob.WaitToFinish.Label=Wait for remote job to complete JobJob.WaitToFinish.Label=Wait for remote job to finish
JobJob.InternalName.Label=Name of Job\: JobJob.InternalName.Label=Name of Job\:
JobJob.SlaveServer.ToolTip=Specify the slave server to execute this job on. JobJob.SlaveServer.ToolTip=Specify the slave server to execute this job on.
JobJob.Header=Job JobJob.Header=Job
Expand Down
Expand Up @@ -4,7 +4,7 @@
#Thu Aug 20 18:52:33 CEST 2009 #Thu Aug 20 18:52:33 CEST 2009
JobTrans.Logfile.IncludeDate.Label=Include date in logfile JobTrans.Logfile.IncludeDate.Label=Include date in logfile
JobTrans.Fileformat.Kettle=Kettle transformations JobTrans.Fileformat.Kettle=Kettle transformations
JobTrans.WaitToFinish.Label=Wait for remote transformation to complete JobTrans.WaitToFinish.Label=Wait for remote transformation to finish
JobTrans.Previous.Label=Copy results to arguments JobTrans.Previous.Label=Copy results to arguments
JobTrans.NameOfTransformation.Label=Specify by name and directory JobTrans.NameOfTransformation.Label=Specify by name and directory
JobTrans.Error.UnablePrepareExec=Unable to prepare for execution of the transformation JobTrans.Error.UnablePrepareExec=Unable to prepare for execution of the transformation
Expand Down
6 changes: 0 additions & 6 deletions plugins/engine-configuration/api/pom.xml
Expand Up @@ -28,12 +28,6 @@
<version>${kettle.version}</version> <version>${kettle.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-ui-swt</artifactId>
<version>${kettle.version}</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>


<build> <build>
Expand Down
Expand Up @@ -35,5 +35,4 @@ public interface RunConfiguration {


void setName( String name ); void setName( String name );
void setDescription( String description ); void setDescription( String description );
RunConfigurationUI getUI();
} }
Expand Up @@ -24,15 +24,16 @@


package org.pentaho.di.engine.configuration.api; package org.pentaho.di.engine.configuration.api;


import org.pentaho.di.ExecutionConfiguration;
import org.pentaho.di.base.AbstractMeta; import org.pentaho.di.base.AbstractMeta;
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.variables.VariableSpace; import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.trans.TransExecutionConfiguration;
import org.pentaho.di.trans.TransMeta;


/** /**
* Created by bmorrise on 3/16/17. * Created by bmorrise on 3/16/17.
*/ */
public interface RunConfigurationExecutor { public interface RunConfigurationExecutor {
void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration, AbstractMeta meta, void execute( RunConfiguration runConfiguration, TransExecutionConfiguration configuration, AbstractMeta meta,
VariableSpace variableSpace ) throws KettleException; VariableSpace variableSpace ) throws KettleException;
} }
Expand Up @@ -36,5 +36,4 @@ public interface RunConfigurationFactory {
boolean delete( String name ); boolean delete( String name );
void deleteAll(); void deleteAll();
List<String> getNames(); List<String> getNames();
List<String> getNames( String type );
} }
Expand Up @@ -31,5 +31,4 @@ public interface RunConfigurationProvider extends RunConfigurationFactory {
RunConfiguration getConfiguration(); RunConfiguration getConfiguration();
RunConfigurationExecutor getExecutor(); RunConfigurationExecutor getExecutor();
String getType(); String getType();
boolean isSupported( String type );
} }

This file was deleted.

Expand Up @@ -24,15 +24,17 @@


package org.pentaho.di.engine.configuration.api; package org.pentaho.di.engine.configuration.api;


import org.eclipse.swt.widgets.Button; import java.lang.annotation.ElementType;
import org.eclipse.swt.widgets.Group; import java.lang.annotation.Retention;
import org.eclipse.swt.widgets.Text; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


/** /**
* Created by bmorrise on 8/22/17. * Created by bmorrise on 3/16/17.
*/ */
public interface RunConfigurationDialog { @Retention( RetentionPolicy.RUNTIME )
Text getName(); @Target( { ElementType.FIELD } )
Button getOKButton(); public @interface RunOption {
Group getGroup(); String label();
String value() default "";
} }
6 changes: 0 additions & 6 deletions plugins/engine-configuration/impl/pom.xml
Expand Up @@ -35,12 +35,6 @@
<version>${kettle.version}</version> <version>${kettle.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-ui-swt</artifactId>
<version>${kettle.version}</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>pentaho</groupId> <groupId>pentaho</groupId>
<artifactId>metastore</artifactId> <artifactId>metastore</artifactId>
Expand Down
Expand Up @@ -24,16 +24,16 @@


package org.pentaho.di.engine.configuration.impl; package org.pentaho.di.engine.configuration.impl;


import java.util.Collections;
import java.util.List;

import org.pentaho.di.engine.configuration.api.RunConfiguration; import org.pentaho.di.engine.configuration.api.RunConfiguration;
import org.pentaho.di.engine.configuration.api.RunConfigurationFactory; import org.pentaho.di.engine.configuration.api.RunConfigurationFactory;
import org.pentaho.metastore.api.IMetaStore; import org.pentaho.metastore.api.IMetaStore;
import org.pentaho.metastore.api.exceptions.MetaStoreException; import org.pentaho.metastore.api.exceptions.MetaStoreException;
import org.pentaho.metastore.persist.MetaStoreFactory; import org.pentaho.metastore.persist.MetaStoreFactory;
import org.pentaho.osgi.metastore.locator.api.MetastoreLocator; import org.pentaho.osgi.metastore.locator.api.MetastoreLocator;


import java.util.Collections;
import java.util.List;

import static org.pentaho.metastore.util.PentahoDefaults.NAMESPACE; import static org.pentaho.metastore.util.PentahoDefaults.NAMESPACE;


/** /**
Expand Down
Expand Up @@ -114,21 +114,6 @@ public List<String> getNames() {
return names; return names;
} }


public List<String> getNames( String type ) {
List<String> names = new ArrayList<>();
for ( RunConfigurationProvider runConfigurationProvider : getRunConfigurationProviders( type ) ) {
names.addAll( runConfigurationProvider.getNames() );
}
Collections.sort( names, ( o1, o2 ) -> {
if ( o2.equals( DefaultRunConfigurationProvider.DEFAULT_CONFIG_NAME ) ) {
return 1;
}
return o1.compareToIgnoreCase( o2 );
} );
return names;
}


public RunConfiguration getRunConfigurationByType( String type ) { public RunConfiguration getRunConfigurationByType( String type ) {
RunConfigurationProvider runConfigurationProvider = getProvider( type ); RunConfigurationProvider runConfigurationProvider = getProvider( type );
if ( runConfigurationProvider != null ) { if ( runConfigurationProvider != null ) {
Expand All @@ -154,19 +139,6 @@ private RunConfigurationProvider getProvider( String type ) {
return null; return null;
} }


public List<RunConfigurationProvider> getRunConfigurationProviders( String type ) {
List<RunConfigurationProvider> runConfigurationProviders = new ArrayList<>();
if ( defaultRunConfigurationProvider != null ) {
runConfigurationProviders.add( defaultRunConfigurationProvider );
}
for ( RunConfigurationProvider runConfigurationProvider : this.runConfigurationProviders ) {
if ( runConfigurationProvider.isSupported( type ) ) {
runConfigurationProviders.add( runConfigurationProvider );
}
}
return runConfigurationProviders;
}

public List<RunConfigurationProvider> getRunConfigurationProviders() { public List<RunConfigurationProvider> getRunConfigurationProviders() {
List<RunConfigurationProvider> runConfigurationProviders = new ArrayList<>(); List<RunConfigurationProvider> runConfigurationProviders = new ArrayList<>();
if ( defaultRunConfigurationProvider != null ) { if ( defaultRunConfigurationProvider != null ) {
Expand Down

0 comments on commit e131649

Please sign in to comment.