//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2016 ArangoDB GmbH, Cologne, Germany /// /// 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. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Simon Grätzer //////////////////////////////////////////////////////////////////////////////// #ifndef ARANGODB_PREGEL_RECOVERY_H #define ARANGODB_PREGEL_RECOVERY_H 1 #include #include #include "Basics/Mutex.h" #include "Cluster/ClusterInfo.h" namespace arangodb { namespace pregel { template class GraphStore; class Conductor; class RecoveryManager { ClusterInfo& _ci; Mutex _lock; AgencyComm _agency; // AgencyCallbackRegistry* _agencyCallbackRegistry; // weak std::map> _listeners; std::map _primaryServers; std::map> _agencyCallbacks; // void _monitorShard(DatabaseID const& database, // CollectionID const& cid, // ShardID const& shard); void _renewPrimaryServer(ShardID const& shard); public: explicit RecoveryManager(ClusterInfo&); ~RecoveryManager(); void monitorCollections(DatabaseID const& database, std::vector const& collections, Conductor* listener); void stopMonitoring(Conductor*); int filterGoodServers(std::vector const& servers, std::vector& goodServers); void updatedFailedServers(std::vector const& failedServers); // bool allServersAvailable(std::vector const& dbServers); }; /* template class CheckpointingManager { friend class RestPregelHandler; std::map _secondaries; ServerID const* secondaryForShard(ShardID const& shard) { return nullptr; } // receivedBackupData(VPackSlice slice); public: template void replicateGraphData(uint64_t exn, uint64_t gss, GraphStore const* graphStore); void restoreGraphData(uint64_t exn, uint64_t gss, GraphStore const* graphStore); void reloadPlanData() { _secondaries.clear(); } };*/ } // namespace pregel } // namespace arangodb #endif