congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
MapReduceTask
Code IndexAdd Tabnine to your IDE (free)

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

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

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.infinispan/infinispan-cdi

public void testinvokeMapReduceOnSubsetOfKeys() throws Exception {
 MapReduceTask<String, String, String, Integer> task = delegate.invokeMapReduce(new String[] {
      "1", "2", "3" }, new WordCountMapper(), new WordCountReducer());
 Map<String, Integer> mapReduce = task.execute();
 Integer count = mapReduce.get("Infinispan");
 assert count == 1;
 count = mapReduce.get("Boston");
 assert count == 1;
}
origin: org.infinispan/infinispan-cdi

public void testinvokeMapReduceWithInputCacheOnSubsetOfKeys() throws Exception {
 MapReduceTask<String, String, String, Integer> task = delegate.invokeMapReduce(new String[] {
      "1", "2", "3" }, new WordCountImpliedInputCacheMapper(), new WordCountReducer());
 Map<String, Integer> mapReduce = task.execute();
 Integer count = mapReduce.get("Infinispan");
 assert count == 1;
 count = mapReduce.get("Boston");
 assert count == 1;
}
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.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 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 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<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.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

@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

@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);
  }
}
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());
  }
}
org.infinispan.distexec.mapreduceMapReduceTask

Most used methods

  • execute
  • <init>
  • mappedWith
  • reducedWith

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Collectors (java.util.stream)
  • JComboBox (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • 21 Best Atom Packages for 2021
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