コード例 #1
0
 /// <summary>
 /// Creates a new instance of a CapCloudBlob.
 /// </summary>
 /// <param name="strong">A reference to the strongly consistent copy of the blob.</param>
 /// <param name="eventual">A reference to the eventually consistent copy of the blob.</param>
 /// <param name="engine">The SLA enforcement engine.</param>
 public CapCloudBlobOld(string name, ReplicaConfiguration configuration, ConsistencySLAEngine engine)
 {
     this.Name          = name;
     this.slaEngine     = engine;
     this.configuration = configuration;
     this.watch         = new Stopwatch();
     this.protocol      = new ReadWriteFramework(name, configuration, engine);
 }
コード例 #2
0
 public ReadWriteFramework(string blobName, ReplicaConfiguration configuration, ConsistencySLAEngine engine)
 {
     this.blobName      = blobName;
     this.containerName = configuration.Name;
     this.configuration = configuration;
     this.slaEngine     = engine;
     this.blobForRead   = null;
     this.watch         = new Stopwatch();
 }
コード例 #3
0
        /// <summary>
        /// Gets a reference to a blob in this container.
        /// </summary>
        /// <param name="blobName">The name of the blob.</param>
        /// <returns>A reference to the blob.</returns>
        public ICloudBlob GetBlobReference(string blobName, string session = "default")
        {
            if (!Sessions.ContainsKey(session))
            {
                Sessions[session] = new SessionState();
            }

            ConsistencySLAEngine slaEngine = new ConsistencySLAEngine(SLA, Configuration, Sessions[session], Monitor);

            return(new CapCloudBlob(blobName, Configuration, slaEngine));
        }
コード例 #4
0
        /// <summary>
        /// Returns a reference to a <see cref="CapCloudBlobContainer"/> object with the specified name.
        /// </summary>
        /// <param name="containerName">The name of the container, or an absolute URI to the container.</param>
        /// <param name="engine">The SLA engine.</param>
        /// <returns>A reference to a container.</returns>
        public CapCloudBlobContainer GetContainerReference(string containerName, ConsistencySLAEngine slaEngine)
        {
            CapCloudBlobContainer result = null;

            if (!slaEngines.ContainsKey(containerName))
            {
                slaEngines[containerName] = new List <ConsistencySLAEngine>();
            }
            slaEngines[containerName].Add(slaEngine);

            //result = new CapCloudBlobContainer(containerName, slaEngine, this.Name);
            return(result);
        }
コード例 #5
0
        /// <summary>
        /// Returns a reference to a <see cref="CapCloudBlobContainer"/> object with the specified name.
        /// </summary>
        /// <param name="containerName">The name of the container, or an absolute URI to the container.</param>
        /// <returns>A reference to a container.</returns>
        public CapCloudBlobContainer GetContainerReference(string containerName)
        {
            CapCloudBlobContainer result = null;

            if (!slaEngines.ContainsKey(containerName))
            {
                slaEngines[containerName] = new List <ConsistencySLAEngine>();
            }
            // TODO: Create a default SLA and default configuration
            ConsistencySLAEngine slaEngine = new ConsistencySLAEngine(null, null);

            slaEngines[containerName].Add(slaEngine);

            //result = new CapCloudBlobContainer(containerName, slaEngine, this.Name);
            return(result);
        }