Пример #1
0
        public void Set(byte[] key, byte[] value)
        {
            BinaryKey binaryKey = new BinaryKey(key);

            BinaryRecord binaryRecord = new BinaryRecord(binaryKey, value);

            int index = KeyHasher.HashKey(binaryKey, BucketArraySize);

            BucketArray.Insert(binaryRecord, index);
        }
Пример #2
0
        public void Set(string key, byte[] value)
        {
            StringKey stringKey = new StringKey(key);

            StringRecord stringRecord = new StringRecord(stringKey, value);

            int index = KeyHasher.HashKey(stringKey, BucketArraySize);

            BucketArray.Insert(stringRecord, index);
        }
Пример #3
0
        public void Get(string key)
        {
            StringKey stringKey = new StringKey(key);

            Record record;

            int index = KeyHasher.HashKey(stringKey, BucketArraySize);

            try
            {
                record       = BucketArray.Select(stringKey, index);
                BinaryResult = record.Value;
            }
            catch (NoValueException e)
            {
                Console.WriteLine(e.Message);
            }
        }