public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException { state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.MODIFY); // CAS updates can be used to simulate a SELECT query, so should require Permission.SELECT as well. if (hasConditions()) state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.SELECT); }
private ResultSet buildCasResultSet(RowIterator partition, QueryOptions options) throws InvalidRequestException { return buildCasResultSet(keyspace(), columnFamily(), partition, getColumnsWithConditions(), false, options); }
private ResultSet buildCasResultSet(RowIterator partition, QueryOptions options) throws InvalidRequestException { return buildCasResultSet(keyspace(), columnFamily(), partition, getColumnsWithConditions(), false, options); }
private ResultSet buildCasResultSet(RowIterator partition, QueryOptions options) throws InvalidRequestException { return buildCasResultSet(keyspace(), columnFamily(), partition, getColumnsWithConditions(), false, options); }
private ResultSet buildCasResultSet(ByteBuffer key, ColumnFamily cf, QueryOptions options) throws InvalidRequestException { return buildCasResultSet(keyspace(), key, columnFamily(), cf, getColumnsWithConditions(), false, options); }
private Query createQuery(final long startTime, final long execTime, final String queryString, final ModificationStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.UPDATE, statement.keyspace(), statement.columnFamily(), queryString, extractConsistencyLevel(options)); }
private Query createQuery(final long startTime, final long execTime, final String queryString, final ModificationStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.UPDATE, statement.keyspace(), statement.columnFamily(), queryString, extractConsistencyLevel(options)); }
private Query createQuery(final long startTime, final long execTime, final String queryString, final ModificationStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.UPDATE, statement.keyspace(), statement.columnFamily(), queryString, extractConsistencyLevel(options)); }
private Query createQuery(final long startTime, final long execTime, final String queryString, final ModificationStatement statement, final QueryState queryState, final QueryOptions options) { return Query.create(startTime, execTime, queryState.getClientState().getRemoteAddress().toString(), Query.StatementType.UPDATE, statement.keyspace(), statement.columnFamily(), queryString, extractConsistencyLevel(options)); }
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException { state.hasColumnFamilyAccess(cfm, Permission.MODIFY); // CAS updates can be used to simulate a SELECT query, so should require Permission.SELECT as well. if (hasConditions()) state.hasColumnFamilyAccess(cfm, Permission.SELECT); // MV updates need to get the current state from the table, and might update the views // Require Permission.SELECT on the base table, and Permission.MODIFY on the views Iterator<ViewDefinition> views = View.findAll(keyspace(), columnFamily()).iterator(); if (views.hasNext()) { state.hasColumnFamilyAccess(cfm, Permission.SELECT); do { state.hasColumnFamilyAccess(views.next().metadata, Permission.MODIFY); } while (views.hasNext()); } for (Function function : getFunctions()) state.ensureHasPermission(Permission.EXECUTE, function); }
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException { state.hasColumnFamilyAccess(cfm, Permission.MODIFY); // CAS updates can be used to simulate a SELECT query, so should require Permission.SELECT as well. if (hasConditions()) state.hasColumnFamilyAccess(cfm, Permission.SELECT); // MV updates need to get the current state from the table, and might update the views // Require Permission.SELECT on the base table, and Permission.MODIFY on the views Iterator<ViewDefinition> views = View.findAll(keyspace(), columnFamily()).iterator(); if (views.hasNext()) { state.hasColumnFamilyAccess(cfm, Permission.SELECT); do { state.hasColumnFamilyAccess(views.next().metadata, Permission.MODIFY); } while (views.hasNext()); } for (Function function : getFunctions()) state.ensureHasPermission(Permission.EXECUTE, function); }
statementKsName = modificationStatement.keyspace(); statementCfName = modificationStatement.columnFamily();
statementKsName = modificationStatement.keyspace(); statementCfName = modificationStatement.columnFamily();
statementKsName = modificationStatement.keyspace(); statementCfName = modificationStatement.columnFamily();
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException { state.hasColumnFamilyAccess(cfm, Permission.MODIFY); // CAS updates can be used to simulate a SELECT query, so should require Permission.SELECT as well. if (hasConditions()) state.hasColumnFamilyAccess(cfm, Permission.SELECT); // MV updates need to get the current state from the table, and might update the views // Require Permission.SELECT on the base table, and Permission.MODIFY on the views Iterator<ViewDefinition> views = View.findAll(keyspace(), columnFamily()).iterator(); if (views.hasNext()) { state.hasColumnFamilyAccess(cfm, Permission.SELECT); do { state.hasColumnFamilyAccess(views.next().metadata, Permission.MODIFY); } while (views.hasNext()); } for (Function function : getFunctions()) state.ensureHasPermission(Permission.EXECUTE, function); }
public ResultMessage executeWithCondition(QueryState queryState, QueryOptions options) throws RequestExecutionException, RequestValidationException { CQL3CasRequest request = makeCasRequest(queryState, options); ColumnFamily result = StorageProxy.cas(keyspace(), columnFamily(), request.key, request, options.getSerialConsistency(), options.getConsistency(), queryState.getClientState()); return new ResultMessage.Rows(buildCasResultSet(request.key, result, options)); }
public ResultMessage executeWithCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException { CQL3CasRequest request = makeCasRequest(queryState, options); try (RowIterator result = StorageProxy.cas(keyspace(), columnFamily(), request.key, request, options.getSerialConsistency(), options.getConsistency(), queryState.getClientState(), queryStartNanoTime)) { return new ResultMessage.Rows(buildCasResultSet(result, options)); } }
public ResultMessage executeWithCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException { CQL3CasRequest request = makeCasRequest(queryState, options); try (RowIterator result = StorageProxy.cas(keyspace(), columnFamily(), request.key, request, options.getSerialConsistency(), options.getConsistency(), queryState.getClientState(), queryStartNanoTime)) { return new ResultMessage.Rows(buildCasResultSet(result, options)); } }
public ResultMessage executeWithCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException { CQL3CasRequest request = makeCasRequest(queryState, options); try (RowIterator result = StorageProxy.cas(keyspace(), columnFamily(), request.key, request, options.getSerialConsistency(), options.getConsistency(), queryState.getClientState(), queryStartNanoTime)) { return new ResultMessage.Rows(buildCasResultSet(result, options)); } }