Examples of ThriftServer


Examples of com.facebook.swift.service.ThriftServer

    }

    private ThriftServer createServer(ServiceInterface handler)
            throws IllegalAccessException, InstantiationException {
        ThriftServiceProcessor processor = new ThriftServiceProcessor(codecManager, handler);
        return new ThriftServer(processor);
    }
View Full Code Here

Examples of com.facebook.swift.service.ThriftServer

        PumaReadServer puma = new PumaReadServer();
        ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), puma);

        // create server and client
        try (
                ThriftServer server = new ThriftServer(processor).start();
                ThriftClientManager clientManager = new ThriftClientManager();
                PumaReadService pumaClient = clientManager.createClient(
                        new FramedClientConnector(fromParts("localhost", server.getPort())),
                        PumaReadService.class).get()
        ) {
View Full Code Here

Examples of com.facebook.swift.service.ThriftServer

        ReadSemanticException exception = new ReadSemanticException("my exception");
        puma.setException(exception);

        TProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), puma);
        try (
                ThriftServer server = new ThriftServer(processor).start();
                ThriftClientManager clientManager = new ThriftClientManager();
                PumaReadService pumaClient = clientManager.createClient(
                        new FramedClientConnector(HostAndPort.fromParts("localhost", server.getPort())),
                        PumaReadService.class).get()
        ) {
View Full Code Here

Examples of com.facebook.swift.service.ThriftServer

    {
        ThriftServiceProcessor processor = new ThriftServiceProcessor(codecManager, handler);
        ThriftServerConfig config = new ThriftServerConfig();
        config.setMaxFrameSize(new DataSize(MAX_FRAME_SIZE, DataSize.Unit.BYTE));

        return new ThriftServer(processor, config).start();
    }
View Full Code Here

Examples of com.kurento.kmf.thrift.ThriftServer

                  e);
            }
          }
        });

    server = new ThriftServer(clientProcessor, executorService,
        localHandlerAddress);

    server.start();

    keepAliveManager = new KeepAliveManager(this,
View Full Code Here

Examples of com.kurento.kmf.thrift.ThriftServer

      public void handleResponse(Response<JsonElement> response) {
        log.error("Trying to send a response from by means of session but it is not supported");
      }
    };

    server = new ThriftServer(serverProcessor, executorService,
        inetSocketAddress);
  }
View Full Code Here

Examples of com.kurento.kmf.thrift.ThriftServer

        cfg);

    ThriftInterfaceExecutorService executorService = new ThriftInterfaceExecutorService(
        cfg);

    ThriftServer clientServer = new ThriftServer(clientProcessor,
        executorService, new InetSocketAddress("127.0.0.1", 7979));
    clientServer.start();

    ThriftServer server = new ThriftServer(serverProcessor,
        executorService, new InetSocketAddress("127.0.0.1", 19191));
    server.start();

    Client client = clientPool.acquireSync();

    String message = "Test echo message";

    String result = client.invokeJsonRpc(message);

    Assert.assertEquals(message, result);

    clientServer.destroy();
    server.destroy();
  }
View Full Code Here

Examples of com.netflix.suro.input.thrift.ThriftServer

                new MessageRouter(map, sinks, jsonMapper),
                config,
                jsonMapper
        );

        ThriftServer server = new ThriftServer(config, msgProcessor);
        server.start();

        SuroClient client = createSuroClient(server.getPort());

        Thread t = createClientThread(jsonMapper, client, TOPIC_NAME);

        // checking the traffic goes
        for (int i = 0; i < 10; ++i) {
            if (client.getSentMessageCount() > 0) {
                break;
            }
            Thread.sleep(1000);
        }
        assertTrue(client.getSentMessageCount() > 0);

        // shutting down the traffic
        hasEnoughSpace = false;
        int count = 0;
        while (count < 3) {
            if (msgProcessor.getStatus() == ServiceStatus.WARNING) {
                ++count;
            }
        }
        assertEquals(count, 3);

        client.shutdown();
        run.set(false);
        t.join();

        // resuming the traffic
        hasEnoughSpace = true;
        run.set(true);
        SuroClient newClient = createSuroClient(server.getPort());
        t = createClientThread(jsonMapper, newClient, TOPIC_NAME);

        for (int i = 0; i < 10; ++i) {
            if (client.getSentMessageCount() > 0) {
                break;
            }
            Thread.sleep(1000);
        }
        assertTrue(client.getSentMessageCount() > 0);

        run.set(false);
        t.join();
        client.shutdown();

        server.shutdown();

        sink.close();

        assertEquals(sink.getNumOfPendingMessages(), 0);
    }
View Full Code Here

Examples of org.apache.blur.thrift.ThriftServer

    StringBuilder builder = new StringBuilder();
    BlurConfiguration localConf = getBlurConfiguration(configuration);
    int controllerPort = localConf.getInt(BLUR_CONTROLLER_BIND_PORT, 40010);
    for (int i = 0; i < num; i++) {
      try {
        ThriftServer server = ThriftBlurControllerServer.createServer(i, localConf);
        controllers.add(server);
        Connection connection = new Connection("localhost", controllerPort + i);
        if (builder.length() != 0) {
          builder.append(',');
        }
View Full Code Here

Examples of org.apache.blur.thrift.ThriftServer

      }));
    }
    int shardPort = localConf.getInt(BLUR_SHARD_BIND_PORT, 40020);
    for (int i = 0; i < num; i++) {
      try {
        ThriftServer server = futures.get(i).get();
        shards.add(server);
        Connection connection = new Connection("localhost", shardPort + i);
        startServer(server, connection);
      } catch (Exception e) {
        LOG.error(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.