Package com.foundationdb.server.error

Examples of com.foundationdb.server.error.ProtobufReadException


        DynamicMessage msg;
        try {
            msg = DynamicMessage.parseFrom(converter.getMessageType(), storeData.rawValue);
        }
        catch (InvalidProtocolBufferException ex) {
            ProtobufReadException nex = new ProtobufReadException(converter.getMessageType().getName(), ex.getMessage());
            nex.initCause(ex);
            throw nex;
        }
        converter.decode(msg, rowData);
    }
View Full Code Here


        checkBuffer(buffer);
        final int serializedSize = buffer.getInt();
        final int initialPos = buffer.position();
        final int bufferSize = buffer.limit() - initialPos;
        if(bufferSize < serializedSize) {
            throw new ProtobufReadException(MESSAGE_NAME, "Buffer corrupt, serialized size greater than remaining");
        }
        CodedInputStream codedInput = CodedInputStream.newInstance(buffer.array(), buffer.position(), Math.min(serializedSize, bufferSize));
        try {
            pbAISBuilder.mergeFrom(codedInput, storageFormatRegistry.getExtensionRegistry());
            // Successfully consumed, update byte buffer
            buffer.position(initialPos + serializedSize);
        } catch(IOException e) {
            // CodedInputStream really only throws InvalidProtocolBufferException, but declares IOE
            throw new ProtobufReadException(MESSAGE_NAME, e.getMessage());
        }
    }
View Full Code Here

                hasRequiredFields(pbParentName);
                Table childTable = destAIS.getTable(schema, pbTable.getTableName());
                Table parentTable = destAIS.getTable(pbParentName.getSchemaName(), pbParentName.getTableName());

                if(parentTable == null) {
                    throw new ProtobufReadException(
                            pbTable.getDescriptorForType().getFullName(),
                            String.format("%s has unknown parentTable %s.%s", childTable.getName(),
                                          pbParentName.getSchemaName(), pbParentName.getTableName())
                    );
                }
View Full Code Here

                if (pbJar.hasVersion()) {
                    sqljJar.setVersion(pbJar.getVersion());
                }
            }
            catch (MalformedURLException ex) {
                throw new ProtobufReadException(
                       pbJar.getDescriptorForType().getFullName(),
                       ex.toString()
                );
            }
        }       
View Full Code Here

    private void loadExternalRoutines(String schema, Collection<AISProtobuf.Routine> pbRoutines) {
        for (AISProtobuf.Routine pbRoutine : pbRoutines) {
            if (pbRoutine.hasClassName() || pbRoutine.hasMethodName()) {
                Routine routine = destAIS.getRoutine(schema, pbRoutine.getRoutineName());
                if (routine == null) {
                    throw new ProtobufReadException(
                            pbRoutine.getDescriptorForType().getFullName(),
                            String.format("%s not found", pbRoutine.getRoutineName())
                    );
                }
                SQLJJar sqljJar = null;
                String className = null;
                String methodName = null;
                if (pbRoutine.hasJarName()) {
                    sqljJar = destAIS.getSQLJJar(pbRoutine.getJarName().getSchemaName(),
                                                 pbRoutine.getJarName().getTableName());
                    if (sqljJar == null) {
                        throw new ProtobufReadException(
                               pbRoutine.getDescriptorForType().getFullName(),
                               String.format("%s references JAR %s", pbRoutine.getRoutineName(), pbRoutine.getJarName())
                        );
                    }
                }
View Full Code Here

                break;
            case MODIFY:
                changes.add(TableChange.createModify(pbChange.getOldName(), pbChange.getNewName()));
                break;
            default:
                throw new ProtobufReadException(AISProtobuf.PendingOSChange.getDescriptor().getFullName(),
                                                "Unknown change type " + pbChange);
            }
        }
    }
View Full Code Here

        if(isValid) {
            switch(joinType) {
                case LEFT_OUTER_JOIN: return Index.JoinType.LEFT;
                case RIGHT_OUTER_JOIN: return Index.JoinType.RIGHT;
            }
            throw new ProtobufReadException(AISProtobuf.JoinType.getDescriptor().getFullName(),
                                            "Unsupported join type: " + joinType.name());
        }
        return null;
    }
View Full Code Here

        if(!required.isEmpty()) {
            Collection<String> names = new ArrayList<>(required.size());
            for(Descriptors.FieldDescriptor desc : required) {
                names.add(desc.getName());
            }
            throw new ProtobufReadException(message.getDescriptorForType().getFullName(),
                                            "Missing required fields: " + names.toString());
        }
    }
View Full Code Here

TOP

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

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.