forked from naver/arcus-java-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemcachedClientIF.java
More file actions
193 lines (120 loc) · 6.15 KB
/
MemcachedClientIF.java
File metadata and controls
193 lines (120 loc) · 6.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
package net.spy.memcached;
import java.net.SocketAddress;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import net.spy.memcached.internal.BulkFuture;
import net.spy.memcached.transcoders.Transcoder;
/**
* This interface is provided as a helper for testing clients of the MemcachedClient.
*/
public interface MemcachedClientIF {
Collection<SocketAddress> getAvailableServers();
Collection<SocketAddress> getUnavailableServers();
Transcoder<Object> getTranscoder();
NodeLocator getNodeLocator();
Future<Boolean> append(long cas, String key, Object val);
<T> Future<Boolean> append(long cas, String key, T val,
Transcoder<T> tc);
Future<Boolean> prepend(long cas, String key, Object val);
<T> Future<Boolean> prepend(long cas, String key, T val,
Transcoder<T> tc);
<T> Future<CASResponse> asyncCAS(String key, long casId, T value,
Transcoder<T> tc);
Future<CASResponse> asyncCAS(String key, long casId, Object value);
<T> Future<CASResponse> asyncCAS(String key, long casId, int exp, T value,
Transcoder<T> tc);
Future<CASResponse> asyncCAS(String key, long casId, int exp, Object value);
<T> CASResponse cas(String key, long casId, int exp, T value, Transcoder<T> tc)
throws OperationTimeoutException;
CASResponse cas(String key, long casId, int exp, Object value)
throws OperationTimeoutException;
<T> CASResponse cas(String key, long casId, T value, Transcoder<T> tc)
throws OperationTimeoutException;
CASResponse cas(String key, long casId, Object value)
throws OperationTimeoutException;
<T> Future<Boolean> add(String key, int exp, T o, Transcoder<T> tc);
Future<Boolean> add(String key, int exp, Object o);
<T> Future<Boolean> set(String key, int exp, T o, Transcoder<T> tc);
Future<Boolean> set(String key, int exp, Object o);
<T> Future<Boolean> replace(String key, int exp, T o,
Transcoder<T> tc);
Future<Boolean> replace(String key, int exp, Object o);
<T> Future<T> asyncGet(String key, Transcoder<T> tc);
Future<Object> asyncGet(String key);
<T> Future<CASValue<T>> asyncGets(String key,
Transcoder<T> tc);
Future<CASValue<Object>> asyncGets(String key);
<T> CASValue<T> gets(String key, Transcoder<T> tc)
throws OperationTimeoutException;
CASValue<Object> gets(String key) throws OperationTimeoutException;
<T> T get(String key, Transcoder<T> tc)
throws OperationTimeoutException;
Object get(String key) throws OperationTimeoutException;
<T> BulkFuture<Map<String, T>> asyncGetBulk(Collection<String> keys,
Iterator<Transcoder<T>> tcs);
<T> BulkFuture<Map<String, T>> asyncGetBulk(Collection<String> keys,
Transcoder<T> tc);
BulkFuture<Map<String, Object>> asyncGetBulk(Collection<String> keys);
<T> BulkFuture<Map<String, T>> asyncGetBulk(Transcoder<T> tc,
String... keys);
BulkFuture<Map<String, Object>> asyncGetBulk(String... keys);
<T> BulkFuture<Map<String, CASValue<T>>> asyncGetsBulk(Collection<String> keys,
Iterator<Transcoder<T>> tcs);
<T> BulkFuture<Map<String, CASValue<T>>> asyncGetsBulk(Collection<String> keys,
Transcoder<T> tc);
BulkFuture<Map<String, CASValue<Object>>> asyncGetsBulk(Collection<String> keys);
<T> BulkFuture<Map<String, CASValue<T>>> asyncGetsBulk(Transcoder<T> tc,
String... keys);
BulkFuture<Map<String, CASValue<Object>>> asyncGetsBulk(String... keys);
<T> Map<String, T> getBulk(Collection<String> keys, Transcoder<T> tc)
throws OperationTimeoutException;
Map<String, Object> getBulk(Collection<String> keys)
throws OperationTimeoutException;
<T> Map<String, T> getBulk(Transcoder<T> tc, String... keys)
throws OperationTimeoutException;
Map<String, Object> getBulk(String... keys)
throws OperationTimeoutException;
<T> Map<String, CASValue<T>> getsBulk(Collection<String> keys, Transcoder<T> tc)
throws OperationTimeoutException;
Map<String, CASValue<Object>> getsBulk(Collection<String> keys)
throws OperationTimeoutException;
<T> Map<String, CASValue<T>> getsBulk(Transcoder<T> tc, String... keys)
throws OperationTimeoutException;
Map<String, CASValue<Object>> getsBulk(String... keys)
throws OperationTimeoutException;
Future<Boolean> touch(String key, int exp);
Map<SocketAddress, String> getVersions();
Map<SocketAddress, Map<String, String>> getStats();
Map<SocketAddress, Map<String, String>> getStats(String prefix);
long incr(String key, int by) throws OperationTimeoutException;
long decr(String key, int by) throws OperationTimeoutException;
long incr(String key, int by, long def, int exp)
throws OperationTimeoutException;
long decr(String key, int by, long def, int exp)
throws OperationTimeoutException;
Future<Long> asyncIncr(String key, int by);
Future<Long> asyncIncr(String key, int by, long def, int exp);
Future<Long> asyncDecr(String key, int by);
Future<Long> asyncDecr(String key, int by, long def, int exp);
long incr(String key, int by, long def)
throws OperationTimeoutException;
long decr(String key, int by, long def)
throws OperationTimeoutException;
Future<Boolean> delete(String key);
Future<Boolean> flush(int delay);
Future<Boolean> flush();
void shutdown();
boolean shutdown(long timeout, TimeUnit unit);
boolean addObserver(ConnectionObserver obs);
boolean removeObserver(ConnectionObserver obs);
/**
* Get the set of SASL mechanisms supported by the servers.
*
* @return the union of all SASL mechanisms supported by the servers.
*/
Set<String> listSaslMechanisms();
}