Exemple #1
0
        /// <summary>
        /// Perform standard read and update server and session state.
        /// </summary>
        /// <param name="op">The read operation</param>
        /// <param name="blob">The blob being read</param>
        /// <param name="ss">The chosen server</param>
        private void FastRead(ReadOp op)
        {
            ServerState ss = slaEngine.FindServerToRead(blobName);

            blobForRead = ClientRegistry.GetCloudBlob(ss.Name, containerName, blobName);

            watch.Start();
            op(blobForRead);
            watch.Stop();

            slaEngine.RecordObjectRead(blobForRead.Name, Timestamp(blobForRead), ss, watch.ElapsedMilliseconds);
        }
        public void FetchAttributes(Microsoft.WindowsAzure.Storage.AccessCondition accessCondition = null, Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions options = null, Microsoft.WindowsAzure.Storage.OperationContext operationContext = null)
        {
            // TODO: use protocol
            ServerState ss   = slaEngine.FindServerToRead(Name);
            ICloudBlob  blob = ClientRegistry.GetCloudBlob(ss.Name, configuration.Name, Name);

            watch.Start();
            blob.FetchAttributes(accessCondition, options, operationContext);
            ss.AddRtt(watch.ElapsedMilliseconds);
            // slaEngine.SessionState.RecordObjectRead(blob.Name, Timestamp(blob), ss);
            slaEngine.Session.RecordObjectRead(blob.Name, Timestamp(blob), ss, "");
        }