Tabnine Logo
MapReduceTask.reducedWith
Code IndexAdd Tabnine to your IDE (free)

How to use
reducedWith
method
in
org.infinispan.distexec.mapreduce.MapReduceTask

Best Java code snippets using org.infinispan.distexec.mapreduce.MapReduceTask.reducedWith (Showing top 20 results out of 315)

origin: org.keycloak/keycloak-model-sessions-infinispan

@Override
public UserSessionModel getUserSessionByBrokerSessionId(RealmModel realm, String brokerSessionId) {
  Map<String, UserSessionEntity> sessions = new MapReduceTask(sessionCache)
      .mappedWith(UserSessionMapper.create(realm.getId()).brokerSessionId(brokerSessionId))
      .reducedWith(new FirstResultReducer())
      .execute();
  List<UserSessionModel> userSessionModels = wrapUserSessions(realm, sessions.values(), false);
  if (userSessionModels.isEmpty()) return null;
  return userSessionModels.get(0);
}
origin: org.keycloak/keycloak-model-sessions-infinispan

.reducedWith(new LargestResultReducer())
.execute();
origin: org.exoplatform.jcr/exo.jcr.component.core

 public Void run()
 {
   MapReduceTask<CacheKey, Object, Void, Void> task =
    new MapReduceTask<CacheKey, Object, Void, Void>(cache);
   task.mappedWith(new ClearCacheMapper(getOwnerId())).reducedWith(new IdentityReducer());
   task.execute();
   return null;
 }
});
origin: org.exoplatform.kernel/exo.kernel.component.ext.cache.impl.infinispan.v5

@Override
public Void run()
{
 MapReduceTask<CacheKey<K>, V, Void, Void> task = new MapReduceTask<CacheKey<K>, V, Void, Void>(cache);
 task.mappedWith(new ClearCacheMapper<K, V>(fullName)).reducedWith(new ClearCacheReducer());
 task.execute();
 return null;
}
origin: org.exoplatform.kernel/exo.kernel.component.ext.cache.impl.infinispan.v5

@Override
public Map<K, V> run()
{
 MapReduceTask<CacheKey<K>, V, K, V> task = new MapReduceTask<CacheKey<K>, V, K, V>(cache);
 task.mappedWith(new GetEntriesMapper<K, V>(fullName)).reducedWith(new GetEntriesReducer<K, V>());
 return task.execute();
}
origin: org.keycloak/keycloak-model-sessions-infinispan

@Override
public List<ClientInitialAccessModel> listClientInitialAccess(RealmModel realm) {
  Map<String, ClientInitialAccessEntity> entities = new MapReduceTask(sessionCache)
      .mappedWith(ClientInitialAccessMapper.create(realm.getId()))
      .reducedWith(new FirstResultReducer())
      .execute();
  return wrapClientInitialAccess(realm, entities.values());
}
origin: org.exoplatform.jcr/exo.jcr.component.core

public Map<String, Integer> run()
{
  MapReduceTask<CacheKey, Object, String, Integer> task =
   new MapReduceTask<CacheKey, Object, String, Integer>(cache);
  task.mappedWith(new GetSizeMapper(getOwnerId())).reducedWith(new GetSizeReducer<String>());
  return task.execute();
}
origin: org.exoplatform.jcr/exo.jcr.component.core

 public Void run()
 {
   MapReduceTask<CacheKey, Object, Void, Void> task =
    new MapReduceTask<CacheKey, Object, Void, Void>(cache);
   task.mappedWith(new UpdateChildsACLMapper(getOwnerId(), parentPath, acl)).reducedWith(
    new IdentityReducer());
   task.execute();
   return null;
 }
});
origin: org.exoplatform.kernel/exo.kernel.component.ext.cache.impl.infinispan.v5

@Override
public Map<String, Integer> run()
{
 MapReduceTask<CacheKey<K>, V, String, Integer> task =
   new MapReduceTask<CacheKey<K>, V, String, Integer>(cache);
 task.mappedWith(new GetSizeMapper<K, V>(fullName)).reducedWith(new GetSizeReducer<String>());
 return task.execute();
}
origin: org.exoplatform.jcr/exo.jcr.component.core

 public Void run()
 {
   MapReduceTask<CacheKey, Object, Void, Void> task =
    new MapReduceTask<CacheKey, Object, Void, Void>(cache);
   task.mappedWith(new UpdateTreePathMapper(getOwnerId(), prevRootPath, newRootPath)).reducedWith(
    new IdentityReducer());
   task.execute();
   return null;
 }
});
origin: org.exoplatform.kernel/exo.kernel.component.ext.cache.impl.infinispan.v5

@Override
public Map<String, List<V>> run()
{
 MapReduceTask<CacheKey<K>, V, String, List<V>> task =
   new MapReduceTask<CacheKey<K>, V, String, List<V>>(cache);
 task.mappedWith(new GetCachedObjectsMapper<K, V>(fullName)).reducedWith(
   new GetCachedObjectsReducer<String, V>());
 return task.execute();
}
origin: org.keycloak/keycloak-model-sessions-infinispan

@Override
public List<UserSessionModel> getUserSessionByBrokerUserId(RealmModel realm, String brokerUserId) {
  Map<String, UserSessionEntity> sessions = new MapReduceTask(sessionCache)
      .mappedWith(UserSessionMapper.create(realm.getId()).brokerUserId(brokerUserId))
      .reducedWith(new FirstResultReducer())
      .execute();
  return wrapUserSessions(realm, sessions.values(), false);
}
origin: org.keycloak/keycloak-model-sessions-infinispan

@Override
public void removeAllUserLoginFailures(RealmModel realm) {
  Map<LoginFailureKey, Object> sessions = new MapReduceTask(loginFailureCache)
      .mappedWith(UserLoginFailureMapper.create(realm.getId()).emitKey())
      .reducedWith(new FirstResultReducer())
      .execute();
  for (LoginFailureKey id : sessions.keySet()) {
    tx.remove(loginFailureCache, id);
  }
}
origin: org.keycloak/keycloak-model-sessions-infinispan

private void onClientRemoved(RealmModel realm, ClientModel client, boolean offline) {
  Cache<String, SessionEntity> cache = getCache(offline);
  Map<String, ClientSessionEntity> map = new MapReduceTask(cache)
      .mappedWith(ClientSessionMapper.create(realm.getId()).client(client.getId()))
      .reducedWith(new FirstResultReducer())
      .execute();
  for (Map.Entry<String, ClientSessionEntity> entry : map.entrySet()) {
    // detach from userSession
    ClientSessionAdapter adapter = wrap(realm, entry.getValue(), offline);
    adapter.setUserSession(null);
    tx.remove(cache, entry.getKey());
  }
}
origin: org.keycloak/keycloak-model-sessions-infinispan

@Override
public List<ClientSessionModel> getOfflineClientSessions(RealmModel realm, UserModel user) {
  Map<String, UserSessionEntity> sessions = new MapReduceTask(offlineSessionCache)
      .mappedWith(UserSessionMapper.create(realm.getId()).user(user.getId()))
      .reducedWith(new FirstResultReducer())
      .execute();
  List<ClientSessionEntity> clientSessions = new LinkedList<>();
  for (UserSessionEntity userSession : sessions.values()) {
    Set<String> currClientSessions = userSession.getClientSessions();
    for (String clientSessionId : currClientSessions) {
      ClientSessionEntity cls = (ClientSessionEntity) offlineSessionCache.get(clientSessionId);
      if (cls != null) {
        clientSessions.add(cls);
      }
    }
  }
  return wrapClientSessions(realm, clientSessions, true);
}
origin: org.keycloak/keycloak-model-sessions-infinispan

@Override
public List<UserSessionModel> getUserSessions(RealmModel realm, UserModel user) {
  Map<String, UserSessionEntity> sessions = new MapReduceTask(sessionCache)
      .mappedWith(UserSessionMapper.create(realm.getId()).user(user.getId()))
      .reducedWith(new FirstResultReducer())
      .execute();
  return wrapUserSessions(realm, sessions.values(), false);
}
origin: org.keycloak/keycloak-model-sessions-infinispan

protected void removeUserSessions(RealmModel realm, boolean offline) {
  Cache<String, SessionEntity> cache = getCache(offline);
  Map<String, String> ids = new MapReduceTask(cache)
      .mappedWith(SessionMapper.create(realm.getId()).emitKey())
      .reducedWith(new FirstResultReducer())
      .execute();
  for (String id : ids.keySet()) {
    cache.remove(id);
  }
}
origin: org.keycloak/keycloak-model-sessions-infinispan

protected long getUserSessionsCount(RealmModel realm, ClientModel client, boolean offline) {
  Cache<String, SessionEntity> cache = getCache(offline);
  Map map = new MapReduceTask(cache)
      .mappedWith(ClientSessionMapper.create(realm.getId()).client(client.getId()).emitUserSessionAndTimestamp())
      .reducedWith(new LargestResultReducer()).execute();
  return map.size();
}
origin: org.keycloak/keycloak-model-sessions-infinispan

protected void removeUserSessions(RealmModel realm, UserModel user, boolean offline) {
  Cache<String, SessionEntity> cache = getCache(offline);
  Map<String, String> sessions = new MapReduceTask(cache)
      .mappedWith(UserSessionMapper.create(realm.getId()).user(user.getId()).emitKey())
      .reducedWith(new FirstResultReducer())
      .execute();
  for (String id : sessions.keySet()) {
    removeUserSession(realm, id, offline);
  }
}
origin: org.keycloak/keycloak-model-sessions-infinispan

protected void removeUserSession(RealmModel realm, String userSessionId, boolean offline) {
  Cache<String, SessionEntity> cache = getCache(offline);
  tx.remove(cache, userSessionId);
  // TODO: Isn't more effective to retrieve from userSessionEntity directly?
  Map<String, String> map = new MapReduceTask(cache)
      .mappedWith(ClientSessionMapper.create(realm.getId()).userSession(userSessionId).emitKey())
      .reducedWith(new FirstResultReducer())
      .execute();
  for (String id : map.keySet()) {
    tx.remove(cache, id);
  }
}
org.infinispan.distexec.mapreduceMapReduceTaskreducedWith

Popular methods of MapReduceTask

  • execute
  • <init>
  • mappedWith

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now