File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Utils/hdinsight-node-common/src/com/microsoft/azure/projectarcadia/common Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 2323package com .microsoft .azure .projectarcadia .common ;
2424
2525import com .microsoft .azure .hdinsight .common .logger .ILogger ;
26+ import com .microsoft .azure .hdinsight .sdk .cluster .ComparableCluster ;
2627import com .microsoft .azure .hdinsight .sdk .cluster .SparkCluster ;
2728import com .microsoft .azure .hdinsight .sdk .rest .azure .projectarcadia .models .SparkCompute ;
2829import com .microsoft .azure .hdinsight .sdk .rest .azure .projectarcadia .models .SparkComputeProvisioningState ;
@@ -153,4 +154,22 @@ public SparkSubmitStorageType getDefaultStorageType() {
153154 public ArcadiaWorkSpace getWorkSpace () {
154155 return workSpace ;
155156 }
157+
158+ @ Override
159+ public int compareTo (@ NotNull ComparableCluster other ) {
160+ if (this == other ) {
161+ return 0 ;
162+ }
163+
164+ final ArcadiaSparkCompute another = (ArcadiaSparkCompute ) other ;
165+
166+ // Compare the workspace name firstly
167+ final int workspaceCmpResult = this .workSpace .getName ().compareToIgnoreCase (another .workSpace .getName ());
168+ if (workspaceCmpResult != 0 ) {
169+ return workspaceCmpResult ;
170+ }
171+
172+ // Then, the compute name
173+ return this .getName ().compareToIgnoreCase (another .getName ());
174+ }
156175}
You can’t perform that action at this time.
0 commit comments