Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.TypeException


                        log.debug("Triggering schema cache refresh for bucket: " + bucketId);
                    }
                    ZkUtil.update(zooKeeper, CACHE_INVALIDATION_PATH + "/" + bucketId, null, -1);
                }
            } catch (KeeperException e) {
                throw new TypeException("Exception while triggering cache refresh", e);
            }
        }
    }
View Full Code Here


        try {
            zooKeeper.setData(CACHE_REFRESHENABLED_PATH, new byte[] { (byte) 1 }, -1);
            cacheRefreshingEnabled = true;
            triggerRefresh();
        } catch (KeeperException e) {
            throw new TypeException("Enabling cache refreshing failed", e);
        }
    }
View Full Code Here

    public void disableSchemaCacheRefresh() throws TypeException, InterruptedException {
        try {
            zooKeeper.setData(CACHE_REFRESHENABLED_PATH, new byte[] { (byte) 0 }, -1);
            cacheRefreshingEnabled = false;
        } catch (KeeperException e) {
            throw new TypeException("Enabling schema cache refreshing failed", e);
        }
    }
View Full Code Here

        int indexOfParams = valueTypeSpec.indexOf("<");
        if (indexOfParams == -1) {
            ValueTypeFactory valueTypeFactory = valueTypeFactories.get(valueTypeSpec);
            if (valueTypeFactory == null) {
                throw new TypeException("Unkown value type: " + valueTypeSpec);
            }
            valueType = valueTypeFactory.getValueType(null);
        } else {
            if (!valueTypeSpec.endsWith(">")) {
                throw new IllegalArgumentException("Invalid value type string, no closing angle bracket: '" +
                        valueTypeSpec + "'");
            }

            String arg = valueTypeSpec.substring(indexOfParams + 1, valueTypeSpec.length() - 1);

            if (arg.length() == 0) {
                throw new IllegalArgumentException("Invalid value type string, type arg is zero length: '" +
                        valueTypeSpec + "'");
            }

            ValueTypeFactory valueTypeFactory = valueTypeFactories.get(valueTypeSpec.substring(0, indexOfParams));
            if (valueTypeFactory == null) {
                throw new TypeException("Unkown value type: " + valueTypeSpec);
            }
            valueType = valueTypeFactory.getValueType(arg);
        }

        return valueType;
View Full Code Here

            updateRecordTypeCache(newRecordType);

            // Clear the concurrency timestamp
            clearConcurrency(nameBytes, now);
        } catch (IOException e) {
            throw new TypeException("Exception occurred while creating recordType '" + recordType.getName()
                    + "' on HBase", e);
        } catch (InterruptedException e) {
            throw new TypeException("Exception occurred while creating recordType '" + recordType.getName()
                    + "' on HBase", e);
        }
        return newRecordType;
    }
View Full Code Here

            // Refresh the caches
            updateRecordTypeCache(newRecordType);

        } catch (IOException e) {
            throw new TypeException("Exception occurred while updating recordType '" + newRecordType.getId()
                    + "' on HBase", e);
        } catch (InterruptedException e) {
            throw new TypeException("Exception occurred while updating recordType '" + newRecordType.getId()
                    + "' on HBase", e);
        } finally {
            if (nameBytes != null && now != null) {
                clearConcurrency(nameBytes, now);
            }
View Full Code Here

                        // record type was created in the meantime, retry
                        exists = true;
                    }
                }
            }
            throw new TypeException("Record type create-or-update failed after " + attempts +
                    " attempts, toggling between create and update mode.");

        }
    }
View Full Code Here

    private boolean updateName(Put put, RecordType recordType, RecordType latestRecordType)
            throws TypeException, RepositoryException, InterruptedException {
        if (!recordType.getName().equals(latestRecordType.getName())) {
            try {
                getRecordTypeByName(recordType.getName(), null);
                throw new TypeException("Changing the name '" + recordType.getName() + "' of a recordType '"
                        + recordType.getId() + "' to a name that already exists is not allowed; old '"
                        + latestRecordType.getName() + "' new '" + recordType.getName() + "'");
            } catch (RecordTypeNotFoundException allowed) {
            }
            put.add(TypeCf.DATA.bytes, TypeColumn.RECORDTYPE_NAME.bytes, encodeName(recordType.getName()));
View Full Code Here

            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

        try {
            if (!getTypeTable().exists(get)) {
                throw new FieldTypeNotFoundException(fieldTypeEntry.getFieldTypeId());
            }
        } catch (IOException e) {
            throw new TypeException("Exception occurred while checking existance of FieldTypeEntry '"
                    + fieldTypeEntry.getFieldTypeId() + "' on HBase", e);
        }
        put.add(TypeCf.FIELDTYPE_ENTRY.bytes, idBytes, version, encodeFieldTypeEntry(fieldTypeEntry));
    }
View Full Code Here

TOP

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

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.