Ejemplo n.º 1
0
 internal static void WriteHeader(ref SpanWriter writer, Guid?guid)
 {
     if (guid.HasValue)
     {
         writer.WriteByteArrayRaw(MagicStartOfFileWithGuid);
         writer.WriteGuid(guid.Value);
     }
     else
     {
         writer.WriteByteArrayRaw(MagicStartOfFile);
     }
 }
Ejemplo n.º 2
0
        uint ReadRelationVersions(uint relationIndex, string name, Dictionary <uint, RelationVersionInfo> relationVersions)
        {
            uint lastPersistedVersion = 0;
            var  relationInfoResolver = new RelationInfoResolver((ObjectDB)_tr.Owner);

            var writer = new SpanWriter();

            writer.WriteByteArrayRaw(ObjectDB.RelationVersionsPrefix);
            writer.WriteVUInt32(relationIndex);
            var prefix = writer.GetSpan().ToArray();

            if (!_trkv.FindFirstKey(prefix))
            {
                return(lastPersistedVersion);
            }
            do
            {
                var keyReader   = new SpanReader(_trkv.GetKey().Slice(prefix.Length));
                var valueReader = new SpanReader(_trkv.GetValue());
                lastPersistedVersion = keyReader.ReadVUInt32();
                var relationVersionInfo = RelationVersionInfo.LoadUnresolved(ref valueReader, name);
                relationVersionInfo.ResolveFieldHandlers(relationInfoResolver.FieldHandlerFactory);
                relationVersions[lastPersistedVersion] = relationVersionInfo;
            } while (_trkv.FindNextKey(prefix));

            return(lastPersistedVersion);
        }
Ejemplo n.º 3
0
 internal void WriteHeader(ref SpanWriter writer)
 {
     writer.WriteByteArrayRaw(DiskChunkCache.MagicStartOfFile);
     writer.WriteUInt8((byte)DiskChunkFileType.HashIndex);
     writer.WriteVInt64(_generation);
     writer.WriteVUInt32((uint)KeySize);
     writer.WriteVUInt64((ulong)KeyValueCount);
 }
Ejemplo n.º 4
0
 public void WriteHeader(ref SpanWriter writer)
 {
     writer.WriteByteArrayRaw(DiskChunkCache.MagicStartOfFile);
     writer.WriteUInt8((byte)DiskChunkFileType.PureValues);
     writer.WriteVInt64(_generation);
 }