Package com.facebook.swift.service

Examples of com.facebook.swift.service.ThriftClientConfig


    private Scribe createScribeClient(
            ThriftClientManager manager, ScopedServer server, TProtocolFactory protocolFactory)
            throws ExecutionException, InterruptedException, TException
    {
        ThriftClientConfig config = new ThriftClientConfig().setConnectTimeout(Duration.valueOf("1s"))
                                                            .setReadTimeout(Duration.valueOf("1s"))
                                                            .setWriteTimeout(Duration.valueOf("1s"));
        ThriftClient<Scribe> thriftClient = new ThriftClient<>(manager, Scribe.class, config, "ScribeClient");
        return thriftClient.open(new FramedClientConnector(HostAndPort.fromParts("localhost", server.getPort()),
                                                           TDuplexProtocolFactory.fromSingleFactory(protocolFactory))).get();
View Full Code Here


    protected <T> ListenableFuture<T> createClient(Class<T> clientClass, int serverPort, final Duration connectDelay)
            throws TTransportException, InterruptedException, ExecutionException
    {
        HostAndPort address = HostAndPort.fromParts("localhost", serverPort);
        ThriftClientConfig config = new ThriftClientConfig().setConnectTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setReadTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setWriteTimeout(new Duration(1, TimeUnit.SECONDS));
        FramedClientConnector connector = new FramedClientConnector(address) {
            @Override
            public FramedClientChannel newThriftClientChannel(
View Full Code Here

    }

    protected <T> ListenableFuture<T> createHttpClient(Class<T> clientClass, int serverPort)
            throws TTransportException, InterruptedException, ExecutionException
    {
        ThriftClientConfig config = new ThriftClientConfig().setConnectTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setReadTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setWriteTimeout(new Duration(1, TimeUnit.SECONDS));
        HttpClientConnector connector =
                new HttpClientConnector(URI.create("http://localhost:" + serverPort + "/thrift/"));
        return new ThriftClient<>(clientManager, clientClass, config, "asyncTestClient").open(connector);
View Full Code Here

        @Override
        public ThriftClient<T> get()
        {
            Preconditions.checkState(clientManager != null, "clientManager has not been set");
            Preconditions.checkState(injector != null, "injector has not been set");
            ThriftClientConfig clientConfig = injector.getInstance(configKey);
            Set<ThriftClientEventHandler> handlersSet = injector.getInstance(eventHandlersKey);
            return new ThriftClient<>(clientManager, clientType, clientConfig, clientName, ImmutableList.copyOf(handlersSet));
        }
View Full Code Here

    protected <T> ListenableFuture<T> createClient(Class<T> clientClass, int serverPort)
            throws TTransportException, InterruptedException, ExecutionException
    {
        HostAndPort address = HostAndPort.fromParts("localhost", serverPort);
        ThriftClientConfig config = new ThriftClientConfig().setConnectTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setReadTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setWriteTimeout(new Duration(1, TimeUnit.SECONDS));
        FramedClientConnector connector = new FramedClientConnector(address);
        return new ThriftClient<>(clientManager, clientClass, config, "asyncTestClient").open(connector);
    }
View Full Code Here

    }

    protected <T> ListenableFuture<T> createHttpClient(Class<T> clientClass, int serverPort)
            throws TTransportException, InterruptedException, ExecutionException
    {
        ThriftClientConfig config = new ThriftClientConfig().setConnectTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setReadTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setWriteTimeout(new Duration(1, TimeUnit.SECONDS));
        HttpClientConnector connector =
                new HttpClientConnector(URI.create("http://localhost:" + serverPort + "/thrift/"));
        return new ThriftClient<>(clientManager, clientClass, config, "asyncTestClient").open(connector);
View Full Code Here

                    final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig()
                        .setHost(store.getHostText())
                        .setPort(store.getPort())
                        .setFramed(useFramedTransport);

                    final ThriftClientConfig clientConfig = new ThriftClientConfig()
                        .setConnectTimeout(new Duration(clientSocketTimeout, TimeUnit.SECONDS));

                    final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(thriftClientManager, clientConfig, metastoreConfig);

                    try {
View Full Code Here

                    final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig()
                        .setHost(store.getHostText())
                        .setPort(store.getPort())
                        .setFramed(useFramedTransport);

                    final ThriftClientConfig clientConfig = new ThriftClientConfig()
                        .setConnectTimeout(new Duration(clientSocketTimeout, TimeUnit.SECONDS));

                    final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(thriftClientManager, clientConfig, metastoreConfig);

                    client = closer.register(ThriftHiveMetastore.Client.forHiveMetastore(factory.getDefaultClient()));
View Full Code Here

    protected <T> ListenableFuture<T> createClient(Class<T> clientClass, int serverPort)
            throws TTransportException, InterruptedException, ExecutionException
    {
        HostAndPort address = HostAndPort.fromParts("localhost", serverPort);
        ThriftClientConfig config = new ThriftClientConfig().setConnectTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setReadTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setWriteTimeout(new Duration(1, TimeUnit.SECONDS));
        FramedClientConnector connector = new FramedClientConnector(address);
        return new ThriftClient<>(clientManager, clientClass, config, "asyncTestClient").open(connector);
    }
View Full Code Here

    protected <T> ListenableFuture<T> createHttpClient(Class<T> clientClass, int serverPort)
            throws TTransportException, InterruptedException, ExecutionException
    {
        HostAndPort address = HostAndPort.fromParts("localhost", serverPort);
        ThriftClientConfig config = new ThriftClientConfig().setConnectTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setReadTimeout(new Duration(1, TimeUnit.SECONDS))
                                                            .setWriteTimeout(new Duration(1, TimeUnit.SECONDS));
        HttpClientConnector connector =
                new HttpClientConnector(URI.create("http://localhost:4567/thrift/"));
        return new ThriftClient<>(clientManager, clientClass, config, "asyncTestClient").open(connector);
View Full Code Here

TOP

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

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.