Package com.facebook.swift.service

Examples of com.facebook.swift.service.ThriftServiceProcessor


    public void tearDownSuite() {
    }

    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


            ImmutableList.Builder<Object> servers = ImmutableList.builder();
            for (ThriftServiceExport serviceExport : serviceExports) {
                Object server = injector.getInstance(serviceExport.getKey());
                servers.add(server);
            }
            return new ThriftServiceProcessor(codecManager, servers.build());
        }
View Full Code Here

    public void tearDownSuite() {
    }

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

        connectionManager = new ConnectionManager(configuration.getConnections(), configuration.getProjectionExpiration().toMillis());
        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

            ImmutableList.Builder<Object> servers = ImmutableList.builder();
            for (ThriftServiceExport serviceExport : serviceExports) {
                Object server = injector.getInstance(serviceExport.getKey());
                servers.add(server);
            }
            return new ThriftServiceProcessor(codecManager, ImmutableList.copyOf(eventHandlers), servers.build());
        }
View Full Code Here

        private final NettyServerTransport server;

        public ScopedServer(TProtocolFactory protocolFactory)
                throws TTransportException, InterruptedException
        {
            ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), new ScribeHandler());

            ThriftServerDef def = ThriftServerDef.newBuilder()
                                                 .listen(0)
                                                 .withProcessor(processor)
                                                 .speaks(protocolFactory).build();
View Full Code Here

    }

    protected ThriftServer createServerFromHandler(Object handler)
            throws IllegalAccessException, InstantiationException
    {
        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

    if (!conf.trackJobProgressOnClient()) {
      return null;
    }
    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());
View Full Code Here

    public void testPumaSwift()
            throws Exception
    {
        // create server and start
        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();
View Full Code Here

    {
        PumaReadServer puma = new PumaReadServer();
        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())),
View Full Code Here

TOP

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

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.