public ResultMessage executeInternal(QueryState state, QueryOptions options) { try { boolean didChangeSchema = announceMigration(true); return didChangeSchema ? new ResultMessage.SchemaChange(changeEvent()) : new ResultMessage.Void(); } catch (RequestValidationException e) { throw new RuntimeException(e); } } }
public ResultMessage execute(QueryState state, QueryOptions options, long queryStartNanoTime) throws RequestValidationException { // If an IF [NOT] EXISTS clause was used, this may not result in an actual schema change. To avoid doing // extra work in the drivers to handle schema changes, we return an empty message in this case. (CASSANDRA-7600) Event.SchemaChange ce = announceMigration(state, false); if (ce == null) return new ResultMessage.Void(); // when a schema alteration results in a new db object being created, we grant permissions on the new // object to the user performing the request if: // * the user is not anonymous // * the configured IAuthorizer supports granting of permissions (not all do, AllowAllAuthorizer doesn't and // custom external implementations may not) AuthenticatedUser user = state.getClientState().getUser(); if (user != null && !user.isAnonymous() && ce.change == Event.SchemaChange.Change.CREATED) { try { grantPermissionsToCreator(state); } catch (UnsupportedOperationException e) { // not a problem, grant is an optional method on IAuthorizer } } return new ResultMessage.SchemaChange(ce); }
public ResultMessage execute(QueryState state, QueryOptions options, long queryStartNanoTime) throws RequestValidationException { // If an IF [NOT] EXISTS clause was used, this may not result in an actual schema change. To avoid doing // extra work in the drivers to handle schema changes, we return an empty message in this case. (CASSANDRA-7600) Event.SchemaChange ce = announceMigration(state, false); if (ce == null) return new ResultMessage.Void(); // when a schema alteration results in a new db object being created, we grant permissions on the new // object to the user performing the request if: // * the user is not anonymous // * the configured IAuthorizer supports granting of permissions (not all do, AllowAllAuthorizer doesn't and // custom external implementations may not) AuthenticatedUser user = state.getClientState().getUser(); if (user != null && !user.isAnonymous() && ce.change == Event.SchemaChange.Change.CREATED) { try { grantPermissionsToCreator(state); } catch (UnsupportedOperationException e) { // not a problem, grant is an optional method on IAuthorizer } } return new ResultMessage.SchemaChange(ce); }
public ResultMessage execute(QueryState state, QueryOptions options, long queryStartNanoTime) throws RequestValidationException { // If an IF [NOT] EXISTS clause was used, this may not result in an actual schema change. To avoid doing // extra work in the drivers to handle schema changes, we return an empty message in this case. (CASSANDRA-7600) Event.SchemaChange ce = announceMigration(state, false); if (ce == null) return new ResultMessage.Void(); // when a schema alteration results in a new db object being created, we grant permissions on the new // object to the user performing the request if: // * the user is not anonymous // * the configured IAuthorizer supports granting of permissions (not all do, AllowAllAuthorizer doesn't and // custom external implementations may not) AuthenticatedUser user = state.getClientState().getUser(); if (user != null && !user.isAnonymous() && ce.change == Event.SchemaChange.Change.CREATED) { try { grantPermissionsToCreator(state); } catch (UnsupportedOperationException e) { // not a problem, grant is an optional method on IAuthorizer } } return new ResultMessage.SchemaChange(ce); }
@Override public ResultMessage execute(QueryState state, QueryOptions options, long queryStartNanoTime) throws RequestValidationException { Event.SchemaChange ce = announceMigration(state, false); return ce == null ? null : new ResultMessage.SchemaChange(ce); }
public ResultMessage execute(QueryState state, QueryOptions options) throws RequestValidationException { // If an IF [NOT] EXISTS clause was used, this may not result in an actual schema change. To avoid doing // extra work in the drivers to handle schema changes, we return an empty message in this case. (CASSANDRA-7600) boolean didChangeSchema = announceMigration(false); return didChangeSchema ? new ResultMessage.SchemaChange(changeEvent()) : new ResultMessage.Void(); }
public ResultMessage executeInternal(QueryState state, QueryOptions options) { Event.SchemaChange ce = announceMigration(state, true); return ce == null ? new ResultMessage.Void() : new ResultMessage.SchemaChange(ce); } }
public ResultMessage executeInternal(QueryState state, QueryOptions options) { Event.SchemaChange ce = announceMigration(state, true); return ce == null ? new ResultMessage.Void() : new ResultMessage.SchemaChange(ce); } }
@Override public ResultMessage execute(QueryState state, QueryOptions options, long queryStartNanoTime) throws RequestValidationException { Event.SchemaChange ce = announceMigration(state, false); return ce == null ? null : new ResultMessage.SchemaChange(ce); }
@Override public ResultMessage execute(QueryState state, QueryOptions options, long queryStartNanoTime) throws RequestValidationException { Event.SchemaChange ce = announceMigration(state, false); return ce == null ? null : new ResultMessage.SchemaChange(ce); }
public ResultMessage executeInternal(QueryState state, QueryOptions options) { Event.SchemaChange ce = announceMigration(state, true); return ce == null ? new ResultMessage.Void() : new ResultMessage.SchemaChange(ce); } }
@Override public ResultMessage execute(QueryState state, QueryOptions options) throws RequestValidationException { announceMigration(false); return indexedCF == null ? null : new ResultMessage.SchemaChange(changeEvent()); }