Examples of readSnapshot()


Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

        FastBlobStateEngine deserializeEngine = typeAStateEngine();

        FastBlobReader reader = new FastBlobReader(deserializeEngine);

        reader.readSnapshot(new ByteArrayInputStream(baos.toByteArray()));

        deserializeEngine.fillSerializationStatesFromDeserializedData();

        deserializeEngine.prepareForWrite();
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

        FastBlobWriter writer = new FastBlobWriter(stateEngine);
        writer.writeSnapshot(dataOutputStream);

        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(baos.toByteArray()));

        return stateEngine;
    }

View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

    @Test
    public void testListenerSnapshot() throws IOException {
        TestTypeDeserializationStateListener listener = new TestTypeDeserializationStateListener();
        stateEngine.setTypeDeserializationStateListener("TypeF", listener);
        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(snapshot1));

        Assert.assertEquals(0, listener.getRemovedValuesSize());
        Assert.assertEquals(10, listener.getAddedValuesSize());
        Assert.assertEquals(3, listener.getAddedValueOrdinal(4));
    }
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

    }

    @Test
    public void testListenerDelta() throws IOException {
        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(snapshot1));

        TestTypeDeserializationStateListener listener = new TestTypeDeserializationStateListener();
        stateEngine.setTypeDeserializationStateListener("TypeF", listener);
        reader.readDelta(new ByteArrayInputStream(delta));
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

    }

    @Test
    public void testListenerDoubleSnapshot() throws IOException {
        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(snapshot1));

        TestTypeDeserializationStateListener listener = new TestTypeDeserializationStateListener();
        stateEngine.setTypeDeserializationStateListener("TypeF", listener);
        reader.readSnapshot(new ByteArrayInputStream(snapshot2));
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(snapshot1));

        TestTypeDeserializationStateListener listener = new TestTypeDeserializationStateListener();
        stateEngine.setTypeDeserializationStateListener("TypeF", listener);
        reader.readSnapshot(new ByteArrayInputStream(snapshot2));

        Assert.assertEquals(3, listener.getRemovedValuesSize());
        Assert.assertEquals(2, listener.getRemovedValueOrdinal(3));
        Assert.assertEquals(2, listener.getAddedValuesSize());
        Assert.assertEquals(10, listener.getAddedValueOrdinal(11));
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

    }

    @Test
    public void testListenerDoubleSnapshotDiscontinuousState() throws IOException {
        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(snapshot1));

        TestTypeDeserializationStateListener listener = new TestTypeDeserializationStateListener();
        stateEngine.setTypeDeserializationStateListener("TypeF", listener);
        reader.readSnapshot(new ByteArrayInputStream(brokenDeltaChainSnapshot2));
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(snapshot1));

        TestTypeDeserializationStateListener listener = new TestTypeDeserializationStateListener();
        stateEngine.setTypeDeserializationStateListener("TypeF", listener);
        reader.readSnapshot(new ByteArrayInputStream(brokenDeltaChainSnapshot2));

        Assert.assertEquals(3, listener.getRemovedValuesSize());
        Assert.assertEquals(2, listener.getRemovedValueOrdinal(3));
        Assert.assertEquals(2, listener.getAddedValuesSize());
        Assert.assertEquals(7, listener.getAddedValueOrdinal(11));
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

        ByteArrayInputStream deltaStream = new ByteArrayInputStream(delta);


        try {
            /// first read the snapshot
            reader.readSnapshot(snapshotStream);
            /// then apply the delta
            reader.readDelta(deltaStream);
        } catch (IOException e) {
            /// either of these methods throws an exception if the FastBlobReader
            /// is unable to read from the provided stream.
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobReader.readSnapshot()

        ByteArrayInputStream deltaStream = new ByteArrayInputStream(delta);


        try {
            /// first read the snapshot
            reader.readSnapshot(snapshotStream);
            /// then apply the delta
            reader.readDelta(deltaStream);
        } catch (IOException e) {
            /// either of these methods throws an exception if the FastBlobReader
            /// is unable to read from the provided stream.
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.