22 #ifndef Hypertable_Lib_LocationCache_h
23 #define Hypertable_Lib_LocationCache_h
55 return (x.
end_row == 0) ?
false :
true;
68 return (y.
end_row == 0) ?
true :
false;
91 std::map<LocationCacheKey, Value *>::iterator
map_iter;
104 bool lookup(
const char *table_name,
const char *rowkey,
106 bool lookup(
const char *table_name,
const char *rowkey,
108 bool invalidate(
const char *table_name,
const char *rowkey);
115 bool lookup(
const char *table_name,
const char *rowkey,
116 Value*& cacheval,
bool inclusive);
118 void remove(Value *cacheval);
125 return *addr1 < *addr2;
130 typedef std::set<const CommAddress *, CommAddressPointerLt>
AddressSet;
147 #endif // Hypertable_Lib_LocationCache_h
void display(std::ostream &)
const CommAddress * get_constant_address(const CommAddress &addr)
void insert(const char *table_name, RangeLocationInfo &range_loc_info, bool pegged=false)
Insert.
This class acts as a cache of Range location information.
bool invalidate(const char *table_name, const char *rowkey)
Holds range start and end row plus location.
FlyweightString m_strings
The Flyweight string set stores duplicate strings efficiently.
std::shared_ptr< LocationCache > LocationCachePtr
Smart pointer to LocationCache.
void move_to_head(Value *cacheval)
MoveToHead.
std::set< const CommAddress *, CommAddressPointerLt > AddressSet
bool operator==(const directory_entry< _Key, _Tp > &lhs, const directory_entry< _Key, _Tp > &rhs)
const CommAddress * addrp
bool lookup(const char *table_name, const char *rowkey, RangeLocationInfo *range_loc_infop, bool inclusive=false)
Lookup.
bool operator!=(const directory_entry< _Key, _Tp > &lhs, const directory_entry< _Key, _Tp > &rhs)
std::map< LocationCacheKey, Value * > LocationMap
bool operator<(const directory_entry< _Key, _Tp > &lhs, const directory_entry< _Key, _Tp > &rhs)
Key type for Range location cache.
STL Strict Weak Ordering for comparing CommAddress pointers.
LocationMap m_location_map
Internet address wrapper classes and utility functions.
void invalidate_host(const std::string &hostname)
bool operator()(const CommAddress *addr1, const CommAddress *addr2) const
String extensions and helpers: sets, maps, append operators etc.
LocationCache(uint32_t max_entries)
Address abstraction to hold either proxy name or IPv4:port address.
std::map< LocationCacheKey, Value * >::iterator map_iter