61 RemoteCacheContext context =
remoteCaches.get(cacheName);
62 if (context == null) {
66 V session = sessionWrapper.getEntity();
68 SessionUpdateTask.CacheOperation operation = task.getOperation(session);
69 SessionUpdateTask.CrossDCMessageStatus status = task.getCrossDCMessageStatus(sessionWrapper);
71 if (status == SessionUpdateTask.CrossDCMessageStatus.NOT_NEEDED) {
72 if (
logger.isTraceEnabled()) {
73 logger.tracef(
"Skip writing to remoteCache for entity '%s' of cache '%s' and operation '%s'", key, cacheName, operation);
78 long loadedMaxIdleTimeMs = context.maxIdleTimeLoader.getMaxIdleTimeMs(realm);
81 final long maxIdleTimeMs = loadedMaxIdleTimeMs + 1800000;
83 if (
logger.isTraceEnabled()) {
84 logger.tracef(
"Running task '%s' on remote cache '%s' . Key is '%s'", operation, cacheName, key);
87 TopologyInfo topology = InfinispanUtil.getTopologyInfo(kcSession);
89 Retry.executeWithBackoff((
int iteration) -> {
92 runOnRemoteCache(topology, context.remoteCache, maxIdleTimeMs, key, task, sessionWrapper);
93 }
catch (HotRodClientException re) {
94 if (
logger.isDebugEnabled()) {
95 logger.debugf(re,
"Failed running task '%s' on remote cache '%s' . Key: '%s', iteration '%s'. Will try to retry the task",
96 operation, cacheName, key, iteration);
static final Logger logger
Definition: RemoteCacheInvoker.java:45
private< K, V extends SessionEntity > void runOnRemoteCache(TopologyInfo topology, RemoteCache< K, SessionEntityWrapper< V >> remoteCache, long maxIdleMs, K key, SessionUpdateTask< V > task, SessionEntityWrapper< V > sessionWrapper)
Definition: RemoteCacheInvoker.java:107
final Map< String, RemoteCacheContext > remoteCaches
Definition: RemoteCacheInvoker.java:47