This repository has been archived by the owner. It is now read-only.
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Introduce structs to enable specifying custom SLA.
Add `SlaPolicy` and `HostMaintenanceRequest` structs to the thrift definition and introduce a new `HostMaintenanceStore` for tracking maintenance requests. These changes will be used in https://reviews.apache.org/r/66716 for implementing custom SLA and scheduler driven maintenance. This RB splits the storage related changes from https://reviews.apache.org/r/66716 for better rollback story. Tested rollback on the vagrant. Testing Done: ./build-support/jenkins/build.sh Bugs closed: AURORA-1977 Reviewed at https://reviews.apache.org/r/67141/
- Loading branch information
Showing
33 changed files
with
828 additions
and
10 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.aurora.scheduler.storage; | ||
|
||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
import org.apache.aurora.scheduler.storage.entities.IHostMaintenanceRequest; | ||
|
||
/** | ||
* Stores maintenance requests for hosts. | ||
*/ | ||
public interface HostMaintenanceStore { | ||
|
||
/** | ||
* Returns the maintenance request for the given host if exists. | ||
* {@link Optional#empty()} otherwise. | ||
* @param host Name of the host | ||
* @return {@link Optional} of {@link IHostMaintenanceRequest} | ||
*/ | ||
Optional<IHostMaintenanceRequest> getHostMaintenanceRequest(String host); | ||
|
||
/** | ||
* Returns all {@link IHostMaintenanceRequest}s currently in storage. | ||
* @return {@link Set} of {@link IHostMaintenanceRequest}s | ||
*/ | ||
Set<IHostMaintenanceRequest> getHostMaintenanceRequests(); | ||
|
||
/** | ||
* Provides write operations to the {@link HostMaintenanceStore}. | ||
*/ | ||
interface Mutable extends HostMaintenanceStore { | ||
/** | ||
* Deletes all attributes in the store. | ||
*/ | ||
void deleteHostMaintenanceRequests(); | ||
|
||
/** | ||
* Saves the maintenance request for the given host. | ||
* @param hostMaintenanceRequest {@link IHostMaintenanceRequest} | ||
*/ | ||
void saveHostMaintenanceRequest(IHostMaintenanceRequest hostMaintenanceRequest); | ||
|
||
/** | ||
* Removes the maintenance request for the given host if one exists. | ||
* @param host Name of the host | ||
*/ | ||
void removeHostMaintenanceRequest(String host); | ||
} | ||
} |
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.