@Override public void validateCellValue(ByteBuffer cellValue) throws MarshalException { if (isMultiCell()) valueComparator().validateCellValue(cellValue); else super.validateCellValue(cellValue); }
@Override public void validateCellValue(ByteBuffer cellValue) throws MarshalException { if (isMultiCell()) valueComparator().validateCellValue(cellValue); else super.validateCellValue(cellValue); }
@Override public void validateCellValue(ByteBuffer cellValue) throws MarshalException { if (isMultiCell()) valueComparator().validateCellValue(cellValue); else super.validateCellValue(cellValue); }
@Override public void validateCellValue(ByteBuffer cellValue) throws MarshalException { if (isMultiCell()) valueComparator().validateCellValue(cellValue); else super.validateCellValue(cellValue); }
@Override public void validateCellValue(ByteBuffer cellValue) throws MarshalException { if (isMultiCell()) valueComparator().validate(cellValue); else super.validateCellValue(cellValue); }
public void validateFields(CFMetaData metadata) throws MarshalException { validateName(metadata); AbstractType<?> valueValidator = metadata.getValueValidator(name()); if (valueValidator != null) valueValidator.validateCellValue(value()); }
/** * Validates the data part of the column (everything in the column object but the name, which is assumed to be valid) */ public static void validateColumnData(CFMetaData metadata, ByteBuffer scName, Column column) throws org.apache.cassandra.exceptions.InvalidRequestException { validateTtl(metadata, column); if (!column.isSetValue()) throw new org.apache.cassandra.exceptions.InvalidRequestException("Column value is required"); if (!column.isSetTimestamp()) throw new org.apache.cassandra.exceptions.InvalidRequestException("Column timestamp is required"); try { LegacyLayout.LegacyCellName cn = LegacyLayout.decodeCellName(metadata, scName, column.name); cn.column.type.validateCellValue(column.value); } catch (UnknownColumnException e) { throw new org.apache.cassandra.exceptions.InvalidRequestException(e.getMessage()); } catch (MarshalException me) { if (logger.isTraceEnabled()) logger.trace("rejecting invalid value {}", ByteBufferUtil.bytesToHex(summarize(column.value))); throw new org.apache.cassandra.exceptions.InvalidRequestException(String.format("(%s) [%s][%s][%s] failed validation", me.getMessage(), metadata.ksName, metadata.cfName, (getThriftColumnNameComparator(metadata, scName)).getString(column.name))); } }
/** * Validates the data part of the column (everything in the column object but the name, which is assumed to be valid) */ public static void validateColumnData(CFMetaData metadata, ByteBuffer scName, Column column) throws org.apache.cassandra.exceptions.InvalidRequestException { validateTtl(metadata, column); if (!column.isSetValue()) throw new org.apache.cassandra.exceptions.InvalidRequestException("Column value is required"); if (!column.isSetTimestamp()) throw new org.apache.cassandra.exceptions.InvalidRequestException("Column timestamp is required"); try { LegacyLayout.LegacyCellName cn = LegacyLayout.decodeCellName(metadata, scName, column.name); cn.column.type.validateCellValue(column.value); } catch (UnknownColumnException e) { throw new org.apache.cassandra.exceptions.InvalidRequestException(e.getMessage()); } catch (MarshalException me) { if (logger.isTraceEnabled()) logger.trace("rejecting invalid value {}", ByteBufferUtil.bytesToHex(summarize(column.value))); throw new org.apache.cassandra.exceptions.InvalidRequestException(String.format("(%s) [%s][%s][%s] failed validation", me.getMessage(), metadata.ksName, metadata.cfName, (getThriftColumnNameComparator(metadata, scName)).getString(column.name))); } }
public void validateCell(Cell cell) { if (cell.isTombstone()) { if (cell.value().hasRemaining()) throw new MarshalException("A tombstone should not have a value"); if (cell.path() != null) validateCellPath(cell.path()); } else if(type.isUDT()) { // To validate a non-frozen UDT field, both the path and the value // are needed, the path being an index into an array of value types. ((UserType)type).validateCell(cell); } else { type.validateCellValue(cell.value()); if (cell.path() != null) validateCellPath(cell.path()); } }
public void validateCell(Cell cell) { if (cell.isTombstone()) { if (cell.value().hasRemaining()) throw new MarshalException("A tombstone should not have a value"); if (cell.path() != null) validateCellPath(cell.path()); } else if(type.isUDT()) { // To validate a non-frozen UDT field, both the path and the value // are needed, the path being an index into an array of value types. ((UserType)type).validateCell(cell); } else { type.validateCellValue(cell.value()); if (cell.path() != null) validateCellPath(cell.path()); } }
public void validateCell(Cell cell) { if (cell.isTombstone()) { if (cell.value().hasRemaining()) throw new MarshalException("A tombstone should not have a value"); if (cell.path() != null) validateCellPath(cell.path()); } else if(type.isUDT()) { // To validate a non-frozen UDT field, both the path and the value // are needed, the path being an index into an array of value types. ((UserType)type).validateCell(cell); } else { type.validateCellValue(cell.value()); if (cell.path() != null) validateCellPath(cell.path()); } }
public void validateCell(Cell cell) { if (cell.isTombstone()) { if (cell.value().hasRemaining()) throw new MarshalException("A tombstone should not have a value"); if (cell.path() != null) validateCellPath(cell.path()); } else if(type.isUDT()) { // To validate a non-frozen UDT field, both the path and the value // are needed, the path being an index into an array of value types. ((UserType)type).validateCell(cell); } else { type.validateCellValue(cell.value()); if (cell.path() != null) validateCellPath(cell.path()); } }