Package org.apache.spark.network

Examples of org.apache.spark.network.TransportContext


  @Before
  public void beforeEach() {
    RpcHandler handler = new SaslRpcHandler(new ExternalShuffleBlockHandler(),
      new TestSecretKeyHolder("my-app-id", "secret"));
    TransportContext context = new TransportContext(conf, handler);
    this.server = context.createServer();
  }
View Full Code Here


    dataContext1.create();
    dataContext1.insertHashShuffleData(1, 0, exec1Blocks);

    conf = new TransportConf(new SystemPropertyConfigProvider());
    handler = new ExternalShuffleBlockHandler();
    TransportContext transportContext = new TransportContext(conf, handler);
    server = transportContext.createServer();
  }
View Full Code Here

  @BeforeClass
  public static void beforeAll() throws IOException {
    SecretKeyHolder secretKeyHolder = new TestSecretKeyHolder("good-key");
    SaslRpcHandler handler = new SaslRpcHandler(new TestRpcHandler(), secretKeyHolder);
    conf = new TransportConf(new SystemPropertyConfigProvider());
    context = new TransportContext(conf, handler);
    server = context.createServer();
  }
View Full Code Here

  }

  @Test
  public void testNoSaslServer() {
    RpcHandler handler = new TestRpcHandler();
    TransportContext context = new TransportContext(conf, handler);
    clientFactory = context.createClientFactory(
      Lists.<TransportClientBootstrap>newArrayList(
        new SaslClientBootstrap(conf, "app-id", new TestSecretKeyHolder("key"))));
    TransportServer server = context.createServer();
    try {
      clientFactory.createClient(TestUtils.getLocalHost(), server.getPort());
    } catch (Exception e) {
      assertTrue(e.getMessage(), e.getMessage().contains("Digest-challenge format violation"));
    } finally {
View Full Code Here

  }

  @Override
  public void init(String appId) {
    this.appId = appId;
    TransportContext context = new TransportContext(conf, new NoOpRpcHandler());
    List<TransportClientBootstrap> bootstraps = Lists.newArrayList();
    if (saslEnabled) {
      bootstraps.add(new SaslClientBootstrap(conf, appId, secretKeyHolder));
    }
    clientFactory = context.createClientFactory(bootstraps);
  }
View Full Code Here

    }

    int port = conf.getInt(
      SPARK_SHUFFLE_SERVICE_PORT_KEY, DEFAULT_SPARK_SHUFFLE_SERVICE_PORT);
    TransportConf transportConf = new TransportConf(new HadoopConfigProvider(conf));
    TransportContext transportContext = new TransportContext(transportConf, rpcHandler);
    shuffleServer = transportContext.createServer(port);
    String authEnabledString = authEnabled ? "enabled" : "not enabled";
    logger.info("Started YARN shuffle service for Spark on port {}. " +
      "Authentication is {}.", port, authEnabledString);
  }
View Full Code Here

TOP

Related Classes of org.apache.spark.network.TransportContext

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.