/** Perform validation of parsed params */
private void validate(List<ByteBuffer> variables) throws InvalidRequestException
{
// Ensure that exactly one key has been specified.
if (keyValidator.size() < 1)
throw new InvalidRequestException("You must specify a PRIMARY KEY");
else if (keyValidator.size() > 1)
throw new InvalidRequestException("You may only specify one PRIMARY KEY");
AbstractType<?> comparator;
try
{
cfProps.validate();
comparator = cfProps.getComparator();
}
catch (ConfigurationException e)
{
throw new InvalidRequestException(e.toString());
}
catch (SyntaxException e)
{
throw new InvalidRequestException(e.toString());
}
for (Map.Entry<Term, String> column : columns.entrySet())
{
ByteBuffer name = column.getKey().getByteBuffer(comparator, variables);
if (keyAlias != null && keyAlias.equals(name))
throw new InvalidRequestException("Invalid column name: "
+ column.getKey().getText()
+ ", because it equals to the key_alias.");
}
}