C# 클래스 PartyCluster.ClusterService.ClusterService

Stateful service that manages the lifetime of the party clusters.
상속: StatefulService, IClusterService
파일 보기 프로젝트 열기: Azure-Samples/service-fabric-dotnet-management-party-cluster

공개 메소드들

메소드 설명
ClusterService ( IClusterOperator clusterOperator, ISendMail mailer, IApplicationDeployService applicationDeployService, IReliableStateManager stateManager, StatefulServiceContext serviceContext, PartyCluster.ClusterService.ClusterConfig config ) : System

Creates a new instance of the service class.

GetClusterListAsync ( ) : Task>

Gets a list of all currently active clusters.

JoinClusterAsync ( int clusterId, string userEmail ) : Task

Processes a request to join a cluster.

보호된 메소드들

메소드 설명
CreateServiceReplicaListeners ( ) : IEnumerable
OnOpenAsync ( ReplicaOpenMode openMode, CancellationToken cancellationToken ) : Task
RunAsync ( CancellationToken cancellationToken ) : Task

Main entry point for the service. This runs a continuous loop that manages the party clusters.

비공개 메소드들

메소드 설명
BalanceClustersAsync ( int target, CancellationToken cancellationToken ) : Task

Adds clusters by the given amount without going over the max threshold and without resulting in below the min threshold.

CodePackageActivationContext_ConfigurationPackageModifiedEvent ( object sender, PackageModifiedEventArgs e ) : void

Handler for config package updates.

CreateClusterId ( ) : int

Creates a new cluster ID.

CreateClusterInternalName ( ) : string

Creates a name for a cluster resource.

GetActiveClusters ( Cluster>.IReliableDictionary clusterDictionary, CancellationToken cancellationToken ) : Cluster>>>.Task

Gets a list of active clusters. Clusters that are new, being created, or ready and not expired are considered active.

GetTargetClusterCapacityAsync ( CancellationToken cancellationToken ) : Task

Determines how many clusters there should be based on user activity and min/max thresholds.

When the user count goes below the low percent threshold, decrease capacity by (high - low)% When the user count goes above the high percent threshold, increase capacity by (1 - high)%

LoadConfigPackageAndSubscribe ( ) : void

Loads configuration settings from a config package named "Config" and subscribes to update events.

ProcessClusterStatusAsync ( PartyCluster.ClusterService.Cluster cluster ) : Task

Processes a cluster based on its current state.

ProcessClustersAsync ( CancellationToken cancellationToken ) : Task

Processes each cluster that is currently in the list of clusters managed by this service.

ProcessCreatingClusterAsync ( PartyCluster.ClusterService.Cluster cluster ) : Task

Processes a cluster in the "Creating" stage.

ProcessDeletingClusterAsync ( PartyCluster.ClusterService.Cluster cluster ) : Task

Processes a cluster that is in the "Deleting" stage.

ProcessNewClusterAsync ( PartyCluster.ClusterService.Cluster cluster ) : Task

Processes a new cluster.

ProcessReadyClusterAsync ( PartyCluster.ClusterService.Cluster cluster ) : Task

Processes clusters in the "Ready" stage.

ProcessRemoveClusterAsync ( PartyCluster.ClusterService.Cluster cluster ) : Task

Processes a cluster in the "Remove" stage.

UpdateClusterConfigSettings ( ConfigurationSettings settings ) : void

Updates the service's ClusterConfig instance with new settings from the given ConfigurationSettings.

메소드 상세

ClusterService() 공개 메소드

Creates a new instance of the service class.
public ClusterService ( IClusterOperator clusterOperator, ISendMail mailer, IApplicationDeployService applicationDeployService, IReliableStateManager stateManager, StatefulServiceContext serviceContext, PartyCluster.ClusterService.ClusterConfig config ) : System
clusterOperator IClusterOperator
mailer ISendMail
applicationDeployService IApplicationDeployService
stateManager IReliableStateManager
serviceContext StatefulServiceContext
config PartyCluster.ClusterService.ClusterConfig
리턴 System

CreateServiceReplicaListeners() 보호된 메소드

protected CreateServiceReplicaListeners ( ) : IEnumerable
리턴 IEnumerable

GetClusterListAsync() 공개 메소드

Gets a list of all currently active clusters.
public GetClusterListAsync ( ) : Task>
리턴 Task>

JoinClusterAsync() 공개 메소드

Processes a request to join a cluster.
public JoinClusterAsync ( int clusterId, string userEmail ) : Task
clusterId int
userEmail string
리턴 Task

OnOpenAsync() 보호된 메소드

protected OnOpenAsync ( ReplicaOpenMode openMode, CancellationToken cancellationToken ) : Task
openMode ReplicaOpenMode
cancellationToken System.Threading.CancellationToken
리턴 Task

RunAsync() 보호된 메소드

Main entry point for the service. This runs a continuous loop that manages the party clusters.
protected RunAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
리턴 Task