コード例 #1
0
        internal unsafe void ParseScalingPolicies(uint count, IntPtr array)
        {
            if (count == 0)
            {
                return;
            }
            var nativeScaling = (NativeTypes.FABRIC_SCALING_POLICY *)array;

            for (int i = 0; i < count; ++i)
            {
                var item = ScalingPolicyDescription.CreateFromNative((IntPtr)(nativeScaling + i));
                this.ScalingPolicies.Add(item);
            }
        }
コード例 #2
0
        private void CopyFrom(ServiceDescription other)
        {
            // Copy basic types
            this.PlacementConstraints         = other.PlacementConstraints;
            this.ServiceTypeName              = other.ServiceTypeName;
            this.ApplicationName              = other.ApplicationName;
            this.ServiceName                  = other.ServiceName;
            this.InitializationData           = other.InitializationData == null ? null : other.InitializationData.ToArray();
            this.isDefaultMoveCostSpecified   = other.IsDefaultMoveCostSpecified;
            this.defaultMoveCost              = other.defaultMoveCost;
            this.ServiceDnsName               = other.ServiceDnsName;
            this.ServicePackageActivationMode = other.ServicePackageActivationMode;

            ServiceLoadMetricDescription.CopyFrom(other.Metrics, this.Metrics);

            this.correlations.AddRange(other.Correlations.Select(c => new ServiceCorrelationDescription(c)));
            this.PartitionSchemeDescription = other.PartitionSchemeDescription.GetCopy();
            this.placementPolicies.AddRange(other.placementPolicies.Select(p => p.GetCopy()));
            this.scalingPolicies.AddRange(other.ScalingPolicies.Select(p => ScalingPolicyDescription.GetCopy(p)));
        }
コード例 #3
0
 internal static ScalingPolicyDescription GetCopy(ScalingPolicyDescription other)
 {
     return(new ScalingPolicyDescription(ScalingMechanismDescription.GetCopy(other.ScalingMechanism), ScalingTriggerDescription.GetCopy(other.ScalingTrigger)));
 }