@Test public void testGetURL() throws KettleDatabaseException, MalformedURLException { String testHostname = "testHostname"; int port = 9429; String testDbName = "testDbName"; String urlString = impalaDatabaseMeta.getURL( testHostname, "" + port, testDbName ); assertTrue( urlString.startsWith( ImpalaDatabaseMeta.URL_PREFIX ) ); urlString = "http: URL url = new URL( urlString ); assertEquals( testHostname, url.getHost() ); assertEquals( port, url.getPort() ); assertEquals( "/" + testDbName + ImpalaDatabaseMeta.AUTH_NO_SASL + ";impala_db=true", url.getPath() ); }
@Override public String getURL( String hostname, String port, String databaseName ) { StringBuilder urlBuffer = new StringBuilder(); if ( Const.isEmpty( port ) ) { port = Integer.toString( getDefaultDatabasePort() ); } String principal = getAttributes().getProperty( "principal" ); String extraPrincipal = getAttributes().getProperty( ATTRIBUTE_PREFIX_EXTRA_OPTION + getPluginId() + ".principal" ); urlBuffer.append( "jdbc:hive2: .append( databaseName ); if ( principal == null && extraPrincipal == null ) { urlBuffer.append( AUTH_NO_SASL ); } urlBuffer.append( ";impala_db=true" ); return urlBuffer.toString(); }
ImpalaDatabaseMeta extends Hive2DatabaseMeta implements DatabaseInterface { @Override public String getURL( String hostname, String port, String databaseName ) { StringBuilder urlBuffer = new StringBuilder(); if ( Const.isEmpty( port ) ) { port = Integer.toString( getDefaultDatabasePort() ); } String principal = getAttributes().getProperty( "principal" ); String extraPrincipal = getAttributes().getProperty( ATTRIBUTE_PREFIX_EXTRA_OPTION + getPluginId() + ".principal" ); urlBuffer.append( "jdbc:hive2: .append( databaseName ); if ( principal == null && extraPrincipal == null ) { urlBuffer.append( AUTH_NO_SASL ); } urlBuffer.append( ";impala_db=true" ); return urlBuffer.toString(); } }
ImpalaDatabaseMeta extends Hive2DatabaseMeta implements DatabaseInterface { @Override public String getURL( String hostname, String port, String databaseName ) { StringBuilder urlBuffer = new StringBuilder(); if ( Const.isEmpty( port ) ) { port = Integer.toString( getDefaultDatabasePort() ); } String principal = getAttributes().getProperty( "principal" ); String extraPrincipal = getAttributes().getProperty( ATTRIBUTE_PREFIX_EXTRA_OPTION + getPluginId() + ".principal" ); urlBuffer.append( "jdbc:hive2: .append( databaseName ); if ( principal == null && extraPrincipal == null ) { urlBuffer.append( AUTH_NO_SASL ); } urlBuffer.append( ";impala_db=true" ); return urlBuffer.toString(); } ImpalaDatabaseMeta( DriverLocator driverLocator, NamedClusterService namedClusterService,
                             MetastoreLocator metastoreLocator ); }
ImpalaDatabaseMeta extends Hive2DatabaseMeta implements DatabaseInterface { @Override public String getURL( String hostname, String port, String databaseName ) { StringBuilder urlBuffer = new StringBuilder(); if ( Const.isEmpty( port ) ) { port = Integer.toString( getDefaultDatabasePort() ); } String principal = getAttributes().getProperty( "principal" ); String extraPrincipal = getAttributes().getProperty( ATTRIBUTE_PREFIX_EXTRA_OPTION + getPluginId() + ".principal" ); urlBuffer.append( "jdbc:hive2: .append( databaseName ); if ( principal == null && extraPrincipal == null ) { urlBuffer.append( AUTH_NO_SASL ); } urlBuffer.append( ";impala_db=true" ); return urlBuffer.toString(); } ImpalaDatabaseMeta( DriverLocator driverLocator, NamedClusterService namedClusterService,
                             MetastoreLocator metastoreLocator ); @Override int[] getAccessTypeList(); @Override String getDriverClass(); @Override String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean useAutoinc,
                                    boolean addFieldname, boolean addCr ); @Override String getURL( String hostname, String port, String databaseName ); @Override String[] getUsedLibraries(); @Override int getDefaultDatabasePort(); @Override List<String> getNamedClusterList(); @Override void putOptionalOptions( Map<String, String> extraOptions ); }
ImpalaDatabaseMeta extends Hive2DatabaseMeta implements DatabaseInterface { @Override public String getURL( String hostname, String port, String databaseName ) { StringBuilder urlBuffer = new StringBuilder(); if ( Const.isEmpty( port ) ) { port = Integer.toString( getDefaultDatabasePort() ); } String principal = getAttributes().getProperty( "principal" ); String extraPrincipal = getAttributes().getProperty( ATTRIBUTE_PREFIX_EXTRA_OPTION + getPluginId() + ".principal" ); urlBuffer.append( "jdbc:hive2: .append( databaseName ); if ( principal == null && extraPrincipal == null ) { urlBuffer.append( AUTH_NO_SASL ); } urlBuffer.append( ";impala_db=true" ); return urlBuffer.toString(); } ImpalaDatabaseMeta( DriverLocator driverLocator, NamedClusterService namedClusterService,
                             MetastoreLocator metastoreLocator ); @Override int[] getAccessTypeList(); @Override String getDriverClass(); @Override String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean useAutoinc,
                                    boolean addFieldname, boolean addCr ); @Override String getURL( String hostname, String port, String databaseName ); @Override String[] getUsedLibraries(); @Override int getDefaultDatabasePort(); @Override List<String> getNamedClusterList(); @Override void putOptionalOptions( Map<String, String> extraOptions ); static final String AUTH_NO_SASL; }