Public Member Functions | Data Fields

ClusterVConnection Struct Reference

#include <P_ClusterCache.h>

Inherits ClusterVConnectionBase.

Collaboration diagram for ClusterVConnection:
Collaboration graph
[legend]

Public Member Functions

int startEvent (int event, Event *e)
int mainEvent (int event, Event *e)
int start (EThread *t)
 ClusterVConnection (int is_new_connect_read=0)
 ~ClusterVConnection ()
void free ()
virtual void do_io_close (int lerrno=-1)
 Indicate that the VConnection is no longer needed.
virtual VIOdo_io_read (Continuation *c, int64_t nbytes, MIOBuffer *buf)
 Read data from the VConnection.
virtual VIOdo_io_write (Continuation *c, int64_t nbytes, IOBufferReader *buf, bool owner=false)
 Write data to the VConnection.
virtual void reenable (VIO *vio)
 SLINK (ClusterVConnection, ready_alink)
int was_closed ()
void allow_close ()
void disable_close ()
int was_remote_closed ()
void allow_remote_close ()
bool schedule_write ()
void set_type (int)
void set_remote_fill_action (Action *)
bool is_ram_cache_hit () const
void set_ram_cache_hit (bool remote_hit)
virtual bool get_data (int id, void *data)
 Convenience function to retrieve information from VConnection.
virtual void get_http_info (CacheHTTPInfo **)
virtual int64_t get_object_size ()
virtual bool is_pread_capable ()
 Test if the VC can support pread.
virtual void set_http_info (CacheHTTPInfo *)
virtual bool set_pin_in_cache (time_t time_pin)
virtual time_t get_pin_in_cache ()
virtual bool set_disk_io_priority (int priority)
virtual int get_disk_io_priority ()
virtual int get_header (void **ptr, int *len)
virtual int set_header (void *ptr, int len)
virtual int get_single_data (void **ptr, int *len)

Data Fields

ClusterHandlerch
int new_connect_read
int remote_free
int last_local_free
int channel
ClusterVCToken token
volatile int close_disabled
volatile int remote_closed
volatile int remote_close_disabled
volatile int remote_lerrno
volatile uint32_t in_vcs
volatile uint32_t type
ink_hrtime start_time
ink_hrtime last_activity_time
Queue< ByteBankDescriptorbyte_bank_q
int n_set_data_msgs
int n_recv_set_data_msgs
volatile int pending_remote_fill
Ptr< IOBufferBlockread_block
bool remote_ram_cache_hit
bool have_all_data
int initial_data_bytes
Ptr< IOBufferBlockremote_write_block
void * current_cont
int iov_map
Ptr< ProxyMutexread_locked
Ptr< ProxyMutexwrite_locked
Ptr< IOBufferDatamarshal_buf
Ptr< IOBufferBlockwrite_list
IOBufferBlockwrite_list_tail
int write_list_bytes
int write_bytes_in_transit
CacheHTTPInfo alternate
time_t time_pin
int disk_io_priority

Detailed Description

Definition at line 483 of file P_ClusterCache.h.


Constructor & Destructor Documentation

ClusterVConnection::ClusterVConnection ( int  is_new_connect_read = 0  ) 
ClusterVConnection::~ClusterVConnection (  ) 

Definition at line 227 of file ClusterVConnection.cc.

References free().


Member Function Documentation

void ClusterVConnection::allow_close (  ) 

Definition at line 412 of file ClusterVConnection.cc.

References close_disabled.

void ClusterVConnection::allow_remote_close (  ) 
void ClusterVConnection::disable_close (  ) 

Definition at line 418 of file ClusterVConnection.cc.

References close_disabled.

void ClusterVConnection::do_io_close ( int  lerrno = -1  )  [virtual]

Indicate that the VConnection is no longer needed.

Once the state machine has finished using this VConnection, it must call this function to indicate that the VConnection can be deallocated. After a close has been called, the VConnection and underlying processor must not send any more events related to this VConnection to the state machine. Likeswise, the state machine must not access the VConnection or any VIOs obtained from it after calling this method.

Parameters:
lerrno indicates where a close is a normal close or an abort. The difference between a normal close and an abort depends on the underlying type of the VConnection.

Reimplemented from ClusterVConnectionBase.

Definition at line 272 of file ClusterVConnection.cc.

References ch, current_cont, type, VC_CLUSTER, and ClusterHandler::vcs_push().

VIO * ClusterVConnection::do_io_read ( Continuation c,
int64_t  nbytes,
MIOBuffer buf 
) [virtual]

Read data from the VConnection.

Called by a state machine to read data from the VConnection. Processors implementing read functionality take out lock, put new bytes on the buffer and call the continuation back before releasing the lock in order to enable the state machine to handle transfer schemes where the end of a given transaction is marked by a special character (ie: NNTP).

Possible Event Codes

On the callback to the continuation, the VConnection may use on of the following values for the event code:

Event code Meaning
VC_EVENT_READ_READY Data has been added to the buffer or the buffer is full
VC_EVENT_READ_COMPLETE The amount of data indicated by 'nbytes' has been read into the buffer
VC_EVENT_EOS The stream being read from has been shutdown
VC_EVENT_ERROR An error occurred during the read
Parameters:
c Continuation to be called back with events.
nbytes Number of bytes to read. If unknown, nbytes must be set to INT64_MAX.
buf buffer to read into.
Returns:
VIO representing the scheduled IO operation.

Reimplemented from ClusterVConnectionBase.

Definition at line 252 of file ClusterVConnection.cc.

References ch, type, VC_CLUSTER, VC_CLUSTER_READ, and ClusterHandler::vcs_push().

VIO * ClusterVConnection::do_io_write ( Continuation c,
int64_t  nbytes,
IOBufferReader buf,
bool  owner = false 
) [virtual]

Write data to the VConnection.

This method is called by a state machine to write data to the VConnection.

Possible Event Codes

On the callback to the continuation, the VConnection may use on of the following event codes:

Event code Meaning
VC_EVENT_WRITE_READY Data was written from the reader or there are no bytes available for the reader to write.
VC_EVENT_WRITE_COMPLETE The amount of data indicated by 'nbytes' has been written to the VConnection
VC_EVENT_INACTIVITY_TIMEOUT No activity was performed for a certain period.
VC_EVENT_ACTIVE_TIMEOUT Write operation continued beyond a time limit.
VC_EVENT_ERROR An error occurred during the write
Parameters:
c Continuation to be called back with events.
nbytes Number of bytes to write. If unknown, nbytes must be set to INT64_MAX.
buf Reader whose data is to be read from.
owner 
Returns:
VIO representing the scheduled IO operation.

Reimplemented from ClusterVConnectionBase.

Definition at line 262 of file ClusterVConnection.cc.

References ch, type, VC_CLUSTER, VC_CLUSTER_WRITE, and ClusterHandler::vcs_push().

void ClusterVConnection::free (  ) 
bool ClusterVConnection::get_data ( int  id,
void *  data 
) [virtual]

Convenience function to retrieve information from VConnection.

This function is provided as a convenience for state machines to transmit information from/to a VConnection without breaking the VConnection abstraction. Its behavior varies depending on the type of VConnection being used.

Parameters:
id Identifier associated to interpret the data field
data Value or pointer with state machine or VConnection data.
Returns:
True if the oparation is successful.

Reimplemented from VConnection.

Definition at line 479 of file ClusterVConnection.cc.

References CACHE_DATA_HTTP_INFO, CACHE_DATA_KEY, and ink_release_assert.

int ClusterVConnection::get_disk_io_priority (  )  [virtual]

Implements CacheVConnection.

Definition at line 648 of file ClusterVConnection.cc.

References disk_io_priority.

int ClusterVConnection::get_header ( void **  ptr,
int *  len 
) [virtual]

Implements CacheVConnection.

Definition at line 101 of file ClusterVConnection.cc.

References ink_assert.

void ClusterVConnection::get_http_info ( CacheHTTPInfo **  info  )  [virtual]

Definition at line 499 of file ClusterVConnection.cc.

References alternate.

int64_t ClusterVConnection::get_object_size (  )  [virtual]

Implements CacheVConnection.

Definition at line 505 of file ClusterVConnection.cc.

References alternate.

time_t ClusterVConnection::get_pin_in_cache (  )  [virtual]

Implements CacheVConnection.

Definition at line 607 of file ClusterVConnection.cc.

References time_pin.

int ClusterVConnection::get_single_data ( void **  ptr,
int *  len 
) [virtual]

Implements CacheVConnection.

Definition at line 115 of file ClusterVConnection.cc.

References ink_assert.

bool ClusterVConnection::is_pread_capable (  )  [virtual]

Test if the VC can support pread.

Returns:
true if do_io_pread will work, false if not.

Implements CacheVConnection.

Definition at line 511 of file ClusterVConnection.cc.

bool ClusterVConnection::is_ram_cache_hit (  )  const [inline, virtual]

Implements CacheVConnection.

Definition at line 585 of file P_ClusterCache.h.

References remote_ram_cache_hit.

int ClusterVConnection::mainEvent ( int  event,
Event e 
)

Definition at line 297 of file ClusterVConnection.cc.

References ink_assert.

void ClusterVConnection::reenable ( VIO vio  )  [virtual]

Reimplemented from ClusterVConnectionBase.

Definition at line 156 of file ClusterVConnection.cc.

References ch, type, VC_CLUSTER_WRITE, and ClusterHandler::vcs_push().

bool ClusterVConnection::schedule_write (  ) 
bool ClusterVConnection::set_disk_io_priority ( int  priority  )  [virtual]
int ClusterVConnection::set_header ( void *  ptr,
int  len 
) [virtual]

Implements CacheVConnection.

Definition at line 108 of file ClusterVConnection.cc.

References ink_assert.

void ClusterVConnection::set_http_info ( CacheHTTPInfo d  )  [virtual]
bool ClusterVConnection::set_pin_in_cache ( time_t  time_pin  )  [virtual]
void ClusterVConnection::set_ram_cache_hit ( bool  remote_hit  )  [inline]

Definition at line 586 of file P_ClusterCache.h.

References remote_ram_cache_hit.

Referenced by cache_op_result_ClusterFunction().

void ClusterVConnection::set_remote_fill_action ( Action  ) 
void ClusterVConnection::set_type ( int  options  ) 
ClusterVConnection::SLINK ( ClusterVConnection  ,
ready_alink   
)
int ClusterVConnection::start ( EThread t  ) 
int ClusterVConnection::startEvent ( int  event,
Event e 
)

Definition at line 286 of file ClusterVConnection.cc.

References Event::ethread, and start().

Referenced by ClusterVConnection().

int ClusterVConnection::was_closed (  ) 
int ClusterVConnection::was_remote_closed (  ) 

Field Documentation

Definition at line 536 of file P_ClusterCache.h.

Referenced by allow_close(), disable_close(), and was_closed().

Definition at line 581 of file P_ClusterCache.h.

Referenced by get_disk_io_priority(), and set_disk_io_priority().

volatile uint32_t ClusterVConnection::in_vcs

Definition at line 571 of file P_ClusterCache.h.

Referenced by free(), and CacheContinuation::remoteOpEvent().

Definition at line 538 of file P_ClusterCache.h.

Referenced by allow_remote_close(), and was_remote_closed().

Definition at line 557 of file P_ClusterCache.h.

Referenced by is_ram_cache_hit(), and set_ram_cache_hit().

Definition at line 580 of file P_ClusterCache.h.

Referenced by get_pin_in_cache(), and set_pin_in_cache().

volatile uint32_t ClusterVConnection::type

The documentation for this struct was generated from the following files: