@Test public void testLoadClusterConfigRepo_WithClusterName() throws Exception { doReturn( SOME_CLUSTER_NAME ).when( repository ).getJobEntryAttributeString( jobId, CLUSTER_NAME_KEY ); util.loadClusterConfig( ncs, jobId, repository, metaStore, null, mock( LogChannelInterface.class ) ); verify( ncs ).getNamedClusterByName( SOME_CLUSTER_NAME, metaStore ); verify( namedCluster ).setZooKeeperHost( ZOOKEPER_HOST ); verify( namedCluster ).setZooKeeperPort( ZOOKEEPER_PORT ); }
public NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep, IMetaStore metaStore, Node entrynode, LogChannelInterface logChannelInterface ) { NamedCluster nc = null; String clusterName = null; try { if ( entrynode != null ) { clusterName = XMLHandler.getTagValue( entrynode, CLUSTER_NAME ); } else if ( rep != null ) { clusterName = rep.getJobEntryAttributeString( id_jobentry, CLUSTER_NAME ); } if ( !StringUtils.isEmpty( clusterName ) ) { nc = namedClusterService.getNamedClusterByName( clusterName, metaStore ); } if ( nc != null ) { return nc; } } catch ( Throwable t ) { logChannelInterface.logDebug( t.getMessage(), t ); } nc = namedClusterService.getClusterTemplate(); if ( !StringUtils.isEmpty( clusterName ) ) { nc.setName( clusterName ); } if ( entrynode != null ) { nc.setZooKeeperHost( XMLHandler.getTagValue( entrynode, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( XMLHandler.getTagValue( entrynode, ZOOKEEPER_PORT ) ); } else if ( rep != null ) { try { nc.setZooKeeperHost( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_PORT ) ); } catch ( KettleException ke ) { logChannelInterface.logError( ke.getMessage(), ke ); } } return nc; }
NamedClusterLoadSaveUtil { public NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep, IMetaStore metaStore, Node entrynode, LogChannelInterface logChannelInterface ) { NamedCluster nc = null; String clusterName = null; try { if ( entrynode != null ) { clusterName = XMLHandler.getTagValue( entrynode, CLUSTER_NAME ); } else if ( rep != null ) { clusterName = rep.getJobEntryAttributeString( id_jobentry, CLUSTER_NAME ); } if ( !StringUtils.isEmpty( clusterName ) ) { nc = namedClusterService.getNamedClusterByName( clusterName, metaStore ); } if ( nc != null ) { return nc; } } catch ( Throwable t ) { logChannelInterface.logDebug( t.getMessage(), t ); } nc = namedClusterService.getClusterTemplate(); if ( !StringUtils.isEmpty( clusterName ) ) { nc.setName( clusterName ); } if ( entrynode != null ) { nc.setZooKeeperHost( XMLHandler.getTagValue( entrynode, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( XMLHandler.getTagValue( entrynode, ZOOKEEPER_PORT ) ); } else if ( rep != null ) { try { nc.setZooKeeperHost( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_PORT ) ); } catch ( KettleException ke ) { logChannelInterface.logError( ke.getMessage(), ke ); } } return nc; } }
NamedClusterLoadSaveUtil { public NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep, IMetaStore metaStore, Node entrynode, LogChannelInterface logChannelInterface ) { NamedCluster nc = null; String clusterName = null; try { if ( entrynode != null ) { clusterName = XMLHandler.getTagValue( entrynode, CLUSTER_NAME ); } else if ( rep != null ) { clusterName = rep.getJobEntryAttributeString( id_jobentry, CLUSTER_NAME ); } if ( !StringUtils.isEmpty( clusterName ) ) { nc = namedClusterService.getNamedClusterByName( clusterName, metaStore ); } if ( nc != null ) { return nc; } } catch ( Throwable t ) { logChannelInterface.logDebug( t.getMessage(), t ); } nc = namedClusterService.getClusterTemplate(); if ( !StringUtils.isEmpty( clusterName ) ) { nc.setName( clusterName ); } if ( entrynode != null ) { nc.setZooKeeperHost( XMLHandler.getTagValue( entrynode, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( XMLHandler.getTagValue( entrynode, ZOOKEEPER_PORT ) ); } else if ( rep != null ) { try { nc.setZooKeeperHost( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_PORT ) ); } catch ( KettleException ke ) { logChannelInterface.logError( ke.getMessage(), ke ); } } return nc; }  }
NamedClusterLoadSaveUtil { public NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep, IMetaStore metaStore, Node entrynode, LogChannelInterface logChannelInterface ) { NamedCluster nc = null; String clusterName = null; try { if ( entrynode != null ) { clusterName = XMLHandler.getTagValue( entrynode, CLUSTER_NAME ); } else if ( rep != null ) { clusterName = rep.getJobEntryAttributeString( id_jobentry, CLUSTER_NAME ); } if ( !StringUtils.isEmpty( clusterName ) ) { nc = namedClusterService.getNamedClusterByName( clusterName, metaStore ); } if ( nc != null ) { return nc; } } catch ( Throwable t ) { logChannelInterface.logDebug( t.getMessage(), t ); } nc = namedClusterService.getClusterTemplate(); if ( !StringUtils.isEmpty( clusterName ) ) { nc.setName( clusterName ); } if ( entrynode != null ) { nc.setZooKeeperHost( XMLHandler.getTagValue( entrynode, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( XMLHandler.getTagValue( entrynode, ZOOKEEPER_PORT ) ); } else if ( rep != null ) { try { nc.setZooKeeperHost( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_PORT ) ); } catch ( KettleException ke ) { logChannelInterface.logError( ke.getMessage(), ke ); } } return nc; }  NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep,
                                         IMetaStore metaStore, Node entrynode,
                                         LogChannelInterface logChannelInterface ); void getXml( StringBuilder retval, NamedClusterService namedClusterService, NamedCluster namedCluster,
                      IMetaStore metaStore, LogChannelInterface logChannelInterface ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step,
                       NamedClusterService namedClusterService, NamedCluster namedCluster,
                       LogChannelInterface logChannelInterface ); }
NamedClusterLoadSaveUtil { public NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep, IMetaStore metaStore, Node entrynode, LogChannelInterface logChannelInterface ) { NamedCluster nc = null; String clusterName = null; try { if ( entrynode != null ) { clusterName = XMLHandler.getTagValue( entrynode, CLUSTER_NAME ); } else if ( rep != null ) { clusterName = rep.getJobEntryAttributeString( id_jobentry, CLUSTER_NAME ); } if ( !StringUtils.isEmpty( clusterName ) ) { nc = namedClusterService.getNamedClusterByName( clusterName, metaStore ); } if ( nc != null ) { return nc; } } catch ( Throwable t ) { logChannelInterface.logDebug( t.getMessage(), t ); } nc = namedClusterService.getClusterTemplate(); if ( !StringUtils.isEmpty( clusterName ) ) { nc.setName( clusterName ); } if ( entrynode != null ) { nc.setZooKeeperHost( XMLHandler.getTagValue( entrynode, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( XMLHandler.getTagValue( entrynode, ZOOKEEPER_PORT ) ); } else if ( rep != null ) { try { nc.setZooKeeperHost( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_HOSTS ) ); nc.setZooKeeperPort( rep.getJobEntryAttributeString( id_jobentry, ZOOKEEPER_PORT ) ); } catch ( KettleException ke ) { logChannelInterface.logError( ke.getMessage(), ke ); } } return nc; }  NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep,
                                         IMetaStore metaStore, Node entrynode,
                                         LogChannelInterface logChannelInterface ); void getXml( StringBuilder retval, NamedClusterService namedClusterService, NamedCluster namedCluster,
                      IMetaStore metaStore, LogChannelInterface logChannelInterface ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step,
                       NamedClusterService namedClusterService, NamedCluster namedCluster,
                       LogChannelInterface logChannelInterface ); static final String CLUSTER_NAME; static final String ZOOKEEPER_HOSTS; static final String ZOOKEEPER_PORT; }