All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.affinity.impl.RndKeyGenerator Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.affinity.impl;

import java.util.Random;

import org.infinispan.affinity.KeyGenerator;

/**
 * Key provider that relies on {@link java.util.Random}'s distribution to generate keys.
 * It doesn't offer any guarantee that the keys are unique.
 *
 * @author [email protected]
 * @since 4.1
 */
public class RndKeyGenerator implements KeyGenerator {

   public static final Random rnd = new Random();

   @Override
   public Object getKey() {
      return rnd.nextLong();
   }
}