Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
data_placement_engine_factory.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_DATA_PLACEMENT_ENGINE_FACTORY_H_
14 #define HERMES_SRC_DPE_DATA_PLACEMENT_ENGINE_FACTORY_H_
15 
16 #include "dpe/minimize_io_time.h"
17 #include "dpe/random.h"
18 #include "dpe/round_robin.h"
19 
20 namespace hermes {
21 
23 
27 class DPEFactory {
28  public:
37  std::unique_ptr<DPE> Get(const PlacementPolicy &type) {
38  switch (type) {
39  case PlacementPolicy::kRandom: {
40  return std::make_unique<Random>();
41  }
42  case PlacementPolicy::kRoundRobin: {
43  return std::make_unique<RoundRobin>();
44  }
45  case PlacementPolicy::kMinimizeIoTime: {
46  return std::make_unique<MinimizeIoTime>();
47  }
48  case PlacementPolicy::kNone:
49  default: {
50  // TODO(luke): @errorhandling not implemented
51  LOG(FATAL) << "PlacementPolicy not implemented" << std::endl;
52  return NULL;
53  }
54  }
55  }
56 };
57 
58 } // namespace hermes
59 
60 #endif // HERMES_SRC_DPE_DATA_PLACEMENT_ENGINE_FACTORY_H_
Definition: data_placement_engine_factory.h:27
std::unique_ptr< DPE > Get(const PlacementPolicy &type)
Definition: data_placement_engine_factory.h:37
PlacementPolicy
Definition: hermes_types.h:73
Definition: adapter_utils.cc:35