#include <P_ClusterCache.h>
Inherits ClusterVConnectionBase.
Definition at line 483 of file P_ClusterCache.h.
ClusterVConnection::ClusterVConnection | ( | int | is_new_connect_read = 0 |
) |
Definition at line 191 of file ClusterVConnection.cc.
References VIO::buffer, ClusterVConnectionBase::read, SET_HANDLER, startEvent(), ClusterVConnState::vio, and ClusterVConnectionBase::write.
ClusterVConnection::~ClusterVConnection | ( | ) |
Definition at line 227 of file ClusterVConnection.cc.
References free().
void ClusterVConnection::allow_close | ( | ) |
Definition at line 412 of file ClusterVConnection.cc.
References close_disabled.
void ClusterVConnection::allow_remote_close | ( | ) |
Definition at line 433 of file ClusterVConnection.cc.
References remote_close_disabled.
Referenced by CacheContinuation::disposeOfDataBuffer(), ClusterVConnectionCacheEvent::eventHandler(), CacheContinuation::remoteOpEvent(), and CacheContinuation::replyOpEvent().
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.
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 |
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. |
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 |
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 |
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 | ( | ) |
Definition at line 233 of file ClusterVConnection.cc.
References alternate, byte_bank_q, ByteBankDescriptor::ByteBankDescriptor_free(), Queue< C, L >::dequeue(), marshal_buf, read_block, remote_write_block, write_bytes_in_transit, write_list, write_list_bytes, and write_list_tail.
Referenced by clusterVCAllocator_free(), and ~ClusterVConnection().
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.
id | Identifier associated to interpret the data field | |
data | Value or pointer with state machine or VConnection data. |
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.
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 | ( | ) |
Definition at line 438 of file ClusterVConnection.cc.
References ClusterVConnectionBase::closed, DEFAULT_MAX_BUFFER_SIZE, remote_closed, write_list, write_list_bytes, and write_list_tail.
Referenced by ClusterHandler::valid_for_data_write(), and ClusterHandler::valid_for_freespace_write().
bool ClusterVConnection::set_disk_io_priority | ( | int | priority | ) | [virtual] |
Implements CacheVConnection.
Definition at line 612 of file ClusterVConnection.cc.
References ch, channel, SetChanPriorityMessage::channel, clusterProcessor, disk_io_priority, SetChanPriorityMessage::disk_priority, ink_release_assert, ClusterProcessor::invoke_remote(), ClusterHandler::machine, ClusterMachine::msg_proto_major, n_set_data_msgs, VIO::NONE, VIO::op, SetChanPriorityMessage::protoToVersion(), ClusterVConnectionBase::read, ClusterVCToken::sequence_number, SetChanPriorityMessage::sequence_number, SET_CHANNEL_PRIORITY_CLUSTER_FUNCTION, SetChanPriorityMessage::SET_CHANNEL_PRIORITY_MESSAGE_VERSION, SetChanPriorityMessage::sizeof_fixedlen_msg(), token, ClusterVConnState::vio, and ClusterVConnectionBase::write.
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] |
Definition at line 517 of file ClusterVConnection.cc.
References ALLOCA_DOUBLE, ch, channel, SetChanDataMessage::channel, clusterProcessor, SetChanDataMessage::data_type, ink_release_assert, ClusterProcessor::invoke_remote(), ClusterHandler::machine, memcpy, ClusterMachine::msg_proto_major, n_set_data_msgs, VIO::NONE, VIO::op, SetChanDataMessage::protoToVersion(), ClusterVConnectionBase::read, ClusterVCToken::sequence_number, SetChanDataMessage::sequence_number, SET_CHANNEL_DATA_CLUSTER_FUNCTION, SetChanDataMessage::SET_CHANNEL_DATA_MESSAGE_VERSION, SetChanDataMessage::sizeof_fixedlen_msg(), token, ClusterVConnState::vio, and ClusterVConnectionBase::write.
bool ClusterVConnection::set_pin_in_cache | ( | time_t | time_pin | ) | [virtual] |
Implements CacheVConnection.
Definition at line 572 of file ClusterVConnection.cc.
References ch, channel, SetChanPinMessage::channel, clusterProcessor, ink_release_assert, ClusterProcessor::invoke_remote(), ClusterHandler::machine, ClusterMachine::msg_proto_major, n_set_data_msgs, VIO::NONE, VIO::op, SetChanPinMessage::pin_time, SetChanPinMessage::protoToVersion(), ClusterVConnectionBase::read, ClusterVCToken::sequence_number, SetChanPinMessage::sequence_number, SET_CHANNEL_PIN_CLUSTER_FUNCTION, SetChanPinMessage::SET_CHANNEL_PIN_MESSAGE_VERSION, SetChanPinMessage::sizeof_fixedlen_msg(), time_pin, token, ClusterVConnState::vio, and ClusterVConnectionBase::write.
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 | ) |
Definition at line 468 of file ClusterVConnection.cc.
References new_connect_read, and pending_remote_fill.
Referenced by CacheContinuation::remoteOpEvent(), and CacheContinuation::setupReadWriteVC().
ClusterVConnection::SLINK | ( | ClusterVConnection | , | |
ready_alink | ||||
) |
int ClusterVConnection::start | ( | EThread * | t | ) |
Definition at line 306 of file ClusterVConnection.cc.
References ClusterVConnectionBase::action_, ClusterHandler::alloc_channel(), ch, channel, CL_TRACE, CLUSTER_CONNECT_RETRY, CLUSTER_EVENT_OPEN, CLUSTER_EVENT_OPEN_FAILED, cluster_schedule(), clusterVCAllocator_free(), Action::continuation, Debug, ECLUSTER_NO_MACHINE, ECLUSTER_NOMORE_CHANNELS, Continuation::handleEvent(), iov_map, Continuation::mutex, Action::mutex, MUTEX_TRY_LOCK, new_connect_read, new_ProxyMutex(), pending_remote_fill, ClusterVConnectionBase::read, EThread::schedule_in(), and ClusterVConnectionBase::write.
Referenced by ClusterProcessor::connect_local(), ClusterHandler::do_open_local_requests(), ClusterProcessor::open_local(), and startEvent().
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 | ( | ) |
Definition at line 406 of file ClusterVConnection.cc.
References close_disabled, and ClusterVConnectionBase::closed.
Referenced by ClusterHandler::update_channels_written(), ClusterHandler::valid_for_data_write(), and ClusterHandler::valid_for_freespace_write().
int ClusterVConnection::was_remote_closed | ( | ) |
Definition at line 424 of file ClusterVConnection.cc.
References byte_bank_q, DLL< C, L >::head, remote_close_disabled, and remote_closed.
Referenced by ClusterHandler::valid_for_data_write(), and ClusterHandler::valid_for_freespace_write().
Definition at line 579 of file P_ClusterCache.h.
Referenced by free(), get_http_info(), get_object_size(), and CacheContinuation::remoteOpEvent().
Definition at line 552 of file P_ClusterCache.h.
Referenced by ClusterHandler::add_to_byte_bank(), ClusterHandler::close_ClusterVConnection(), ClusterHandler::finish_delayed_reads(), free(), ClusterHandler::get_read_locks(), ClusterHandler::update_channels_read(), and was_remote_closed().
Definition at line 521 of file P_ClusterCache.h.
Referenced by ClusterHandler::close_ClusterVConnection(), ClusterProcessor::connect_local(), do_io_close(), do_io_read(), do_io_write(), ClusterProcessor::open_local(), ClusterHandler::protoZombieEvent(), reenable(), set_disk_io_priority(), set_http_info(), set_pin_in_cache(), start(), and ClusterHandler::vcs_push().
Definition at line 534 of file P_ClusterCache.h.
Referenced by ClusterHandler::alloc_channel(), ClusterHandler::build_freespace_descriptors(), ClusterHandler::build_write_descriptors(), ClusterHandler::close_ClusterVConnection(), ClusterHandler::complete_channel_read(), ClusterProcessor::connect_local(), ClusterVConnectionBase::do_io_read(), ClusterHandler::finish_delayed_reads(), ClusterHandler::free_channel(), ClusterHandler::get_read_locks(), CacheContinuation::localVCsetupEvent(), set_disk_io_priority(), set_http_info(), set_pin_in_cache(), CacheContinuation::setup_local_vc(), start(), ClusterHandler::update_channels_partial_read(), and ClusterHandler::valid_for_freespace_write().
volatile int ClusterVConnection::close_disabled |
Definition at line 536 of file P_ClusterCache.h.
Referenced by allow_close(), disable_close(), and was_closed().
Definition at line 561 of file P_ClusterCache.h.
Referenced by cache_op_ClusterFunction(), do_io_close(), CacheContinuation::localVCsetupEvent(), and CacheContinuation::setup_local_vc().
Definition at line 581 of file P_ClusterCache.h.
Referenced by get_disk_io_priority(), and set_disk_io_priority().
Definition at line 558 of file P_ClusterCache.h.
Referenced by ClusterHandler::close_ClusterVConnection(), CacheContinuation::remoteOpEvent(), and ClusterHandler::valid_for_freespace_write().
volatile uint32_t ClusterVConnection::in_vcs |
Definition at line 540 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_freespace_descriptors(), ClusterHandler::build_write_descriptors(), clusterVCAllocator_free(), and ClusterHandler::vcs_push().
Definition at line 559 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::complete_channel_read(), and ClusterHandler::valid_for_freespace_write().
Definition at line 565 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::compute_active_channels(), start(), and ClusterHandler::update_channels_partial_read().
Definition at line 551 of file P_ClusterCache.h.
Referenced by ClusterProcessor::connect_local(), ClusterProcessor::open_local(), ClusterHandler::update_channels_partial_read(), ClusterHandler::update_channels_read(), and ClusterHandler::update_channels_written().
Definition at line 533 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_freespace_descriptors(), ClusterHandler::compute_active_channels(), and ClusterHandler::valid_for_freespace_write().
Definition at line 571 of file P_ClusterCache.h.
Referenced by free(), and CacheContinuation::remoteOpEvent().
Definition at line 554 of file P_ClusterCache.h.
Referenced by set_channel_data_ClusterFunction(), set_channel_pin_ClusterFunction(), and set_channel_priority_ClusterFunction().
Definition at line 553 of file P_ClusterCache.h.
Referenced by post_setchan_pin_ClusterFunction(), post_setchan_priority_ClusterFunction(), post_setchan_send_ClusterFunction(), set_disk_io_priority(), set_http_info(), set_pin_in_cache(), and ClusterHandler::valid_for_data_write().
Definition at line 531 of file P_ClusterCache.h.
Referenced by ClusterProcessor::connect_local(), ClusterProcessor::open_local(), set_type(), and start().
volatile int ClusterVConnection::pending_remote_fill |
Definition at line 555 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_controlmsg_descriptors(), ClusterHandler::build_initial_vector(), cache_op_ClusterFunction(), ClusterHandler::complete_channel_read(), CacheContinuation::disposeOfDataBuffer(), ClusterHandler::get_read_locks(), CacheContinuation::localVCsetupEvent(), CacheContinuation::remoteOpEvent(), CacheContinuation::replyOpEvent(), set_type(), start(), ClusterHandler::update_channels_partial_read(), ClusterHandler::update_channels_read(), ClusterHandler::update_channels_written(), ClusterHandler::valid_for_data_write(), and ClusterHandler::valid_for_freespace_write().
Definition at line 556 of file P_ClusterCache.h.
Referenced by ClusterHandler::add_to_byte_bank(), ClusterHandler::build_initial_vector(), ClusterHandler::close_ClusterVConnection(), free(), ClusterHandler::get_read_locks(), ClusterHandler::update_channels_partial_read(), ClusterHandler::update_channels_read(), and ClusterHandler::valid_for_freespace_write().
Definition at line 567 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::close_ClusterVConnection(), ClusterHandler::close_free_lock(), ClusterHandler::free_locks(), ClusterHandler::get_read_locks(), ClusterHandler::update_channels_partial_read(), and ClusterHandler::update_channels_read().
volatile int ClusterVConnection::remote_close_disabled |
Definition at line 538 of file P_ClusterCache.h.
Referenced by allow_remote_close(), and was_remote_closed().
volatile int ClusterVConnection::remote_closed |
Definition at line 537 of file P_ClusterCache.h.
Referenced by close_channel_ClusterFunction(), ClusterHandler::close_ClusterVConnection(), CacheContinuation::disposeOfDataBuffer(), CacheContinuation::localVCsetupEvent(), ClusterHandler::remote_close(), CacheContinuation::remoteOpEvent(), CacheContinuation::replyOpEvent(), schedule_write(), and was_remote_closed().
Definition at line 532 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_write_descriptors(), ClusterHandler::compute_active_channels(), ClusterHandler::process_freespace_msgs(), and ClusterHandler::valid_for_data_write().
volatile int ClusterVConnection::remote_lerrno |
Definition at line 539 of file P_ClusterCache.h.
Referenced by close_channel_ClusterFunction(), and ClusterHandler::remote_close().
Definition at line 557 of file P_ClusterCache.h.
Referenced by is_ram_cache_hit(), and set_ram_cache_hit().
Definition at line 560 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_controlmsg_descriptors(), ClusterHandler::build_initial_vector(), free(), and ClusterHandler::update_channels_written().
Definition at line 550 of file P_ClusterCache.h.
Referenced by ClusterHandler::close_ClusterVConnection(), ClusterProcessor::connect_local(), and ClusterProcessor::open_local().
time_t ClusterVConnection::time_pin |
Definition at line 580 of file P_ClusterCache.h.
Referenced by get_pin_in_cache(), and set_pin_in_cache().
Definition at line 535 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_freespace_descriptors(), ClusterHandler::build_initial_vector(), ClusterHandler::build_write_descriptors(), ChannelToCacheWriteVC(), close_channel_ClusterFunction(), ClusterHandler::close_ClusterVConnection(), ClusterProcessor::connect_local(), ClusterHandler::do_open_local_requests(), ClusterHandler::get_read_locks(), ClusterHandler::get_write_locks(), CacheContinuation::lookupOpenWriteVC(), ClusterProcessor::open_local(), set_disk_io_priority(), set_http_info(), set_pin_in_cache(), ClusterHandler::update_channels_partial_read(), ClusterHandler::update_channels_read(), and ClusterHandler::update_channels_written().
volatile uint32_t ClusterVConnection::type |
Definition at line 541 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_freespace_descriptors(), ClusterHandler::build_write_descriptors(), close_channel_ClusterFunction(), cluster_schedule(), clusterVCAllocator_free(), do_io_close(), do_io_read(), do_io_write(), reenable(), CacheContinuation::replyOpEvent(), and ClusterHandler::vcs_push().
Definition at line 577 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::close_ClusterVConnection(), ClusterHandler::cluster_signal_and_update(), ClusterHandler::cluster_signal_and_update_locked(), free(), ClusterHandler::protoZombieEvent(), ClusterHandler::update_channels_written(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), and ClusterHandler::vc_ok_write().
Definition at line 574 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::build_write_descriptors(), ClusterHandler::close_ClusterVConnection(), ClusterHandler::cluster_signal_and_update(), ClusterHandler::cluster_signal_and_update_locked(), free(), ClusterHandler::protoZombieEvent(), schedule_write(), ClusterHandler::valid_for_data_write(), and ClusterHandler::vc_ok_write().
Definition at line 576 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::build_write_descriptors(), ClusterHandler::close_ClusterVConnection(), free(), ClusterHandler::protoZombieEvent(), schedule_write(), and ClusterHandler::valid_for_data_write().
Definition at line 575 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::close_ClusterVConnection(), free(), ClusterHandler::protoZombieEvent(), schedule_write(), and ClusterHandler::valid_for_data_write().
Definition at line 568 of file P_ClusterCache.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::build_write_descriptors(), ClusterHandler::close_ClusterVConnection(), ClusterHandler::close_free_lock(), ClusterHandler::free_locks(), ClusterHandler::get_write_locks(), and ClusterHandler::valid_for_data_write().