Package com.facebook.presto.client

Examples of com.facebook.presto.client.ClientSession


        }
    }

    protected ClientSession getClientSession()
    {
        return new ClientSession(coordinator.getBaseUrl(), SESSION.getUser(), SESSION.getSource(), SESSION.getCatalog(), SESSION.getSchema(), true);
    }
View Full Code Here


        return new ClientSession(coordinator.getBaseUrl(), SESSION.getUser(), SESSION.getSource(), SESSION.getCatalog(), SESSION.getSchema(), true);
    }

    protected ClientSession getSampledClientSession()
    {
        return new ClientSession(coordinator.getBaseUrl(), SESSION.getUser(), SESSION.getSource(), SESSION.getCatalog(), "sampled", true);
    }
View Full Code Here

public class TestClientOptions
{
    @Test
    public void testDefault()
    {
        ClientSession session = new ClientOptions().toClientSession();
        assertEquals(session.getServer().toString(), "http://localhost:8080");
        assertEquals(session.getSource(), "presto-cli");
    }
View Full Code Here

    @Test
    public void testSource()
    {
        ClientOptions options = new ClientOptions();
        options.source = "test";
        ClientSession session = options.toClientSession();
        assertEquals(session.getSource(), "test");
    }
View Full Code Here

    @Test
    public void testServerHostOnly()
    {
        ClientOptions options = new ClientOptions();
        options.server = "localhost";
        ClientSession session = options.toClientSession();
        assertEquals(session.getServer().toString(), "http://localhost:80");
    }
View Full Code Here

    @Test
    public void testServerHostPort()
    {
        ClientOptions options = new ClientOptions();
        options.server = "localhost:8888";
        ClientSession session = options.toClientSession();
        assertEquals(session.getServer().toString(), "http://localhost:8888");
    }
View Full Code Here

    @Test
    public void testServerHttpUri()
    {
        ClientOptions options = new ClientOptions();
        options.server = "http://localhost/foo";
        ClientSession session = options.toClientSession();
        assertEquals(session.getServer().toString(), "http://localhost/foo");
    }
View Full Code Here

    @Test
    public void testServerHttpsUri()
    {
        ClientOptions options = new ClientOptions();
        options.server = "https://localhost/foo";
        ClientSession session = options.toClientSession();
        assertEquals(session.getServer().toString(), "https://localhost/foo");
    }
View Full Code Here

    @Test
    public void testUpdateSessionParameters()
            throws Exception
    {
        ClientOptions options = new ClientOptions();
        ClientSession session = options.toClientSession();
        session = Console.processSessionParameterChange(SqlParser.createStatement("USE CATALOG test_catalog"), session);
        assertEquals(session.getCatalog(), "test_catalog");
        session = Console.processSessionParameterChange(SqlParser.createStatement("USE SCHEMA test_schema"), session);
        assertEquals(session.getSchema(), "test_schema");
    }
View Full Code Here

        return prestoServer;
    }

    public ClientSession toClientSession(ConnectorSession connectorSession)
    {
        return new ClientSession(
                prestoServer.getBaseUrl(),
                connectorSession.getUser(),
                connectorSession.getSource(),
                connectorSession.getCatalog(),
                connectorSession.getSchema(),
View Full Code Here

TOP

Related Classes of com.facebook.presto.client.ClientSession

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.