Package org.apache.hadoop.gateway.topology

Examples of org.apache.hadoop.gateway.topology.Service


    assertThat( topology.getName(), is( "topology" ) );
    assertThat( topology.getTimestamp(), is( file.lastModified() ) );
    assertThat( topology.getServices().size(), is( 1 ) );

    Service comp = topology.getServices().iterator().next();
    assertThat( comp, notNullValue() );
    assertThat( comp.getRole(), is( "NAMENODE" ) );
    assertThat( comp.getUrl(), is( new URL( "http://host:80/webhdfs/v1" ) ) );

    Provider provider = topology.getProviders().iterator().next();
    assertThat( provider, notNullValue() );
    assertThat( provider.isEnabled(), is(true) );
    assertThat( provider.getRole(), is( "authentication" ) );
View Full Code Here


  @Test
  public void testSimpleTopology() throws IOException, SAXException, ParserConfigurationException {
    GatewayConfig config = new GatewayConfigImpl();
    Topology topology = new Topology();
    topology.setName( "test-cluster" );
    Service service = new Service();
    service.setRole( "NAMENODE" );
    service.setUrl( new URL( "http://localhost:50070/webhdfs/v1" ) );
    topology.addService( service );
    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setEnabled( true );
    ProviderParam param = new ProviderParam();
View Full Code Here

        if (serviceName != null && serviceName.isEmpty()) {
            serviceName = null;
        }
        nextToken = nextToken.substring(dotPosition + 1);

        Service service = topology.getService(serviceRole, serviceName);
        if (service == null) {
            service = new Service();
            service.setName(serviceName);
            service.setRole(serviceRole);
            topology.addService(service);
        }

        if (SERVICE_URL.equalsIgnoreCase(nextToken)) {
            service.addUrl( value );
        } else {
          dotPosition = nextToken.indexOf(DOT);
          if (dotPosition != -1) {
            String aggregator = nextToken.substring(0, dotPosition);
            nextToken = nextToken.substring(dotPosition + 1);
View Full Code Here

    assertThat( topology.getName(), is( "topology" ) );
    assertThat( topology.getTimestamp(), is( file.lastModified() ) );
    assertThat( topology.getServices().size(), is( 1 ) );

    Service comp = topology.getServices().iterator().next();
    assertThat( comp, notNullValue() );
    assertThat( comp.getRole(), is( "WEBHDFS" ) );
    assertThat( comp.getUrls().size(), is( 2 ) );
    assertThat( comp.getUrls(), hasItem( "http://host1:80/webhdfs" ) );
    assertThat( comp.getUrls(), hasItem( "http://host2:80/webhdfs" ) );

    Provider provider = topology.getProviders().iterator().next();
    assertThat( provider, notNullValue() );
    assertThat( provider.isEnabled(), is(true) );
    assertThat( provider.getRole(), is( "authentication" ) );
View Full Code Here

    assertThat( provider.getRole(), is( "test-provider-role" ) );
    assertThat( provider.getName(), is( "test-provider-name" ) );
    assertThat( provider.getParams(), hasEntry( is( "test-provider-param-name-1" ), is( "test-provider-param-value-1" ) ) );
    assertThat( provider.getParams(), hasEntry( is( "test-provider-param-name-2" ), is( "test-provider-param-value-2" ) ) );

    Service service = topology.getServices().iterator().next();
    assertThat( service, notNullValue() );
    assertThat( service.getRole(), is( "test-service-role" ) );
    assertThat( service.getUrls().size(), is( 2 ) );
    assertThat( service.getUrls(), hasItem( "test-service-scheme://test-service-host1:42/test-service-path" ) );
    assertThat( service.getUrls(), hasItem( "test-service-scheme://test-service-host2:42/test-service-path" ) );
    assertThat( service.getName(), is( "test-service-name" ) );
    assertThat( service.getParams(), hasEntry( is( "test-service-param-name-1" ), is( "test-service-param-value-1" ) ) );
    assertThat( service.getParams(), hasEntry( is( "test-service-param-name-2" ), is( "test-service-param-value-2" ) ) );
  }
View Full Code Here

    assertThat( topology.getName(), is( "topology2" ) );
    assertThat( topology.getTimestamp(), is( file.lastModified() ) );
    assertThat( topology.getServices().size(), is( 4 ) );
    assertThat( topology.getProviders().size(), is( 2 ) );

    Service webhdfsService = topology.getService( "WEBHDFS", null );
    assertThat( webhdfsService, notNullValue() );
    assertThat( webhdfsService.getRole(), is( "WEBHDFS" ) );
    assertThat( webhdfsService.getName(), nullValue() );
    assertThat( webhdfsService.getUrls().size(), is( 2 ) );
    assertThat( webhdfsService.getUrls(), hasItem( "http://host1:50070/webhdfs" ) );
    assertThat( webhdfsService.getUrls(), hasItem( "http://host2:50070/webhdfs" ) );

    Service webhcatService = topology.getService( "WEBHCAT", null );
    assertThat( webhcatService, notNullValue() );
    assertThat( webhcatService.getRole(), is( "WEBHCAT" ) );
    assertThat( webhcatService.getName(), nullValue() );
    assertThat( webhcatService.getUrls().size(), is( 1 ) );
    assertThat( webhcatService.getUrls(), hasItem( "http://host:50111/templeton" ) );

    Service oozieService = topology.getService( "OOZIE", null );
    assertThat( oozieService, notNullValue() );
    assertThat( oozieService.getRole(), is( "OOZIE" ) );
    assertThat( oozieService.getName(), nullValue() );
    assertThat( webhcatService.getUrls().size(), is( 1 ) );
    assertThat( oozieService.getUrls(), hasItem( "http://host:11000/oozie" ) );

    Service hiveService = topology.getService( "HIVE", null );
    assertThat( hiveService, notNullValue() );
    assertThat( hiveService.getRole(), is( "HIVE" ) );
    assertThat( hiveService.getName(), nullValue() );
    assertThat( webhcatService.getUrls().size(), is( 1 ) );
    assertThat( hiveService.getUrls(), hasItem( "http://host:10000" ) );

    Provider authenticationProvider = topology.getProvider( "authentication", "ShiroProvider" );
    assertThat( authenticationProvider, notNullValue() );
    assertThat( authenticationProvider.isEnabled(), is( true ) );
    assertThat( authenticationProvider.getRole(), is( "authentication" ) );
View Full Code Here

    assertThat( provider.isEnabled(), is( true ) );
    assertThat( provider.getParams(), hasEntry( is( "test-provider-param-name-1" ), is( "test-provider-param-value-1" ) ) );
    assertThat( provider.getParams(), hasEntry( is( "test-provider-param-name-2" ), is( "test-provider-param-value-2" ) ) );

    assertThat( topology.getServices().size(), is( 1 ) );
    Service service = topology.getServices().iterator().next();
    assertThat( service, notNullValue() );
    assertThat( service.getRole(), is( "test-service-role" ) );
    assertThat( service.getUrls().size(), is( 2 ) );
    assertThat( service.getUrls(), hasItem( "test-service-scheme://test-service-host1:42/test-service-path" ) );
    assertThat( service.getUrls(), hasItem( "test-service-scheme://test-service-host2:42/test-service-path" ) );
    assertThat( service.getName(), is( "test-service-name" ) );
    assertThat( service.getParams(), hasEntry( is( "test-service-param-name-1" ), is( "test-service-param-value-1" ) ) );
    assertThat( service.getParams(), hasEntry( is( "test-service-param-name-2" ), is( "test-service-param-value-2" ) ) );
  }
View Full Code Here

      e.printStackTrace(); // I18N not required.
    }

    Topology topology = new Topology();
    topology.setName( "test-cluster" );
    Service service = new Service();
    service.setRole( "WEBHDFS" );
    service.addUrl( "http://localhost:50070/test-service-url" );
    topology.addService( service );

    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setName( "generic" );
View Full Code Here

      e.printStackTrace(); // I18N not required.
    }

    Topology topology = new Topology();
    topology.setName( "test-cluster" );
    Service service = new Service();
    service.setRole( "WEBHDFS" );
    service.addUrl( "http://localhost:50070/test-service-url" );
    topology.addService( service );

    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setName( "generic" );
View Full Code Here

      e.printStackTrace(); // I18N not required.
    }

    Topology topology = new Topology();
    topology.setName( "test-cluster" );
    Service service = new Service();
    service.setRole( "WEBHDFS" );
    service.addUrl( "http://localhost:50070/webhdfs" );
    topology.addService( service );
    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setName( "ShiroProvider" );
    provider.setEnabled( true );
View Full Code Here

TOP

Related Classes of org.apache.hadoop.gateway.topology.Service

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.