Neuter the TimeoutException propogation for now.

This commit is contained in:
Greg Burd 2017-10-20 14:30:25 -04:00
parent 9d91436cb5
commit 9bbb6d2371
7 changed files with 38 additions and 39 deletions

View file

@ -41,7 +41,7 @@ public abstract class AbstractOperation<E, O extends AbstractOperation<E, O>> ex
return new PreparedOperation<E>(prepareStatement(), this); return new PreparedOperation<E>(prepareStatement(), this);
} }
public E sync() throws TimeoutException { public E sync() {//throws TimeoutException {
final Timer.Context context = requestLatency.time(); final Timer.Context context = requestLatency.time();
try { try {
ResultSet resultSet = this.execute(sessionOps, null, traceContext, queryExecutionTimeout, queryTimeoutUnits, ResultSet resultSet = this.execute(sessionOps, null, traceContext, queryExecutionTimeout, queryTimeoutUnits,
@ -52,7 +52,7 @@ public abstract class AbstractOperation<E, O extends AbstractOperation<E, O>> ex
} }
} }
public E sync(UnitOfWork uow) throws TimeoutException { public E sync(UnitOfWork uow) {//throws TimeoutException {
if (uow == null) if (uow == null)
return sync(); return sync();
@ -69,11 +69,11 @@ public abstract class AbstractOperation<E, O extends AbstractOperation<E, O>> ex
public CompletableFuture<E> async() { public CompletableFuture<E> async() {
return CompletableFuture.<E>supplyAsync(() -> { return CompletableFuture.<E>supplyAsync(() -> {
try { // try {
return sync(); return sync();
} catch (TimeoutException ex) { // } catch (TimeoutException ex) {
throw new CompletionException(ex); // throw new CompletionException(ex);
} // }
}); });
} }
@ -81,11 +81,11 @@ public abstract class AbstractOperation<E, O extends AbstractOperation<E, O>> ex
if (uow == null) if (uow == null)
return async(); return async();
return CompletableFuture.<E>supplyAsync(() -> { return CompletableFuture.<E>supplyAsync(() -> {
try { // try {
return sync(); return sync();
} catch (TimeoutException ex) { // } catch (TimeoutException ex) {
throw new CompletionException(ex); // throw new CompletionException(ex);
} // }
}); });
} }
} }

View file

@ -64,7 +64,7 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
}); });
} }
public Optional<E> sync() throws TimeoutException { public Optional<E> sync() {//throws TimeoutException {
final Timer.Context context = requestLatency.time(); final Timer.Context context = requestLatency.time();
try { try {
ResultSet resultSet = this.execute(sessionOps, null, traceContext, queryExecutionTimeout, queryTimeoutUnits, ResultSet resultSet = this.execute(sessionOps, null, traceContext, queryExecutionTimeout, queryTimeoutUnits,
@ -75,7 +75,7 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
} }
} }
public Optional<E> sync(UnitOfWork<?> uow) throws TimeoutException { public Optional<E> sync(UnitOfWork<?> uow) {//throws TimeoutException {
if (uow == null) if (uow == null)
return sync(); return sync();
@ -118,11 +118,11 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
public CompletableFuture<Optional<E>> async() { public CompletableFuture<Optional<E>> async() {
return CompletableFuture.<Optional<E>>supplyAsync(() -> { return CompletableFuture.<Optional<E>>supplyAsync(() -> {
try { // try {
return sync(); return sync();
} catch (TimeoutException ex) { // } catch (TimeoutException ex) {
throw new CompletionException(ex); // throw new CompletionException(ex);
} // }
}); });
} }
@ -130,11 +130,11 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
if (uow == null) if (uow == null)
return async(); return async();
return CompletableFuture.<Optional<E>>supplyAsync(() -> { return CompletableFuture.<Optional<E>>supplyAsync(() -> {
try { // try {
return sync(); return sync();
} catch (TimeoutException ex) { // } catch (TimeoutException ex) {
throw new CompletionException(ex); // throw new CompletionException(ex);
} // }
}); });
} }
} }

View file

@ -57,7 +57,7 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
}); });
} }
public Stream<E> sync() throws TimeoutException { public Stream<E> sync() {//throws TimeoutException {
final Timer.Context context = requestLatency.time(); final Timer.Context context = requestLatency.time();
try { try {
ResultSet resultSet = this.execute(sessionOps, null, traceContext, queryExecutionTimeout, queryTimeoutUnits, ResultSet resultSet = this.execute(sessionOps, null, traceContext, queryExecutionTimeout, queryTimeoutUnits,
@ -68,7 +68,7 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
} }
} }
public Stream<E> sync(UnitOfWork<?> uow) throws TimeoutException { public Stream<E> sync(UnitOfWork<?> uow) {//throws TimeoutException {
if (uow == null) if (uow == null)
return sync(); return sync();
@ -105,11 +105,11 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
public CompletableFuture<Stream<E>> async() { public CompletableFuture<Stream<E>> async() {
return CompletableFuture.<Stream<E>>supplyAsync(() -> { return CompletableFuture.<Stream<E>>supplyAsync(() -> {
try { // try {
return sync(); return sync();
} catch (TimeoutException ex) { // } catch (TimeoutException ex) {
throw new CompletionException(ex); // throw new CompletionException(ex);
} // }
}); });
} }
@ -117,11 +117,11 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
if (uow == null) if (uow == null)
return async(); return async();
return CompletableFuture.<Stream<E>>supplyAsync(() -> { return CompletableFuture.<Stream<E>>supplyAsync(() -> {
try { // try {
return sync(); return sync();
} catch (TimeoutException ex) { // } catch (TimeoutException ex) {
throw new CompletionException(ex); // throw new CompletionException(ex);
} // }
}); });
} }
} }

View file

@ -237,7 +237,7 @@ public final class InsertOperation<T> extends AbstractOperation<T, InsertOperati
} }
@Override @Override
public T sync(UnitOfWork uow) throws TimeoutException { public T sync(UnitOfWork uow) {//throws TimeoutException {
if (uow == null) { if (uow == null) {
return sync(); return sync();
} }

View file

@ -49,7 +49,7 @@ public abstract class Operation<E> {
} }
public ResultSet execute(AbstractSessionOperations session, UnitOfWork uow, TraceContext traceContext, long timeout, public ResultSet execute(AbstractSessionOperations session, UnitOfWork uow, TraceContext traceContext, long timeout,
TimeUnit units, boolean showValues, boolean cached) throws TimeoutException { TimeUnit units, boolean showValues, boolean cached) { //throws TimeoutException {
// Start recording in a Zipkin sub-span our execution time to perform this // Start recording in a Zipkin sub-span our execution time to perform this
// operation. // operation.
@ -68,7 +68,7 @@ public abstract class Operation<E> {
Statement statement = options(buildStatement(cached)); Statement statement = options(buildStatement(cached));
ResultSetFuture futureResultSet = session.executeAsync(statement, showValues); ResultSetFuture futureResultSet = session.executeAsync(statement, showValues);
return futureResultSet.getUninterruptibly(timeout, units); return futureResultSet.getUninterruptibly(); //TODO(gburd): (timeout, units);
} finally { } finally {
if (span != null) { if (span != null) {

View file

@ -570,13 +570,12 @@ public final class UpdateOperation<E> extends AbstractFilterOperation<E, UpdateO
} }
@Override @Override
public E sync(UnitOfWork uow) throws TimeoutException { public E sync(UnitOfWork uow) {//throws TimeoutException {
if (uow == null) { if (uow == null) {
return sync(); return sync();
} }
E result = super.sync(uow); E result = super.sync(uow);
// TODO(gburd): Only drafted entity objects are updated in the cache at this // TODO(gburd): Only drafted entity objects are updated in the cache at this time.
// time.
if (draft != null) { if (draft != null) {
updateCache(uow, result, getFacets()); updateCache(uow, result, getFacets());
} }

View file

@ -57,7 +57,7 @@ public class MaterializedViewTest extends AbstractEmbeddedCassandraTest {
.get(); .get();
cyclist = session.dsl(Cyclist.class); cyclist = session.dsl(Cyclist.class);
try { //try {
session session
.insert(cyclist) .insert(cyclist)
.value(cyclist::cid, UUID.randomUUID()) .value(cyclist::cid, UUID.randomUUID())
@ -66,8 +66,8 @@ public class MaterializedViewTest extends AbstractEmbeddedCassandraTest {
.value(cyclist::country, "Netherlands") .value(cyclist::country, "Netherlands")
.value(cyclist::name, "Pascal EENKHOORN") .value(cyclist::name, "Pascal EENKHOORN")
.sync(); .sync();
} catch (TimeoutException e) { //} catch (TimeoutException e) {
} //}
} }
@Test @Test