Package com.facebook.swift.service

Examples of com.facebook.swift.service.ThriftServer


    }

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


    }

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

        EventService eventService = new EventService(connectionManager, configuration.getPingTime().toMillis());
        DiscoveryService discoveryService = new DiscoveryService(connectionManager);
        CuratorProjectionService projectionService = new CuratorProjectionService(connectionManager);
        DiscoveryServiceLowLevel discoveryServiceLowLevel = new DiscoveryServiceLowLevel(connectionManager);
        ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), Lists.<ThriftEventHandler>newArrayList(), projectionService, eventService, discoveryService, discoveryServiceLowLevel);
        server = new ThriftServer(processor, configuration.getThrift());
    }
View Full Code Here

    {
        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

    try {
      JobProgressTrackerService service = new JobProgressTrackerService(conf);
      ThriftServiceProcessor processor =
          new ThriftServiceProcessor(new ThriftCodecManager(),
              new ArrayList<ThriftEventHandler>(), service);
      service.server = new ThriftServer(processor, new ThriftServerConfig());
      service.server.start();
      JOB_PROGRESS_SERVICE_HOST.set(conf,
          InetAddress.getLocalHost().getHostName());
      JOB_PROGRESS_SERVICE_PORT.set(conf, service.server.getPort());
      return service;
View Full Code Here

        PumaReadServer puma = new PumaReadServer();
        ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), ImmutableList.<ThriftEventHandler>of(), 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

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

        NiftyProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), ImmutableList.<ThriftEventHandler>of(), 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

    }

    private ThriftServer createServer(ServiceInterface handler)
            throws IllegalAccessException, InstantiationException {
        ThriftServiceProcessor processor = new ThriftServiceProcessor(codecManager, ImmutableList.<ThriftEventHandler>of(), handler);
        return new ThriftServer(processor, serverConfig);
    }
View Full Code Here

    @Test
    public void testThriftServerShutdown()
            throws InterruptedException
    {
        ServerCreator serverCreator = new ServerCreator().invoke();
        ThriftServer server = serverCreator.getServer();

        server.start();
        serverCreator.stop();
        serverCreator.checkExecutorsTerminated();
    }
View Full Code Here

            NettyServerConfig serverConfig = NettyServerConfig.newBuilder()
                                                              .setBossThreadExecutor(bossExecutor)
                                                              .setWorkerThreadExecutor(ioWorkerExecutor)
                                                              .build();

            server = new ThriftServer(serverConfig, serverDef);
            return this;
        }
View Full Code Here

TOP

Related Classes of com.facebook.swift.service.ThriftServer

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.