Skip to content

Commit

Permalink
[PDI-13378] Cannot set variable as port number in new "Named cluster"
Browse files Browse the repository at this point in the history
dialog
  • Loading branch information
e-cuellar committed Jan 16, 2015
1 parent 90d9df4 commit 816c8bd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
Expand Up @@ -66,15 +66,15 @@ public NamedCluster getClusterTemplate() {
clusterTemplate = new NamedCluster(); clusterTemplate = new NamedCluster();
clusterTemplate.setName( "new cluster" ); clusterTemplate.setName( "new cluster" );
clusterTemplate.setNameNodeHost( "localhost" ); clusterTemplate.setNameNodeHost( "localhost" );
clusterTemplate.setNameNodePort( 50070 ); clusterTemplate.setNameNodePort( "50070" );
clusterTemplate.setHdfsHost( "localhost" ); clusterTemplate.setHdfsHost( "localhost" );
clusterTemplate.setHdfsPort( 50075 ); clusterTemplate.setHdfsPort( "50075" );
clusterTemplate.setHdfsUsername( "user" ); clusterTemplate.setHdfsUsername( "user" );
clusterTemplate.setHdfsPassword( "password" ); clusterTemplate.setHdfsPassword( "password" );
clusterTemplate.setJobTrackerHost( "localhost" ); clusterTemplate.setJobTrackerHost( "localhost" );
clusterTemplate.setJobTrackerPort( 50030 ); clusterTemplate.setJobTrackerPort( "50030" );
clusterTemplate.setZooKeeperHost( "localhost" ); clusterTemplate.setZooKeeperHost( "localhost" );
clusterTemplate.setZooKeeperPort( 2888 ); clusterTemplate.setZooKeeperPort( "2888" );
clusterTemplate.setOozieUrl( "http://localhost:8080/oozie" ); clusterTemplate.setOozieUrl( "http://localhost:8080/oozie" );
} }
return clusterTemplate.clone(); return clusterTemplate.clone();
Expand Down
26 changes: 13 additions & 13 deletions core/src/org/pentaho/di/core/namedcluster/model/NamedCluster.java
Expand Up @@ -45,12 +45,12 @@ public class NamedCluster implements Cloneable, VariableSpace {
@MetaStoreAttribute @MetaStoreAttribute
private String nameNodeHost; private String nameNodeHost;
@MetaStoreAttribute @MetaStoreAttribute
private int nameNodePort; private String nameNodePort;


@MetaStoreAttribute @MetaStoreAttribute
private String hdfsHost; private String hdfsHost;
@MetaStoreAttribute @MetaStoreAttribute
private int hdfsPort; private String hdfsPort;
@MetaStoreAttribute @MetaStoreAttribute
private String hdfsUsername; private String hdfsUsername;
@MetaStoreAttribute ( password=true ) @MetaStoreAttribute ( password=true )
Expand All @@ -59,12 +59,12 @@ public class NamedCluster implements Cloneable, VariableSpace {
@MetaStoreAttribute @MetaStoreAttribute
private String jobTrackerHost; private String jobTrackerHost;
@MetaStoreAttribute @MetaStoreAttribute
private int jobTrackerPort; private String jobTrackerPort;


@MetaStoreAttribute @MetaStoreAttribute
private String zooKeeperHost; private String zooKeeperHost;
@MetaStoreAttribute @MetaStoreAttribute
private int zooKeeperPort; private String zooKeeperPort;


@MetaStoreAttribute @MetaStoreAttribute
private String oozieUrl; private String oozieUrl;
Expand Down Expand Up @@ -210,11 +210,11 @@ public void setNameNodeHost( String nameNodeHost ) {
this.nameNodeHost = nameNodeHost; this.nameNodeHost = nameNodeHost;
} }


public int getNameNodePort() { public String getNameNodePort() {
return nameNodePort; return nameNodePort;
} }


public void setNameNodePort( int nameNodePort ) { public void setNameNodePort( String nameNodePort ) {
this.nameNodePort = nameNodePort; this.nameNodePort = nameNodePort;
} }


Expand All @@ -226,11 +226,11 @@ public void setHdfsHost( String hdfsHost ) {
this.hdfsHost = hdfsHost; this.hdfsHost = hdfsHost;
} }


public int getHdfsPort() { public String getHdfsPort() {
return hdfsPort; return hdfsPort;
} }


public void setHdfsPort( int hdfsPort ) { public void setHdfsPort( String hdfsPort ) {
this.hdfsPort = hdfsPort; this.hdfsPort = hdfsPort;
} }


Expand Down Expand Up @@ -258,11 +258,11 @@ public void setJobTrackerHost( String jobTrackerHost ) {
this.jobTrackerHost = jobTrackerHost; this.jobTrackerHost = jobTrackerHost;
} }


public int getJobTrackerPort() { public String getJobTrackerPort() {
return jobTrackerPort; return jobTrackerPort;
} }


public void setJobTrackerPort( int jobTrackerPort ) { public void setJobTrackerPort( String jobTrackerPort ) {
this.jobTrackerPort = jobTrackerPort; this.jobTrackerPort = jobTrackerPort;
} }


Expand All @@ -274,11 +274,11 @@ public void setZooKeeperHost( String zooKeeperHost ) {
this.zooKeeperHost = zooKeeperHost; this.zooKeeperHost = zooKeeperHost;
} }


public int getZooKeeperPort() { public String getZooKeeperPort() {
return zooKeeperPort; return zooKeeperPort;
} }


public void setZooKeeperPort( int zooKeeperPort ) { public void setZooKeeperPort( String zooKeeperPort ) {
this.zooKeeperPort = zooKeeperPort; this.zooKeeperPort = zooKeeperPort;
} }


Expand All @@ -298,4 +298,4 @@ public void setLastModifiedDate( long lastModifiedDate ) {
this.lastModifiedDate = lastModifiedDate; this.lastModifiedDate = lastModifiedDate;
} }


} }
Expand Up @@ -73,7 +73,7 @@ public NamedClusterComposite( Composite parent, NamedCluster namedCluster, Props
gridData.widthHint = 300; gridData.widthHint = 300;


numberGridData = new GridData(); numberGridData = new GridData();
numberGridData.widthHint = 80; numberGridData.widthHint = 160;


labelGridData = new GridData(); labelGridData = new GridData();
labelGridData.widthHint = 300; labelGridData.widthHint = 300;
Expand Down Expand Up @@ -210,7 +210,7 @@ public void invoke( NamedCluster nc, TextVar textVar, String value ) {
Callback hdfsPortCB = new Callback() { Callback hdfsPortCB = new Callback() {
public void invoke( NamedCluster nc, TextVar textVar, String value ) { public void invoke( NamedCluster nc, TextVar textVar, String value ) {
try { try {
nc.setHdfsPort( Integer.parseInt( value ) ); nc.setHdfsPort( value );
} catch ( NumberFormatException nfe ) { } catch ( NumberFormatException nfe ) {
textVar.setText( "" + nc.getHdfsPort() ); textVar.setText( "" + nc.getHdfsPort() );
} }
Expand Down Expand Up @@ -258,7 +258,7 @@ public void invoke( NamedCluster nc, TextVar textVar, String value ) {
Callback portCB = new Callback() { Callback portCB = new Callback() {
public void invoke( NamedCluster nc, TextVar textVar, String value ) { public void invoke( NamedCluster nc, TextVar textVar, String value ) {
try { try {
nc.setNameNodePort( Integer.parseInt( value ) ); nc.setNameNodePort( value );
} catch ( NumberFormatException nfe ) { } catch ( NumberFormatException nfe ) {
textVar.setText( "" + nc.getNameNodePort() ); textVar.setText( "" + nc.getNameNodePort() );
} }
Expand Down Expand Up @@ -286,7 +286,7 @@ public void invoke( NamedCluster nc, TextVar textVar, String value ) {
Callback portCB = new Callback() { Callback portCB = new Callback() {
public void invoke( NamedCluster nc, TextVar textVar, String value ) { public void invoke( NamedCluster nc, TextVar textVar, String value ) {
try { try {
nc.setJobTrackerPort( Integer.parseInt( value ) ); nc.setJobTrackerPort( value );
} catch ( NumberFormatException nfe ) { } catch ( NumberFormatException nfe ) {
textVar.setText( "" + nc.getJobTrackerPort() ); textVar.setText( "" + nc.getJobTrackerPort() );
} }
Expand Down Expand Up @@ -314,7 +314,7 @@ public void invoke( NamedCluster nc, TextVar textVar, String value ) {
Callback portCB = new Callback() { Callback portCB = new Callback() {
public void invoke( NamedCluster nc, TextVar textVar, String value ) { public void invoke( NamedCluster nc, TextVar textVar, String value ) {
try { try {
nc.setZooKeeperPort( Integer.parseInt( value ) ); nc.setZooKeeperPort( value );
} catch ( NumberFormatException nfe ) { } catch ( NumberFormatException nfe ) {
textVar.setText( "" + nc.getZooKeeperPort() ); textVar.setText( "" + nc.getZooKeeperPort() );
} }
Expand Down

0 comments on commit 816c8bd

Please sign in to comment.