@Test public void testProcessURLsubstitutionNC() throws Exception { String prefix = "hc"; String pathWithoutPrefix = " String pathWithPrefix = prefix + ":" + pathWithoutPrefix; buildAppendEncodedUserPassMocks( namedClusterHdfsUsername, namedClusterHdfsPassword ); buildExtractSchemeMocks( prefix, pathWithPrefix, pathWithoutPrefix ); assertEquals( "hdfs: namedCluster.processURLsubstitution( "hc: }
@Override public String processURLsubstitution( String incomingURL, IMetaStore metastore, VariableSpace variableSpace ) { if ( isUseGateway() ) { if ( incomingURL.startsWith( NC_SCHEME ) ) { return incomingURL; } StringBuilder builder = new StringBuilder( NC_SCHEME + ": builder.append( getName() ); builder.append( incomingURL.startsWith( "/" ) ? incomingURL : "/" + incomingURL ); return builder.toString(); } else if ( isMapr() ) { String url = processURLsubstitution( incomingURL, MAPRFS_SCHEME, metastore, variableSpace ); if ( url != null && !url.startsWith( MAPRFS_SCHEME ) ) { url = MAPRFS_SCHEME + ": } return url; } else { return processURLsubstitution( incomingURL, getStorageScheme(), metastore, variableSpace ); } }
NamedClusterImpl implements NamedCluster, NamedClusterOsgi { @Override public String processURLsubstitution( String incomingURL, IMetaStore metastore, VariableSpace variableSpace ) { if ( isUseGateway() ) { if ( incomingURL.startsWith( NC_SCHEME ) ) { return incomingURL; } StringBuilder builder = new StringBuilder( NC_SCHEME + ": builder.append( getName() ); builder.append( incomingURL.startsWith( "/" ) ? incomingURL : "/" + incomingURL ); return builder.toString(); } else if ( isMapr() ) { String url = processURLsubstitution( incomingURL, MAPRFS_SCHEME, metastore, variableSpace ); if ( url != null && !url.startsWith( MAPRFS_SCHEME ) ) { url = MAPRFS_SCHEME + ": } return url; } else { return processURLsubstitution( incomingURL, getStorageScheme(), metastore, variableSpace ); } } }
NamedClusterImpl implements NamedCluster, NamedClusterOsgi { @Override public String processURLsubstitution( String incomingURL, IMetaStore metastore, VariableSpace variableSpace ) { if ( isUseGateway() ) { if ( incomingURL.startsWith( NC_SCHEME ) ) { return incomingURL; } StringBuilder builder = new StringBuilder( NC_SCHEME + ": builder.append( getName() ); builder.append( incomingURL.startsWith( "/" ) ? incomingURL : "/" + incomingURL ); return builder.toString(); } else if ( isMapr() ) { String url = processURLsubstitution( incomingURL, MAPRFS_SCHEME, metastore, variableSpace ); if ( url != null && !url.startsWith( MAPRFS_SCHEME ) ) { url = MAPRFS_SCHEME + ": } return url; } else { return processURLsubstitution( incomingURL, getStorageScheme(), metastore, variableSpace ); } } NamedClusterImpl();  NamedClusterImpl( NamedCluster namedCluster ); }
NamedClusterImpl implements NamedCluster, NamedClusterOsgi { @Override public String processURLsubstitution( String incomingURL, IMetaStore metastore, VariableSpace variableSpace ) { if ( isUseGateway() ) { if ( incomingURL.startsWith( NC_SCHEME ) ) { return incomingURL; } StringBuilder builder = new StringBuilder( NC_SCHEME + ": builder.append( getName() ); builder.append( incomingURL.startsWith( "/" ) ? incomingURL : "/" + incomingURL ); return builder.toString(); } else if ( isMapr() ) { String url = processURLsubstitution( incomingURL, MAPRFS_SCHEME, metastore, variableSpace ); if ( url != null && !url.startsWith( MAPRFS_SCHEME ) ) { url = MAPRFS_SCHEME + ": } return url; } else { return processURLsubstitution( incomingURL, getStorageScheme(), metastore, variableSpace ); } } NamedClusterImpl();  NamedClusterImpl( NamedCluster namedCluster ); void setName( String name ); String getName(); String getShimIdentifier(); void setShimIdentifier( String shimIdentifier ); String getStorageScheme(); void setStorageScheme( String storageScheme ); void copyVariablesFrom( VariableSpace space ); String environmentSubstitute( String aString ); String[] environmentSubstitute( String[] aString ); String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ); VariableSpace getParentVariableSpace(); void setParentVariableSpace( VariableSpace parent ); String getVariable( String variableName, String defaultValue ); String getVariable( String variableName ); boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); void initializeVariablesFrom( VariableSpace parent ); String[] listVariables(); void setVariable( String variableName, String variableValue ); void shareVariablesWith( VariableSpace space ); void injectVariables( Map<String, String> prop ); void replaceMeta( NamedCluster nc ); NamedClusterImpl clone(); @Override String processURLsubstitution( String incomingURL, IMetaStore metastore, VariableSpace variableSpace ); String getHostNameParsed( VariableSpace variableSpace ); @Override boolean equals( Object obj ); String getHdfsHost(); void setHdfsHost( String hdfsHost ); String getHdfsPort(); void setHdfsPort( String hdfsPort ); String getHdfsUsername(); void setHdfsUsername( String hdfsUsername ); String getHdfsPassword(); void setHdfsPassword( String hdfsPassword ); String getJobTrackerHost(); void setJobTrackerHost( String jobTrackerHost ); String getJobTrackerPort(); void setJobTrackerPort( String jobTrackerPort ); String getZooKeeperHost(); void setZooKeeperHost( String zooKeeperHost ); String getZooKeeperPort(); void setZooKeeperPort( String zooKeeperPort ); String getOozieUrl(); void setOozieUrl( String oozieUrl ); long getLastModifiedDate(); void setLastModifiedDate( long lastModifiedDate ); void setMapr( boolean mapr ); @Deprecated boolean isMapr(); @Override String toString(); String toXmlForEmbed( String rootTag ); NamedCluster fromXmlForEmbed( Node node ); @Override String getGatewayUrl(); @Override void setGatewayUrl( String gatewayUrl ); @Override String getGatewayUsername(); @Override void setGatewayUsername( String gatewayUsername ); @Override String getGatewayPassword(); @Override void setGatewayPassword( String gatewayPassword ); @Override boolean isUseGateway(); @Override void setUseGateway( boolean useGateway ); @Override String getKafkaBootstrapServers(); @Override void setKafkaBootstrapServers( String kafkaBootstrapServers ); @Override NamedClusterOsgi nonOsgiFromXmlForEmbed( Node node ); String decodePassword( String password ); String encodePassword( String password ); @Override List<NamedClusterSiteFile> getSiteFiles(); @Override void setSiteFiles( List<NamedClusterSiteFile> siteFiles ); @Override void addSiteFile( String fileName, String content ); @Override InputStream getSiteFileInputStream( String siteFileName ); }
NamedClusterImpl implements NamedCluster, NamedClusterOsgi { @Override public String processURLsubstitution( String incomingURL, IMetaStore metastore, VariableSpace variableSpace ) { if ( isUseGateway() ) { if ( incomingURL.startsWith( NC_SCHEME ) ) { return incomingURL; } StringBuilder builder = new StringBuilder( NC_SCHEME + ": builder.append( getName() ); builder.append( incomingURL.startsWith( "/" ) ? incomingURL : "/" + incomingURL ); return builder.toString(); } else if ( isMapr() ) { String url = processURLsubstitution( incomingURL, MAPRFS_SCHEME, metastore, variableSpace ); if ( url != null && !url.startsWith( MAPRFS_SCHEME ) ) { url = MAPRFS_SCHEME + ": } return url; } else { return processURLsubstitution( incomingURL, getStorageScheme(), metastore, variableSpace ); } } NamedClusterImpl();  NamedClusterImpl( NamedCluster namedCluster ); void setName( String name ); String getName(); String getShimIdentifier(); void setShimIdentifier( String shimIdentifier ); String getStorageScheme(); void setStorageScheme( String storageScheme ); void copyVariablesFrom( VariableSpace space ); String environmentSubstitute( String aString ); String[] environmentSubstitute( String[] aString ); String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ); VariableSpace getParentVariableSpace(); void setParentVariableSpace( VariableSpace parent ); String getVariable( String variableName, String defaultValue ); String getVariable( String variableName ); boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); void initializeVariablesFrom( VariableSpace parent ); String[] listVariables(); void setVariable( String variableName, String variableValue ); void shareVariablesWith( VariableSpace space ); void injectVariables( Map<String, String> prop ); void replaceMeta( NamedCluster nc ); NamedClusterImpl clone(); @Override String processURLsubstitution( String incomingURL, IMetaStore metastore, VariableSpace variableSpace ); String getHostNameParsed( VariableSpace variableSpace ); @Override boolean equals( Object obj ); String getHdfsHost(); void setHdfsHost( String hdfsHost ); String getHdfsPort(); void setHdfsPort( String hdfsPort ); String getHdfsUsername(); void setHdfsUsername( String hdfsUsername ); String getHdfsPassword(); void setHdfsPassword( String hdfsPassword ); String getJobTrackerHost(); void setJobTrackerHost( String jobTrackerHost ); String getJobTrackerPort(); void setJobTrackerPort( String jobTrackerPort ); String getZooKeeperHost(); void setZooKeeperHost( String zooKeeperHost ); String getZooKeeperPort(); void setZooKeeperPort( String zooKeeperPort ); String getOozieUrl(); void setOozieUrl( String oozieUrl ); long getLastModifiedDate(); void setLastModifiedDate( long lastModifiedDate ); void setMapr( boolean mapr ); @Deprecated boolean isMapr(); @Override String toString(); String toXmlForEmbed( String rootTag ); NamedCluster fromXmlForEmbed( Node node ); @Override String getGatewayUrl(); @Override void setGatewayUrl( String gatewayUrl ); @Override String getGatewayUsername(); @Override void setGatewayUsername( String gatewayUsername ); @Override String getGatewayPassword(); @Override void setGatewayPassword( String gatewayPassword ); @Override boolean isUseGateway(); @Override void setUseGateway( boolean useGateway ); @Override String getKafkaBootstrapServers(); @Override void setKafkaBootstrapServers( String kafkaBootstrapServers ); @Override NamedClusterOsgi nonOsgiFromXmlForEmbed( Node node ); String decodePassword( String password ); String encodePassword( String password ); @Override List<NamedClusterSiteFile> getSiteFiles(); @Override void setSiteFiles( List<NamedClusterSiteFile> siteFiles ); @Override void addSiteFile( String fileName, String content ); @Override InputStream getSiteFileInputStream( String siteFileName ); static final String HDFS_SCHEME; static final String MAPRFS_SCHEME; static final String WASB_SCHEME; static final String NC_SCHEME; static final String ID; static final String CHILD; static final String CHILDREN; static final String STRING; static final String VALUE; static final String UPPER_STRING; }