|
23 | 23 | import com.google.common.collect.ImmutableList; |
24 | 24 | import com.google.common.collect.Sets; |
25 | 25 | import com.google.gcloud.BaseService; |
26 | | -import com.google.gcloud.ExceptionHandler; |
27 | | -import com.google.gcloud.ExceptionHandler.Interceptor; |
28 | 26 | import com.google.gcloud.RetryHelper; |
29 | 27 | import com.google.gcloud.RetryHelper.RetryHelperException; |
30 | 28 | import com.google.gcloud.RetryParams; |
|
41 | 39 | import java.util.Set; |
42 | 40 | import java.util.concurrent.Callable; |
43 | 41 |
|
44 | | -final class DatastoreImpl extends BaseService<DatastoreOptions> |
45 | | - implements Datastore { |
46 | | - |
47 | | - private static final Interceptor EXCEPTION_HANDLER_INTERCEPTOR = |
48 | | - new Interceptor() { |
49 | | - |
50 | | - private static final long serialVersionUID = 6911242958397733203L; |
51 | | - |
52 | | - @Override |
53 | | - public RetryResult afterEval(Exception exception, RetryResult retryResult) { |
54 | | - return Interceptor.RetryResult.CONTINUE_EVALUATION; |
55 | | - } |
56 | | - |
57 | | - @Override |
58 | | - public RetryResult beforeEval(Exception exception) { |
59 | | - if (exception instanceof DatastoreException) { |
60 | | - boolean retryable = ((DatastoreException) exception).retryable(); |
61 | | - return retryable ? Interceptor.RetryResult.RETRY : Interceptor.RetryResult.NO_RETRY; |
62 | | - } |
63 | | - return Interceptor.RetryResult.CONTINUE_EVALUATION; |
64 | | - } |
65 | | - }; |
66 | | - private static final ExceptionHandler EXCEPTION_HANDLER = ExceptionHandler.builder() |
67 | | - .abortOn(RuntimeException.class, DatastoreException.class) |
68 | | - .interceptor(EXCEPTION_HANDLER_INTERCEPTOR).build(); |
| 42 | +final class DatastoreImpl extends BaseService<DatastoreOptions> implements Datastore { |
69 | 43 |
|
70 | 44 | private final DatastoreRpc datastoreRpc; |
71 | 45 | private final RetryParams retryParams; |
|
0 commit comments