public PersistentHashTable(string hashtableName, int tableSize, int keySize, int valueSize, int userHeaderSize)
 {
     _simpleCollectionNextIndex = new PersistentNextSpaceArray(hashtableName, keySize + valueSize, userHeaderSize + GetHeaderSize());
     HashTableHeader header = new HashTableHeader(tableSize, keySize, valueSize);
     _simpleCollectionNextIndex.PutUserHeader(header.Serialize());
     _simpleCollectionNextIndex.Put(tableSize-1, new byte[0]);
 }
        public PersistentHashTable(string hashtableName, int tableSize, int keySize, int valueSize, int userHeaderSize)
        {
            _simpleCollectionNextIndex = new PersistentNextSpaceArray(hashtableName, keySize + valueSize, userHeaderSize + GetHeaderSize());
            HashTableHeader header = new HashTableHeader(tableSize, keySize, valueSize);

            _simpleCollectionNextIndex.PutUserHeader(header.Serialize());
            _simpleCollectionNextIndex.Put(tableSize - 1, new byte[0]);
        }
Exemplo n.º 3
0
        private void GetPutUserHeaderTest(byte[] uHeader)
        {
            IPersistentArrayNextSpace target = InitPA("GetPutPAUserHeaderTest", 1, 16);

            try
            {
                target.PutUserHeader(uHeader);
                byte[] actual = target.GetUserHeader();
                TestHelper.AssertByteArraysAreSame(uHeader, actual);
            }
            finally
            {
                target.Close();
            }
        }
 private void PutNextFreeSpaceIndex(int nextFreeSpaceIndex)
 {
     _simpleCollectionNextSpace.PutUserHeader(nextFreeSpaceIndex.ToBytes().Append(GetUserHeader()));
 }
 public void PutUserHeader(byte[] userHeader)
 {
     byte[] headerBytes   = GetHashTableHeader().Serialize();
     byte[] newUserHeader = headerBytes.Append(userHeader);
     _simpleCollectionNextIndex.PutUserHeader(newUserHeader);
 }
Exemplo n.º 6
0
 public void PutUserHeader(byte[] userHeader)
 {
     byte[] userHeaderBytes = _cache.Size.ToBytes().Append(userHeader);
     _simpleCollectionNextSpace.PutUserHeader(userHeaderBytes);
 }