Public Types | Public Member Functions | Data Fields

VIO Class Reference

Descriptor for an IO operation. More...

#include <I_VIO.h>

Collaboration diagram for VIO:
Collaboration graph
[legend]

Public Types

enum  {
  NONE = 0, READ, WRITE, CLOSE,
  ABORT, SHUTDOWN_READ, SHUTDOWN_WRITE, SHUTDOWN_READWRITE,
  SEEK, PREAD, PWRITE, STAT
}

Public Member Functions

 ~VIO ()
Continuationget_continuation ()
 Interface for the VConnection that owns this handle.
void set_continuation (Continuation *cont)
void done ()
 Set nbytes to be what is current available.
int64_t ntodo ()
 Determine the number of bytes remaining.
void set_writer (MIOBuffer *writer)
void set_reader (IOBufferReader *reader)
MIOBufferget_writer ()
IOBufferReaderget_reader ()
inkcoreapi void reenable ()
 Reenable the IO operation.
inkcoreapi void reenable_re ()
 Reenable the IO operation.
 VIO (int aop)
 VIO ()

Data Fields

Continuation_cont
 Continuation to callback.
int64_t nbytes
 Number of bytes to be done for this operation.
int64_t ndone
 Number of bytes already completed.
int op
 Type of operation.
MIOBufferAccessor buffer
 Provides access to the reader or writer for this operation.
VConnectionvc_server
 Internal backpointer to the VConnection for use in the reenable functions.
Ptr< ProxyMutexmutex
 Reference to the state machine's mutex.

Detailed Description

Descriptor for an IO operation.

A VIO is a descriptor for an in progress IO operation. It is returned from do_io_read() and do_io_write() methods on VConnections. Through the VIO, the state machine can monitor the progress of an operation and reenable the operation when data becomes available.

The VIO operation represents several types of operations, and they can be identified through the 'op' member. It can take any of the following values:

Constant Meaning
READThe VIO represents a read operation
WRITEThe VIO represents a write operation
CLOSEThe VIO represents the request to close the VConnection
ABORT
SHUTDOWN_READ
SHUTDOWN_WRITE
SHUTDOWN_READWRITE
SEEK
PREAD
PWRITE
STAT

Definition at line 73 of file I_VIO.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
NONE 
READ 
WRITE 
CLOSE 
ABORT 
SHUTDOWN_READ 
SHUTDOWN_WRITE 
SHUTDOWN_READWRITE 
SEEK 
PREAD 
PWRITE 
STAT 

Definition at line 148 of file I_VIO.h.


Constructor & Destructor Documentation

VIO::~VIO (  )  [inline]

Definition at line 76 of file I_VIO.h.

TS_INLINE VIO::VIO ( int  aop  ) 

Definition at line 30 of file P_VIO.h.

TS_INLINE VIO::VIO (  ) 

Definition at line 46 of file P_VIO.h.


Member Function Documentation

TS_INLINE void VIO::done (  ) 

Set nbytes to be what is current available.

Interface to set nbytes to be ndone + buffer.reader()->read_avail() if a reader is set.

Definition at line 87 of file P_VIO.h.

References buffer, nbytes, ndone, IOBufferReader::read_avail(), and MIOBufferAccessor::reader().

TS_INLINE Continuation * VIO::get_continuation (  ) 

Interface for the VConnection that owns this handle.

Definition at line 57 of file P_VIO.h.

References _cont.

TS_INLINE IOBufferReader * VIO::get_reader (  ) 
TS_INLINE MIOBuffer * VIO::get_writer (  ) 

Definition at line 72 of file P_VIO.h.

References buffer, and MIOBufferAccessor::writer().

Referenced by TransformTerminus::handle_event(), and TSVIOBufferGet().

TS_INLINE int64_t VIO::ntodo (  ) 
TS_INLINE void VIO::reenable (  ) 

Reenable the IO operation.

Interface that the state machine uses to reenable an I/O operation. Reenable tells the VConnection that more data is available for the operation and that it should try to continue the operation in progress. I/O operations become disabled when they can make no forward progress. For a read this means that it's buffer is full. For a write, that it's buffer is empty. If reenable is called and progress is still not possible, it is ignored and no events are generated. However, unnecessary reenables (ones where no progress can be made) should be avoided as they hurt system throughput and waste CPU.

Definition at line 121 of file P_VIO.h.

References VConnection::reenable(), and vc_server.

Referenced by KeepAliveConn::append(), HttpTunnel::consumer_handler(), HttpTunnel::consumer_reenable(), UnixNetVConnection::do_io_read(), UnixNetVConnection::do_io_write(), ClusterState::doIO_write_event(), CacheTestSM::event_handler(), FetchSM::ext_read_data(), FetchSM::ext_write_data(), RangeTransform::handle_event(), NullTransform::handle_event(), PrefetchTransform::handle_event(), CacheContinuation::handleDisposeEvent(), ObjectReloadCont::ObjectReloadEvent(), FetchSM::process_fetch_read(), HttpTunnel::producer_handler(), NetVCTest::read_handler(), OneWayTunnel::reenable_all(), OneWayMultiTunnel::reenable_all(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), HttpSM::state_read_client_request_header(), HttpSM::state_read_push_response_header(), HttpSM::state_read_server_response_header(), HttpSM::state_send_server_request_header(), RangeTransform::transform_to_range(), TSVIOReenable(), and NetVCTest::write_handler().

TS_INLINE void VIO::reenable_re (  ) 

Reenable the IO operation.

Interface that the state machine uses to reenable an I/O operation. Reenable tells the VConnection that more data is available for the operation and that it should try to continue the operation in progress. I/O operations become disabled when they can make no forward progress. For a read this means that it's buffer is full. For a write, that it's buffer is empty. If reenable is called and progress is still not possible, it is ignored and no events are generated. However, unnecessary reenables (ones where no progress can be made) should be avoided as they hurt system throughput and waste CPU.

Definition at line 133 of file P_VIO.h.

References VConnection::reenable_re(), and vc_server.

Referenced by ClusterState::doIO_write_event(), and CacheContinuation::handleDisposeEvent().

TS_INLINE void VIO::set_continuation ( Continuation cont  ) 
TS_INLINE void VIO::set_reader ( IOBufferReader reader  ) 

Definition at line 67 of file P_VIO.h.

References buffer, and MIOBufferAccessor::reader_for().

TS_INLINE void VIO::set_writer ( MIOBuffer writer  ) 

Definition at line 62 of file P_VIO.h.

References buffer, and MIOBufferAccessor::writer_for().


Field Documentation

Provides access to the reader or writer for this operation.

Contains a pointer to the IOBufferReader if the operation is a write and a pointer to a MIOBuffer if the operation is a read.

Definition at line 199 of file I_VIO.h.

Referenced by TransformVConnection::backlog(), TestProxy::cacheTransRemoteToCacheFileEvent(), OneWayTunnel::close_source_vio(), OneWayTunnel::close_target_vio(), OneWayMultiTunnel::close_target_vio(), ClusterVConnection::ClusterVConnection(), UnixNetVConnection::do_io_close(), TransformTerminus::do_io_close(), INKVConnInternal::do_io_close(), ClusterVConnectionBase::do_io_close(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), UnixNetVConnection::do_io_shutdown(), TransformTerminus::do_io_shutdown(), INKVConnInternal::do_io_shutdown(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), ClusterState::doIO(), done(), ClusterHandler::finish_delayed_reads(), free_CacheVC(), ClusterHandler::get_read_locks(), get_reader(), get_writer(), TestProxy::gets(), CheckConnect::handle_connect(), OneWayMultiTunnel::init(), SSLNetVConnection::net_read_io(), CacheVC::openReadFromWriterMain(), CacheVC::openReadMain(), CacheVC::openWriteMain(), read_from_net(), ClusterVConnectionBase::reenable(), CacheVC::reenable(), TestProxy::sendEvent(), set_reader(), set_writer(), ssl_read_from_net(), TestProxy::startEvent(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), ClusterHandler::update_channels_partial_read(), ClusterHandler::update_channels_read(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), ClusterHandler::vc_ok_read(), ClusterHandler::vc_ok_write(), CacheContinuation::VCdataRead(), and write_to_net_io().

int64_t VIO::nbytes

Number of bytes to be done for this operation.

The total number of bytes this operation must complete.

Definition at line 172 of file I_VIO.h.

Referenced by ClusterHandler::build_write_descriptors(), ClusterHandler::compute_active_channels(), UnixNetVConnection::do_io_close(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), UnixNetVConnection::do_io_shutdown(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), ClusterState::doIO(), ClusterState::doIO_read_event(), ClusterState::doIO_write_event(), done(), CheckConnect::handle_connect(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), HttpSM::handle_server_setup_error(), CacheContinuation::handleDisposeEvent(), CacheVC::handleWrite(), SocksProxy::mainEvent(), SocksEntry::mainEvent(), ntodo(), CacheVC::openReadFromWriter(), print_netstate(), ClusterHandler::remote_close(), HttpSM::setup_server_read_response_header(), CacheContinuation::setupReadBufTunnel(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), HttpSM::state_read_client_request_header(), HttpSM::state_read_push_response_header(), HttpSM::state_read_server_response_header(), HttpSM::state_watch_for_client_abort(), RangeTransform::transform_to_range(), TSVIONBytesGet(), TSVIONBytesSet(), and HttpSM::tunnel_handler_transform_read().

int64_t VIO::ndone

Number of bytes already completed.

The number of bytes that already have been completed for the operation. Processor can update this value only if they hold the lock.

Definition at line 182 of file I_VIO.h.

Referenced by ClusterHandler::build_write_descriptors(), HttpTunnel::chain_abort_all(), CacheTestSM::check_buffer(), HttpTunnel::close_vc(), ClusterHandler::complete_channel_read(), ClusterHandler::compute_active_channels(), HttpTunnel::consumer_handler(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), ClusterState::doIO(), ClusterState::doIO_read_event(), ClusterState::doIO_write_event(), done(), CacheTestSM::event_handler(), CacheTestSM::fill_buffer(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), HttpSM::handle_server_setup_error(), CacheVC::handleReadDone(), CacheVC::handleWrite(), SocksProxy::mainEvent(), SocksEntry::mainEvent(), ntodo(), CacheVC::openReadFromWriterMain(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openWriteMain(), print_netstate(), HttpTunnel::producer_handler(), NetVCTest::read_finished(), read_from_net(), ClusterHandler::remote_close(), HttpSM::setup_server_read_response_header(), CacheContinuation::setupReadBufTunnel(), ssl_read_from_net(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), HttpSM::state_read_client_request_header(), HttpSM::state_read_push_response_header(), HttpSM::state_read_server_response_header(), HttpSM::state_watch_for_client_abort(), TSVIONDoneGet(), TSVIONDoneSet(), ClusterHandler::update_channels_written(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), CacheContinuation::VCdataRead(), NetVCTest::write_finished(), NetVCTest::write_handler(), and write_to_net_io().

int VIO::op

Type of operation.

The type of operation that this VIO represents.

Definition at line 190 of file I_VIO.h.

Referenced by ChannelToCacheWriteVC(), CacheVC::die(), UnixNetVConnection::do_io_close(), TransformTerminus::do_io_close(), INKVConnInternal::do_io_close(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), TransformTerminus::do_io_shutdown(), INKVConnInternal::do_io_shutdown(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), CacheVC::do_read_call(), free_CacheVC(), CheckConnect::handle_connect(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), CacheVC::handleReadDone(), CacheVC::is_ram_cache_hit(), Cache::lookup(), UnixNetVConnection::mainEvent(), SSLNetVConnection::net_read_io(), Cache::open_read(), Cache::open_write(), CacheVC::openReadStartEarliest(), print_netstate(), ClusterHandler::protoZombieEvent(), read_from_net(), PluginVC::reenable(), CacheVC::reenable(), PluginVC::reenable_re(), ClusterHandler::remote_close(), Cache::remove(), ClusterVConnection::set_disk_io_priority(), ClusterVConnection::set_http_info(), ClusterVConnection::set_pin_in_cache(), CacheVC::set_pin_in_cache(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), ClusterHandler::vc_ok_read(), ClusterHandler::vc_ok_write(), and write_to_net_io().


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