Codota Logo
MapReduceTask
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
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 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.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.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 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 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 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

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

@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 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 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

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

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

  • Start an intent from android
  • getExternalFilesDir (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • onCreateOptionsMenu (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • ImageIO (javax.imageio)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now