@Test public void testSiteXMLParsingImportDataprocNamedCluster() { ThinNameClusterModel model = new ThinNameClusterModel(); model.setName( ncTestName ); model.setShimVendor( "Dataproc" ); model.setShimVersion( "1.4" ); JSONObject result = hadoopClusterManager.importNamedCluster( model, getFiles( "src/test/resources/dataproc" ) ); assertEquals( ncTestName, result.get( "namedCluster" ) ); verify( namedCluster ).setJobTrackerHost( "cluster-ec0a-m-0" ); verify( namedCluster ).setJobTrackerPort( "" ); verify( namedCluster ).setZooKeeperHost( "cluster-ec0a-m-0,cluster-ec0a-m-1,cluster-ec0a-m-2" ); }
public JSONObject importNamedCluster( ThinNameClusterModel model, Map<String, CachedFileItemStream> siteFilesSource ) { JSONObject response = new JSONObject(); response.put( NAMED_CLUSTER, "" ); try { NamedCluster nc = namedClusterService.getClusterTemplate(); nc.setHdfsHost( "" ); nc.setHdfsPort( "" ); nc.setJobTrackerHost( "" ); nc.setJobTrackerPort( "" ); nc.setZooKeeperHost( "" ); nc.setZooKeeperPort( "" ); nc.setOozieUrl( "" ); nc.setName( model.getName() ); nc.setHdfsUsername( model.getHdfsUsername() ); nc.setHdfsPassword( nc.encodePassword( model.getHdfsPassword() ) ); if ( variableSpace != null ) { nc.shareVariablesWith( variableSpace ); } else { nc.initializeVariablesFrom( null ); } boolean isConfigurationSet = configureNamedCluster( siteFilesSource, nc, model.getShimVendor(), model.getShimVersion() ); if ( isConfigurationSet ) { deleteNamedClusterSchemaOnly( model ); setupKnoxSecurity( nc, model ); deleteConfigFolder( nc.getName() ); installSiteFiles( siteFilesSource, nc ); namedClusterService.create( nc, metaStore ); createConfigProperties( nc ); setupKerberosSecurity( model, siteFilesSource, "", "" ); response.put( NAMED_CLUSTER, nc.getName() ); } } catch ( Exception e ) { log.logError( e.getMessage() ); } return response; }
HadoopClusterManager implements RuntimeTestProgressCallback { public JSONObject importNamedCluster( ThinNameClusterModel model, Map<String, CachedFileItemStream> siteFilesSource ) { JSONObject response = new JSONObject(); response.put( NAMED_CLUSTER, "" ); try { NamedCluster nc = namedClusterService.getClusterTemplate(); nc.setHdfsHost( "" ); nc.setHdfsPort( "" ); nc.setJobTrackerHost( "" ); nc.setJobTrackerPort( "" ); nc.setZooKeeperHost( "" ); nc.setZooKeeperPort( "" ); nc.setOozieUrl( "" ); nc.setName( model.getName() ); nc.setHdfsUsername( model.getHdfsUsername() ); nc.setHdfsPassword( nc.encodePassword( model.getHdfsPassword() ) ); if ( variableSpace != null ) { nc.shareVariablesWith( variableSpace ); } else { nc.initializeVariablesFrom( null ); } boolean isConfigurationSet = configureNamedCluster( siteFilesSource, nc, model.getShimVendor(), model.getShimVersion() ); if ( isConfigurationSet ) { deleteNamedClusterSchemaOnly( model ); setupKnoxSecurity( nc, model ); deleteConfigFolder( nc.getName() ); installSiteFiles( siteFilesSource, nc ); namedClusterService.create( nc, metaStore ); createConfigProperties( nc ); setupKerberosSecurity( model, siteFilesSource, "", "" ); response.put( NAMED_CLUSTER, nc.getName() ); } } catch ( Exception e ) { log.logError( e.getMessage() ); } return response; } }
HadoopClusterManager implements RuntimeTestProgressCallback { public JSONObject importNamedCluster( ThinNameClusterModel model, Map<String, CachedFileItemStream> siteFilesSource ) { JSONObject response = new JSONObject(); response.put( NAMED_CLUSTER, "" ); try { NamedCluster nc = namedClusterService.getClusterTemplate(); nc.setHdfsHost( "" ); nc.setHdfsPort( "" ); nc.setJobTrackerHost( "" ); nc.setJobTrackerPort( "" ); nc.setZooKeeperHost( "" ); nc.setZooKeeperPort( "" ); nc.setOozieUrl( "" ); nc.setName( model.getName() ); nc.setHdfsUsername( model.getHdfsUsername() ); nc.setHdfsPassword( nc.encodePassword( model.getHdfsPassword() ) ); if ( variableSpace != null ) { nc.shareVariablesWith( variableSpace ); } else { nc.initializeVariablesFrom( null ); } boolean isConfigurationSet = configureNamedCluster( siteFilesSource, nc, model.getShimVendor(), model.getShimVersion() ); if ( isConfigurationSet ) { deleteNamedClusterSchemaOnly( model ); setupKnoxSecurity( nc, model ); deleteConfigFolder( nc.getName() ); installSiteFiles( siteFilesSource, nc ); namedClusterService.create( nc, metaStore ); createConfigProperties( nc ); setupKerberosSecurity( model, siteFilesSource, "", "" ); response.put( NAMED_CLUSTER, nc.getName() ); } } catch ( Exception e ) { log.logError( e.getMessage() ); } return response; } HadoopClusterManager( Spoon spoon, NamedClusterService namedClusterService, IMetaStore metaStore,
                               String internalShim ); }
HadoopClusterManager implements RuntimeTestProgressCallback { public JSONObject importNamedCluster( ThinNameClusterModel model, Map<String, CachedFileItemStream> siteFilesSource ) { JSONObject response = new JSONObject(); response.put( NAMED_CLUSTER, "" ); try { NamedCluster nc = namedClusterService.getClusterTemplate(); nc.setHdfsHost( "" ); nc.setHdfsPort( "" ); nc.setJobTrackerHost( "" ); nc.setJobTrackerPort( "" ); nc.setZooKeeperHost( "" ); nc.setZooKeeperPort( "" ); nc.setOozieUrl( "" ); nc.setName( model.getName() ); nc.setHdfsUsername( model.getHdfsUsername() ); nc.setHdfsPassword( nc.encodePassword( model.getHdfsPassword() ) ); if ( variableSpace != null ) { nc.shareVariablesWith( variableSpace ); } else { nc.initializeVariablesFrom( null ); } boolean isConfigurationSet = configureNamedCluster( siteFilesSource, nc, model.getShimVendor(), model.getShimVersion() ); if ( isConfigurationSet ) { deleteNamedClusterSchemaOnly( model ); setupKnoxSecurity( nc, model ); deleteConfigFolder( nc.getName() ); installSiteFiles( siteFilesSource, nc ); namedClusterService.create( nc, metaStore ); createConfigProperties( nc ); setupKerberosSecurity( model, siteFilesSource, "", "" ); response.put( NAMED_CLUSTER, nc.getName() ); } } catch ( Exception e ) { log.logError( e.getMessage() ); } return response; } HadoopClusterManager( Spoon spoon, NamedClusterService namedClusterService, IMetaStore metaStore,
                               String internalShim ); JSONObject importNamedCluster( ThinNameClusterModel model,
                                        Map<String, CachedFileItemStream> siteFilesSource ); JSONObject createNamedCluster( ThinNameClusterModel model,
                                        Map<String, CachedFileItemStream> siteFilesSource ); JSONObject editNamedCluster( ThinNameClusterModel model, boolean isEditMode,
                                      Map<String, CachedFileItemStream> siteFilesSource ); ThinNameClusterModel getNamedCluster( String namedCluster ); JSONObject installDriver( FileItemStream driver ); boolean isValidConfigurationFile( String fileName ); void deleteNamedCluster( IMetaStore metaStore, String namedCluster, boolean refreshTree ); Object runTests( RuntimeTester runtimeTester, String namedCluster ); void onProgress( final RuntimeTestStatus clusterTestStatus ); }
HadoopClusterManager implements RuntimeTestProgressCallback { public JSONObject importNamedCluster( ThinNameClusterModel model, Map<String, CachedFileItemStream> siteFilesSource ) { JSONObject response = new JSONObject(); response.put( NAMED_CLUSTER, "" ); try { NamedCluster nc = namedClusterService.getClusterTemplate(); nc.setHdfsHost( "" ); nc.setHdfsPort( "" ); nc.setJobTrackerHost( "" ); nc.setJobTrackerPort( "" ); nc.setZooKeeperHost( "" ); nc.setZooKeeperPort( "" ); nc.setOozieUrl( "" ); nc.setName( model.getName() ); nc.setHdfsUsername( model.getHdfsUsername() ); nc.setHdfsPassword( nc.encodePassword( model.getHdfsPassword() ) ); if ( variableSpace != null ) { nc.shareVariablesWith( variableSpace ); } else { nc.initializeVariablesFrom( null ); } boolean isConfigurationSet = configureNamedCluster( siteFilesSource, nc, model.getShimVendor(), model.getShimVersion() ); if ( isConfigurationSet ) { deleteNamedClusterSchemaOnly( model ); setupKnoxSecurity( nc, model ); deleteConfigFolder( nc.getName() ); installSiteFiles( siteFilesSource, nc ); namedClusterService.create( nc, metaStore ); createConfigProperties( nc ); setupKerberosSecurity( model, siteFilesSource, "", "" ); response.put( NAMED_CLUSTER, nc.getName() ); } } catch ( Exception e ) { log.logError( e.getMessage() ); } return response; } HadoopClusterManager( Spoon spoon, NamedClusterService namedClusterService, IMetaStore metaStore,
                               String internalShim ); JSONObject importNamedCluster( ThinNameClusterModel model,
                                        Map<String, CachedFileItemStream> siteFilesSource ); JSONObject createNamedCluster( ThinNameClusterModel model,
                                        Map<String, CachedFileItemStream> siteFilesSource ); JSONObject editNamedCluster( ThinNameClusterModel model, boolean isEditMode,
                                      Map<String, CachedFileItemStream> siteFilesSource ); ThinNameClusterModel getNamedCluster( String namedCluster ); JSONObject installDriver( FileItemStream driver ); boolean isValidConfigurationFile( String fileName ); void deleteNamedCluster( IMetaStore metaStore, String namedCluster, boolean refreshTree ); Object runTests( RuntimeTester runtimeTester, String namedCluster ); void onProgress( final RuntimeTestStatus clusterTestStatus ); static final String STRING_NAMED_CLUSTERS; static final String PLACEHOLDER_VALUE; }