예제 #1
0
        public int Hash(string input)
        {
            if (_isDisposed)
            {
                throw new ObjectDisposedException("HashServiceImpl disposed");
            }

            return(MurmurHash.StringHash(input));
        }
예제 #2
0
 public static int HashFor(Address node)
 {
     // cluster node identifier is the host and port of the address; protocol and system is assumed to be the same
     if (!string.IsNullOrEmpty(node.Host) && node.Port.HasValue)
     {
         return(MurmurHash.StringHash(node.Host + ":" + node.Port.Value.ToString()));
     }
     else
     {
         throw new IllegalStateException("Unexpected address without host/port: " + node);
     }
 }
예제 #3
0
 public ReplicatorActor(string replicaId, ReplicatorSettings settings)
     : this(MurmurHash.StringHash(replicaId), settings)
 {
 }
예제 #4
0
        private ORSetKey <EntryId> Key(EntryId entityId)
        {
            var i = Math.Abs(MurmurHash.StringHash(entityId)) % NrOfKeys;

            return(_stateKeys[i]);
        }
예제 #5
0
 public int GetPersistenceHash(string aggregateId)
 {
     return(MurmurHash.StringHash(aggregateId));
 }
 public int Murmur_string_hash()
 {
     return(MurmurHash.StringHash(testString));
 }
예제 #7
0
 public override int GetHashCode() => MurmurHash.StringHash(StreamId) ^ MurmurHash.StringHash(ReplicaId);