Esempio n. 1
0
        // Token: 0x06000B94 RID: 2964 RVA: 0x000337D0 File Offset: 0x000319D0
        public byte[] ReadNextPage(long expectedPageNum, out long lowGen, out long highGen)
        {
            if (expectedPageNum < 1L)
            {
                throw new ArgumentOutOfRangeException(string.Format(CultureInfo.CurrentCulture, "pageNumber is {0}, must be >= 1 ", new object[]
                {
                    expectedPageNum
                }));
            }
            lowGen  = (long)((ulong)-1);
            highGen = 0L;
            NetworkChannelMessage         message = this.m_channel.GetMessage();
            SeedPageReaderSinglePageReply seedPageReaderSinglePageReply = message as SeedPageReaderSinglePageReply;

            if (seedPageReaderSinglePageReply == null)
            {
                this.m_channel.ThrowUnexpectedMessage(message);
            }
            if (seedPageReaderSinglePageReply.PageNumber != expectedPageNum)
            {
                this.m_channel.ThrowUnexpectedMessage(message);
            }
            lowGen  = seedPageReaderSinglePageReply.LowGeneration;
            highGen = seedPageReaderSinglePageReply.HighGeneration;
            return(seedPageReaderSinglePageReply.PageBytes);
        }
Esempio n. 2
0
 // Token: 0x06000B91 RID: 2961 RVA: 0x0003348C File Offset: 0x0003168C
 public byte[] ReadOnePage(long pageNumber, out long lowGen, out long highGen)
 {
     byte[] result = null;
     if (pageNumber < 1L)
     {
         throw new ArgumentOutOfRangeException(string.Format(CultureInfo.CurrentCulture, "pageNumber is {0}, must be >= 1 ", new object[]
         {
             pageNumber
         }));
     }
     lowGen  = (long)((ulong)-1);
     highGen = 0L;
     try
     {
         this.GetChannel();
         SeedPageReaderSinglePageRequest seedPageReaderSinglePageRequest = new SeedPageReaderSinglePageRequest(this.m_channel, this.m_databaseGuid, this.m_databaseName, this.m_databasePath, (uint)pageNumber);
         seedPageReaderSinglePageRequest.Send();
         NetworkChannelMessage         message = this.m_channel.GetMessage();
         SeedPageReaderSinglePageReply seedPageReaderSinglePageReply = message as SeedPageReaderSinglePageReply;
         if (seedPageReaderSinglePageReply == null)
         {
             this.m_channel.ThrowUnexpectedMessage(message);
         }
         this.m_pageSize = (long)seedPageReaderSinglePageReply.PageBytes.Length;
         lowGen          = seedPageReaderSinglePageReply.LowGeneration;
         highGen         = seedPageReaderSinglePageReply.HighGeneration;
         result          = seedPageReaderSinglePageReply.PageBytes;
     }
     catch (NetworkRemoteException ex)
     {
         ReplayEventLogConstants.Tuple_ReadOnePageError.LogEvent(string.Empty, new object[]
         {
             pageNumber,
             this.m_databaseName,
             this.m_serverName,
             ex
         });
         throw;
     }
     catch (NetworkTransportException ex2)
     {
         ReplayEventLogConstants.Tuple_ReadOnePageError.LogEvent(string.Empty, new object[]
         {
             pageNumber,
             this.m_databaseName,
             this.m_serverName,
             ex2
         });
         throw;
     }
     return(result);
 }
Esempio n. 3
0
        public override void Execute()
        {
            ExTraceGlobals.IncrementalReseederTracer.TraceDebug <Guid, uint>((long)this.GetHashCode(), "SeedPageReaderSinglePageRequest: databaseGuid ({0}), pageno ({1}).", base.DatabaseGuid, this.m_pageno);
            bool            flag            = false;
            ReplayStopwatch replayStopwatch = new ReplayStopwatch();

            try
            {
                SeederPageReaderServerContext seederPageReaderServerContext = base.Channel.GetSeederPageReaderServerContext(this.m_databaseName, this.m_databasePath);
                replayStopwatch.Start();
                ExTraceGlobals.IncrementalReseederTracer.TraceDebug <uint, Guid>((long)this.GetHashCode(), "SeedPageReaderSinglePageRequest. Reading page {0} from {1}.", this.m_pageno, base.DatabaseGuid);
                long   lowGeneration;
                long   highGeneration;
                byte[] pageBytes = seederPageReaderServerContext.DatabaseReader.ReadOnePage((long)((ulong)this.m_pageno), out lowGeneration, out highGeneration);
                SeedPageReaderSinglePageReply seedPageReaderSinglePageReply = new SeedPageReaderSinglePageReply(base.Channel);
                seedPageReaderSinglePageReply.PageNumber     = (long)((ulong)this.m_pageno);
                seedPageReaderSinglePageReply.LowGeneration  = lowGeneration;
                seedPageReaderSinglePageReply.HighGeneration = highGeneration;
                seedPageReaderSinglePageReply.PageBytes      = pageBytes;
                ExTraceGlobals.IncrementalReseederTracer.TraceDebug <Guid>((long)this.GetHashCode(), "SeedPageReaderSinglePageRequest. Sending the data for {0}.", base.DatabaseGuid);
                seedPageReaderSinglePageReply.Send();
                flag = true;
            }
            catch (TransientException ex)
            {
                base.Channel.SendException(ex);
            }
            catch (IOException ex2)
            {
                base.Channel.SendException(ex2);
            }
            finally
            {
                ExTraceGlobals.IncrementalReseederTracer.TraceDebug <uint, long, string>((long)this.GetHashCode(), "SeedPageReader finished reading and sending page {0} after {1} sec. Operation successful: {2}", this.m_pageno, replayStopwatch.ElapsedMilliseconds / 1000L, flag.ToString());
            }
        }