Skip to content

Commit

Permalink
[BACKLOG-25015] Refactor: StepMetaInferface holds a new default metho…
Browse files Browse the repository at this point in the history
…d interface, which will allow for decoupling PDI-data-refinery from ETL Metadata injection step
  • Loading branch information
pedrofvteixeira committed Aug 13, 2018
1 parent b8d9c76 commit f6ffec1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
18 changes: 13 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<platform.version>9.0.0.0-SNAPSHOT</platform.version>
<dependency.commons.lang.revision>2.6</dependency.commons.lang.revision>
<dependency.h2.revision>1.0.78</dependency.h2.revision>
<pentaho-hadoop-shims-api.version>${project.version}</pentaho-hadoop-shims-api.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -82,11 +83,6 @@
<artifactId>kettle-ui-swt</artifactId>
<version>${pdi.version}</version>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>meta-inject-plugin</artifactId>
<version>${pdi.version}</version>
</dependency>
<dependency>
<groupId>org.pentaho</groupId>
<artifactId>commons-xul-core</artifactId>
Expand Down Expand Up @@ -265,6 +261,18 @@
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.pentaho</groupId>
<artifactId>pentaho-hadoop-shims-api</artifactId>
<version>${pentaho-hadoop-shims-api.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
17 changes: 10 additions & 7 deletions src/main/java/org/pentaho/di/trans/util/TransUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Community Edition Project: data-refinery-pdi-plugin
*
* Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2018 by Hitachi Vantara : http://www.pentaho.com
*
* *******************************************************************************
*
Expand Down Expand Up @@ -31,7 +31,6 @@
import org.pentaho.di.repository.Repository;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.steps.metainject.MetaInjectMeta;
import org.pentaho.metastore.api.IMetaStore;

import java.util.HashMap;
Expand All @@ -45,13 +44,17 @@ public static Map<String, ProvidesDatabaseConnectionInformation> collectOutputSt
new HashMap<String, ProvidesDatabaseConnectionInformation>();
for ( StepMeta stepMeta : transMeta.getSteps() ) {
ProvidesDatabaseConnectionInformation info = getDatabaseConnectionInformation( stepMeta.getStepMetaInterface() );

if ( info != null ) {
stepMap.put( StringUtils.trimToEmpty( stepMeta.getName() ), info );
} else if ( stepMeta.getStepMetaInterface() instanceof MetaInjectMeta ) {
MetaInjectMeta metaInject = ( (MetaInjectMeta) stepMeta.getStepMetaInterface() );
TransMeta injectedTransMeta =
MetaInjectMeta.loadTransformationMeta( metaInject, repository, metastore, transMeta );
stepMap.putAll( collectOutputStepInTrans( injectedTransMeta, repository, metastore ) );
} else if ( stepMeta != null && stepMeta.getStepMetaInterface() != null ) {

TransMeta relatedTransMeta = stepMeta.getStepMetaInterface().fetchTransMeta( stepMeta.getStepMetaInterface(),
repository, metastore, transMeta );

if ( relatedTransMeta != null ) {
stepMap.putAll( collectOutputStepInTrans( relatedTransMeta, repository, metastore ) );
}
}
}
return stepMap;
Expand Down

0 comments on commit f6ffec1

Please sign in to comment.