com.datastax.driver.core.exceptions.UnpreparedException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-cql-shaded Show documentation
Show all versions of driver-cql-shaded Show documentation
A Shaded CQL ActivityType driver for http://nosqlbench.io/
/*
* Copyright DataStax, Inc.
*
* This software can be used solely with DataStax Enterprise. Please consult the license at
* http://www.datastax.com/terms/datastax-dse-driver-license-terms
*/
package com.datastax.driver.core.exceptions;
import com.datastax.driver.core.EndPoint;
import java.net.InetAddress;
import java.net.InetSocketAddress;
/** Indicates that the contacted host replied with an UNPREPARED error code. */
public class UnpreparedException extends QueryValidationException implements CoordinatorException {
private static final long serialVersionUID = 0;
private final EndPoint endPoint;
public UnpreparedException(EndPoint endPoint, String message) {
super(
String.format(
"A prepared query was submitted on %s but was not known of that node: %s",
endPoint, message));
this.endPoint = endPoint;
}
/** Private constructor used solely when copying exceptions. */
private UnpreparedException(EndPoint endPoint, String message, UnpreparedException cause) {
super(message, cause);
this.endPoint = endPoint;
}
@Override
public EndPoint getEndPoint() {
return endPoint;
}
@Override
@Deprecated
public InetSocketAddress getAddress() {
return (endPoint == null) ? null : endPoint.resolve();
}
@Override
@Deprecated
public InetAddress getHost() {
return (endPoint == null) ? null : endPoint.resolve().getAddress();
}
@Override
public UnpreparedException copy() {
return new UnpreparedException(endPoint, getMessage(), this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy