-
Notifications
You must be signed in to change notification settings - Fork 2
Common Extraction Errors
bfemiano edited this page Sep 17, 2012
·
1 revision
Extraction cell contents can produce a number of different errors.
Many of the cellmate error messages are very descriptive such as this one from CellReflector if you attempt to read a value type inconsistent with the provided cell
throw new CellExtractorException("Unable to cast field value as instance of " + type.getName() +
". Found field class of "
+ field.getType().getName(), e, ErrorType.CLASS_CAST);
It helps to understand the different types of errors listed in ErrorType
- CLASS_CAST - this is frequently the result of a mismatch between the declared type in a cell and the type-specific extractor method used. For example:
extractor.getStringValue(cell)
will throw this error if thecell
is IntValueCell - ILLEGAL_ACCESS - error attempting to reflectively access a field. This one is relatively uncommon.
- MISSING_FIELD - If trying to access a named auxiliary field that doesn't exist, or you're trying to read the label/value from your cell without the proper Label and Value annotations.
- MISSING_ANNOTATION - If you've provided a cell class that is missing the Cell annotation.
- MISSING_COLFAM_ON_WRITE - If you're trying to write a cell that is not annotated with ColumnFamily.
- NULL_FIELD - Trying to access a null value or auxiliary value reference.
- TOO_MANY_FIELDS - Thrown by specific methods that are designed to only return one single matching cell.
- UNSUPPORTED_TYPE - Thrown only by the cell reflector method
getValueBytesIfPrimative()
if attempting to read byte content from a value type that's not String, byte[], int, double or long. - REJECTED_WRITE - Thrown whenever a mutation rejection occured during write.
- UNKNOWN_ERROR - An error different from those listed here occurred.