-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support configuration overrides of rack sensitivity / agent placement.
- Loading branch information
William Hou
committed
Sep 14, 2021
1 parent
78de2ba
commit 69e8eac
Showing
16 changed files
with
8,757 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
SingularityService/src/main/java/com/hubspot/singularity/config/OverrideConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.hubspot.singularity.config; | ||
|
||
import com.hubspot.singularity.AgentPlacement; | ||
import java.util.Optional; | ||
|
||
/** | ||
* Stores temporary overrides for certain Singularity behavior, | ||
* because calling configuration setters directly doesn't work. | ||
*/ | ||
public class OverrideConfiguration { | ||
/** If false, ignore rack sensitive requests. If true, work normally. */ | ||
private boolean allowRackSensitivity = true; | ||
|
||
/** If set, overrides agent placement for all requests to the specified value. */ | ||
private Optional<AgentPlacement> agentPlacementOverride = Optional.empty(); | ||
|
||
public boolean isAllowRackSensitivity() { | ||
return allowRackSensitivity; | ||
} | ||
|
||
public void setAllowRackSensitivity(boolean allowRackSensitivity) { | ||
this.allowRackSensitivity = allowRackSensitivity; | ||
} | ||
|
||
public Optional<AgentPlacement> getAgentPlacementOverride() { | ||
return agentPlacementOverride; | ||
} | ||
|
||
public void setAgentPlacementOverride(Optional<AgentPlacement> agentPlacementOverride) { | ||
this.agentPlacementOverride = agentPlacementOverride; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.