@Test public void testSaveRep_WithoutClusterName() throws Exception { when( namedCluster.getZooKeeperHost() ).thenReturn( ZOOKEPER_HOST ); when( namedCluster.getZooKeeperPort() ).thenReturn( ZOOKEEPER_PORT ); util.saveRep( repository, metaStore, transId, stepId, ncs, namedCluster, log ); verify( repository ).saveStepAttribute( eq( transId ), eq( stepId ), anyInt(), eq( ZOOKEEPER_HOSTS_KEY ), eq( ZOOKEPER_HOST ) ); verify( repository ).saveStepAttribute( eq( transId ), eq( stepId ), anyInt(), eq( ZOOKEEPER_PORT_KEY ), eq( ZOOKEEPER_PORT ) ); }
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step, NamedClusterService namedClusterService, NamedCluster namedCluster, LogChannelInterface logChannelInterface ) throws KettleException { String namedClusterName = namedCluster.getName(); String m_zookeeperHosts = namedCluster.getZooKeeperHost(); String m_zookeeperPort = namedCluster.getZooKeeperPort(); if ( !StringUtils.isEmpty( namedClusterName ) ) { rep.saveStepAttribute( id_transformation, id_step, CLUSTER_NAME, namedClusterName ); try { if ( namedClusterService.contains( namedClusterName, metaStore ) ) { NamedCluster nc = namedClusterService.read( namedClusterName, metaStore ); m_zookeeperHosts = nc.getZooKeeperHost(); m_zookeeperPort = nc.getZooKeeperPort(); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } } if ( !Utils.isEmpty( m_zookeeperHosts ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_HOSTS, m_zookeeperHosts ); } if ( !Utils.isEmpty( m_zookeeperPort ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_PORT, m_zookeeperPort ); } }
NamedClusterLoadSaveUtil { public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step, NamedClusterService namedClusterService, NamedCluster namedCluster, LogChannelInterface logChannelInterface ) throws KettleException { String namedClusterName = namedCluster.getName(); String m_zookeeperHosts = namedCluster.getZooKeeperHost(); String m_zookeeperPort = namedCluster.getZooKeeperPort(); if ( !StringUtils.isEmpty( namedClusterName ) ) { rep.saveStepAttribute( id_transformation, id_step, CLUSTER_NAME, namedClusterName ); try { if ( namedClusterService.contains( namedClusterName, metaStore ) ) { NamedCluster nc = namedClusterService.read( namedClusterName, metaStore ); m_zookeeperHosts = nc.getZooKeeperHost(); m_zookeeperPort = nc.getZooKeeperPort(); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } } if ( !Utils.isEmpty( m_zookeeperHosts ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_HOSTS, m_zookeeperHosts ); } if ( !Utils.isEmpty( m_zookeeperPort ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_PORT, m_zookeeperPort ); } } }
NamedClusterLoadSaveUtil { public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step, NamedClusterService namedClusterService, NamedCluster namedCluster, LogChannelInterface logChannelInterface ) throws KettleException { String namedClusterName = namedCluster.getName(); String m_zookeeperHosts = namedCluster.getZooKeeperHost(); String m_zookeeperPort = namedCluster.getZooKeeperPort(); if ( !StringUtils.isEmpty( namedClusterName ) ) { rep.saveStepAttribute( id_transformation, id_step, CLUSTER_NAME, namedClusterName ); try { if ( namedClusterService.contains( namedClusterName, metaStore ) ) { NamedCluster nc = namedClusterService.read( namedClusterName, metaStore ); m_zookeeperHosts = nc.getZooKeeperHost(); m_zookeeperPort = nc.getZooKeeperPort(); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } } if ( !Utils.isEmpty( m_zookeeperHosts ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_HOSTS, m_zookeeperHosts ); } if ( !Utils.isEmpty( m_zookeeperPort ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_PORT, m_zookeeperPort ); } }  }
NamedClusterLoadSaveUtil { public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step, NamedClusterService namedClusterService, NamedCluster namedCluster, LogChannelInterface logChannelInterface ) throws KettleException { String namedClusterName = namedCluster.getName(); String m_zookeeperHosts = namedCluster.getZooKeeperHost(); String m_zookeeperPort = namedCluster.getZooKeeperPort(); if ( !StringUtils.isEmpty( namedClusterName ) ) { rep.saveStepAttribute( id_transformation, id_step, CLUSTER_NAME, namedClusterName ); try { if ( namedClusterService.contains( namedClusterName, metaStore ) ) { NamedCluster nc = namedClusterService.read( namedClusterName, metaStore ); m_zookeeperHosts = nc.getZooKeeperHost(); m_zookeeperPort = nc.getZooKeeperPort(); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } } if ( !Utils.isEmpty( m_zookeeperHosts ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_HOSTS, m_zookeeperHosts ); } if ( !Utils.isEmpty( m_zookeeperPort ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_PORT, m_zookeeperPort ); } }  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 void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step, NamedClusterService namedClusterService, NamedCluster namedCluster, LogChannelInterface logChannelInterface ) throws KettleException { String namedClusterName = namedCluster.getName(); String m_zookeeperHosts = namedCluster.getZooKeeperHost(); String m_zookeeperPort = namedCluster.getZooKeeperPort(); if ( !StringUtils.isEmpty( namedClusterName ) ) { rep.saveStepAttribute( id_transformation, id_step, CLUSTER_NAME, namedClusterName ); try { if ( namedClusterService.contains( namedClusterName, metaStore ) ) { NamedCluster nc = namedClusterService.read( namedClusterName, metaStore ); m_zookeeperHosts = nc.getZooKeeperHost(); m_zookeeperPort = nc.getZooKeeperPort(); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } } if ( !Utils.isEmpty( m_zookeeperHosts ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_HOSTS, m_zookeeperHosts ); } if ( !Utils.isEmpty( m_zookeeperPort ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, ZOOKEEPER_PORT, m_zookeeperPort ); } }  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; }