Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
disk_queues Class Reference

Detailed Description

Encapsulates disk queues.

Remarks
is a singleton

Definition at line 39 of file disk_queues.hpp.

+ Inheritance diagram for disk_queues:
+ Collaboration diagram for disk_queues:

#include <disk_queues.hpp>

Public Member Functions

 ~disk_queues ()
 
void add_request (request_ptr &req, disk_id_type disk)
 
bool cancel_request (request_ptr &req, disk_id_type disk)
 
request_queueget_queue (disk_id_type disk)
 
void make_queue (file *file)
 
void set_priority_op (const request_queue::priority_op &op)
 
- Public Member Functions inherited from singleton< disk_queues >
 singleton ()=default
 
 singleton (const singleton &)=delete
 non-copyable: delete copy-constructor More...
 
singletonoperator= (const singleton &)=delete
 non-copyable: delete assignment operator More...
 

Protected Member Functions

 disk_queues ()
 

Protected Attributes

std::mutex mutex_
 
request_queue_map queues_
 

Private Types

using disk_id_type = int64_t
 
using request_queue_map = std::map< disk_id_type, request_queue * >
 

Additional Inherited Members

- Static Public Member Functions inherited from singleton< disk_queues >
static instance_pointer get_instance ()
 
static instance_typeget_ref ()
 

Member Typedef Documentation

using disk_id_type = int64_t
private

Definition at line 43 of file disk_queues.hpp.

using request_queue_map = std::map<disk_id_type, request_queue*>
private

Definition at line 44 of file disk_queues.hpp.

Constructor & Destructor Documentation

disk_queues ( )
protected

Definition at line 26 of file disk_queues.cpp.

References singleton< stats >::get_instance().

Definition at line 31 of file disk_queues.cpp.

References disk_queues::mutex_, and disk_queues::queues_.

Member Function Documentation

bool cancel_request ( request_ptr req,
disk_id_type  disk 
)

Cancel a request. The specified request is canceled unless already being processed. However, cancelation cannot be guaranteed. Cancelled requests must still be waited for in order to ensure correct operation.

Parameters
reqrequest to cancel
diskdisk number for disk that req was scheduled on
Returns
true iff the request was canceled successfully

Definition at line 87 of file disk_queues.cpp.

References disk_queues::mutex_, and disk_queues::queues_.

request_queue * get_queue ( disk_id_type  disk)

Definition at line 100 of file disk_queues.cpp.

References disk_queues::mutex_, and disk_queues::queues_.

void make_queue ( file file)

Definition at line 39 of file disk_queues.cpp.

References file::get_queue_id(), disk_queues::mutex_, and disk_queues::queues_.

void set_priority_op ( const request_queue::priority_op op)

Changes requests priorities.

Parameters
opone of:
  • READ, read requests are served before write requests within a disk queue
  • WRITE, write requests are served before read requests within a disk queue
  • NONE, read and write requests are served by turns, alternately

Definition at line 110 of file disk_queues.cpp.

References disk_queues::mutex_, and disk_queues::queues_.

Referenced by buffered_writer< block_type >::buffered_writer().

Member Data Documentation


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