Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the PartitionEvent class.
 /// </summary>
 /// <param name="eventInstanceId">The identifier for the FabricEvent instance.</param>
 /// <param name="timeStamp">The time event was logged.</param>
 /// <param name="kind">The kind of FabricEvent.</param>
 /// <param name="partitionId">An internal ID used by Service Fabric to uniquely identify a partition. This is a
 /// randomly generated GUID when the service was created. The partition ID is unique and does not change for the
 /// lifetime of the service. If the same service was deleted and recreated the IDs of its partitions would be
 /// different.</param>
 /// <param name="hasCorrelatedEvents">Shows there is existing related events available.</param>
 public PartitionEvent(
     Guid?eventInstanceId,
     DateTime?timeStamp,
     FabricEventKind?kind,
     PartitionId partitionId,
     bool?hasCorrelatedEvents = default(bool?))
     : base(
         eventInstanceId,
         timeStamp,
         Common.FabricEventKind.PartitionEvent,
         hasCorrelatedEvents)
 {
     partitionId.ThrowIfNull(nameof(partitionId));
     this.PartitionId = partitionId;
 }
 /// <summary>
 /// Initializes a new instance of the LoadedPartitionInformationResult class.
 /// </summary>
 /// <param name="serviceName">Name of the service this partition belongs to.</param>
 /// <param name="partitionId">Id of the partition.</param>
 /// <param name="metricName">Name of the metric for which this information is provided.</param>
 /// <param name="load">Load for metric.</param>
 public LoadedPartitionInformationResult(
     string serviceName,
     PartitionId partitionId,
     string metricName,
     long?load)
 {
     serviceName.ThrowIfNull(nameof(serviceName));
     partitionId.ThrowIfNull(nameof(partitionId));
     metricName.ThrowIfNull(nameof(metricName));
     load.ThrowIfNull(nameof(load));
     this.ServiceName = serviceName;
     this.PartitionId = partitionId;
     this.MetricName  = metricName;
     this.Load        = load;
 }
 /// <summary>
 /// Initializes a new instance of the ServiceCreatedEvent class.
 /// </summary>
 /// <param name="eventInstanceId">The identifier for the FabricEvent instance.</param>
 /// <param name="timeStamp">The time event was logged.</param>
 /// <param name="serviceId">The identity of the service. This ID is an encoded representation of the service name. This
 /// is used in the REST APIs to identify the service resource.
 /// Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the service name
 /// is "fabric:/myapp/app1/svc1",
 /// the service identity would be "myapp~app1\~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
 /// </param>
 /// <param name="serviceTypeName">Service type name.</param>
 /// <param name="applicationName">Application name.</param>
 /// <param name="applicationTypeName">Application type name.</param>
 /// <param name="serviceInstance">Id of Service instance.</param>
 /// <param name="isStateful">Indicates if Service is stateful.</param>
 /// <param name="partitionCount">Number of partitions.</param>
 /// <param name="targetReplicaSetSize">Size of target replicas set.</param>
 /// <param name="minReplicaSetSize">Minimum size of replicas set.</param>
 /// <param name="servicePackageVersion">Version of Service package.</param>
 /// <param name="partitionId">An internal ID used by Service Fabric to uniquely identify a partition. This is a
 /// randomly generated GUID when the service was created. The partition ID is unique and does not change for the
 /// lifetime of the service. If the same service was deleted and recreated the IDs of its partitions would be
 /// different.</param>
 /// <param name="category">The category of event.</param>
 /// <param name="hasCorrelatedEvents">Shows there is existing related events available.</param>
 public ServiceCreatedEvent(
     Guid?eventInstanceId,
     DateTime?timeStamp,
     string serviceId,
     string serviceTypeName,
     string applicationName,
     string applicationTypeName,
     long?serviceInstance,
     bool?isStateful,
     int?partitionCount,
     int?targetReplicaSetSize,
     int?minReplicaSetSize,
     string servicePackageVersion,
     PartitionId partitionId,
     string category          = default(string),
     bool?hasCorrelatedEvents = default(bool?))
     : base(
         eventInstanceId,
         timeStamp,
         Common.FabricEventKind.ServiceCreated,
         serviceId,
         category,
         hasCorrelatedEvents)
 {
     serviceTypeName.ThrowIfNull(nameof(serviceTypeName));
     applicationName.ThrowIfNull(nameof(applicationName));
     applicationTypeName.ThrowIfNull(nameof(applicationTypeName));
     serviceInstance.ThrowIfNull(nameof(serviceInstance));
     isStateful.ThrowIfNull(nameof(isStateful));
     partitionCount.ThrowIfNull(nameof(partitionCount));
     targetReplicaSetSize.ThrowIfNull(nameof(targetReplicaSetSize));
     minReplicaSetSize.ThrowIfNull(nameof(minReplicaSetSize));
     servicePackageVersion.ThrowIfNull(nameof(servicePackageVersion));
     partitionId.ThrowIfNull(nameof(partitionId));
     this.ServiceTypeName       = serviceTypeName;
     this.ApplicationName       = applicationName;
     this.ApplicationTypeName   = applicationTypeName;
     this.ServiceInstance       = serviceInstance;
     this.IsStateful            = isStateful;
     this.PartitionCount        = partitionCount;
     this.TargetReplicaSetSize  = targetReplicaSetSize;
     this.MinReplicaSetSize     = minReplicaSetSize;
     this.ServicePackageVersion = servicePackageVersion;
     this.PartitionId           = partitionId;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the ReplicaEvent class.
 /// </summary>
 /// <param name="eventInstanceId">The identifier for the FabricEvent instance.</param>
 /// <param name="timeStamp">The time event was logged.</param>
 /// <param name="kind">The kind of FabricEvent.</param>
 /// <param name="partitionId">An internal ID used by Service Fabric to uniquely identify a partition. This is a
 /// randomly generated GUID when the service was created. The partition ID is unique and does not change for the
 /// lifetime of the service. If the same service was deleted and recreated the IDs of its partitions would be
 /// different.</param>
 /// <param name="replicaId">Id of a stateful service replica. ReplicaId is used by Service Fabric to uniquely identify
 /// a replica of a partition. It is unique within a partition and does not change for the lifetime of the replica. If a
 /// replica gets dropped and another replica gets created on the same node for the same partition, it will get a
 /// different value for the id. Sometimes the id of a stateless service instance is also referred as a replica
 /// id.</param>
 /// <param name="category">The category of event.</param>
 /// <param name="hasCorrelatedEvents">Shows there is existing related events available.</param>
 public ReplicaEvent(
     Guid?eventInstanceId,
     DateTime?timeStamp,
     FabricEventKind?kind,
     PartitionId partitionId,
     ReplicaId replicaId,
     string category          = default(string),
     bool?hasCorrelatedEvents = default(bool?))
     : base(
         eventInstanceId,
         timeStamp,
         Common.FabricEventKind.ReplicaEvent,
         category,
         hasCorrelatedEvents)
 {
     partitionId.ThrowIfNull(nameof(partitionId));
     replicaId.ThrowIfNull(nameof(replicaId));
     this.PartitionId = partitionId;
     this.ReplicaId   = replicaId;
 }