if (cfDef.isCompact)
{
if (builder.componentCount() == 0)
throw new InvalidRequestException(String.format("Missing PRIMARY KEY part %s", cfDef.columns.values().iterator().next()));
Operation operation;
if (cfDef.value == null)
{
// No value was defined, we set to the empty value
operation = ColumnOperation.SetToEmpty();
}
else
{
List<Operation> operations = processedColumns.get(cfDef.value);
if (operations.isEmpty())
throw new InvalidRequestException(String.format("Missing mandatory column %s", cfDef.value));
assert operations.size() == 1;
operation = operations.get(0);
}
operation.execute(cf, builder.copy(), cfDef.value == null ? null : cfDef.value.type, params, null);
}
else
{
for (Map.Entry<CFDefinition.Name, Operation> entry : processedColumns.entries())
{
CFDefinition.Name name = entry.getKey();
Operation op = entry.getValue();
op.execute(cf, builder.copy().add(name.name.key), name.type, params, group == null || !op.requiresRead(name.type) ? null : group.getCollection(name.name.key));
}
}
return type == Type.COUNTER ? new CounterMutation(rm, cl) : rm;
}