Skip to content

[PDI-20383] - Adding runconfig options to be passed through pan command #10075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rmansoor
Copy link
Contributor

No description provided.

Copy link

Failed

  • D Reliability Rating on New Code (is worse than A)
  • 25.20% Coverage on New Code (is less than 80.00%)
  • 49 New Issues (is greater than 0)

Analysis Details

49 Issues

  • Bug 1 Bug
  • Vulnerability 0 Vulnerabilities
  • Code Smell 48 Code Smells

Coverage and Duplications

  • Coverage 25.20% Coverage (25.00% Estimated after merge)
  • Duplications 0.69% Duplicated Code (17.40% Estimated after merge)

Project ID: org.pentaho.di:pdi

View in SonarQube

@buildguy
Copy link
Collaborator

👍 Frogbot scanned this pull request and did not find any new security issues.

Note:

Frogbot also supports Contextual Analysis, Secret Detection, IaC and SAST Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.


@buildguy
Copy link
Collaborator

⚠️ Build finished in 47m 31s

Build command:

mvn clean verify -B -e -Daudit -Djs.no.sandbox

⛔ Failed Tests

⛈️ 2 test(s) failed:

org.pentaho.ui.database.event.FragmentHandlerTest.org.pentaho.ui.database.event.FragmentHandlerTest (click to expand)

No more handles [gtk_init_check() failed]

org.pentaho.di.ui.trans.step.BaseStepDialog_ConnectionLine_Test.org.pentaho.di.ui.trans.step.BaseStepDialog_ConnectionLine_Test (click to expand)

No more handles [gtk_init_check() failed]

Tests run: 5713, Failures: 2, Skipped: 26    Test Results


ℹ️ This is an automatic message

Copy link
Contributor

@jonjarvis jonjarvis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a first pass review of this refactoring. I don't believe this will work for the Spark use case. Also, it might make sense to refactor the different execution models (local, remote, clustered) into their own classes entirely and make them available through a @Serviceprovider instead of via an ExtensionPoint.

/**
* Helper method to check if a string is empty.
*/
private boolean isEmpty(String str) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use org.pentaho.di.core.util.Utils.isEmpty( String ) instead of re-writing function

@@ -37,7 +37,7 @@
/**
* Created by bmorrise on 3/16/17.
*/
@ExtensionPoint( id = "RunConfigurationRunExtensionPoint", extensionPointId = "SpoonTransBeforeStart",
@ExtensionPoint( id = "RunConfigurationRunExtensionPoint", extensionPointId = "TransBeforeStart",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you rename this, you're also going to have to edit this:

SpoonTransBeforeStart( "SpoonTransBeforeStart", "Right before the transformation is started" ),

}


// Running Remotely
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a dead comment because of the refactoring

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one dead code now? Is it fully replaced by the "EnhancedPanCommandExecutor" ?

try {
// Trigger the extension point that handles run configurations
ExtensionPointHandler.callExtensionPoint( getLog(), KettleExtensionPoint.SpoonTransBeforeStart.id,
new Object[] { executionConfiguration, trans.getTransMeta(), trans.getTransMeta(), repository } );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the extension point that will execute under a run configuration if it exists. The behavior below this will have to change such that it doesn't execute if the extension point calls "execute" to run on spark. Otherwise, the lines of code following this try block will always execute a transformation locally.


try {
ExtensionPointHandler.callExtensionPoint(log, KettleExtensionPoint.SpoonTransBeforeStart.id, new Object[] {
executionConfiguration, transMeta, transMeta, repository
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the extension point that actually executes under a run configuration (if it exists). So for the spark use case, this is what would actually "execute" the Spark transformation.

return executeClustered(transMeta, executionConfiguration);

} else {
throw new KettleException(BaseMessages.getString(PKG, "PanTransformationDelegate.Error.NoExecutionTypeSpecified"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this exception always get thrown for a spark run configuration?

for (String key : paramMap.keySet()) {
transMeta.setParameterValue(key, Const.NVL(paramMap.get(key), ""));
}
transMeta.activateParameters();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the parameters have to be activated for the spark execution model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants