@@ -208,8 +208,12 @@ protected byte[] getStorageObject(final CASValue<Object> casValue) throws Resour
208208 @ Override
209209 protected boolean updateCAS (
210210 final String storageKey , final CASValue <Object > casValue , final byte [] storageObject ) throws ResourceIOException {
211- final CASResponse casResult = client .cas (storageKey , casValue .getCas (), storageObject );
212- return casResult == CASResponse .OK ;
211+ try {
212+ final CASResponse casResult = client .cas (storageKey , casValue .getCas (), storageObject );
213+ return casResult == CASResponse .OK ;
214+ } catch (final OperationTimeoutException ex ) {
215+ throw new MemcachedOperationTimeoutException (ex );
216+ }
213217 }
214218
215219 @ Override
@@ -219,12 +223,16 @@ protected void delete(final String storageKey) throws ResourceIOException {
219223
220224 @ Override
221225 protected Map <String , byte []> bulkRestore (final Collection <String > storageKeys ) throws ResourceIOException {
222- final Map <String , ?> storageObjectMap = client .getBulk (storageKeys );
223- final Map <String , byte []> resultMap = new HashMap <>(storageObjectMap .size ());
224- for (final Map .Entry <String , ?> resultEntry : storageObjectMap .entrySet ()) {
225- resultMap .put (resultEntry .getKey (), castAsByteArray (resultEntry .getValue ()));
226+ try {
227+ final Map <String , ?> storageObjectMap = client .getBulk (storageKeys );
228+ final Map <String , byte []> resultMap = new HashMap <>(storageObjectMap .size ());
229+ for (final Map .Entry <String , ?> resultEntry : storageObjectMap .entrySet ()) {
230+ resultMap .put (resultEntry .getKey (), castAsByteArray (resultEntry .getValue ()));
231+ }
232+ return resultMap ;
233+ } catch (final OperationTimeoutException ex ) {
234+ throw new MemcachedOperationTimeoutException (ex );
226235 }
227- return resultMap ;
228236 }
229237
230238}
0 commit comments