@Test public void testSaveNamedClusterRepNoName() throws KettleException, MetaStoreException { String hdfsHost = "hdfsHost"; String hdfsPort = "hdfsPort"; String jobTrackerHost = "jobTrackerHost"; String jobTrackerPort = "jobTrackerPort"; when( namedCluster.getHdfsHost() ).thenReturn( hdfsHost ); when( namedCluster.getHdfsPort() ).thenReturn( hdfsPort ); when( namedCluster.getJobTrackerHost() ).thenReturn( jobTrackerHost ); when( namedCluster.getJobTrackerPort() ).thenReturn( jobTrackerPort ); namedClusterLoadSaveUtil .saveNamedClusterRep( namedCluster, namedClusterService, repository, metaStore, id_job, objectId, logChannelInterface ); verify( repository, never() ) .saveJobEntryAttribute( eq( id_job ), eq( objectId ), eq( NamedClusterLoadSaveUtil.CLUSTER_NAME ), anyString() ); verify( repository ).saveJobEntryAttribute( id_job, objectId, NamedClusterLoadSaveUtil.HDFS_HOSTNAME, hdfsHost ); verify( repository ).saveJobEntryAttribute( id_job, objectId, NamedClusterLoadSaveUtil.HDFS_PORT, hdfsPort ); verify( repository ) .saveJobEntryAttribute( id_job, objectId, NamedClusterLoadSaveUtil.JOB_TRACKER_HOSTNAME, jobTrackerHost ); verify( repository ) .saveJobEntryAttribute( id_job, objectId, NamedClusterLoadSaveUtil.JOB_TRACKER_PORT, jobTrackerPort ); }
public void saveNamedClusterRep( NamedCluster namedCluster, NamedClusterService namedClusterService, Repository rep, IMetaStore metaStore, ObjectId id_job, ObjectId objectId, LogChannelInterface logChannelInterface ) throws KettleException { if ( namedCluster != null ) { String namedClusterName = namedCluster.getName(); if ( !Const.isEmpty( namedClusterName ) ) { rep.saveJobEntryAttribute( id_job, objectId, CLUSTER_NAME, namedClusterName ); } try { if ( !StringUtils.isEmpty( namedClusterName ) && namedClusterService.contains( namedClusterName, metaStore ) ) { namedCluster = namedClusterService.read( namedClusterName, metaStore ); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } rep.saveJobEntryAttribute( id_job, objectId, HDFS_HOSTNAME, namedCluster.getHdfsHost() ); rep.saveJobEntryAttribute( id_job, objectId, HDFS_PORT, namedCluster.getHdfsPort() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_HOSTNAME, namedCluster.getJobTrackerHost() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_PORT, namedCluster.getJobTrackerPort() ); } }
NamedClusterLoadSaveUtil { public void saveNamedClusterRep( NamedCluster namedCluster, NamedClusterService namedClusterService, Repository rep, IMetaStore metaStore, ObjectId id_job, ObjectId objectId, LogChannelInterface logChannelInterface ) throws KettleException { if ( namedCluster != null ) { String namedClusterName = namedCluster.getName(); if ( !Const.isEmpty( namedClusterName ) ) { rep.saveJobEntryAttribute( id_job, objectId, CLUSTER_NAME, namedClusterName ); } try { if ( !StringUtils.isEmpty( namedClusterName ) && namedClusterService.contains( namedClusterName, metaStore ) ) { namedCluster = namedClusterService.read( namedClusterName, metaStore ); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } rep.saveJobEntryAttribute( id_job, objectId, HDFS_HOSTNAME, namedCluster.getHdfsHost() ); rep.saveJobEntryAttribute( id_job, objectId, HDFS_PORT, namedCluster.getHdfsPort() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_HOSTNAME, namedCluster.getJobTrackerHost() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_PORT, namedCluster.getJobTrackerPort() ); } } }
NamedClusterLoadSaveUtil { public void saveNamedClusterRep( NamedCluster namedCluster, NamedClusterService namedClusterService, Repository rep, IMetaStore metaStore, ObjectId id_job, ObjectId objectId, LogChannelInterface logChannelInterface ) throws KettleException { if ( namedCluster != null ) { String namedClusterName = namedCluster.getName(); if ( !Const.isEmpty( namedClusterName ) ) { rep.saveJobEntryAttribute( id_job, objectId, CLUSTER_NAME, namedClusterName ); } try { if ( !StringUtils.isEmpty( namedClusterName ) && namedClusterService.contains( namedClusterName, metaStore ) ) { namedCluster = namedClusterService.read( namedClusterName, metaStore ); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } rep.saveJobEntryAttribute( id_job, objectId, HDFS_HOSTNAME, namedCluster.getHdfsHost() ); rep.saveJobEntryAttribute( id_job, objectId, HDFS_PORT, namedCluster.getHdfsPort() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_HOSTNAME, namedCluster.getJobTrackerHost() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_PORT, namedCluster.getJobTrackerPort() ); } }  }
NamedClusterLoadSaveUtil { public void saveNamedClusterRep( NamedCluster namedCluster, NamedClusterService namedClusterService, Repository rep, IMetaStore metaStore, ObjectId id_job, ObjectId objectId, LogChannelInterface logChannelInterface ) throws KettleException { if ( namedCluster != null ) { String namedClusterName = namedCluster.getName(); if ( !Const.isEmpty( namedClusterName ) ) { rep.saveJobEntryAttribute( id_job, objectId, CLUSTER_NAME, namedClusterName ); } try { if ( !StringUtils.isEmpty( namedClusterName ) && namedClusterService.contains( namedClusterName, metaStore ) ) { namedCluster = namedClusterService.read( namedClusterName, metaStore ); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } rep.saveJobEntryAttribute( id_job, objectId, HDFS_HOSTNAME, namedCluster.getHdfsHost() ); rep.saveJobEntryAttribute( id_job, objectId, HDFS_PORT, namedCluster.getHdfsPort() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_HOSTNAME, namedCluster.getJobTrackerHost() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_PORT, namedCluster.getJobTrackerPort() ); } }  void saveNamedClusterRep( NamedCluster namedCluster, NamedClusterService namedClusterService, Repository rep,
      IMetaStore metaStore, ObjectId id_job, ObjectId objectId, LogChannelInterface logChannelInterface ); void getXmlNamedCluster( NamedCluster namedCluster, NamedClusterService namedClusterService, IMetaStore metaStore,
      LogChannelInterface logChannelInterface, StringBuilder retval ); NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep,
                                         IMetaStore metaStore, Node entrynode,
                                         LogChannelInterface logChannelInterface ); }
NamedClusterLoadSaveUtil { public void saveNamedClusterRep( NamedCluster namedCluster, NamedClusterService namedClusterService, Repository rep, IMetaStore metaStore, ObjectId id_job, ObjectId objectId, LogChannelInterface logChannelInterface ) throws KettleException { if ( namedCluster != null ) { String namedClusterName = namedCluster.getName(); if ( !Const.isEmpty( namedClusterName ) ) { rep.saveJobEntryAttribute( id_job, objectId, CLUSTER_NAME, namedClusterName ); } try { if ( !StringUtils.isEmpty( namedClusterName ) && namedClusterService.contains( namedClusterName, metaStore ) ) { namedCluster = namedClusterService.read( namedClusterName, metaStore ); } } catch ( MetaStoreException e ) { logChannelInterface.logDebug( e.getMessage(), e ); } rep.saveJobEntryAttribute( id_job, objectId, HDFS_HOSTNAME, namedCluster.getHdfsHost() ); rep.saveJobEntryAttribute( id_job, objectId, HDFS_PORT, namedCluster.getHdfsPort() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_HOSTNAME, namedCluster.getJobTrackerHost() ); rep.saveJobEntryAttribute( id_job, objectId, JOB_TRACKER_PORT, namedCluster.getJobTrackerPort() ); } }  void saveNamedClusterRep( NamedCluster namedCluster, NamedClusterService namedClusterService, Repository rep,
      IMetaStore metaStore, ObjectId id_job, ObjectId objectId, LogChannelInterface logChannelInterface ); void getXmlNamedCluster( NamedCluster namedCluster, NamedClusterService namedClusterService, IMetaStore metaStore,
      LogChannelInterface logChannelInterface, StringBuilder retval ); NamedCluster loadClusterConfig( NamedClusterService namedClusterService, ObjectId id_jobentry, Repository rep,
                                         IMetaStore metaStore, Node entrynode,
                                         LogChannelInterface logChannelInterface ); static final String CLUSTER_NAME; static final String HDFS_HOSTNAME; static final String HDFS_PORT; static final String JOB_TRACKER_HOSTNAME; static final String JOB_TRACKER_PORT; }