Add static utilities for unlimited and zero quota
@@ -7,6 +7,8 @@ import java.util.Optional;
* Quota information transmitted to the configserver on deploy.
*/
public class Quota {
+ private static final Quota UNLIMITED = new Quota(Optional.empty(), Optional.empty());
+ private static final Quota ZERO = new Quota(0, 0);
private final Optional<Integer> maxClusterSize;
private final Optional<Integer> budget; // in USD/hr, as calculated by NodeResources
@@ -40,6 +42,14 @@ public class Quota {
return new Quota(maxClusterSize, Optional.of(budget));
}
+ public static Quota zero() {
+ return ZERO;
+ }
+
+ public static Quota unlimted() {
+ return UNLIMITED;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
