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);
}
public E sync() throws TimeoutException {
public E sync() {//throws TimeoutException {
final Timer.Context context = requestLatency.time();
try {
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)
return sync();
@ -69,11 +69,11 @@ public abstract class AbstractOperation<E, O extends AbstractOperation<E, O>> ex
public CompletableFuture<E> async() {
return CompletableFuture.<E>supplyAsync(() -> {
try {
// try {
return sync();
} catch (TimeoutException ex) {
throw new CompletionException(ex);
}
// } catch (TimeoutException ex) {
// throw new CompletionException(ex);
// }
});
}
@ -81,11 +81,11 @@ public abstract class AbstractOperation<E, O extends AbstractOperation<E, O>> ex
if (uow == null)
return async();
return CompletableFuture.<E>supplyAsync(() -> {
try {
// try {
return sync();
} catch (TimeoutException ex) {
throw new CompletionException(ex);
}
// } catch (TimeoutException 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();
try {
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)
return sync();
@ -118,11 +118,11 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
public CompletableFuture<Optional<E>> async() {
return CompletableFuture.<Optional<E>>supplyAsync(() -> {
try {
// try {
return sync();
} catch (TimeoutException ex) {
throw new CompletionException(ex);
}
// } catch (TimeoutException ex) {
// throw new CompletionException(ex);
// }
});
}
@ -130,11 +130,11 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
if (uow == null)
return async();
return CompletableFuture.<Optional<E>>supplyAsync(() -> {
try {
// try {
return sync();
} catch (TimeoutException ex) {
throw new CompletionException(ex);
}
// } catch (TimeoutException 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();
try {
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)
return sync();
@ -105,11 +105,11 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
public CompletableFuture<Stream<E>> async() {
return CompletableFuture.<Stream<E>>supplyAsync(() -> {
try {
// try {
return sync();
} catch (TimeoutException ex) {
throw new CompletionException(ex);
}
// } catch (TimeoutException ex) {
// throw new CompletionException(ex);
// }
});
}
@ -117,11 +117,11 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
if (uow == null)
return async();
return CompletableFuture.<Stream<E>>supplyAsync(() -> {
try {
// try {
return sync();
} catch (TimeoutException ex) {
throw new CompletionException(ex);
}
// } catch (TimeoutException ex) {
// throw new CompletionException(ex);
// }
});
}
}

View file

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

View file

@ -49,7 +49,7 @@ public abstract class Operation<E> {
}
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
// operation.
@ -68,7 +68,7 @@ public abstract class Operation<E> {
Statement statement = options(buildStatement(cached));
ResultSetFuture futureResultSet = session.executeAsync(statement, showValues);
return futureResultSet.getUninterruptibly(timeout, units);
return futureResultSet.getUninterruptibly(); //TODO(gburd): (timeout, units);
} finally {
if (span != null) {

View file

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

View file

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