Package com.foundationdb.server.error

Examples of com.foundationdb.server.error.ProtobufWriteException


        String MESSAGE_NAME = AISProtobuf.AkibanInformationSchema.getDescriptor().getFullName();
        int requiredSize = getBufferSize();
        int serializedSize = requiredSize - 4; // Added by requiredBufferSize
        int bufferSize = buffer.limit() - buffer.position();
        if(bufferSize < requiredSize) {
            throw new ProtobufWriteException(MESSAGE_NAME, "Required size exceeds buffer size");
        }
        buffer.putInt(serializedSize);
        int bufferPos = buffer.position();
        bufferSize = buffer.limit() - bufferPos;
        CodedOutputStream codedOutput = CodedOutputStream.newInstance(buffer.array(), bufferPos, bufferSize);
        try {
            pbAIS.writeTo(codedOutput);
            // Successfully written, update backing buffer info
            buffer.position(bufferPos + serializedSize);
        } catch(IOException e) {
            // CodedOutputStream really only throws OutOfSpace exception, but declares IOE
            throw new ProtobufWriteException(MESSAGE_NAME, e.getMessage());
        }
    }
View Full Code Here


    private static AISProtobuf.JoinType convertJoinType(Index.JoinType joinType) {
        switch(joinType) {
            case LEFT: return AISProtobuf.JoinType.LEFT_OUTER_JOIN;
            case RIGHT: return AISProtobuf.JoinType.RIGHT_OUTER_JOIN;
        }
        throw new ProtobufWriteException(AISProtobuf.Join.getDescriptor().getFullName(),
                                         "No match for Index.JoinType "+joinType.name());
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.error.ProtobufWriteException

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.