@Override public void run() { r.destroy(key); } }, expiration, TimeUnit.SECONDS);
@Override public void run() { r.destroy(key); } }, expiration, TimeUnit.SECONDS);
public void destroy(Object key, Object aCacheWriterParam) throws TimeoutException, EntryNotFoundException, CacheWriterException { this.region.destroy(key, aCacheWriterParam); }
public void destroy(Object key) throws TimeoutException, EntryNotFoundException, CacheWriterException { this.region.destroy(key); }
@Override public Status delete(String table, String key) { getRegion(table).destroy(key); return Status.OK; }
@Override public void destroySession(String sessionId) { try { getOperatingRegion().destroy(sessionId); } catch (EntryNotFoundException enex) { // Ignored } }
@Override public V remove(final Object key) { try { V oldValue = region.get(key, callbackArg); region.destroy(key, callbackArg); return oldValue; } catch (EntryNotFoundException e) { return null; } }
private void destroyEntries(String regionName, int size) { Cache cache = getCache(); final Region region = cache.getRegion(regionName); for (int i = 0; i < size; i++) { region.destroy(i); } }
@Override public Object destroy(Object key, Object callbackArgument) throws TimeoutException, EntryNotFoundException, CacheWriterException { try { preOp(); return this.realRegion.destroy(key, callbackArgument); } finally { postOp(); } }
@Override public void beforeDestroy(EntryEvent<String, HttpSession> event) throws CacheWriterException { try { this.backingRegion.destroy(event.getKey(), event.getCallbackArgument()); } catch (EntryNotFoundException e) { // I think it is safe to ignore this exception. The entry could have // expired already in the backing region. } }
@Override public Object destroy(Object key) throws TimeoutException, EntryNotFoundException, CacheWriterException { try { preOp(); return this.realRegion.destroy(key); } finally { postOp(); } }
@Override public void apply(Cache cache) { Region<String, DeltaSessionInterface> region = getRegion(cache); try { region.destroy(this.key); if (cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); builder.append("Applied ").append(this); cache.getLogger().fine(builder.toString()); } } catch (EntryNotFoundException e) { StringBuilder builder = new StringBuilder(); builder.append(this).append(": Session ").append(this.key).append(" was not found"); cache.getLogger().warning(builder.toString()); } }
@Override public void expire(boolean notify) { if (notify) { getOperatingRegion().destroy(this.getId(), this); } else { super.expire(false); } }
this.prRoot.destroy(rId);
private ByteBuffer processAsciiCommand(ByteBuffer buffer, Cache cache) { CharBuffer flb = getFirstLineBuffer(); getAsciiDecoder().reset(); getAsciiDecoder().decode(buffer, flb, false); flb.flip(); String firstLine = getFirstLine(); String[] firstLineElements = firstLine.split(" "); assert "delete".equals(firstLineElements[0]); String key = stripNewline(firstLineElements[1]); boolean noReply = firstLineElements.length > 2; Region<Object, ValueWrapper> r = getMemcachedRegion(cache); String reply = null; try { r.destroy(key); reply = Reply.DELETED.toString(); } catch (EntryNotFoundException e) { reply = Reply.NOT_FOUND.toString(); } return noReply ? null : asciiCharset.encode(reply); }
/** * {@inheritDoc} */ @Override public void destroySession(String id) { if (!isStopping) { try { GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(id); if (session != null && session.getJvmOwnerId().equals(jvmId)) { LOG.debug("Destroying session {}", id); sessionCache.getOperatingRegion().destroy(id); mbean.decActiveSessions(); } } catch (EntryNotFoundException nex) { } } else { if (sessionCache.isClientServer()) { LOG.debug("Destroying session {}", id); try { sessionCache.getOperatingRegion().localDestroy(id); } catch (EntryNotFoundException nex) { // Ignored } catch (CacheClosedException ccex) { // Ignored } } } }
@Override public void process(ClusterDistributionManager dm) { Region r = getRegion(dm.getSystem()); if (r != null) { try { if (action == ExpirationAction.LOCAL_DESTROY) { r.localDestroy(key); } else if (action == ExpirationAction.DESTROY) { r.destroy(key); } else if (action == ExpirationAction.INVALIDATE) { r.invalidate(key); } else if (action == ExpirationAction.LOCAL_INVALIDATE) { r.localInvalidate(key); } } catch (Exception e) { logger.warn("Failed attempt to destroy or invalidate entry {} {} from console at {}", new Object[] {r.getFullPath(), key, this.getSender()}); } } }
private ByteBuffer processBinaryCommand(RequestReader request, Cache cache) { ByteBuffer buffer = request.getRequest(); ByteBuffer response = request.getResponse(); KeyWrapper key = getKey(buffer, HEADER_LENGTH); Region<Object, ValueWrapper> r = getMemcachedRegion(cache); try { r.destroy(key); if (isQuiet()) { return null; } response.putShort(POSITION_RESPONSE_STATUS, ResponseStatus.NO_ERROR.asShort()); } catch (EntryNotFoundException e) { response.putShort(POSITION_RESPONSE_STATUS, ResponseStatus.KEY_NOT_FOUND.asShort()); } catch (Exception e) { response = handleBinaryException(key, request, response, "delete", e); } if (getLogger().fineEnabled()) { getLogger().fine("delete:key:" + key); } return response; }
private void destroyDynamicRegionImpl(String fullRegionName) throws CacheException { // Destroy the entry in the dynamicRegionList try { if (this.cache.getLogger().fineEnabled()) { this.cache.getLogger() .fine("Destroying entry from dynamic region list at key: " + fullRegionName); } this.dynamicRegionList.destroy(fullRegionName); } catch (CacheException e) { this.cache.getLogger().warning( String.format("Error destroying Dynamic Region '%s'", fullRegionName), e); throw e; } if (this.cache.getLogger().fineEnabled()) { this.cache.getLogger().fine("Destroyed Dynamic Region " + fullRegionName); } }
private void testAllOperations() { ClientCache clientCache = (ClientCache) cache; Region<String, String> region = clientCache.<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create("internalRegion"); assertFailure(() -> region.create("Object1", "Value1")); assertFailure(() -> region.put("Object1", "Value1")); assertFailure(() -> region.putIfAbsent("Object1", "Value1")); assertFailure(() -> region.get("Object1")); Map<String, String> map = new HashMap<>(); map.put("Object1", "Value1"); assertFailure(() -> region.putAll(map)); List<String> list = new ArrayList<>(); list.add("Object1"); assertFailure(() -> region.getAll(list)); assertFailure(() -> region.removeAll(list)); assertFailure(() -> region.destroy("Object1")); assertFailure(() -> region.remove("Object1")); assertFailure(() -> region.replace("Object1", "oldValue", "newValue")); assertFailure(() -> region.invalidate("Object1")); assertFailure(region::keySetOnServer); assertFailure(() -> region.registerInterest("Object1")); }