Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.PageBuilder


        }
        state = State.FINISHED;

        String fragment = recordSink.commit();

        PageBuilder page = new PageBuilder(TYPES);
        BIGINT.writeLong(page.getBlockBuilder(0), rowCount);
        VARCHAR.writeSlice(page.getBlockBuilder(1), Slices.utf8Slice(fragment));
        return page.build();
    }
View Full Code Here


        //Note: Poissonized Samples can be larger than the original dataset if desired
        checkArgument(sampleRatio > 0, "sample ratio must be strictly positive");

        this.operatorContext = checkNotNull(operatorContext, "operatorContext is null");
        this.types = ImmutableList.copyOf(types);
        this.pageBuilder = new PageBuilder(types);
        this.sampleWeightChannel = types.size() - 1;
        this.sampleRatio = sampleRatio;
        this.rescaled = rescaled;
    }
View Full Code Here

        }
        state = State.FINISHED;

        tableCommitter.commitTable(fragmentBuilder.build());

        PageBuilder page = new PageBuilder(getTypes());
        BIGINT.writeLong(page.getBlockBuilder(0), rowCount);
        return page.build();
    }
View Full Code Here

        this.maxRowCountPerPartition = maxRowCountPerPartition;

        this.partitionRowCount = new LongBigArray(0);
        this.groupByHash = new GroupByHash(partitionTypes, Ints.toArray(partitionChannels), expectedPositions);
        this.types = toTypes(sourceTypes, outputChannels);
        this.pageBuilder = new PageBuilder(types);
    }
View Full Code Here

        this.planNodeId = checkNotNull(sourceId, "sourceId is null");
        this.pageSourceProvider = checkNotNull(pageSourceProvider, "pageSourceManager is null");
        this.types = ImmutableList.copyOf(checkNotNull(types, "types is null"));
        this.columns = ImmutableList.copyOf(checkNotNull(columns, "columns is null"));

        this.pageBuilder = new PageBuilder(getTypes());
    }
View Full Code Here

        this.types = ImmutableList.<Type>builder()
                .addAll(probeTypes)
                .addAll(lookupSourceSupplier.getTypes())
                .build();
        this.pageBuilder = new PageBuilder(types);
    }
View Full Code Here

        pages.clear();

        LookupSource lookupSource = outputPagesIndex.createLookupSource(indexChannels);

        // Build a page containing the keys that produced no output rows, so in future requests can skip these keys
        PageBuilder missingKeysPageBuilder = new PageBuilder(missingKeysIndex.getTypes());
        UnloadedIndexKeyRecordCursor unloadedKeyRecordCursor = unloadedKeysRecordSet.cursor();
        while (unloadedKeyRecordCursor.advanceNextPosition()) {
            Block[] blocks = unloadedKeyRecordCursor.getBlocks();
            int position = unloadedKeyRecordCursor.getPosition();
            if (lookupSource.getJoinPosition(position, blocks) < 0) {
                for (int i = 0; i < blocks.length; i++) {
                    Block block = blocks[i];
                    Type type = unloadedKeyRecordCursor.getType(i);
                    type.appendTo(block, position, missingKeysPageBuilder.getBlockBuilder(i));
                }
            }
        }
        Page missingKeysPage = missingKeysPageBuilder.build();

        memoryInBytes += missingKeysPage.getSizeInBytes();
        if (isMemoryExceeded()) {
            return null;
        }

        // only update missing keys if we have new missing keys
        if (!missingKeysPageBuilder.isEmpty()) {
            missingKeysIndex.addPage(missingKeysPage);
            missingKeys = missingKeysIndex.createLookupSource(missingKeysChannels);
        }

        return new IndexSnapshot(lookupSource, missingKeys);
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.PageBuilder

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.