Package com.facebook.swift.service

Examples of com.facebook.swift.service.ThriftClientManager


    public void setupTest() throws Exception {
        // TODO: move this to setupSuite when TestNG/surefire integration is fixed
        handler = handlerClass.newInstance();
        server = createServer(handler).start();

        clientManager = new ThriftClientManager(codecManager);
        client = createClient(clientManager).get();
    }
View Full Code Here


        final int port = NetUtils.findUnusedPort();

        startService(port);

        final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig().setPort(port);
        try (final ThriftClientManager clientManager = new ThriftClientManager()) {
            final ThriftClientConfig clientConfig = new ThriftClientConfig();
            final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(clientManager, clientConfig, metastoreConfig);

            try (final HiveMetastore metastore = factory.getDefaultClient()) {
                final Table table = metastore.getTable("hello", "world");
View Full Code Here

    {
        final int port = NetUtils.findUnusedPort();

        final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig().setPort(port);
        final ThriftClientConfig clientConfig = new ThriftClientConfig();
        try (final ThriftClientManager clientManager = new ThriftClientManager()) {
            final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(clientManager, clientConfig, metastoreConfig);

            try (final HiveMetastore metastore = factory.getDefaultClient()) {
                assertFalse(metastore.isConnected());
            }
View Full Code Here

            .setPort(port)
            .setMaxRetries(5)
            .setRetrySleep(new Duration(1, TimeUnit.SECONDS))
            .setRetryTimeout(new Duration(30, TimeUnit.SECONDS));

        try (final ThriftClientManager clientManager = new ThriftClientManager()) {
            final ThriftClientConfig clientConfig = new ThriftClientConfig();
            final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(clientManager, clientConfig, metastoreConfig);

            try (final HiveMetastore metastore = factory.getDefaultClient()) {
                assertFalse(metastore.isConnected());
View Full Code Here

            .setPort(port)
            .setMaxRetries(5)
            .setRetrySleep(new Duration(1, TimeUnit.SECONDS))
            .setRetryTimeout(new Duration(30, TimeUnit.SECONDS));

        try (final ThriftClientManager clientManager = new ThriftClientManager()) {
            final ThriftClientConfig clientConfig = new ThriftClientConfig();
            final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(clientManager, clientConfig, metastoreConfig);

            try (final HiveMetastore metastore = factory.getDefaultClient()) {
                assertFalse(metastore.isConnected());
View Full Code Here

            .setPort(port)
            .setMaxRetries(5)
            .setRetrySleep(new Duration(5, TimeUnit.SECONDS))
            .setRetryTimeout(new Duration(30, TimeUnit.SECONDS));

        try (final ThriftClientManager clientManager = new ThriftClientManager()) {
            final ThriftClientConfig clientConfig = new ThriftClientConfig();
            final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(clientManager, clientConfig, metastoreConfig);

            try (final HiveMetastore metastore = factory.getDefaultClient()) {
                assertFalse(metastore.isConnected());
View Full Code Here

        final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig()
            .setMaxRetries(10)
            .setRetrySleep(new Duration(3, TimeUnit.SECONDS))
            .setRetryTimeout(new Duration(45, TimeUnit.SECONDS));

        try (final ThriftClientManager clientManager = new ThriftClientManager()) {
            final ThriftClientConfig clientConfig = new ThriftClientConfig();
            final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(clientManager, clientConfig, metastoreConfig);

            try (final HiveMetastore metastore = factory.getClientForHost(builder.build())) {
                assertFalse(metastore.isConnected());
View Full Code Here

    @BeforeMethod(alwaysRun = true)
    public void setup()
            throws IllegalAccessException, InstantiationException, TException
    {
        codecManager = new ThriftCodecManager();
        clientManager = new ThriftClientManager(codecManager);
        syncServer = createSyncServer();
    }
View Full Code Here

        final int port = NetUtils.findUnusedPort();

        startService(port);

        final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig().setPort(port);
        try (final ThriftClientManager clientManager = new ThriftClientManager()) {
            final ThriftClientConfig clientConfig = new ThriftClientConfig();
            final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(clientManager, clientConfig, metastoreConfig);

            try (final HiveMetastore metastore = factory.getDefaultClient()) {
                final Table table = metastore.getTable("hello", "world");
View Full Code Here

    {
        final int port = NetUtils.findUnusedPort();

        final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig().setPort(port);
        final ThriftClientConfig clientConfig = new ThriftClientConfig();
        try (final ThriftClientManager clientManager = new ThriftClientManager()) {
            final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(clientManager, clientConfig, metastoreConfig);

            try (final HiveMetastore metastore = factory.getDefaultClient()) {
                fail();
            }
View Full Code Here

TOP

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

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.