/// <summary>
        ///     Check the shard set action queues for the next request and, if found,
        ///     process the associated action off the queue.
        /// </summary>
        /// <param name="uniqueProcessID">A unique process identifier pass to the table driver to identify the caller.</param>
        public virtual void CheckAndProcessQueue(Guid uniqueProcessID)
        {
            SendQueueProcessingEvent("Queue Processing Started");

            //Get the next queue request in order of execution
            var request = GetNextQueueRequest();

            // identity the request type and call the appropriate method to handle the request
            while (request != null)
            {
                switch (request.GetType().Name)
                {
                case _shardCreationRequest:
                {
                    SendQueueProcessingEvent(_shardCreationRequest, request);
                    ShardSetConfig.HandleShardCreationRequest(request as ShardCreationRequest, this);
                    break;
                }

                case _shardMapPublishingRequest:
                {
                    SendQueueProcessingEvent(_shardMapPublishingRequest, request);
                    ShardSetConfig.HandleShardMapPublishingRequest(request as ShardMapPublishingRequest,
                                                                   this);
                    break;
                }

                case _shardletMoveRequest:
                {
                    SendQueueProcessingEvent(_shardletMoveRequest, request);
                    Shardlet.HandleShardletMoveRequest(request as ShardletMoveRequest, this, uniqueProcessID);
                    break;
                }

                case _shardDeletionRequest:
                {
                    SendQueueProcessingEvent(_shardDeletionRequest, request);
                    ShardSetConfig.HandleShardDeletionRequest(request as ShardDeletionRequest, this);
                    break;
                }

                case _shardMapSyncRequest:
                {
                    SendQueueProcessingEvent(_shardMapSyncRequest, request);
                    ShardSetConfig.HandleShardSyncRequest(request as ShardSyncRequest, this);
                    break;
                }
                }

                request = GetNextQueueRequest();
            }

            SendQueueProcessingEvent("Queue Processing Completed");
        }
Пример #2
0
 /// <summary>
 /// Terminates the connections to the shardlet.
 /// </summary>
 /// <param name="shardlet">The shardlet.</param>
 public abstract void TerminateConnections(Shardlet shardlet);
Пример #3
0
 /// <summary>
 /// De-registers the shardlet connection.
 /// </summary>
 /// <param name="shardlet">The shardlet.</param>
 /// <param name="spid">The spid.</param>
 public abstract void RemoveShardletConnection(Shardlet shardlet, short spid);
Пример #4
0
 /// <summary>
 /// Registers the shardlet connection.
 /// </summary>
 /// <param name="shardlet">The shardlet.</param>
 /// <param name="spid">The spid.</param>
 public abstract void PublishShardletConnection(Shardlet shardlet, short spid);
Пример #5
0
 /// <summary>
 /// Publishes the Shardlet into the pinned Shardlet list.
 /// </summary>
 /// <param name="shardlet">The Shardlet.</param>
 public abstract void PublishShardlet(Shardlet shardlet);
 /// <summary>
 /// Disconnects the specified shardlet.
 /// </summary>
 /// <param name="shardlet">The shardlet.</param>
 /// <param name="spid">The spid.</param>
 public static void Disconnect(Shardlet shardlet, short spid)
 {
     ScaleOutShardletManager.GetManager().Disconnect(shardlet, spid);
 }