Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

MediaPage Class Reference

#include <mcache.h>

Inheritance diagram for MediaPage:

Inheritance graph
[legend]
Collaboration diagram for MediaPage:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { FETCHLOCK = 1, XMITLOCK = 2 }

Public Member Functions

 MediaPage (const char *n, int s, double mt, double et, double a, int l)
virtual ~MediaPage ()
virtual WebPageType type () const
virtual void print_info (char *buf)
int num_layer () const
HitCountget_hit_count (int layer)
void hit_layer (int layer)
int layer_size (int layer)
void add_segment (int layer, const MediaSegment &s)
int evict_tail_segment (int layer, int size)
void add_layer (int layer)
char * print_layer (int layer)
MediaSegmentList is_available (int layer, const MediaSegment &s)
MediaSegment next_available (int layer, const MediaSegment &s)
MediaSegment next_overlap (int layer, const MediaSegment &s)
void lock ()
void unlock ()
int is_locked ()
void tlock ()
void tunlock ()
int is_tlocked ()
int is_complete ()
void set_complete ()
void create ()
int realsize () const
void name (char *buf)
double & mtime ()
double & etime ()
double & age ()
HttpAppserver ()
void validate (double mtime)
void invalidate (double mtime)
int is_valid () const
int is_header_valid () const
void set_valid_hdr ()
void set_uncacheable ()
int is_uncacheable ()
void set_unread ()
void set_read ()
int is_unread ()
int is_server_down ()
void server_down ()
int & counter ()
int count_inval (int a, int th)
int count_request (int b, int th)
void set_mpush (double time)
void clear_mpush ()
int is_mpush ()
double mpush_time ()
int size () const
int & id ()

Static Public Member Functions

void split_name (const char *name, PageID &id)
void print_name (char *name, PageID &id)

Static Public Attributes

int PUSHALL_ = 0

Protected Member Functions

void set_complete_layer (int layer)
int is_complete_layer (int layer)
void set_page_state (int state)
void clear_page_state (int state)
void set_page_action (int action)
void clear_page_action (int action)

Protected Attributes

MediaSegmentList layer_ [MAX_LAYER]
int flags_ [MAX_LAYER]
HitCounthc_ [MAX_LAYER]
int num_layer_
int locked_
int realsize_
HttpAppserver_
double age_
double mtime_
double etime_
int status_
int counter_
double mpushTime_
int size_
int id_

Member Enumeration Documentation

anonymous enum
 

Enumeration values:
FETCHLOCK 
XMITLOCK 

Definition at line 148 of file mcache.h.

00148 {FETCHLOCK = 1, XMITLOCK = 2};


Constructor & Destructor Documentation

MediaPage::MediaPage const char *  n,
int  s,
double  mt,
double  et,
double  a,
int  l
 

Definition at line 38 of file mcache.cc.

References flags_, hc_, and num_layer_.

00039                                       :
00040         ClientPage(n, s, mt, et, a), num_layer_(l), locked_(0), realsize_(0)
00041 {
00042         for (int i = 0; i < num_layer_; i++) {
00043                 hc_[i] = new HitCount(this, i);
00044                 flags_[i] = 0;
00045         }
00046 }

MediaPage::~MediaPage  )  [virtual]
 

Definition at line 48 of file mcache.cc.

References MediaSegmentList::destroy(), hc_, layer_, and num_layer_.

00049 {
00050         int i; 
00051         for (i = 0; i < num_layer_; i++) {
00052                 // Delete hit count list
00053                 // These hit count records should have already been removed
00054                 // from the cache's hit count list. 
00055                 assert((hc_[i]->prev() == NULL) && (hc_[i]->next() == NULL));
00056                 delete hc_[i];
00057                 // Delete media segment list
00058                 layer_[i].destroy();
00059         }
00060 }

Here is the call graph for this function:


Member Function Documentation

void MediaPage::add_layer int  layer  )  [inline]
 

Definition at line 116 of file mcache.h.

References num_layer_.

00116                                   {
00117                 assert((layer >= 0) && (layer < num_layer_));
00118                 num_layer_ = (num_layer_ < layer) ? layer : num_layer_;
00119         }

void MediaPage::add_segment int  layer,
const MediaSegment s
 

Definition at line 83 of file mcache.cc.

References MediaSegmentList::add(), MediaSegment::datasize(), MediaSegment::is_last(), layer_, MAX_LAYER, realsize_, and set_complete_layer().

Referenced by MClientPagePool::add_segment(), and create().

00084 {
00085         assert((layer >= 0) && (layer < MAX_LAYER));
00086         layer_[layer].add(s);
00087         realsize_ += s.datasize();
00088         if (s.is_last())
00089                 set_complete_layer(layer);
00090 }

Here is the call graph for this function:

double& ClientPage::age  )  [inline, inherited]
 

Definition at line 108 of file pagepool.h.

References ClientPage::age_.

Referenced by HttpUpdateData::PageRec::copy(), ClientPagePool::get_age(), and ClientPage::print_info().

00108 { return age_; }

void ClientPage::clear_mpush  )  [inline, inherited]
 

Definition at line 197 of file pagepool.h.

References ClientPage::clear_page_action(), and HTTP_MANDATORY_PUSH.

Referenced by HttpMInvalCache::command(), HttpYucInvalServer::command(), and HttpMInvalCache::recv_upd().

00197 { clear_page_action(HTTP_MANDATORY_PUSH); }

Here is the call graph for this function:

void ClientPage::clear_page_action int  action  )  [inline, protected, inherited]
 

Definition at line 215 of file pagepool.h.

References ClientPage::status_.

Referenced by ClientPage::clear_mpush().

00215                                            {
00216                 status_ = status_ & ~action;
00217         }

void ClientPage::clear_page_state int  state  )  [inline, protected, inherited]
 

Definition at line 209 of file pagepool.h.

References ClientPage::status_.

Referenced by ClientPage::invalidate(), ClientPage::server_down(), ClientPage::set_read(), ClientPage::set_valid_hdr(), and ClientPage::validate().

00209                                          {
00210                 status_ = status_ & ~state;
00211         }

int ClientPage::count_inval int  a,
int  th
[inline, inherited]
 

Definition at line 174 of file pagepool.h.

References ClientPage::counter_, and ClientPage::PUSHALL_.

Referenced by HttpYucInvalServer::command(), HttpMInvalCache::process_inv(), and HttpMInvalCache::recv_upd().

00174                                               { 
00175                 if (PUSHALL_) 
00176                         return INT_MAX;
00177                 else {
00178                         counter_ -= a; 
00179                         if (counter_ < th) 
00180                                 counter_ = th;
00181                         return counter_; 
00182                 }
00183         }

int ClientPage::count_request int  b,
int  th
[inline, inherited]
 

Definition at line 184 of file pagepool.h.

References ClientPage::counter_, and ClientPage::PUSHALL_.

Referenced by HttpMInvalCache::command(), and HttpYucInvalServer::command().

00184                                                 { 
00185                 if (PUSHALL_) 
00186                         return INT_MAX;
00187                 else {
00188                         counter_ += b; 
00189                         if (counter_ > th) 
00190                                 counter_ = th;
00191                         return counter_; 
00192                 }
00193         }

int& ClientPage::counter  )  [inline, inherited]
 

Definition at line 170 of file pagepool.h.

References ClientPage::counter_, and ClientPage::PUSHALL_.

Referenced by ClientPagePool::add_page(), HttpMInvalCache::command(), HttpYucInvalServer::command(), HttpMInvalCache::process_inv(), and HttpMInvalCache::recv_upd().

00170                               { 
00171                 if (PUSHALL_) counter_ = INT_MAX;
00172                 return counter_;
00173         }

void MediaPage::create  ) 
 

Definition at line 70 of file mcache.cc.

References add_segment(), MediaSegmentList::destroy(), layer_, MAX_LAYER, num_layer_, realsize_, set_complete_layer(), and Page::size_.

Referenced by MClientPagePool::fill_page().

00071 {
00072         assert((num_layer_ >= 0) && (num_layer_ < MAX_LAYER));
00073         int i, sz = size_ / num_layer_;
00074         for (i = 0; i < num_layer_; i++) {
00075                 // Delete whatever that was there. 
00076                 layer_[i].destroy();
00077                 add_segment(i, MediaSegment(0, sz));
00078                 set_complete_layer(i);
00079         }
00080         realsize_ = size_;
00081 }

Here is the call graph for this function:

double& ClientPage::etime  )  [inline, inherited]
 

Definition at line 107 of file pagepool.h.

References ClientPage::etime_.

Referenced by ClientPagePool::get_etime(), ClientPage::print_info(), and ClientPagePool::set_etime().

00107 { return etime_; }

int MediaPage::evict_tail_segment int  layer,
int  size
 

Definition at line 109 of file mcache.cc.

References MediaSegmentList::evict_tail(), is_locked(), is_tlocked(), layer_, MAX_LAYER, ClientPage::name(), and realsize_.

Referenced by MClientPagePool::repl_finegrain().

00110 {
00111         if (is_locked() || is_tlocked())
00112                 return 0;
00113 
00114         assert((layer >= 0) && (layer < MAX_LAYER));
00115         //#ifdef MCACHE_DEBUG
00116 #if 0
00117         char buf[20];
00118         name(buf);
00119         fprintf(stderr, "Page %s evicted layer %d: ", buf, layer);
00120 #endif
00121         int sz = layer_[layer].evict_tail(size);
00122         realsize_ -= sz;
00123         //#ifdef MCACHE_DEBUG
00124 #if 0
00125         fprintf(stderr, "\n");
00126 #endif
00127         return sz;
00128 }

Here is the call graph for this function:

HitCount* MediaPage::get_hit_count int  layer  )  [inline]
 

Definition at line 99 of file mcache.h.

References hc_, and num_layer_.

Referenced by MClientPagePool::add_segment(), MClientPagePool::force_remove(), MClientPagePool::hc_update(), and MClientPagePool::repl_atomic().

00099                                            { 
00100                 assert((layer >= 0) && (layer < num_layer_));
00101                 return hc_[layer]; 
00102         }

void MediaPage::hit_layer int  layer  )  [inline]
 

Definition at line 103 of file mcache.h.

References hc_, layer_, num_layer_, Page::size_, and HitCount::update().

Referenced by MClientPagePool::hc_update().

00103                                   {
00104                 assert((layer >= 0) && (layer < num_layer_));
00105                 hc_[layer]->update((double)(layer_[layer].length()*num_layer_)
00106                                    / (double)size_); 
00107         }

Here is the call graph for this function:

int& Page::id  )  [inline, inherited]
 

Definition at line 38 of file pagepool.h.

References Page::id_.

Referenced by TracePagePool::add_page(), ClientPage::name(), and ServerPage::ServerPage().

00038 { return id_; }

void ClientPage::invalidate double  mtime  )  [inline, inherited]
 

Definition at line 120 of file pagepool.h.

References ClientPage::clear_page_state(), HTTP_VALID_HEADER, HTTP_VALID_PAGE, and ClientPage::mtime_.

Referenced by HttpMInvalCache::process_inv().

00120                                       { 
00121                 if (mtime_ >= mtime)
00122                         return;
00123                 clear_page_state(HTTP_VALID_PAGE);
00124                 clear_page_state(HTTP_VALID_HEADER);
00125                 mtime_ = mtime;
00126         }

Here is the call graph for this function:

MediaSegmentList MediaPage::is_available int  layer,
const MediaSegment s
[inline]
 

Definition at line 124 of file mcache.h.

References MediaSegmentList::check_holes(), layer_, and MAX_LAYER.

Referenced by MediaCache::get_data().

00124                                                                         {
00125                 assert((layer >= 0) && (layer < MAX_LAYER));
00126                 return layer_[layer].check_holes(s);
00127         }

Here is the call graph for this function:

int MediaPage::is_complete  ) 
 

Definition at line 92 of file mcache.cc.

References is_complete_layer(), layer_, MediaSegmentList::length(), and num_layer_.

00093 {
00094         // Consider a page finished when all NON-EMPTY layers are 
00095         // marked as "completed"
00096         for (int i = 0; i < num_layer_; i++)
00097                 if (!is_complete_layer(i) && (layer_[i].length() > 0))
00098                         return 0;
00099         return 1;
00100 }

Here is the call graph for this function:

int MediaPage::is_complete_layer int  layer  )  [inline, protected]
 

Definition at line 173 of file mcache.h.

References flags_.

Referenced by is_complete().

00173                                          {
00174                 return flags_[layer] == 1; 
00175         }

int ClientPage::is_header_valid  )  const [inline, inherited]
 

Definition at line 130 of file pagepool.h.

References HTTP_VALID_HEADER, HTTP_VALID_PAGE, and ClientPage::status_.

Referenced by HttpPercInvalCache::command(), and HttpPercInvalCache::recv_inv_filter().

00130                                     {
00131                 return ((status_ & HTTP_VALID_PAGE) || 
00132                         (status_ & HTTP_VALID_HEADER));
00133         }

int MediaPage::is_locked  )  [inline]
 

Definition at line 153 of file mcache.h.

References FETCHLOCK, and locked_.

Referenced by evict_tail_segment(), MediaCache::get_data(), MClientPagePool::repl_atomic(), and MClientPagePool::repl_finegrain().

00153 { return (locked_ & FETCHLOCK); }

int ClientPage::is_mpush  )  [inline, inherited]
 

Definition at line 198 of file pagepool.h.

References HTTP_MANDATORY_PUSH, and ClientPage::status_.

Referenced by ClientPagePool::add_page(), HttpYucInvalServer::command(), and HttpMInvalCache::recv_upd().

00198 { return status_ & HTTP_MANDATORY_PUSH; }

int ClientPage::is_server_down  )  [inline, inherited]
 

Definition at line 158 of file pagepool.h.

References HTTP_SERVER_DOWN, and ClientPage::status_.

00158 { return (status_ & HTTP_SERVER_DOWN); }

int MediaPage::is_tlocked  )  [inline]
 

Definition at line 157 of file mcache.h.

References locked_, and XMITLOCK.

Referenced by evict_tail_segment(), MClientPagePool::repl_atomic(), and MClientPagePool::repl_finegrain().

00157 { return (locked_ & XMITLOCK); }

int ClientPage::is_uncacheable  )  [inline, inherited]
 

Definition at line 144 of file pagepool.h.

References HTTP_UNCACHEABLE, and ClientPage::status_.

Referenced by ClientPage::print_info().

00144                                     {
00145                 return (status_ & HTTP_UNCACHEABLE);
00146         }

int ClientPage::is_unread  )  [inline, inherited]
 

Definition at line 156 of file pagepool.h.

References HTTP_UNREAD_PAGE, and ClientPage::status_.

Referenced by HttpMInvalCache::command().

00156 { return (status_ & HTTP_UNREAD_PAGE); }

int ClientPage::is_valid  )  const [inline, inherited]
 

Definition at line 127 of file pagepool.h.

References HTTP_VALID_PAGE, and ClientPage::status_.

Referenced by HttpApp::command(), and HttpMInvalCache::recv_inv_filter().

00127                              { 
00128                 return (status_ & HTTP_VALID_PAGE);
00129         }

int MediaPage::layer_size int  layer  )  [inline]
 

Definition at line 109 of file mcache.h.

References layer_, MediaSegmentList::length(), and num_layer_.

Referenced by MClientPagePool::add_segment(), MediaServer::get_next_segment(), and MClientPagePool::repl_finegrain().

00109                                   { 
00110                 assert((layer >= 0) && (layer < num_layer_));
00111                 return layer_[layer].length();
00112         }

Here is the call graph for this function:

void MediaPage::lock  )  [inline]
 

Definition at line 151 of file mcache.h.

References FETCHLOCK, and locked_.

Referenced by MClientPagePool::fill_page().

00151 { locked_ |= FETCHLOCK; }

double ClientPage::mpush_time  )  [inline, inherited]
 

Definition at line 199 of file pagepool.h.

References ClientPage::mpushTime_.

Referenced by ClientPagePool::add_page(), HttpYucInvalServer::command(), and HttpMInvalCache::recv_upd().

00199 { return mpushTime_; }

double& ClientPage::mtime  )  [inline, inherited]
 

Definition at line 106 of file pagepool.h.

References ClientPage::mtime_.

Referenced by HttpUpdateData::PageRec::copy(), ClientPagePool::get_mtime(), ClientPage::print_info(), HttpMInvalCache::process_inv(), HttpPercInvalCache::recv_inv_filter(), HttpMInvalCache::recv_inv_filter(), HttpMInvalCache::recv_upd(), and ClientPagePool::set_mtime().

00106 { return mtime_; }

void ClientPage::name char *  buf  )  [inherited]
 

Definition at line 100 of file pagepool.cc.

References Page::id(), and ClientPage::server_.

Referenced by ClientPagePool::add_page(), MClientPagePool::cache_replace(), HttpUpdateData::PageRec::copy(), evict_tail_segment(), HitCountList::print(), MClientPagePool::repl_atomic(), and MClientPagePool::repl_finegrain().

00101 {
00102         sprintf(buf, "%s:%d", server_->name(), id());
00103 }

Here is the call graph for this function:

MediaSegment MediaPage::next_available int  layer,
const MediaSegment s
[inline]
 

Definition at line 132 of file mcache.h.

References MediaSegmentList::get_nextseg(), layer_, and MAX_LAYER.

00132                                                                       {
00133                 assert((layer >= 0) && (layer < MAX_LAYER));
00134                 return layer_[layer].get_nextseg(s);
00135         }

Here is the call graph for this function:

MediaSegment MediaPage::next_overlap int  layer,
const MediaSegment s
[inline]
 

Definition at line 136 of file mcache.h.

References MediaSegment::end(), MediaSegmentList::get_nextseg(), MediaSegment::is_last(), layer_, MAX_LAYER, MediaSegment::set_last(), and MediaSegment::start().

Referenced by MediaCache::get_data(), and MediaServer::get_next_segment().

00136                                                                     {
00137                 assert((layer >= 0) && (layer < MAX_LAYER));
00138                 MediaSegment s1 = layer_[layer].get_nextseg(s);
00139                 if ((s1.end() <= s.start()) || (s1.start() >= s.end())) {
00140                         MediaSegment s;
00141                         if (s1.is_last())
00142                                 s.set_last();
00143                         return s;
00144                 } else
00145                         return s1;
00146         }

Here is the call graph for this function:

int MediaPage::num_layer  )  const [inline]
 

Definition at line 97 of file mcache.h.

References num_layer_.

Referenced by MClientPagePool::add_segment(), MediaClient::command(), MediaCache::command(), HttpApp::command(), MClientPagePool::force_remove(), MediaServer::get_next_segment(), and MClientPagePool::repl_atomic().

00097 { return num_layer_; }

void MediaPage::print_info char *  buf  )  [virtual]
 

Reimplemented from ClientPage.

Definition at line 62 of file mcache.cc.

References num_layer_, and ClientPage::print_info().

00063 {
00064         ClientPage::print_info(buf);
00065         buf += strlen(buf);
00066         sprintf(buf, " pgtype MEDIA layer %d", num_layer_);
00067 }

Here is the call graph for this function:

char* MediaPage::print_layer int  layer  )  [inline]
 

Definition at line 120 of file mcache.h.

References MediaSegmentList::dump2buf(), layer_, and num_layer_.

Referenced by MediaClient::command(), and MediaCache::command().

00120                                      {
00121                 assert((layer >= 0) && (layer < num_layer_));
00122                 return layer_[layer].dump2buf();
00123         }

Here is the call graph for this function:

void ClientPage::print_name char *  name,
PageID id
[static, inherited]
 

Definition at line 72 of file pagepool.cc.

References PageID::id_, and PageID::s_.

00073 {
00074         sprintf(name, "%s:%-d", id.s_->name(), id.id_);
00075 }

int MediaPage::realsize  )  const [inline]
 

Definition at line 167 of file mcache.h.

References realsize_.

Referenced by MClientPagePool::fill_page(), MClientPagePool::force_remove(), MClientPagePool::repl_atomic(), and MClientPagePool::repl_finegrain().

00167 { return realsize_; }

HttpApp* ClientPage::server  )  [inline, inherited]
 

Definition at line 109 of file pagepool.h.

References ClientPage::server_.

Referenced by ClientPagePool::invalidate_server(), and HttpMInvalCache::process_inv().

00109 { return server_; }

void ClientPage::server_down  )  [inline, inherited]
 

Definition at line 159 of file pagepool.h.

References ClientPage::clear_page_state(), HTTP_SERVER_DOWN, HTTP_VALID_HEADER, HTTP_VALID_PAGE, and ClientPage::set_page_state().

Referenced by ClientPagePool::invalidate_server().

00159                                   {
00160                 // Set page as invalid
00161                 // Don't change mtime, only change page status
00162                 clear_page_state(HTTP_VALID_PAGE);
00163                 clear_page_state(HTTP_VALID_HEADER);
00164                 set_page_state(HTTP_SERVER_DOWN);
00165         }

Here is the call graph for this function:

void MediaPage::set_complete  ) 
 

Definition at line 102 of file mcache.cc.

References num_layer_, and set_complete_layer().

00103 {
00104         for (int i = 0; i < num_layer_; i++)
00105                 set_complete_layer(i);
00106 }

Here is the call graph for this function:

void MediaPage::set_complete_layer int  layer  )  [inline, protected]
 

Definition at line 170 of file mcache.h.

References flags_.

Referenced by add_segment(), create(), and set_complete().

00170                                            {
00171                 flags_[layer] = 1;
00172         }

void ClientPage::set_mpush double  time  )  [inline, inherited]
 

Definition at line 194 of file pagepool.h.

References HTTP_MANDATORY_PUSH, ClientPage::mpushTime_, and ClientPage::set_page_action().

Referenced by ClientPagePool::add_page(), HttpMInvalCache::command(), and HttpYucInvalServer::command().

00194                                            { 
00195                 set_page_action(HTTP_MANDATORY_PUSH), mpushTime_ = time; 
00196         }

Here is the call graph for this function:

void ClientPage::set_page_action int  action  )  [inline, protected, inherited]
 

Definition at line 212 of file pagepool.h.

References ClientPage::status_.

Referenced by ClientPage::set_mpush().

00212                                          {
00213                 status_ |= action;
00214         }

void ClientPage::set_page_state int  state  )  [inline, protected, inherited]
 

Definition at line 206 of file pagepool.h.

References ClientPage::status_.

Referenced by ClientPage::server_down(), ClientPage::set_uncacheable(), ClientPage::set_unread(), ClientPage::set_valid_hdr(), and ClientPage::validate().

00206                                        {
00207                 status_ |= state;
00208         }

void ClientPage::set_read  )  [inline, inherited]
 

Definition at line 153 of file pagepool.h.

References ClientPage::clear_page_state(), and HTTP_UNREAD_PAGE.

Referenced by HttpMInvalCache::command().

00153                                { 
00154                 clear_page_state(HTTP_UNREAD_PAGE);
00155         }

Here is the call graph for this function:

void ClientPage::set_uncacheable  )  [inline, inherited]
 

Definition at line 141 of file pagepool.h.

References HTTP_UNCACHEABLE, and ClientPage::set_page_state().

Referenced by ClientPagePool::enter_page(), and MClientPagePool::enter_page().

00141                                       { 
00142                 set_page_state(HTTP_UNCACHEABLE);
00143         }

Here is the call graph for this function:

void ClientPage::set_unread  )  [inline, inherited]
 

Definition at line 150 of file pagepool.h.

References HTTP_UNREAD_PAGE, and ClientPage::set_page_state().

Referenced by HttpMInvalCache::command(), and HttpMInvalCache::recv_upd().

00150                                  { 
00151                 set_page_state(HTTP_UNREAD_PAGE); 
00152         }

Here is the call graph for this function:

void ClientPage::set_valid_hdr  )  [inline, inherited]
 

Definition at line 134 of file pagepool.h.

References ClientPage::clear_page_state(), HTTP_SERVER_DOWN, HTTP_VALID_HEADER, HTTP_VALID_PAGE, and ClientPage::set_page_state().

Referenced by ClientPagePool::enter_metadata().

00134                                     { 
00135                 // XXX page invalid, but only header valid
00136                 clear_page_state(HTTP_SERVER_DOWN);
00137                 clear_page_state(HTTP_VALID_PAGE);
00138                 set_page_state(HTTP_VALID_HEADER); 
00139         }

Here is the call graph for this function:

int Page::size  )  const [inline, inherited]
 

Definition at line 37 of file pagepool.h.

References Page::size_.

Referenced by HttpUpdateData::add(), HttpUpdateData::PageRec::copy(), MClientPagePool::fill_page(), MClientPagePool::force_remove(), ClientPagePool::get_size(), Page::Page(), ClientPage::print_info(), and MClientPagePool::remove_page().

00037 { return size_; }

void ClientPage::split_name const char *  name,
PageID id
[static, inherited]
 

Definition at line 77 of file pagepool.cc.

References abort(), PageID::id_, and PageID::s_.

Referenced by ClientPagePool::add_page(), CompMathPagePool::command(), ClientPagePool::get_page(), MediaServer::get_piq(), and ClientPagePool::remove_page().

00078 {
00079         char *buf = new char[strlen(name)+1];
00080         strcpy(buf, name);
00081         char *tmp = strtok(buf, ":");
00082         id.s_ = (HttpApp*)TclObject::lookup(tmp);
00083         if (id.s_ == NULL) {
00084                 fprintf(stderr, "Non-exitent server name for page %s\n", name);
00085                 abort();
00086         }
00087         tmp = strtok(NULL, ":");
00088         id.id_ = atol(tmp);
00089         delete []buf;
00090 }

Here is the call graph for this function:

void MediaPage::tlock  )  [inline]
 

Definition at line 155 of file mcache.h.

References locked_, and XMITLOCK.

Referenced by MediaCache::command().

00155 { locked_ |= XMITLOCK; }

void MediaPage::tunlock  )  [inline]
 

Definition at line 156 of file mcache.h.

References locked_, and XMITLOCK.

Referenced by MediaCache::command().

00156 { locked_ &= ~XMITLOCK; }

virtual WebPageType MediaPage::type  )  const [inline, virtual]
 

Reimplemented from ClientPage.

Definition at line 95 of file mcache.h.

References MEDIA, and WebPageType.

Referenced by MediaCache::command(), and HttpApp::command().

00095 { return MEDIA; }

void MediaPage::unlock  )  [inline]
 

Definition at line 152 of file mcache.h.

References FETCHLOCK, and locked_.

Referenced by MediaCache::command(), and MClientPagePool::fill_page().

00152 { locked_ &= ~FETCHLOCK; }

void ClientPage::validate double  mtime  )  [inline, inherited]
 

Definition at line 112 of file pagepool.h.

References abort(), ClientPage::clear_page_state(), HTTP_SERVER_DOWN, HTTP_VALID_PAGE, ClientPage::mtime_, and ClientPage::set_page_state().

00112                                     { 
00113                 if (mtime_ >= mtime)
00114                         abort(); // This shouldn't happen!
00115                 // Clear server down bit
00116                 clear_page_state(HTTP_SERVER_DOWN);
00117                 set_page_state(HTTP_VALID_PAGE);
00118                 mtime_ = mtime;
00119         }

Here is the call graph for this function:


Member Data Documentation

double ClientPage::age_ [protected, inherited]
 

Definition at line 220 of file pagepool.h.

Referenced by ClientPage::age().

int ClientPage::counter_ [protected, inherited]
 

Definition at line 224 of file pagepool.h.

Referenced by ClientPage::count_inval(), ClientPage::count_request(), and ClientPage::counter().

double ClientPage::etime_ [protected, inherited]
 

Definition at line 222 of file pagepool.h.

Referenced by ClientPage::etime().

int MediaPage::flags_[MAX_LAYER] [protected]
 

Definition at line 178 of file mcache.h.

Referenced by is_complete_layer(), MediaPage(), and set_complete_layer().

HitCount* MediaPage::hc_[MAX_LAYER] [protected]
 

Definition at line 179 of file mcache.h.

Referenced by get_hit_count(), hit_layer(), MediaPage(), and ~MediaPage().

int Page::id_ [protected, inherited]
 

Definition at line 43 of file pagepool.h.

Referenced by ClientPage::ClientPage(), Page::id(), and ServerPage::ServerPage().

MediaSegmentList MediaPage::layer_[MAX_LAYER] [protected]
 

Definition at line 177 of file mcache.h.

Referenced by add_segment(), create(), evict_tail_segment(), hit_layer(), is_available(), is_complete(), layer_size(), next_available(), next_overlap(), print_layer(), and ~MediaPage().

int MediaPage::locked_ [protected]
 

Definition at line 181 of file mcache.h.

Referenced by is_locked(), is_tlocked(), lock(), tlock(), tunlock(), and unlock().

double ClientPage::mpushTime_ [protected, inherited]
 

Definition at line 225 of file pagepool.h.

Referenced by ClientPage::mpush_time(), and ClientPage::set_mpush().

double ClientPage::mtime_ [protected, inherited]
 

Definition at line 221 of file pagepool.h.

Referenced by ClientPage::invalidate(), ClientPage::mtime(), and ClientPage::validate().

int MediaPage::num_layer_ [protected]
 

Definition at line 180 of file mcache.h.

Referenced by add_layer(), create(), get_hit_count(), hit_layer(), is_complete(), layer_size(), MediaPage(), num_layer(), print_info(), print_layer(), set_complete(), and ~MediaPage().

int ClientPage::PUSHALL_ = 0 [static, inherited]
 

Definition at line 43 of file pagepool.cc.

Referenced by PagePool::command(), ClientPage::count_inval(), ClientPage::count_request(), and ClientPage::counter().

int MediaPage::realsize_ [protected]
 

Definition at line 182 of file mcache.h.

Referenced by add_segment(), create(), evict_tail_segment(), and realsize().

HttpApp* ClientPage::server_ [protected, inherited]
 

Definition at line 219 of file pagepool.h.

Referenced by ClientPage::ClientPage(), ClientPage::name(), and ClientPage::server().

int Page::size_ [protected, inherited]
 

Definition at line 42 of file pagepool.h.

Referenced by create(), hit_layer(), Page::Page(), ServerPage::size(), and Page::size().

int ClientPage::status_ [protected, inherited]
 

Definition at line 223 of file pagepool.h.

Referenced by ClientPage::clear_page_action(), ClientPage::clear_page_state(), ClientPage::is_header_valid(), ClientPage::is_mpush(), ClientPage::is_server_down(), ClientPage::is_uncacheable(), ClientPage::is_unread(), ClientPage::is_valid(), ClientPage::set_page_action(), and ClientPage::set_page_state().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 12:59:57 2004 for NS2.26SourcesOriginal by doxygen 1.3.3