kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 8597902e03c229638fe372668a208055cb265d1aea960f66eef918c5a6dabe70 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2016-06-20 17:03 -07:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-07-18 13:35 -07:00 |
| Parents | 4c7d7faed12e |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/policies/RetryPolicy.java +6 −2
| @@ -41,6 +41,10 @@ | ||
| 41 | 41 | * </ul> |
| 42 | 42 | */ |
| 43 | 43 | class RetryDecision { |
| 44 | + | |
| 45 | + private static final RetryDecision RETHROW_DECISION = new RetryDecision(Type.RETHROW, null, true); | |
| 46 | + private static final RetryDecision IGNORE_DECISION = new RetryDecision(Type.IGNORE, null, true); | |
| 47 | + | |
| 44 | 48 | /** |
| 45 | 49 | * The types of retry decisions. |
| 46 | 50 | */ |
| @@ -99,7 +103,7 @@ | ||
| 99 | 103 | * @return a {@link RetryDecision.Type#RETHROW} retry decision. |
| 100 | 104 | */ |
| 101 | 105 | public static RetryDecision rethrow() { |
| 102 | - return new RetryDecision(Type.RETHROW, null, true); | |
| 106 | + return RETHROW_DECISION; | |
| 103 | 107 | } |
| 104 | 108 | |
| 105 | 109 | /** |
| @@ -128,7 +132,7 @@ | ||
| 128 | 132 | * @return an {@link RetryDecision.Type#IGNORE} retry decision. |
| 129 | 133 | */ |
| 130 | 134 | public static RetryDecision ignore() { |
| 131 | - return new RetryDecision(Type.IGNORE, null, true); | |
| 135 | + return IGNORE_DECISION; | |
| 132 | 136 | } |
| 133 | 137 | |
| 134 | 138 | /** |