public String getKeyspace() throws InvalidRequestException { if (keyspace == null) throw new InvalidRequestException("No keyspace has been specified. USE a keyspace, or explicitly specify keyspace.tablename"); return keyspace; }
public Aggregate newAggregate() throws InvalidRequestException { throw new InvalidRequestException(String.format("Aggregate '%s' exists but hasn't been loaded successfully for the following reason: %s. " + "Please see the server log for more details", this, reason.getMessage())); } };
public String getKeyspace() throws InvalidRequestException { if (keyspace == null) throw new InvalidRequestException("No keyspace has been specified. USE a keyspace, or explicitly specify keyspace.tablename"); return keyspace; }
public Aggregate newAggregate() throws InvalidRequestException { throw new InvalidRequestException(String.format("Aggregate '%s' exists but hasn't been loaded successfully for the following reason: %s. " + "Please see the server log for more details", this, reason.getMessage())); } };
private void throwNestedNonFrozenError(Raw innerType) { if (innerType instanceof RawCollection) throw new InvalidRequestException("Non-frozen collections are not allowed inside collections: " + this); else throw new InvalidRequestException("Non-frozen UDTs are not allowed inside collections: " + this); }
public Aggregate newAggregate() throws InvalidRequestException { throw new InvalidRequestException(String.format("Aggregate '%s' exists but hasn't been loaded successfully for the following reason: %s. " + "Please see the server log for more details", this, reason.getMessage())); } };
private static void validateKeyspace(String keyspace) throws InvalidRequestException { if (keyspace == null) throw new InvalidRequestException("You have not set a keyspace for this session"); }
private InvalidRequestException broken() { return new InvalidRequestException(String.format("Function '%s' exists but hasn't been loaded successfully " + "for the following reason: %s. Please see the server log for details", this, reason.getMessage())); } };
public void validateForWrite(String keyspaceName) throws InvalidRequestException { switch (this) { case SERIAL: case LOCAL_SERIAL: throw new InvalidRequestException("You must use conditional updates for serializable writes"); } }
private InvalidRequestException broken() { return new InvalidRequestException(String.format("Function '%s' exists but hasn't been loaded successfully " + "for the following reason: %s. Please see the server log for details", this, reason.getMessage())); } };
public void validateForRead(String keyspaceName) throws InvalidRequestException { switch (this) { case ANY: throw new InvalidRequestException("ANY ConsistencyLevel is only supported for writes"); } }
public void validateForWrite(String keyspaceName) throws InvalidRequestException { switch (this) { case SERIAL: case LOCAL_SERIAL: throw new InvalidRequestException("You must use conditional updates for serializable writes"); } }
public void validateForRead(String keyspaceName) throws InvalidRequestException { switch (this) { case ANY: throw new InvalidRequestException("ANY ConsistencyLevel is only supported for writes"); } }
private void validateNotFullIndex(IndexTarget target) throws InvalidRequestException { if (target.type == IndexTarget.Type.FULL) throw new InvalidRequestException("full() indexes can only be created on frozen collections"); }
/** * Returns an <code>InvalidRequestException</code> with the specified message. * * @param messageTemplate the template used to build the error message * @param messageArgs the message arguments * @return an <code>InvalidRequestException</code> with the specified message. */ public static InvalidRequestException invalidRequest(String messageTemplate, Object... messageArgs) { return new InvalidRequestException(String.format(messageTemplate, messageArgs)); }
private void validateTargetColumnIsMapIfIndexInvolvesKeys(boolean isMap, IndexTarget target) throws InvalidRequestException { if (target.type == IndexTarget.Type.KEYS || target.type == IndexTarget.Type.KEYS_AND_VALUES) { if (!isMap) throw new InvalidRequestException(String.format("Cannot create index on %s of column %s with non-map type", target.type, target.column)); } }
private static boolean isSuper(String thriftColumnType) throws org.apache.cassandra.exceptions.InvalidRequestException { switch (thriftColumnType.toLowerCase(Locale.ENGLISH)) { case "standard": return false; case "super": return true; default: throw new org.apache.cassandra.exceptions.InvalidRequestException("Invalid column type " + thriftColumnType); } }
private void validateForFrozenCollection(IndexTarget target) throws InvalidRequestException { if (target.type != IndexTarget.Type.FULL) throw new InvalidRequestException(String.format("Cannot create %s() index on frozen column %s. " + "Frozen collections only support full() indexes", target.type, target.column)); }
public void freeze() throws InvalidRequestException { String message = String.format("frozen<> is only allowed on collections, tuples, and user-defined types (got %s)", this); throw new InvalidRequestException(message); }
public void freeze() throws InvalidRequestException { String message = String.format("frozen<> is only allowed on collections, tuples, and user-defined types (got %s)", this); throw new InvalidRequestException(message); }