Package com.facebook.presto

Examples of com.facebook.presto.UnpartitionedPagePartitionFunction


        // set no more queues a second time to assure that we don't get an exception or such
        sharedBuffer.setOutputBuffers(INITIAL_EMPTY_OUTPUT_BUFFERS.withNoMoreBufferIds());
        assertFinished(sharedBuffer);

        // add queue calls after finish should be ignored
        sharedBuffer.setOutputBuffers(INITIAL_EMPTY_OUTPUT_BUFFERS.withBuffer("foo", new UnpartitionedPagePartitionFunction()).withNoMoreBufferIds());
    }
View Full Code Here


            addPage(sharedBuffer, createPage(i));
        }
        sharedBuffer.finish();


        outputBuffers = outputBuffers.withBuffer("first", new UnpartitionedPagePartitionFunction());
        sharedBuffer.setOutputBuffers(outputBuffers);
        assertBufferResultEquals(sharedBuffer.get("first", 0, sizeOfPages(1), NO_WAIT), bufferResult(0, createPage(0)));
        sharedBuffer.abort("first");
        assertQueueClosed(sharedBuffer, "first", 0);
        assertBufferResultEquals(sharedBuffer.get("first", 1, sizeOfPages(1), NO_WAIT), emptyResults(1, true));

        outputBuffers = outputBuffers.withBuffer("second", new UnpartitionedPagePartitionFunction()).withNoMoreBufferIds();
        sharedBuffer.setOutputBuffers(outputBuffers);
        assertBufferResultEquals(sharedBuffer.get("second", 0, sizeOfPages(1), NO_WAIT), bufferResult(0, createPage(0)));
        sharedBuffer.abort("second");
        assertQueueClosed(sharedBuffer, "second", 0);
        assertFinished(sharedBuffer);
View Full Code Here

    @Test
    public void testFinishClosesEmptyQueues()
            throws Exception
    {
        OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("first", new UnpartitionedPagePartitionFunction())
                .withBuffer("second", new UnpartitionedPagePartitionFunction());
        SharedBuffer sharedBuffer = new SharedBuffer(sizeOfPages(10), outputBuffers);

        // finish while queues are empty
        sharedBuffer.finish();
View Full Code Here

    @Test
    public void testAbortFreesReader()
            throws Exception
    {
        OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("queue", new UnpartitionedPagePartitionFunction());
        SharedBuffer sharedBuffer = new SharedBuffer(sizeOfPages(5), outputBuffers);
        assertFalse(sharedBuffer.isFinished());

        ExecutorService executor = Executors.newCachedThreadPool();
View Full Code Here

    @Test
    public void testFinishFreesReader()
            throws Exception
    {
        OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("queue", new UnpartitionedPagePartitionFunction());
        SharedBuffer sharedBuffer = new SharedBuffer(sizeOfPages(5), outputBuffers);
        assertFalse(sharedBuffer.isFinished());

        ExecutorService executor = Executors.newCachedThreadPool();
View Full Code Here

    @Test
    public void testFinishFreesWriter()
            throws Exception
    {
        OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("queue", new UnpartitionedPagePartitionFunction())
                .withNoMoreBufferIds();
        SharedBuffer sharedBuffer = new SharedBuffer(sizeOfPages(5), outputBuffers);
        assertFalse(sharedBuffer.isFinished());

        ExecutorService executor = Executors.newCachedThreadPool();
View Full Code Here

    @Test
    public void testDestroyFreesReader()
            throws Exception
    {
        OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("queue", new UnpartitionedPagePartitionFunction())
                .withNoMoreBufferIds();
        SharedBuffer sharedBuffer = new SharedBuffer(sizeOfPages(5), outputBuffers);
        assertFalse(sharedBuffer.isFinished());

        ExecutorService executor = Executors.newCachedThreadPool();
View Full Code Here

    @Test
    public void testDestroyFreesWriter()
            throws Exception
    {
        OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("queue", new UnpartitionedPagePartitionFunction())
                .withNoMoreBufferIds();
        SharedBuffer sharedBuffer = new SharedBuffer(sizeOfPages(5), outputBuffers);
        assertFalse(sharedBuffer.isFinished());

        ExecutorService executor = Executors.newCachedThreadPool();
View Full Code Here

            InMemoryNodeManager nodeManager = new InMemoryNodeManager();
            nodeManager.addNode("foo", new Node("other", URI.create("http://127.0.0.1:11"), NodeVersion.UNKNOWN));

            OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                    .withBuffer("out", new UnpartitionedPagePartitionFunction())
                    .withNoMoreBufferIds();

            stageExecution = new SqlStageExecution(new QueryId("query"),
                    new MockLocationFactory(),
                    joinPlan,
View Full Code Here

        // add new buffers
        OutputBuffers newOutputBuffers;
        if (fragment.getOutputPartitioning() == OutputPartitioning.NONE) {
            ImmutableMap.Builder<String, PagePartitionFunction> newBuffers = ImmutableMap.builder();
            for (Node parentNode : parentNodes) {
                newBuffers.put(parentNode.getNodeIdentifier(), new UnpartitionedPagePartitionFunction());
            }
            newOutputBuffers = startingOutputBuffers.withBuffers(newBuffers.build());

            // no more flag
            if (noMoreParentNodes) {
View Full Code Here

TOP

Related Classes of com.facebook.presto.UnpartitionedPagePartitionFunction

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.