#include <P_ClusterCache.h>
Inherits CacheVConnection.
Inherited by ClusterVConnection.
Definition at line 334 of file P_ClusterCache.h.
ClusterVConnectionBase::ClusterVConnectionBase | ( | ) |
Definition at line 66 of file ClusterVConnection.cc.
void ClusterVConnectionBase::cancel_active_timeout | ( | ) | [inline] |
Definition at line 430 of file P_ClusterCache.h.
References active_timeout, active_timeout_in, and Action::cancel().
void ClusterVConnectionBase::cancel_inactivity_timeout | ( | ) | [inline] |
Definition at line 440 of file P_ClusterCache.h.
References Action::cancel(), inactivity_timeout, and inactivity_timeout_in.
void ClusterVConnectionBase::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.
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. |
Implements CacheVConnection.
Reimplemented in ClusterVConnection.
Definition at line 138 of file ClusterVConnection.cc.
References VIO::buffer, MIOBufferAccessor::clear(), closed, ClusterVConnState::enabled, VConnection::lerrno, read, ClusterVConnState::vio, and write.
VIO * ClusterVConnectionBase::do_io_pread | ( | Continuation * | , | |
int64_t | , | |||
MIOBuffer * | , | |||
int64_t | ||||
) | [virtual] |
Implements CacheVConnection.
Definition at line 94 of file ClusterVConnection.cc.
VIO * ClusterVConnectionBase::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 |
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. |
Implements CacheVConnection.
Reimplemented in ClusterVConnection.
Definition at line 77 of file ClusterVConnection.cc.
References VIO::buffer, ClusterVConnection::channel, closed, Debug, ClusterVConnState::enabled, ink_assert, VIO::nbytes, VIO::ndone, VIO::op, read, VIO::set_continuation(), VIO::vc_server, ClusterVConnState::vio, and MIOBufferAccessor::writer_for().
virtual void ClusterVConnectionBase::do_io_shutdown | ( | ShutdownHowTo_t | howto | ) | [inline, virtual] |
Terminate one or both directions of the VConnection.
Indicates that one or both sides of the VConnection should be terminated. After this call is issued, no further I/O can be done on the specified direction of the connection. The processor must not send any further events (including timeout events) to the state machine, and the state machine must not use any VIOs from a shutdown direction of the connection. Even if both sides of a connection are shutdown, the state machine must still call do_io_close() when it wishes the VConnection to be deallocated.
Possible howto values
Value | Meaning |
IO_SHUTDOWN_READ | Indicates that this VConnection should not generate any more read events |
IO_SHUTDOWN_WRITE | Indicates that this VConnection should not generate any more write events |
IO_SHUTDOWN_READWRITE | Indicates that this VConnection should not generate any more read nor write events |
howto | Specifies which direction of the VConnection to shutdown. |
Reimplemented from CacheVConnection.
Definition at line 347 of file P_ClusterCache.h.
References ink_assert.
VIO * ClusterVConnectionBase::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 |
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 |
Implements CacheVConnection.
Reimplemented in ClusterVConnection.
Definition at line 122 of file ClusterVConnection.cc.
References VIO::buffer, closed, ClusterVConnState::enabled, ink_assert, VIO::nbytes, VIO::ndone, VIO::op, MIOBufferAccessor::reader_for(), VIO::set_continuation(), VIO::vc_server, ClusterVConnState::vio, and write.
void ClusterVConnectionBase::reenable | ( | VIO * | vio | ) | [virtual] |
Implements CacheVConnection.
Reimplemented in ClusterVConnection.
Definition at line 165 of file ClusterVConnection.cc.
References VIO::buffer, closed, ClusterVConnState::enabled, ink_assert, read, IOBufferReader::read_avail(), MIOBufferAccessor::reader(), ClusterVConnState::vio, write, MIOBuffer::write_avail(), and MIOBufferAccessor::writer().
Referenced by reenable_re().
void ClusterVConnectionBase::reenable_re | ( | VIO * | vio | ) | [virtual] |
Implements CacheVConnection.
Definition at line 186 of file ClusterVConnection.cc.
References reenable().
void ClusterVConnectionBase::set_active_timeout | ( | ink_hrtime | timeout_in | ) | [inline] |
Definition at line 392 of file P_ClusterCache.h.
References Action::cancel(), Action::cancelled, Event::ethread, ink_assert, EThread::schedule_in(), Event::schedule_in(), this_ethread(), and thread.
void ClusterVConnectionBase::set_inactivity_timeout | ( | ink_hrtime | timeout_in | ) | [inline] |
Definition at line 411 of file P_ClusterCache.h.
References Action::cancel(), Action::cancelled, Event::ethread, inactivity_timeout, inactivity_timeout_in, ink_assert, EThread::schedule_in(), Event::schedule_in(), this_ethread(), and thread.
Definition at line 375 of file P_ClusterCache.h.
Referenced by clusterVCAllocator_free(), ClusterProcessor::connect_local(), ClusterHandler::do_open_local_requests(), CacheContinuation::lookupOpenWriteVC(), ClusterProcessor::open_local(), CacheContinuation::remoteOpEvent(), and ClusterVConnection::start().
Definition at line 385 of file P_ClusterCache.h.
Referenced by cancel_active_timeout(), and ClusterHandler::close_ClusterVConnection().
Definition at line 383 of file P_ClusterCache.h.
Referenced by cancel_active_timeout().
volatile int ClusterVConnectionBase::closed |
Definition at line 377 of file P_ClusterCache.h.
Referenced by ClusterHandler::close_ClusterVConnection(), ClusterHandler::cluster_signal_and_update(), ClusterHandler::cluster_signal_and_update_locked(), ClusterHandler::complete_channel_read(), do_io_close(), do_io_read(), do_io_write(), ClusterHandler::protoZombieEvent(), reenable(), ClusterHandler::remote_close(), ClusterVConnection::schedule_write(), ClusterHandler::vc_ok_read(), ClusterHandler::vc_ok_write(), and ClusterVConnection::was_closed().
Definition at line 384 of file P_ClusterCache.h.
Referenced by cancel_inactivity_timeout(), ClusterHandler::close_ClusterVConnection(), and set_inactivity_timeout().
Definition at line 382 of file P_ClusterCache.h.
Referenced by cancel_inactivity_timeout(), and set_inactivity_timeout().
Definition at line 378 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_freespace_descriptors(), ClusterHandler::build_initial_vector(), ChannelToCacheWriteVC(), ClusterHandler::close_ClusterVConnection(), ClusterHandler::close_free_lock(), cluster_reschedule_offset(), cluster_schedule(), ClusterVC_enqueue_read(), ClusterVC_remove_read(), ClusterVConnection::ClusterVConnection(), ClusterHandler::complete_channel_read(), ClusterHandler::compute_active_channels(), do_io_close(), do_io_read(), ClusterHandler::finish_delayed_reads(), ClusterHandler::free_locks(), ClusterHandler::get_read_locks(), ClusterHandler::protoZombieEvent(), reenable(), ClusterVConnection::set_disk_io_priority(), ClusterVConnection::set_http_info(), ClusterVConnection::set_pin_in_cache(), ClusterVConnection::start(), ClusterHandler::update_channels_partial_read(), ClusterHandler::update_channels_read(), ClusterHandler::valid_for_freespace_write(), and ClusterHandler::vc_ok_read().
Definition at line 376 of file P_ClusterCache.h.
Referenced by set_active_timeout(), and set_inactivity_timeout().
Definition at line 379 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_write_descriptors(), ClusterHandler::close_ClusterVConnection(), cluster_reschedule_offset(), ClusterVC_enqueue_write(), ClusterVC_remove_write(), ClusterVConnection::ClusterVConnection(), ClusterHandler::compute_active_channels(), do_io_close(), do_io_write(), ClusterHandler::get_write_locks(), ClusterHandler::protoZombieEvent(), reenable(), ClusterVConnection::set_disk_io_priority(), ClusterVConnection::set_http_info(), ClusterVConnection::set_pin_in_cache(), ClusterVConnection::start(), ClusterHandler::update_channels_written(), ClusterHandler::valid_for_data_write(), and ClusterHandler::vc_ok_write().