Package com.facebook.swift.service

Examples of com.facebook.swift.service.ThriftServerConfig


    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


    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

    private static final Logger LOGGER = LoggerFactory.getLogger(TestThriftClientManager.class);
    public static final String LOCALHOST_IP_ADDRESS = "127.0.0.1";

    public TestThriftClientManager()
    {
        super(DelayedMapSyncHandler.class, DelayedMap.Client.class, new ThriftServerConfig().setBindAddress(LOCALHOST_IP_ADDRESS));
    }
View Full Code Here

    private final ThriftServerConfig serverConfig;

    public SuiteBase(
            Class<? extends ServiceInterface> handlerClass,
            Class<? extends ClientInterface> clientClass) {
        this(handlerClass, clientClass, new ThriftServerConfig());
    }
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

    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

    /**
     * Start a {@link ThriftServer} without using Guice dependency injection
     */
    public void runPlainServer() throws Exception
    {
        ThriftServerConfig config =
                new ThriftServerConfig().setWorkerThreads(200)
                                        .setPort(4567)
                                        .setTransportName("header")
                                        .setProtocolName("header");

        ThriftCodecManager codecManager = new ThriftCodecManager();
View Full Code Here

            throws ExecutionException, InterruptedException
    {
        ThriftCodecManager codecManager = new ThriftCodecManager();
        ThriftServiceProcessor processor = new ThriftServiceProcessor(codecManager, ImmutableList.<ThriftEventHandler>of(), new GenericService());

        try (ThriftServer server = new ThriftServer(processor, new ThriftServerConfig()).start();
             ThriftClientManager clientManager = new ThriftClientManager(codecManager)) {
            ThriftClient<GenericInterface.Client> clientOpener = new ThriftClient<>(clientManager, GenericInterface.Client.class);
            try (GenericInterface.Client client = clientOpener.open(new FramedClientConnector(HostAndPort.fromParts("localhost", server.getPort()))).get()) {
                GenericStruct<String> original = new GenericStruct<>();
                original.genericField = "original.genericField";
View Full Code Here

    }
  }

  /** Translates Hadoop's Configuration into Thrift's server config */
  private static ThriftServerConfig getServerConfig(Configuration conf) {
    ThriftServerConfig serverConfig = new ThriftServerConfig();
    serverConfig.setPort(conf.getInt(StorageServiceConfigKeys.PROXY_THRIFT_PORT_KEY,
        StorageServiceConfigKeys.PROXY_THRIFT_PORT_DEFAULT));
    return serverConfig;
  }
View Full Code Here

TOP

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

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.