Skip to content

Commit

Permalink
Regenerate LoadMetricInformation with double properties (#141)
Browse files Browse the repository at this point in the history
The following properties changed type because they 
were previously incorrectly defined in the swagger spec:

`balancingThreshold`: `int` -> `double`
`activityThreshold`: `int` -> `string`
`currentClusterLoad`: `int` -> `double`
`clusterCapacityRemaining`: `int` -> `double`
`nodeBufferPercentage`: `int` -> `double`
`bufferedClusterCapacityRemaining`: `int` -> `double`
`clusterRemainingBufferedCapacity`: `int` -> `string`
`minimumNodeLoad`: `int` -> `double`
`maximumNodeLoad`: `int` -> `double`
`plannedLoadRemoval`: `int` -> `double`

Property type change is in principle a breaking change. However,
previous version increment from `4.12.0` to `5.0.0` did not fix all
problems so it was not usable. In that sense, this is considered
a bugfix rather than a new major version (`6.0.0`).
  • Loading branch information
gobradovic authored Nov 9, 2024
1 parent b928541 commit 85416aa
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion properties/service_fabric_common.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<!-- TODO: Versions numbers are changed here manually for now, Integrate this with GitVersion. -->
<MajorVersion>5</MajorVersion>
<MinorVersion>0</MinorVersion>
<BuildVersion>0</BuildVersion>
<BuildVersion>1</BuildVersion>
<Revision>0</Revision>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader)
var isBalancedAfter = default(bool?);
var deviationBefore = default(double?);
var deviationAfter = default(double?);
var balancingThreshold = default(int?);
var balancingThreshold = default(double?);
var action = default(string);
var activityThreshold = default(int?);
var activityThreshold = default(string);
var clusterCapacity = default(string);
var clusterLoad = default(string);
var currentClusterLoad = default(int?);
var currentClusterLoad = default(double?);
var clusterRemainingCapacity = default(string);
var clusterCapacityRemaining = default(int?);
var clusterCapacityRemaining = default(double?);
var isClusterCapacityViolation = default(bool?);
var nodeBufferPercentage = default(int?);
var nodeBufferPercentage = default(double?);
var clusterBufferedCapacity = default(string);
var bufferedClusterCapacityRemaining = default(int?);
var clusterRemainingBufferedCapacity = default(int?);
var bufferedClusterCapacityRemaining = default(double?);
var clusterRemainingBufferedCapacity = default(string);
var minNodeLoadValue = default(string);
var minimumNodeLoad = default(int?);
var minimumNodeLoad = default(double?);
var minNodeLoadNodeId = default(NodeId);
var maxNodeLoadValue = default(string);
var maximumNodeLoad = default(int?);
var maximumNodeLoad = default(double?);
var maxNodeLoadNodeId = default(NodeId);
var plannedLoadRemoval = default(int?);
var plannedLoadRemoval = default(double?);

do
{
Expand All @@ -84,15 +84,15 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader)
}
else if (string.Compare("BalancingThreshold", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
balancingThreshold = reader.ReadValueAsInt();
balancingThreshold = reader.ReadValueAsDouble();
}
else if (string.Compare("Action", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
action = reader.ReadValueAsString();
}
else if (string.Compare("ActivityThreshold", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
activityThreshold = reader.ReadValueAsInt();
activityThreshold = reader.ReadValueAsString();
}
else if (string.Compare("ClusterCapacity", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
Expand All @@ -104,43 +104,43 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader)
}
else if (string.Compare("CurrentClusterLoad", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
currentClusterLoad = reader.ReadValueAsInt();
currentClusterLoad = reader.ReadValueAsDouble();
}
else if (string.Compare("ClusterRemainingCapacity", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
clusterRemainingCapacity = reader.ReadValueAsString();
}
else if (string.Compare("ClusterCapacityRemaining", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
clusterCapacityRemaining = reader.ReadValueAsInt();
clusterCapacityRemaining = reader.ReadValueAsDouble();
}
else if (string.Compare("IsClusterCapacityViolation", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
isClusterCapacityViolation = reader.ReadValueAsBool();
}
else if (string.Compare("NodeBufferPercentage", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
nodeBufferPercentage = reader.ReadValueAsInt();
nodeBufferPercentage = reader.ReadValueAsDouble();
}
else if (string.Compare("ClusterBufferedCapacity", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
clusterBufferedCapacity = reader.ReadValueAsString();
}
else if (string.Compare("BufferedClusterCapacityRemaining", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
bufferedClusterCapacityRemaining = reader.ReadValueAsInt();
bufferedClusterCapacityRemaining = reader.ReadValueAsDouble();
}
else if (string.Compare("ClusterRemainingBufferedCapacity", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
clusterRemainingBufferedCapacity = reader.ReadValueAsInt();
clusterRemainingBufferedCapacity = reader.ReadValueAsString();
}
else if (string.Compare("MinNodeLoadValue", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
minNodeLoadValue = reader.ReadValueAsString();
}
else if (string.Compare("MinimumNodeLoad", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
minimumNodeLoad = reader.ReadValueAsInt();
minimumNodeLoad = reader.ReadValueAsDouble();
}
else if (string.Compare("MinNodeLoadNodeId", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
Expand All @@ -152,15 +152,15 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader)
}
else if (string.Compare("MaximumNodeLoad", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
maximumNodeLoad = reader.ReadValueAsInt();
maximumNodeLoad = reader.ReadValueAsDouble();
}
else if (string.Compare("MaxNodeLoadNodeId", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
maxNodeLoadNodeId = NodeIdConverter.Deserialize(reader);
}
else if (string.Compare("PlannedLoadRemoval", propName, StringComparison.OrdinalIgnoreCase) == 0)
{
plannedLoadRemoval = reader.ReadValueAsInt();
plannedLoadRemoval = reader.ReadValueAsDouble();
}
else
{
Expand Down Expand Up @@ -233,7 +233,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.BalancingThreshold != null)
{
writer.WriteProperty(obj.BalancingThreshold, "BalancingThreshold", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.BalancingThreshold, "BalancingThreshold", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.Action != null)
Expand All @@ -243,7 +243,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.ActivityThreshold != null)
{
writer.WriteProperty(obj.ActivityThreshold, "ActivityThreshold", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.ActivityThreshold, "ActivityThreshold", JsonWriterExtensions.WriteStringValue);
}

if (obj.ClusterCapacity != null)
Expand All @@ -258,7 +258,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.CurrentClusterLoad != null)
{
writer.WriteProperty(obj.CurrentClusterLoad, "CurrentClusterLoad", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.CurrentClusterLoad, "CurrentClusterLoad", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.ClusterRemainingCapacity != null)
Expand All @@ -268,7 +268,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.ClusterCapacityRemaining != null)
{
writer.WriteProperty(obj.ClusterCapacityRemaining, "ClusterCapacityRemaining", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.ClusterCapacityRemaining, "ClusterCapacityRemaining", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.IsClusterCapacityViolation != null)
Expand All @@ -278,7 +278,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.NodeBufferPercentage != null)
{
writer.WriteProperty(obj.NodeBufferPercentage, "NodeBufferPercentage", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.NodeBufferPercentage, "NodeBufferPercentage", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.ClusterBufferedCapacity != null)
Expand All @@ -288,12 +288,12 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.BufferedClusterCapacityRemaining != null)
{
writer.WriteProperty(obj.BufferedClusterCapacityRemaining, "BufferedClusterCapacityRemaining", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.BufferedClusterCapacityRemaining, "BufferedClusterCapacityRemaining", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.ClusterRemainingBufferedCapacity != null)
{
writer.WriteProperty(obj.ClusterRemainingBufferedCapacity, "ClusterRemainingBufferedCapacity", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.ClusterRemainingBufferedCapacity, "ClusterRemainingBufferedCapacity", JsonWriterExtensions.WriteStringValue);
}

if (obj.MinNodeLoadValue != null)
Expand All @@ -303,7 +303,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.MinimumNodeLoad != null)
{
writer.WriteProperty(obj.MinimumNodeLoad, "MinimumNodeLoad", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.MinimumNodeLoad, "MinimumNodeLoad", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.MinNodeLoadNodeId != null)
Expand All @@ -318,7 +318,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.MaximumNodeLoad != null)
{
writer.WriteProperty(obj.MaximumNodeLoad, "MaximumNodeLoad", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.MaximumNodeLoad, "MaximumNodeLoad", JsonWriterExtensions.WriteDoubleValue);
}

if (obj.MaxNodeLoadNodeId != null)
Expand All @@ -328,7 +328,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj)

if (obj.PlannedLoadRemoval != null)
{
writer.WriteProperty(obj.PlannedLoadRemoval, "PlannedLoadRemoval", JsonWriterExtensions.WriteIntValue);
writer.WriteProperty(obj.PlannedLoadRemoval, "PlannedLoadRemoval", JsonWriterExtensions.WriteDoubleValue);
}

writer.WriteEndObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,26 @@ public LoadMetricInformation(
bool? isBalancedAfter = default(bool?),
double? deviationBefore = default(double?),
double? deviationAfter = default(double?),
int? balancingThreshold = default(int?),
double? balancingThreshold = default(double?),
string action = default(string),
int? activityThreshold = default(int?),
string activityThreshold = default(string),
string clusterCapacity = default(string),
string clusterLoad = default(string),
int? currentClusterLoad = default(int?),
double? currentClusterLoad = default(double?),
string clusterRemainingCapacity = default(string),
int? clusterCapacityRemaining = default(int?),
double? clusterCapacityRemaining = default(double?),
bool? isClusterCapacityViolation = default(bool?),
int? nodeBufferPercentage = default(int?),
double? nodeBufferPercentage = default(double?),
string clusterBufferedCapacity = default(string),
int? bufferedClusterCapacityRemaining = default(int?),
int? clusterRemainingBufferedCapacity = default(int?),
double? bufferedClusterCapacityRemaining = default(double?),
string clusterRemainingBufferedCapacity = default(string),
string minNodeLoadValue = default(string),
int? minimumNodeLoad = default(int?),
double? minimumNodeLoad = default(double?),
NodeId minNodeLoadNodeId = default(NodeId),
string maxNodeLoadValue = default(string),
int? maximumNodeLoad = default(int?),
double? maximumNodeLoad = default(double?),
NodeId maxNodeLoadNodeId = default(NodeId),
int? plannedLoadRemoval = default(int?))
double? plannedLoadRemoval = default(double?))
{
this.Name = name;
this.IsBalancedBefore = isBalancedBefore;
Expand Down Expand Up @@ -138,7 +138,7 @@ public LoadMetricInformation(
/// <summary>
/// Gets the balancing threshold for a certain metric.
/// </summary>
public int? BalancingThreshold { get; }
public double? BalancingThreshold { get; }

/// <summary>
/// Gets the current action being taken with regard to this metric
Expand All @@ -148,7 +148,7 @@ public LoadMetricInformation(
/// <summary>
/// Gets the Activity Threshold specified for this metric in the system Cluster Manifest.
/// </summary>
public int? ActivityThreshold { get; }
public string ActivityThreshold { get; }

/// <summary>
/// Gets the total cluster capacity for a given metric
Expand All @@ -164,7 +164,7 @@ public LoadMetricInformation(
/// <summary>
/// Gets the total cluster load.
/// </summary>
public int? CurrentClusterLoad { get; }
public double? CurrentClusterLoad { get; }

/// <summary>
/// Gets the remaining capacity for the metric in the cluster. In future releases of Service Fabric this parameter will
Expand All @@ -175,7 +175,7 @@ public LoadMetricInformation(
/// <summary>
/// Gets the remaining capacity for the metric in the cluster.
/// </summary>
public int? ClusterCapacityRemaining { get; }
public double? ClusterCapacityRemaining { get; }

/// <summary>
/// Gets indicates that the metric is currently over capacity in the cluster.
Expand All @@ -185,7 +185,7 @@ public LoadMetricInformation(
/// <summary>
/// Gets the reserved percentage of total node capacity for this metric.
/// </summary>
public int? NodeBufferPercentage { get; }
public double? NodeBufferPercentage { get; }

/// <summary>
/// Gets remaining capacity in the cluster excluding the reserved space. In future releases of Service Fabric this
Expand All @@ -196,12 +196,12 @@ public LoadMetricInformation(
/// <summary>
/// Gets remaining capacity in the cluster excluding the reserved space.
/// </summary>
public int? BufferedClusterCapacityRemaining { get; }
public double? BufferedClusterCapacityRemaining { get; }

/// <summary>
/// Gets the remaining percentage of cluster total capacity for this metric.
/// </summary>
public int? ClusterRemainingBufferedCapacity { get; }
public string ClusterRemainingBufferedCapacity { get; }

/// <summary>
/// Gets the minimum load on any node for this metric. In future releases of Service Fabric this parameter will be
Expand All @@ -212,7 +212,7 @@ public LoadMetricInformation(
/// <summary>
/// Gets the minimum load on any node for this metric.
/// </summary>
public int? MinimumNodeLoad { get; }
public double? MinimumNodeLoad { get; }

/// <summary>
/// Gets the node id of the node with the minimum load for this metric.
Expand All @@ -228,7 +228,7 @@ public LoadMetricInformation(
/// <summary>
/// Gets the maximum load on any node for this metric.
/// </summary>
public int? MaximumNodeLoad { get; }
public double? MaximumNodeLoad { get; }

/// <summary>
/// Gets the node id of the node with the maximum load for this metric.
Expand All @@ -241,6 +241,6 @@ public LoadMetricInformation(
/// This kind of load is reported for replicas that are currently being moving to other nodes and for replicas that are
/// currently being dropped but still use the load on the source node.
/// </summary>
public int? PlannedLoadRemoval { get; }
public double? PlannedLoadRemoval { get; }
}
}

0 comments on commit 85416aa

Please sign in to comment.