Package com.facebook.presto

Examples of com.facebook.presto.UnpartitionedPagePartitionFunction


        // add a page and verify the future is not complete
        addPage(sharedBuffer, createPage(33));
        assertFalse(future.isDone());

        // add the buffer and verify we did not get the page
        sharedBuffer.setOutputBuffers(INITIAL_EMPTY_OUTPUT_BUFFERS.withBuffer("first", new UnpartitionedPagePartitionFunction()));
        assertBufferResultEquals(TYPES, getFuture(future, NO_WAIT), emptyResults(0, true));

        // verify that a normal read returns a closed empty result
        assertBufferResultEquals(TYPES, getBufferResult(sharedBuffer, "first", 0, sizeOfPages(10), NO_WAIT), emptyResults(0, true));
    }
View Full Code Here


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

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

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

    public void testFinishClosesEmptyQueues()
            throws Exception
    {
        SharedBuffer sharedBuffer = new SharedBuffer(TASK_ID, stateNotificationExecutor, sizeOfPages(10));
        sharedBuffer.setOutputBuffers(INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("first", new UnpartitionedPagePartitionFunction())
                .withBuffer("second", new UnpartitionedPagePartitionFunction()));

        // finish while queues are empty
        sharedBuffer.setNoMorePages();

        assertQueueClosed(sharedBuffer, "first", 0);
View Full Code Here

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

        // attempt to get a page
        ListenableFuture<BufferResult> future = sharedBuffer.get("queue", 0, sizeOfPages(10));
View Full Code Here

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

        // attempt to get a page
        ListenableFuture<BufferResult> future = sharedBuffer.get("queue", 0, sizeOfPages(10));
View Full Code Here

    public void testFinishFreesWriter()
            throws Exception
    {
        SharedBuffer sharedBuffer = new SharedBuffer(TASK_ID, stateNotificationExecutor, sizeOfPages(5));
        sharedBuffer.setOutputBuffers(INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("queue", new UnpartitionedPagePartitionFunction())
                .withNoMoreBufferIds());
        assertFalse(sharedBuffer.isFinished());

        // fill the buffer
        for (int i = 0; i < 5; i++) {
View Full Code Here

    public void testDestroyFreesReader()
            throws Exception
    {
        SharedBuffer sharedBuffer = new SharedBuffer(TASK_ID, stateNotificationExecutor, sizeOfPages(5));
        sharedBuffer.setOutputBuffers(INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("queue", new UnpartitionedPagePartitionFunction())
                .withNoMoreBufferIds());
        assertFalse(sharedBuffer.isFinished());

        // attempt to get a page
        ListenableFuture<BufferResult> future = sharedBuffer.get("queue", 0, sizeOfPages(10));
View Full Code Here

    public void testDestroyFreesWriter()
            throws Exception
    {
        SharedBuffer sharedBuffer = new SharedBuffer(TASK_ID, stateNotificationExecutor, sizeOfPages(5));
        sharedBuffer.setOutputBuffers(INITIAL_EMPTY_OUTPUT_BUFFERS
                .withBuffer("queue", new UnpartitionedPagePartitionFunction())
                .withNoMoreBufferIds());
        assertFalse(sharedBuffer.isFinished());

        // fill the buffer
        for (int i = 0; i < 5; i++) {
View Full Code Here

        SqlTask sqlTask = createInitialTask();

        TaskInfo taskInfo = sqlTask.updateTask(SESSION,
                PLAN_FRAGMENT,
                ImmutableList.of(new TaskSource(TABLE_SCAN_NODE_ID, ImmutableSet.of(SPLIT), true)),
                INITIAL_EMPTY_OUTPUT_BUFFERS.withBuffer("out", new UnpartitionedPagePartitionFunction()).withNoMoreBufferIds());
        assertEquals(taskInfo.getState(), TaskState.RUNNING);

        taskInfo = sqlTask.getTaskInfo();
        assertEquals(taskInfo.getState(), TaskState.RUNNING);
View Full Code Here

        SqlTask sqlTask = createInitialTask();

        TaskInfo taskInfo = sqlTask.updateTask(SESSION,
                PLAN_FRAGMENT,
                ImmutableList.of(new TaskSource(TABLE_SCAN_NODE_ID, ImmutableSet.of(SPLIT), true)),
                INITIAL_EMPTY_OUTPUT_BUFFERS.withBuffer("out", new UnpartitionedPagePartitionFunction()).withNoMoreBufferIds());
        assertEquals(taskInfo.getState(), TaskState.RUNNING);

        taskInfo = sqlTask.getTaskInfo();
        assertEquals(taskInfo.getState(), TaskState.RUNNING);
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.