summaryrefslogtreecommitdiffstats
path: root/src/tools/immutable_object_cache/Policy.h
blob: 7924a8919de67bd75cba4ed7edf1f04775460632 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab

#ifndef CEPH_CACHE_POLICY_H
#define CEPH_CACHE_POLICY_H

#include <list>
#include <string>

namespace ceph {
namespace immutable_obj_cache {

typedef enum {
  OBJ_CACHE_NONE = 0,
  OBJ_CACHE_PROMOTED,
  OBJ_CACHE_SKIP,
  OBJ_CACHE_DNE,
} cache_status_t;

class Policy {
 public:
  Policy() {}
  virtual ~Policy() {}
  virtual cache_status_t lookup_object(std::string) = 0;
  virtual int evict_entry(std::string) = 0;
  virtual void update_status(std::string, cache_status_t,
                             uint64_t size = 0) = 0;
  virtual cache_status_t get_status(std::string) = 0;
  virtual void get_evict_list(std::list<std::string>* obj_list) = 0;
};

}  // namespace immutable_obj_cache
}  // namespace ceph
#endif