| 82 | } |
| 83 | |
| 84 | @Override |
| 85 | public Future<Variable> store(Variable variable) { |
| 86 | if (!MesosNativeLibrary.version().before(MESOS_2161_JIRA_FIX_VERSION)) { |
| 87 | return new StoreFuture(variable); |
| 88 | } |
| 89 | |
| 90 | // TODO(jmlvanre): Deprecate anonymous future in 0.24 (MESOS-2161). |
| 91 | final long future = __store(variable); // Asynchronously start the operation. |
| 92 | return new Future<Variable>() { |
| 93 | @Override |
| 94 | public boolean cancel(boolean mayInterruptIfRunning) { |
| 95 | if (mayInterruptIfRunning) { |
| 96 | return __store_cancel(future); |
| 97 | } |
| 98 | return false; // Should not interrupt and already running (or finished). |
| 99 | } |
| 100 | |
| 101 | @Override |
| 102 | public boolean isCancelled() { |
| 103 | return __store_is_cancelled(future); |
| 104 | } |
| 105 | |
| 106 | @Override |
| 107 | public boolean isDone() { |
| 108 | return __store_is_done(future); |
| 109 | } |
| 110 | |
| 111 | @Override |
| 112 | public Variable get() throws InterruptedException, ExecutionException { |
| 113 | return __store_get(future); |
| 114 | } |
| 115 | |
| 116 | @Override |
| 117 | public Variable get(long timeout, TimeUnit unit) |
| 118 | throws InterruptedException, ExecutionException, TimeoutException { |
| 119 | return __store_get_timeout(future, timeout, unit); |
| 120 | } |
| 121 | |
| 122 | @Override |
| 123 | protected void finalize() { |
| 124 | __store_finalize(future); |
| 125 | } |
| 126 | }; |
| 127 | } |
| 128 | |
| 129 | @Override |
| 130 | public Future<Boolean> expunge(Variable variable) { |