Examples of RecordException


Examples of org.lilyproject.repository.api.RecordException

                newRecord.setResponseStatus(ResponseStatus.CREATED);
                removeUnidirectionalState(newRecord);
                return newRecord;

            } catch (IOException e) {
                throw new RecordException("Exception occurred while creating record '" + recordId + "' in HBase table",
                        e);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new RecordException("Exception occurred while creating record '" + recordId + "' in HBase table",
                        e);
            } catch (BlobException e) {
                throw new RecordException("Exception occurred while creating record '" + recordId + "'",
                        e);
            }
        } finally {
            metrics.report(Action.CREATE, System.currentTimeMillis() - before);
        }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

            // Check if the update is an update of mutable fields
            if (updateVersion) {
                try {
                    return updateMutableFields(record, useLatestRecordType, conditions, fieldTypes);
                } catch (BlobException e) {
                    throw new RecordException("Exception occurred while updating record '" + record.getId() + "'",
                            e);
                }
            } else {
                return updateRecord(record, useLatestRecordType, conditions, fieldTypes);
            }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

            removeUnidirectionalState(newRecord);
            return newRecord;

        } catch (IOException e) {
            throw new RecordException("Exception occurred while updating record '" + recordId + "' on HBase table",
                    e);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RecordException("Exception occurred while updating record '" + recordId + "' on HBase table",
                    e);
        } catch (BlobException e) {
            throw new RecordException("Exception occurred while putting updated record '" + recordId
                    + "' on HBase table", e);
        }
    }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

                newRecord.setResponseStatus(ResponseStatus.UP_TO_DATE);
            }

            setRecordTypesAfterUpdate(record, originalRecord, changedScopes);
        } catch (IOException e) {
            throw new RecordException("Exception occurred while updating record '" + recordId + "' on HBase table",
                    e);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RecordException("Exception occurred while updating record '" + recordId + "' on HBase table",
                    e);
        }

        removeUnidirectionalState(newRecord);
        return newRecord;
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

            // Clear the old data and delete any referenced blobs
            clearData(recordId, originalRecord, originalRecord.getVersion());

        } catch (IOException e) {
            throw new RecordException("Exception occurred while deleting record '" + recordId + "' on HBase table", e);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RecordException("Exception occurred while deleting record '" + recordId + "' on HBase table", e);
        } finally {
            long after = System.currentTimeMillis();
            metrics.report(Action.DELETE, (after - before));
        }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

            writeQName(entry.getKey(), output);
            output.writeUTF(valueType.getName());
            try {
                valueType.write(entry.getValue(), output, new IdentityRecordStack());
            } catch (Exception e) {
                throw new RecordException("Error serializing field " + entry.getKey(), e);
            }
        }

        // Write the fields to delete
        output.writeVInt(record.getFieldsToDelete().size());
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

        ResultScanner hbaseScanner;
        try {
            hbaseScanner = recordTable.getScanner(hbaseScan);
        } catch (IOException e) {
            throw new RecordException("Error creating scanner", e);
        }
        return hbaseScanner;
    }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

            if (result == null || result.isEmpty()) {
                throw new RecordNotFoundException(recordId, this, this);
            }

        } catch (IOException e) {
            throw new RecordException("Exception occurred while retrieving record '" + recordId
                    + "' from HBase table", e);
        }
        return result;
    }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

                    continue;
                }
                results.put(recordIds.get(i++), result);
            }
        } catch (IOException e) {
            throw new RecordException("Exception occurred while retrieving records '" + recordIds
                    + "' from HBase table", e);
        }
        return results;
    }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordException

    private void encodeData(Object value, DataOutput dataOutput, IdentityRecordStack parentRecords)
            throws RepositoryException, InterruptedException {
        Record record = (Record)value;
        if (parentRecords.contains(record)) {
            throw new RecordException("A record may not be nested in itself: " + record.getId());
        }


        RecordType recordType;
        QName recordRecordTypeName = record.getRecordTypeName();
        if (recordRecordTypeName != null) {
            if (valueTypeRecordTypeName != null) {
                // Validate the same record type is being used
                // 20130314: temporarily disabled this, see LILY-1279
//                if (!valueTypeRecordTypeName.equals(recordRecordTypeName)) {
//                    throw new RecordException("The record's Record Type '" + recordRecordTypeName +
//                            "' does not match the record value type's record type '" + valueTypeRecordTypeName + "'");
//                }
            }
            recordType = typeManager.getRecordTypeByName(recordRecordTypeName, null);
        } else if (valueTypeRecordTypeName != null) {
                recordType = typeManager.getRecordTypeByName(valueTypeRecordTypeName, null);
        } else {
            throw new RecordException("The record '" + record + "' should specify a record type");
        }

        // Get and sort the field type entries that should be in the record
        List<FieldType> fieldTypes = getSortedFieldTypes(recordType);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.