congrats Icon
New! Announcing our next generation AI code completions
Read here
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

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Collectors (java.util.stream)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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