Package io.airlift.units

Examples of io.airlift.units.Duration


            throw e;
        }

        this.httpClient = new StandaloneNettyAsyncHttpClient("test",
                new HttpClientConfig()
                        .setConnectTimeout(new Duration(1, TimeUnit.DAYS))
                        .setReadTimeout(new Duration(10, TimeUnit.DAYS)));

        long start = System.nanoTime();
        while (!allNodesGloballyVisible()) {
            assertLessThan(nanosSince(start), new Duration(10, SECONDS));
            MILLISECONDS.sleep(10);
        }

        for (TestingPrestoServer server : servers) {
            server.getMetadata().addFunctions(CUSTOM_FUNCTIONS);
View Full Code Here


    }

    private void executeQueries(List<String> queries, ParallelQueryRunner parallelQueryRunner, int parallelism)
            throws Exception
    {
        Duration duration = parallelQueryRunner.executeCommands(parallelism, queries);
        System.out.printf("%2d: %s\n", parallelism, duration.convertTo(TimeUnit.SECONDS));
    }
View Full Code Here

                    System.exit(1);
                }
            }, executor);

            remainingQueries.await();
            Duration executionTime = Duration.nanosSince(start);

            // wait for runners to spin-down
            allFutures.get();

            return executionTime;
View Full Code Here

        public QueryRunner(ClientSession session, ListeningExecutorService executor)
        {
            this.session = session;
            this.executor = executor;

            httpClient = new JettyHttpClient(new HttpClientConfig().setConnectTimeout(new Duration(10, TimeUnit.SECONDS)));
        }
View Full Code Here

        assertRecordedDefaults(recordDefaults(HiveMetastoreClientConfig.class)
            .setHost("localhost")
            .setPort(9083)
            .setFramed(false)
            .setMaxRetries(0)
            .setRetrySleep(new Duration (10, TimeUnit.SECONDS))
            .setRetryTimeout(new Duration(1, TimeUnit.MINUTES)));
    }
View Full Code Here

        HiveMetastoreClientConfig expected = new HiveMetastoreClientConfig()
            .setHost("some.host")
            .setPort(12345)
            .setFramed(true)
            .setMaxRetries(5)
            .setRetrySleep(new Duration(30, TimeUnit.SECONDS))
            .setRetryTimeout(new Duration(2, TimeUnit.MINUTES));

        assertFullMapping(properties, expected);
    }
View Full Code Here

        final int port = NetUtils.findUnusedPort();

        final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig()
            .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);
View Full Code Here

        startService(port);

        final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig()
            .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);
View Full Code Here

        }, 10, TimeUnit.SECONDS);

        final HiveMetastoreClientConfig metastoreConfig = new HiveMetastoreClientConfig()
            .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);
View Full Code Here

            }
        }, 10, TimeUnit.SECONDS);

        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);
View Full Code Here

TOP

Related Classes of io.airlift.units.Duration

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.