public long getTimestamp(QueryState state) { long tstamp = getSpecificOptions().timestamp; return tstamp != Long.MIN_VALUE ? tstamp : state.getTimestamp(); }
public long getTimestamp(QueryState state) { long tstamp = getSpecificOptions().timestamp; return tstamp != Long.MIN_VALUE ? tstamp : state.getTimestamp(); }
public long getTimestamp(QueryState state) { long tstamp = getSpecificOptions().timestamp; return tstamp != Long.MIN_VALUE ? tstamp : state.getTimestamp(); }
public long getTimestamp(QueryState state) { long tstamp = getSpecificOptions().timestamp; return tstamp != Long.MIN_VALUE ? tstamp : state.getTimestamp(); }
public long getTimestamp(ThriftClientState clientState) { return timestamp == null ? clientState.getQueryState().getTimestamp() : timestamp; }
public ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException { for (IMutation mutation : getMutations(options, true, queryState.getTimestamp(), queryStartNanoTime)) mutation.apply(); return null; }
public ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException { for (IMutation mutation : getMutations(options, true, queryState.getTimestamp(), queryStartNanoTime)) mutation.apply(); return null; }
public ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException { for (IMutation mutation : getMutations(options, true, queryState.getTimestamp(), queryStartNanoTime)) mutation.apply(); return null; }
private ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException { for (IMutation mutation : getMutations(BatchQueryOptions.withoutPerStatementVariables(options), true, queryState.getTimestamp(), queryStartNanoTime)) mutation.apply(); return null; }
private ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException { for (IMutation mutation : getMutations(BatchQueryOptions.withoutPerStatementVariables(options), true, queryState.getTimestamp(), queryStartNanoTime)) mutation.apply(); return null; }
private ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException { for (IMutation mutation : getMutations(BatchQueryOptions.withoutPerStatementVariables(options), true, queryState.getTimestamp(), queryStartNanoTime)) mutation.apply(); return null; }
public UntypedResultSet process(final ConsistencyLevel cl, final ConsistencyLevel serialConsistencyLevel, ClientState clientState, final String query, Long writetime, final Object... values) throws RequestExecutionException, RequestValidationException, InvalidRequestException { if (logger.isDebugEnabled()) logger.debug("processing CL={} SERIAL_CL={} query={}", cl, serialConsistencyLevel, query); ParsedStatement.Prepared prepared = QueryProcessor.getStatement(query, clientState); List<ByteBuffer> boundValues = new ArrayList<ByteBuffer>(values.length); for (int i = 0; i < values.length; i++) { Object v = values[i]; AbstractType type = prepared.boundNames.get(i).type; boundValues.add(v instanceof ByteBuffer || v == null ? (ByteBuffer) v : type.decompose(v)); } QueryState queryState = new QueryState(clientState); QueryOptions queryOptions = QueryOptions.forInternalCalls(cl, serialConsistencyLevel, boundValues); ResultMessage result = QueryProcessor.instance.process(query, queryState, queryOptions, System.nanoTime()); writetime = queryState.getTimestamp(); if (result instanceof ResultMessage.Rows) return UntypedResultSet.create(((ResultMessage.Rows) result).result); else return null; }
public ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException { for (IMutation mutation : getMutations(options, true, queryState.getTimestamp())) { assert mutation instanceof Mutation || mutation instanceof CounterMutation; if (mutation instanceof Mutation) ((Mutation) mutation).apply(); else if (mutation instanceof CounterMutation) ((CounterMutation) mutation).apply(); } return null; }
private ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException { for (IMutation mutation : getMutations(BatchQueryOptions.withoutPerStatementVariables(options), true, queryState.getTimestamp())) { assert mutation instanceof Mutation || mutation instanceof CounterMutation; if (mutation instanceof Mutation) ((Mutation) mutation).apply(); else if (mutation instanceof CounterMutation) ((CounterMutation) mutation).apply(); } return null; }
private Pair<CQL3CasRequest,Set<ColumnDefinition>> makeCasRequest(BatchQueryOptions options, QueryState state) throws InvalidRequestException long now = state.getTimestamp(); ByteBuffer key = null; CQL3CasRequest casRequest = null;
@Override public Event.SchemaChange announceMigration(QueryState queryState, boolean isLocalOnly) throws RequestValidationException { KeyspaceMetadata ksm = Schema.instance.getKSMetaData(keyspace()); CFMetaData cfm = validateColumnFamily(ksm, columnFamily()); Pair<CFMetaData, List<ViewDefinition>> x = updateTable(ksm, cfm, queryState.getTimestamp()); MigrationManager.announceColumnFamilyUpdate(x.left, x.right, isLocalOnly); return new Event.SchemaChange(Event.SchemaChange.Change.UPDATED, Event.SchemaChange.Target.TABLE, keyspace(), columnFamily()); }
static RowIterator casInternal(CQL3CasRequest request, QueryState state) { UUID ballot = UUIDGen.getTimeUUIDFromMicros(state.getTimestamp()); SinglePartitionReadCommand readCommand = request.readCommand(FBUtilities.nowInSeconds()); FilteredPartition current; try (ReadExecutionController executionController = readCommand.executionController(); PartitionIterator iter = readCommand.executeInternal(executionController)) { current = FilteredPartition.create(PartitionIterators.getOnlyElement(iter, readCommand)); } if (!request.appliesTo(current)) return current.rowIterator(); PartitionUpdate updates = request.makeUpdates(current); updates = TriggerExecutor.instance.execute(updates); Commit proposal = Commit.newProposal(ballot, updates); proposal.makeMutation().apply(); return null; }
static RowIterator casInternal(CQL3CasRequest request, QueryState state) { UUID ballot = UUIDGen.getTimeUUIDFromMicros(state.getTimestamp()); SinglePartitionReadCommand readCommand = request.readCommand(FBUtilities.nowInSeconds()); FilteredPartition current; try (ReadExecutionController executionController = readCommand.executionController(); PartitionIterator iter = readCommand.executeInternal(executionController)) { current = FilteredPartition.create(PartitionIterators.getOnlyElement(iter, readCommand)); } if (!request.appliesTo(current)) return current.rowIterator(); PartitionUpdate updates = request.makeUpdates(current); updates = TriggerExecutor.instance.execute(updates); Commit proposal = Commit.newProposal(ballot, updates); proposal.makeMutation().apply(); return null; }
static RowIterator casInternal(CQL3CasRequest request, QueryState state) { UUID ballot = UUIDGen.getTimeUUIDFromMicros(state.getTimestamp()); SinglePartitionReadCommand readCommand = request.readCommand(FBUtilities.nowInSeconds()); FilteredPartition current; try (ReadExecutionController executionController = readCommand.executionController(); PartitionIterator iter = readCommand.executeInternal(executionController)) { current = FilteredPartition.create(PartitionIterators.getOnlyElement(iter, readCommand)); } if (!request.appliesTo(current)) return current.rowIterator(); PartitionUpdate updates = request.makeUpdates(current); updates = TriggerExecutor.instance.execute(updates); Commit proposal = Commit.newProposal(ballot, updates); proposal.makeMutation().apply(); return null; }
static ColumnFamily casInternal(CQL3CasRequest request, QueryState state) throws InvalidRequestException { UUID ballot = UUIDGen.getTimeUUIDFromMicros(state.getTimestamp()); CFMetaData metadata = Schema.instance.getCFMetaData(request.cfm.ksName, request.cfm.cfName); ReadCommand readCommand = ReadCommand.create(request.cfm.ksName, request.key, request.cfm.cfName, request.now, request.readFilter()); Keyspace keyspace = Keyspace.open(request.cfm.ksName); Row row = readCommand.getRow(keyspace); ColumnFamily current = row.cf; if (current == null) current = ArrayBackedSortedColumns.factory.create(metadata); if (!request.appliesTo(current)) { return current; } ColumnFamily updates = request.makeUpdates(current); updates = TriggerExecutor.instance.execute(request.key, updates); Commit proposal = Commit.newProposal(request.key, ballot, updates); proposal.makeMutation().apply(); return null; }