本文整理了Java中org.apache.geode.cache.Region.destroy
方法的一些代码示例,展示了Region.destroy
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Region.destroy
方法的具体详情如下:
包路径:org.apache.geode.cache.Region
类名称:Region
方法名:destroy
[英]Destroys the entry with the specified key. Destroy removes not only the value but also the key and entry from this region. Destroy will be distributed to other caches if the scope is not Scope.LOCAL
.
Does not update any CacheStatistics
.
[中]销毁具有指定密钥的条目。Destroy不仅会删除该区域中的值,还会删除该区域中的键和条目。如果作用域不是[$0$],销毁将被分发到其他缓存。
不更新任何CacheStatistics
。
代码示例来源:origin: apache/geode
@Override
public void run() {
r.destroy(key);
}
}, expiration, TimeUnit.SECONDS);
代码示例来源:origin: apache/geode
@Override
public void run() {
r.destroy(key);
}
}, expiration, TimeUnit.SECONDS);
代码示例来源:origin: apache/geode
public void destroy(Object key, Object aCacheWriterParam)
throws TimeoutException, EntryNotFoundException, CacheWriterException {
this.region.destroy(key, aCacheWriterParam);
}
代码示例来源:origin: apache/geode
public void destroy(Object key)
throws TimeoutException, EntryNotFoundException, CacheWriterException {
this.region.destroy(key);
}
代码示例来源:origin: brianfrankcooper/YCSB
@Override
public Status delete(String table, String key) {
getRegion(table).destroy(key);
return Status.OK;
}
代码示例来源:origin: apache/geode
@Override
public void destroySession(String sessionId) {
try {
getOperatingRegion().destroy(sessionId);
} catch (EntryNotFoundException enex) {
// Ignored
}
}
代码示例来源:origin: apache/geode
@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;
}
}
代码示例来源:origin: apache/geode
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);
}
}
代码示例来源:origin: apache/geode
@Override
public Object destroy(Object key, Object callbackArgument)
throws TimeoutException, EntryNotFoundException, CacheWriterException {
try {
preOp();
return this.realRegion.destroy(key, callbackArgument);
} finally {
postOp();
}
}
代码示例来源:origin: apache/geode
@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.
}
}
代码示例来源:origin: apache/geode
@Override
public Object destroy(Object key)
throws TimeoutException, EntryNotFoundException, CacheWriterException {
try {
preOp();
return this.realRegion.destroy(key);
} finally {
postOp();
}
}
代码示例来源:origin: apache/geode
@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());
}
}
代码示例来源:origin: apache/geode
@Override
public void expire(boolean notify) {
if (notify) {
getOperatingRegion().destroy(this.getId(), this);
} else {
super.expire(false);
}
}
代码示例来源:origin: apache/geode
this.prRoot.destroy(rId);
代码示例来源:origin: apache/geode
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);
}
代码示例来源:origin: apache/geode
/**
* {@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
}
}
}
}
代码示例来源:origin: apache/geode
@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()});
}
}
}
代码示例来源:origin: apache/geode
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;
}
代码示例来源:origin: apache/geode
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);
}
}
代码示例来源:origin: apache/geode
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"));
}
内容来源于网络,如有侵权,请联系作者删除!