Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.RepositoryException


            HTableInterface htable = wrapWithAuthorization(nonAuthHTable);
            return new HBaseRepository(key, this, htable, nonAuthHTable, blobManager, tableManager, getRecordFactory());
        } catch (org.apache.hadoop.hbase.TableNotFoundException e) {
            throw new TableNotFoundException(key.getRepositoryName(), key.getTableName());
        } catch (IOException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here


                    } else {
                        allSatisfied = false;
                        break;
                    }
                } else {
                    throw new RepositoryException("When comparing to null, only (not-)equal operator is allowed. " +
                            "Operator: " + condition.getOp() + ", field: " + condition.getField());
                }
            }

            if (value == null && condition.getAllowMissing()) {
View Full Code Here

        ValueType valueType = typeManager.getFieldTypeByName(cond.getField()).getValueType();
        Comparator comparator = valueType.getComparator();

        if (comparator == null) {
            throw new RepositoryException("Other than (not-)equals operator in mutation condition used for value type "
                    + "that does not support comparison: " + valueType.getName());
        }

        int result = comparator.compare(currentValue, cond.getValue());
View Full Code Here

            // first Put call below, and hence the clearData afterwards might fail, leaving us with a half-deleted
            // record.
            if (AuthorizationContextHolder.getCurrentContext() != null) {
                for (QName field : originalRecord.getFields().keySet()) {
                    if (fieldTypes.getFieldType(field).getScope() != Scope.NON_VERSIONED) {
                        throw new RepositoryException("Deleting records with versioned or versioned-mutable fields "
                                + "is not supported when authorization is active.");
                    }
                }
            }
View Full Code Here

                recordIds.add(id);
            }
            Closer.close(
                    scanner); // Not closed in finally block: avoid HBase contact when there could be connection problems.
        } catch (IOException e) {
            throw new RepositoryException("Error getting list of variants of record " + recordId.getMaster(), e);
        }

        return recordIds;
    }
View Full Code Here

                node.put("@class", className);
                return node;
            }
        }

        throw new RepositoryException("No json converter available for filter type " + className);
    }
View Full Code Here

            if (json.supports(className)) {
                return json.fromJson(node, namespaces, repository, converter);
            }
        }

        throw new RepositoryException("No json converter available for filter type " + className);
    }
View Full Code Here

            }
            ValueType valueType = fieldType.getValueType();

            // fieldValue should never be null by the time we get here, but check anyway
            if (fieldValue == null) {
                throw new RepositoryException("Null field values are not allowed. Field: " + fieldType.getName());
            }

            if (!valueType.getType().isAssignableFrom(fieldValue.getClass())) {
                throw new RepositoryException(String.format("Incorrect type of value provided for field %s. "
                        + "Expected instance of %s but got %s.", fieldType.getName(), valueType.getType().getName(),
                        fieldValue.getClass().getName()));
            }

            DataOutput dataOutput = new DataOutputImpl();
            boolean hasMetadata = metadata != null && !metadata.getMap().isEmpty();

            dataOutput.writeByte(hasMetadata ? FieldFlags.METADATA_V1 : FieldFlags.DEFAULT);
            try {
                valueType.write(fieldValue, dataOutput, new IdentityRecordStack(parentRecord));
            } catch (InterruptedException e) {
                throw e;
            } catch (Exception e) {
                // wrap the exception so that it is known what field causes the problem
                throw new RepositoryException("Error serializing value for field " + fieldType.getName(), e);
            }

            if (hasMetadata) {
                if (fieldType.getScope() == Scope.VERSIONED_MUTABLE) {
                    throw new RuntimeException("Field metadata is currently not supported for versioned-mutable fields.");
View Full Code Here

    public T next() throws RepositoryException, InterruptedException {
        Result result;
        try {
            result = hbaseScanner.next();
        } catch (IOException e) {
            throw new RepositoryException(e);
        }

        if (result == null) {
            // no more results
            return null;
View Full Code Here

    public RepositoryException convert(AvroRepositoryException avroException) {
        try {
            Class exceptionClass = Class.forName(avroException.getExceptionClass());
            Constructor constructor = exceptionClass.getConstructor(String.class, Map.class);
            RepositoryException repositoryException = (RepositoryException) constructor.newInstance(
                    avroException.getMessage$(), avroException.getParams());
            restoreCauses(avroException.getRemoteCauses(), repositoryException);
            return repositoryException;
        } catch (Exception e) {
            log.error("Failure while converting remote exception", e);

            RepositoryException repositoryException = new RepositoryException(avroException.getMessage$());
            restoreCauses(avroException.getRemoteCauses(), repositoryException);
            return repositoryException;
        }
    }
View Full Code Here

TOP

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

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.