/** * Prepares insert statement for writing data to SSTable * * @return prepared Insert statement and it's bound names */ private Pair<UpdateStatement, List<ColumnSpecification>> prepareInsert() { ParsedStatement.Prepared cqlStatement = insertStatement.prepare(ClientState.forInternalCalls()); UpdateStatement insert = (UpdateStatement) cqlStatement.statement; insert.validate(ClientState.forInternalCalls()); if (insert.hasConditions()) throw new IllegalArgumentException("Conditional statements are not supported"); if (insert.isCounter()) throw new IllegalArgumentException("Counter update statements are not supported"); if (cqlStatement.boundNames.isEmpty()) throw new IllegalArgumentException("Provided insert statement has no bind variables"); return Pair.create(insert, cqlStatement.boundNames); } }
/** * Prepares insert statement for writing data to SSTable * * @return prepared Insert statement and it's bound names */ private Pair<UpdateStatement, List<ColumnSpecification>> prepareInsert() { ParsedStatement.Prepared cqlStatement = insertStatement.prepare(ClientState.forInternalCalls()); UpdateStatement insert = (UpdateStatement) cqlStatement.statement; insert.validate(ClientState.forInternalCalls()); if (insert.hasConditions()) throw new IllegalArgumentException("Conditional statements are not supported"); if (insert.isCounter()) throw new IllegalArgumentException("Counter update statements are not supported"); if (cqlStatement.boundNames.isEmpty()) throw new IllegalArgumentException("Provided insert statement has no bind variables"); return Pair.create(insert, cqlStatement.boundNames); } }
/** * Prepares insert statement for writing data to SSTable * * @return prepared Insert statement and it's bound names */ private Pair<UpdateStatement, List<ColumnSpecification>> prepareInsert() { ParsedStatement.Prepared cqlStatement = insertStatement.prepare(ClientState.forInternalCalls()); UpdateStatement insert = (UpdateStatement) cqlStatement.statement; insert.validate(ClientState.forInternalCalls()); if (insert.hasConditions()) throw new IllegalArgumentException("Conditional statements are not supported"); if (insert.isCounter()) throw new IllegalArgumentException("Counter update statements are not supported"); if (cqlStatement.boundNames.isEmpty()) throw new IllegalArgumentException("Provided insert statement has no bind variables"); return Pair.create(insert, cqlStatement.boundNames); } }
statements.add(parsed.prepare(boundNames, clientState));
statements.add(parsed.prepare(boundNames, clientState));
statements.add(parsed.prepare(boundNames, clientState));
public ParsedStatement.Prepared prepare() throws InvalidRequestException { VariableSpecifications boundNames = getBoundVariables(); List<ModificationStatement> statements = new ArrayList<>(parsedStatements.size()); for (ModificationStatement.Parsed parsed : parsedStatements) statements.add(parsed.prepare(boundNames)); Attributes prepAttrs = attrs.prepare("[batch]", "[batch]"); prepAttrs.collectMarkerSpecification(boundNames); BatchStatement batchStatement = new BatchStatement(boundNames.size(), type, statements, prepAttrs); batchStatement.validate(); return new ParsedStatement.Prepared(batchStatement, boundNames); } }
public ParsedStatement.Prepared prepare() throws InvalidRequestException { VariableSpecifications boundNames = getBoundVariables(); ModificationStatement statement = prepare(boundNames); return new ParsedStatement.Prepared(statement, boundNames); }
public ParsedStatement.Prepared prepare(ClientState clientState) { VariableSpecifications boundNames = getBoundVariables(); ModificationStatement statement = prepare(boundNames, clientState); return new ParsedStatement.Prepared(statement, boundNames, boundNames.getPartitionKeyBindIndexes(statement.cfm)); }
public ParsedStatement.Prepared prepare(ClientState clientState) { VariableSpecifications boundNames = getBoundVariables(); ModificationStatement statement = prepare(boundNames, clientState); return new ParsedStatement.Prepared(statement, boundNames, boundNames.getPartitionKeyBindIndexes(statement.cfm)); }
public ParsedStatement.Prepared prepare(ClientState clientState) { VariableSpecifications boundNames = getBoundVariables(); ModificationStatement statement = prepare(boundNames, clientState); return new ParsedStatement.Prepared(statement, boundNames, boundNames.getPartitionKeyBindIndexes(statement.cfm)); }