Package com.foundationdb.ais.protobuf

Examples of com.foundationdb.ais.protobuf.ProtobufWriter.save()


        return newAIS;
    }

    public void clone(AkibanInformationSchema destAIS, AkibanInformationSchema srcAIS, ProtobufWriter.WriteSelector selector) {
        ProtobufWriter writer = new ProtobufWriter(selector);
        AISProtobuf.AkibanInformationSchema pbAIS = writer.save(srcAIS);
        ProtobufReader reader = new ProtobufReader(typesRegistry, storageFormatRegistry, destAIS, pbAIS.toBuilder());
        reader.loadAIS();
    }
}
View Full Code Here


    }

    /** Serialize given AIS. Allocates a new buffer if necessary so always use <i>returned</i> buffer. */
    private static ByteBuffer serialize(ByteBuffer buffer, AkibanInformationSchema ais, ProtobufWriter.WriteSelector selector) {
        ProtobufWriter writer = new ProtobufWriter(selector);
        writer.save(ais);
        int size = writer.getBufferSize();
        if(buffer == null || (buffer.capacity() < size)) {
            buffer = ByteBuffer.allocate(size);
        }
        buffer.clear();
View Full Code Here

    }

    private ByteBuffer serialize(AkibanInformationSchema ais) throws Exception
    {
        ProtobufWriter writer = new ProtobufWriter();
        writer.save(ais);
        ByteBuffer buffer = ByteBuffer.allocate(writer.getBufferSize());
        writer.serialize(buffer);
        buffer.flip();
        return buffer;
    }
View Full Code Here

    }

    /** Serialize given AIS. Allocates a new buffer if necessary so always use <i>returned</i> buffer. */
    private static ByteBuffer serialize(ByteBuffer buffer, AkibanInformationSchema ais, WriteSelector selector) {
        ProtobufWriter writer = new ProtobufWriter(selector);
        writer.save(ais);
        int size = writer.getBufferSize();
        if(buffer == null || (buffer.capacity() < size)) {
            buffer = ByteBuffer.allocate(size);
        }
        buffer.clear();
View Full Code Here

        storageDescription.setStorageKey("KEY");
        storageDescription.setExtension("PLUS");
        assertTrue(isFullDescription(storageDescription));
        sequence.setStorageDescription(storageDescription);
        ProtobufWriter writer = new ProtobufWriter();
        writer.save(aisb.akibanInformationSchema());
        writer.serialize(bytes);
        bytes.flip();
    }

    @Test
View Full Code Here

        ProtobufReader reader = new ProtobufReader(typesRegistry, newFormatRegistry, ais);
        reader.loadBuffer(bytes);
        reader.loadAIS();
        bytes.flip();
        ProtobufWriter writer = new ProtobufWriter();
        writer.save(ais);
        writer.serialize(bytes);
        bytes.flip();
        Sequence sequence = loadSequence(typesRegistry, testFormatRegistry);
        assertNotNull(sequence);
        assertTrue(isFullDescription(sequence.getStorageDescription()));
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.