~mathiaz/+junk/ceph-new-pkg-review

2 by Mathias Gug
Import ceph_0.21-0ubuntu1 from https://launchpad.net/~clint-fewbar/+archive/ceph/+packages.
1
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2
// vim: ts=8 sw=2 smarttab
3
#ifndef CEPH_AGER_H
4
#define CEPH_AGER_H
5
6
#include "include/types.h"
7
#include "include/Distribution.h"
8
#include "os/ObjectStore.h"
9
#include "common/Clock.h"
10
11
#include <list>
12
#include <vector>
13
using namespace std;
14
15
class Ager {
16
  ObjectStore *store;
17
18
 private:
19
  list<file_object_t>           age_free_oids;
20
  file_object_t                 age_cur_oid;
21
  vector< list<file_object_t> > age_objects;
22
  Distribution file_size_distn; //kb
23
  bool         did_distn;
24
25
  void age_empty(float pc);
26
  uint64_t age_fill(float pc, utime_t until);
27
  ssize_t age_pick_size();
28
  file_object_t age_get_oid();
29
30
 public:
31
  Ager(ObjectStore *s) : store(s), did_distn(false) {} 
32
33
  void age(int time,
34
           float high_water,    // fill to this %
35
          float low_water,     // then empty to this %
36
          int count,         // this many times
37
          float final_water,   // and end here ( <= low_water)
38
          int fake_size_mb=0);
39
40
  void save_freelist(int);
41
  void load_freelist();
42
};
43
44
#endif