Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
random.h
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Distributed under BSD 3-Clause license. *
3  * Copyright by The HDF Group. *
4  * Copyright by the Illinois Institute of Technology. *
5  * All rights reserved. *
6  * *
7  * This file is part of Hermes. The full Hermes copyright notice, including *
8  * terms governing use, modification, and redistribution, is contained in *
9  * the COPYING file, which can be found at the top directory. If you do not *
10  * have access to the file, you may request a copy from help@hdfgroup.org. *
11  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12 
13 #ifndef HERMES_SRC_DPE_RANDOM_H_
14 #define HERMES_SRC_DPE_RANDOM_H_
15 
16 #include "data_placement_engine.h"
17 
18 namespace hermes {
22 class Random : public DPE {
23  public:
24  Random() : DPE(PlacementPolicy::kRandom) {}
25  ~Random() = default;
26  Status Placement(const std::vector<size_t> &blob_sizes,
27  const std::vector<u64> &node_state,
28  const std::vector<TargetID> &targets,
29  const api::Context &ctx,
30  std::vector<PlacementSchema> &output);
31 
32  private:
36  void GetOrderedCapacities(const std::vector<u64> &node_state,
37  const std::vector<TargetID> &targets,
38  std::multimap<u64, TargetID> &ordered_cap);
40  Status AddSchema(std::multimap<u64, TargetID> &ordered_cap, size_t blob_size,
41  PlacementSchema &schema);
42 };
43 
44 } // namespace hermes
45 
46 #endif // HERMES_SRC_DPE_RANDOM_H_
Definition: hermes_status.h:80
Definition: data_placement_engine.h:35
DPE(PlacementPolicy policy)
Definition: data_placement_engine.h:42
Definition: random.h:22
Status AddSchema(std::multimap< u64, TargetID > &ordered_cap, size_t blob_size, PlacementSchema &schema)
Definition: random.cc:21
void GetOrderedCapacities(const std::vector< u64 > &node_state, const std::vector< TargetID > &targets, std::multimap< u64, TargetID > &ordered_cap)
Definition: random.cc:47
Status Placement(const std::vector< size_t > &blob_sizes, const std::vector< u64 > &node_state, const std::vector< TargetID > &targets, const api::Context &ctx, std::vector< PlacementSchema > &output)
Definition: random.cc:55
Definition: adapter_utils.cc:35
std::vector< std::pair< size_t, TargetID > > PlacementSchema
Definition: hermes_types.h:226
Definition: hermes_types.h:137