Package io.airlift.slice

Examples of io.airlift.slice.SliceOutput.slice()


            }

            SliceOutput output = new DynamicSliceOutput(sizeEstimate);
            PagesSerde.writePages(output, new Page(blocks));
            BlockBuilder builder = new BlockBuilder(SINGLE_VARBINARY);
            builder.append(output.slice());
            return builder.build();
        }

        @Override
        public Block evaluateFinal()
View Full Code Here


                sizeEstimate += blocks[i].getDataSize().toBytes();
            }

            SliceOutput sliceOutput = new DynamicSliceOutput(sizeEstimate);
            PagesSerde.writePages(sliceOutput, new Page(blocks));
            output.append(sliceOutput.slice());
        }

        @Override
        public void evaluateFinal(int groupId, BlockBuilder output)
        {
View Full Code Here

            }

            SliceOutput output = new DynamicSliceOutput(sizeEstimate);
            PagesSerde.writePages(blockEncodingSerde, output, new Page(blocks));
            BlockBuilder builder = VARCHAR.createBlockBuilder(new BlockBuilderStatus());
            builder.appendSlice(output.slice());
            return builder.build();
        }

        @Override
        public Block evaluateFinal()
View Full Code Here

                sizeEstimate += blocks[i].getSizeInBytes();
            }

            SliceOutput sliceOutput = new DynamicSliceOutput(sizeEstimate);
            PagesSerde.writePages(blockEncodingSerde, sliceOutput, new Page(blocks));
            output.appendSlice(sliceOutput.slice());
        }

        @Override
        public void evaluateFinal(int groupId, BlockBuilder output)
        {
View Full Code Here

            appendTo(state.getKeyType(), sliceOutput, state.getKey());
        }
        if (state.getValue() != null && !state.getValue().isNull(0)) {
            appendTo(state.getValueType(), sliceOutput, state.getValue());
        }
        Slice slice = sliceOutput.slice();
        out.writeBytes(slice, 0, slice.length());
        out.closeEntry();
    }

    private static void appendTo(Type type, SliceOutput output, Block block)
View Full Code Here

                .appendByte(0xff);

        // overflow value
        expected.appendByte(0);

        assertSlicesEqual(makeHll(12).serialize(), expected.slice());
    }

    @Test
    public void testSingleNoOverflow()
            throws Exception
View Full Code Here

        for (int key : mins.keySet()) {
            output.appendInt(key);
            output.appendDouble(mins.get(key));
            output.appendDouble(maxs.get(key));
        }
        return output.slice().getBytes();
    }

    public static FeatureUnitNormalizer deserialize(byte[] modelData)
    {
        SliceInput input = Slices.wrappedBuffer(modelData).getInput();
View Full Code Here

            }

            SliceOutput output = new DynamicSliceOutput(sizeEstimate);
            PagesSerde.writePages(output, new Page(blocks));
            BlockBuilder builder = new BlockBuilder(SINGLE_VARBINARY);
            builder.append(output.slice());
            return builder.build();
        }

        @Override
        public Block evaluateFinal()
View Full Code Here

                sizeEstimate += blocks[i].getDataSize().toBytes();
            }

            SliceOutput sliceOutput = new DynamicSliceOutput(sizeEstimate);
            PagesSerde.writePages(sliceOutput, new Page(blocks));
            output.append(sliceOutput.slice());
        }

        @Override
        public void evaluateFinal(int groupId, BlockBuilder output)
        {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.