Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.RecordTypeNotFoundException


    public RecordType getRecordTypeById(SchemaId id, Long version)
            throws RecordTypeNotFoundException, TypeException, RepositoryException, InterruptedException {
        ArgumentValidator.notNull(id, "id");
        RecordType recordType = getRecordTypeFromCache(id, version);
        if (recordType == null) {
            throw new RecordTypeNotFoundException(id, version);
        }
        return recordType.clone();
    }
View Full Code Here


    public RecordType getRecordTypeByName(QName name, Long version)
            throws RecordTypeNotFoundException, TypeException, RepositoryException, InterruptedException {
        ArgumentValidator.notNull(name, "name");
        RecordType recordType = getRecordTypeFromCache(name, version);
        if (recordType == null) {
            throw new RecordTypeNotFoundException(name, version);
        }
        return recordType.clone();
    }
View Full Code Here

        SchemaId id;
        if (recordType.getId() == null) {
            // Map the name to id
            RecordType existingType = getRecordTypeFromCache(recordType.getName(), recordType.getVersion());
            if (existingType == null) {
                throw new RecordTypeNotFoundException(recordType.getName(), null);
            } else {
                id = existingType.getId();
            }
        } else {
            id = recordType.getId();
        }

        RecordType newRecordType = recordType.clone();
        newRecordType.setId(id);

        byte[] rowId = id.getBytes();
        byte[] nameBytes = null;
        Long now = null;

        try {

            // Do an exists check first
            if (!getTypeTable().exists(new Get(rowId))) {
                throw new RecordTypeNotFoundException(recordType.getId(), null);
            }

            // Only do the concurrency check when a name was given
            QName name = recordType.getName();
            if (name != null) {
View Full Code Here

            result = getTypeTable().get(get);
            // This covers the case where a given id would match a name that was
            // used for setting the concurrent counters
            if (result == null || result.isEmpty()
                    || result.getValue(TypeCf.DATA.bytes, TypeColumn.VERSION.bytes) == null) {
                throw new RecordTypeNotFoundException(id, null);
            }
        } catch (IOException e) {
            throw new TypeException("Exception occurred while retrieving recordType '" + id + "' from HBase table", e);
        }
        return extractRecordType(id, version, result);
View Full Code Here

        List<KeyValue> existingVersions = result.getColumn(TypeCf.DATA.bytes, TypeColumn.VERSION.bytes);
        Long existingMaxVersion = Bytes.toLong(result.getValue(TypeCf.DATA.bytes, TypeColumn.VERSION.bytes));

        if (version != null) {
            if (existingMaxVersion < version) {
                throw new RecordTypeNotFoundException(id, version);
            }
            RecordType recordType = newRecordType(id, name);
            recordType.setVersion(version);
            extractFieldTypeEntries(result, version, recordType);
            extractSupertypes(result, version, recordType);
View Full Code Here

                return typeManager2.getRecordTypeByName(name, null);
            } catch (RecordTypeNotFoundException e) {
                // continue
            }
        }
        throw new RecordTypeNotFoundException(name, null);
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.repository.api.RecordTypeNotFoundException

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.