public CqlPreparedResult prepare_cql_query(ByteBuffer query, Compression compression) throws TException { throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); }
public CqlResult execute_prepared_cql_query(int itemId, List<ByteBuffer> bindVariables) throws TException { throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); }
public CqlPreparedResult prepare_cql_query(ByteBuffer query, Compression compression) throws TException { throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); }
public CqlResult execute_cql_query(ByteBuffer query, Compression compression) throws TException { throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); }
public CqlResult execute_prepared_cql_query(int itemId, List<ByteBuffer> bindVariables) throws TException { throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); }
public CqlResult execute_cql_query(ByteBuffer query, Compression compression) throws TException { throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead"); }
public InvalidRequestException deepCopy() { return new InvalidRequestException(this); }
public InvalidRequestException deepCopy() { return new InvalidRequestException(this); }
public InvalidRequestException deepCopy() { return new InvalidRequestException(this); }
@Test public void attemptsShouldBeCountedPerHost() { CassandraClientPoolImpl cassandraClientPool = CassandraClientPoolImpl.createImplForTest( MetricsManagers.of(metricRegistry, taggedMetricRegistry), config, CassandraClientPoolImpl.StartupChecks.DO_NOT_RUN, blacklist); host(HOST_1).throwsException(new SocketTimeoutException()) .throwsException(new InvalidRequestException()) .inPool(cassandraClientPool); host(HOST_2).throwsException(new SocketTimeoutException()) .inPool(cassandraClientPool); runNoopWithRetryOnHost(HOST_1, cassandraClientPool); assertThat(blacklist.contains(HOST_2), is(false)); }
public static InvalidRequestException toThrift(RequestValidationException e) { return new InvalidRequestException(e.getMessage()); }
public static InvalidRequestException toThrift(RequestValidationException e) { return new InvalidRequestException(e.getMessage()); }
public static InvalidRequestException toThrift(RequestValidationException e) { return new InvalidRequestException(e.getMessage()); }
private void validateCQLVersion(int major) throws InvalidRequestException { /* * The rules are: * - If no version are set, we don't validate anything. The reason is * that 1) old CQL2 client might not have called set_cql_version * and 2) some client may have removed the set_cql_version for CQL3 * when updating to 1.2.0. A CQL3 client upgrading from pre-1.2 * shouldn't be in that case however since set_cql_version uses to * be mandatory (for CQL3). * - Otherwise, checks the major matches whatever was set. */ SemanticVersion versionSet = state().getCQLVersion(); if (versionSet == null) return; if (versionSet.major != major) throw new InvalidRequestException( "Cannot execute/prepare CQL" + major + " statement since the CQL has been set to CQL" + versionSet.major + "(This might mean your client hasn't been upgraded correctly to use the new CQL3 methods introduced in Cassandra 1.2+)."); }
private void validateLogin() throws InvalidRequestException { try { state().validateLogin(); } catch (UnauthorizedException e) { throw new InvalidRequestException(e.getMessage()); } }
private void validateLogin() throws InvalidRequestException { try { state().validateLogin(); } catch (UnauthorizedException e) { throw new InvalidRequestException(e.getMessage()); } }
public void set_cql_version(String version) throws InvalidRequestException { try { state().setCQLVersion(version); } catch (org.apache.cassandra.exceptions.InvalidRequestException e) { throw new InvalidRequestException(e.getMessage()); } }
private void validateLogin() throws InvalidRequestException { try { state().validateLogin(); } catch (UnauthorizedException e) { throw new InvalidRequestException(e.getMessage()); } }
/** update an existing keyspace, but do not allow column family modifications. * @throws SchemaDisagreementException */ public String system_update_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, TException { logger.debug("update_keyspace"); try { ThriftValidation.validateKeyspaceNotSystem(ks_def.name); state().hasKeyspaceAccess(ks_def.name, Permission.ALTER); ThriftValidation.validateKeyspace(ks_def.name); if (ks_def.getCf_defs() != null && ks_def.getCf_defs().size() > 0) throw new InvalidRequestException("Keyspace update must not contain any column family definitions."); MigrationManager.announceKeyspaceUpdate(KSMetaData.fromThrift(ks_def)); return Schema.instance.getVersion().toString(); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
/** update an existing keyspace, but do not allow column family modifications. * @throws SchemaDisagreementException */ public String system_update_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, TException { logger.trace("update_keyspace"); try { ThriftValidation.validateKeyspaceNotSystem(ks_def.name); state().hasKeyspaceAccess(ks_def.name, Permission.ALTER); ThriftValidation.validateKeyspace(ks_def.name); if (ks_def.getCf_defs() != null && ks_def.getCf_defs().size() > 0) throw new InvalidRequestException("Keyspace update must not contain any table definitions."); MigrationManager.announceKeyspaceUpdate(ThriftConversion.fromThrift(ks_def)); return Schema.instance.getVersion().toString(); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }