Apache Mesos
manager.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __RESOURCE_PROVIDER_MANAGER_HPP__
18 #define __RESOURCE_PROVIDER_MANAGER_HPP__
19 
20 #include <stout/nothing.hpp>
21 
23 #include <process/future.hpp>
24 #include <process/http.hpp>
25 #include <process/owned.hpp>
26 #include <process/queue.hpp>
27 
28 #include "messages/messages.hpp"
29 
32 
33 namespace mesos {
34 namespace internal {
35 
36 // Forward declarations.
37 class ResourceProviderManagerProcess;
38 
39 
41 {
42 public:
45 
47 
49  const ResourceProviderManager& other) = delete;
50 
52  const ResourceProviderManager& other) = delete;
53 
54  // The API endpoint handler.
58 
59  void applyOperation(const ApplyOperationMessage& message) const;
60 
61  // Forwards an operation status acknowledgement to the relevant
62  // resource provider.
64  const AcknowledgeOperationStatusMessage& message) const;
65 
66  // Forwards operation reconciliation requests from the master to the
67  // relevant resource providers.
69  const ReconcileOperationsMessage& message) const;
70 
71  // Permanently remove a resource provider.
73  const ResourceProviderID& resourceProviderId) const;
74 
75  // Ensure that the resources are ready for use.
77 
78  // Returns a stream of messages from the resource provider manager.
80 
81 private:
83 };
84 
85 } // namespace internal {
86 } // namespace mesos {
87 
88 #endif // __RESOURCE_PROVIDER_MANAGER_HPP__
process::Future< Nothing > removeResourceProvider(const ResourceProviderID &resourceProviderId) const
void applyOperation(const ApplyOperationMessage &message) const
Future< Response > request(const Request &request, bool streamedResponse=false)
Asynchronously sends an HTTP request to the process and returns the HTTP response once the entire res...
process::Queue< ResourceProviderMessage > messages() const
Definition: resources.hpp:83
Definition: http.hpp:533
ResourceProviderManager & operator=(const ResourceProviderManager &other)=delete
void reconcileOperations(const ReconcileOperationsMessage &message) const
Definition: agent.hpp:25
ResourceProviderManager(process::Owned< resource_provider::Registrar > registrar)
Definition: attributes.hpp:24
Definition: queue.hpp:29
Definition: executor.hpp:48
void acknowledgeOperationStatus(const AcknowledgeOperationStatusMessage &message) const
Definition: owned.hpp:36
process::Future< Nothing > publishResources(const Resources &resources)
process::Future< process::http::Response > api(const process::http::Request &request, const Option< process::http::authentication::Principal > &principal) const