Package com.netflix.zeno.fastblob.record

Examples of com.netflix.zeno.fastblob.record.FastBlobDeserializationRecord.position()


        ByteDataBuffer buf = new ByteDataBuffer();

        rec.writeDataTo(buf);

        FastBlobDeserializationRecord deserializeRec = new FastBlobDeserializationRecord(testSerializer.getFastBlobSchema(), buf.getUnderlyingArray());
        deserializeRec.position(0);

        Boolean deserialized = testSerializer.deserialize(deserializeRec);

        Assert.assertEquals(Boolean.TRUE, deserialized);
    }
View Full Code Here


        ByteDataBuffer buf = new ByteDataBuffer();

        rec.writeDataTo(buf);

        FastBlobDeserializationRecord deserializeRec = new FastBlobDeserializationRecord(testSerializer.getFastBlobSchema(), buf.getUnderlyingArray());
        deserializeRec.position(0);

        Object[] deserialized = testSerializer.deserialize(deserializeRec);

        Assert.assertArrayEquals(bytes, (byte[])deserialized[0]);
        Assert.assertArrayEquals(bytes2, (byte[])deserialized[1]);
View Full Code Here

                            int ordinal = (int)(pointerAndOrdinal >> 36);

                            int sizeOfData = VarInt.readVInt(byteData.getUnderlyingArray(), pointer);
                            pointer += VarInt.sizeOfVInt(sizeOfData);

                            rec.position(pointer);

                            fill.add(ordinal, rec);
                        }
                    }
                }
View Full Code Here

                            }

                            int sizeOfData = VarInt.readVInt(byteData.getUnderlyingArray(), pointer);
                            pointer += VarInt.sizeOfVInt(sizeOfData);

                            rec.position(pointer);
                            remapper.remapOrdinals(rec, mappedBuffer);

                            int newOrdinal = destState.addData(mappedBuffer, FastBlobImageUtils.toLong(imageMembershipsFlags));
                            stateOrdinalMapping.setMappedOrdinal(ordinal, newOrdinal);
View Full Code Here

        rec.writeDataTo(buf);

        FastBlobDeserializationRecord deserializeRec = new FastBlobDeserializationRecord(testSerializer.getFastBlobSchema(), buf.getUnderlyingArray());

        deserializeRec.position(0);

        return deserializeRec;
    }

    public class TestSerializer1 extends NFTypeSerializer<String[]> {
View Full Code Here

        ByteDataBuffer buf = new ByteDataBuffer();

        rec.writeDataTo(buf);

        FastBlobDeserializationRecord deserializationRecord = new FastBlobDeserializationRecord(schema, buf.getUnderlyingArray());
        deserializationRecord.position(0);

        PojoWithAllTypes deserialized = serializer.deserialize(deserializationRecord);

        Assert.assertTrue(deserialized.boolField);
        Assert.assertTrue(Arrays.equals(new byte[] {7, 8}, deserialized.bytesField));
View Full Code Here

        for(int j=0;j<numObjects;j++) {
            int currentOrdinalDelta = VarInt.readVInt(byteData);

            currentOrdinal += currentOrdinalDelta;

            int objectSize = rec.position(byteData.currentStreamPosition());
            byteData.incrementStreamPosition(objectSize);

            if(typeDeserializationState != null) {
                typeDeserializationState.add(currentOrdinal, rec);
            }
View Full Code Here

        for(int j=0;j<numObjects;j++) {
            int currentOrdinalDelta = VarInt.readVInt(byteData);

            currentOrdinal += currentOrdinalDelta;

            int recordSize = rec.position(byteData.currentStreamPosition());

            if(typeDeserializationState != null) {
                NFTypeSerializer<T> serializer = typeDeserializationState.getSerializer();
                T deserializedObject = serializer.deserialize(rec);
                serializer.serialize(deserializedObject, serializationRecord);
View Full Code Here

                int ordinal = ByteArrayOrdinalMap.getOrdinal(pointerAndOrdinal);

                int sizeOfData = VarInt.readVInt(byteData.getUnderlyingArray(), pointer);
                pointer += VarInt.sizeOfVInt(sizeOfData);

                rec.position(pointer);

                add(ordinal, rec);
            }
        }
    }
View Full Code Here

        VarInt.writeVInt(fromDataBuffer, (int)buf.length());

        fromDataBuffer.copyFrom(buf);

        FastBlobDeserializationRecord rec = new FastBlobDeserializationRecord(schema, fromDataBuffer.getUnderlyingArray());
        rec.position(0);

        ByteDataBuffer toDataBuffer = new ByteDataBuffer();
        new OrdinalRemapper(ordinalMapping).remapOrdinals(rec, toDataBuffer);
        return toDataBuffer;
    }
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.