Thrill  0.1

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

- Public Types inherited from singleton< disk_queues >
using instance_pointer = instance_type *
 
using instance_type = disk_queues
 
using volatile_instance_pointer = volatile instance_pointer
 
- Static Public Member Functions inherited from singleton< disk_queues >
static instance_pointer create_instance ()
 create instance of SubInstanceType and move into singleton More...
 
static void destroy_instance ()
 destroy singleton and mark as invalid More...
 
static instance_pointer get_instance ()
 return instance or create base instance if empty More...
 
static instance_typeget_ref ()
 

Member Typedef Documentation

◆ disk_id_type

using disk_id_type = int64_t
private

Definition at line 43 of file disk_queues.hpp.

◆ request_queue_map

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()

disk_queues ( )
protected

Definition at line 26 of file disk_queues.cpp.

References singleton< stats >::get_instance().

◆ ~disk_queues()

Definition at line 31 of file disk_queues.cpp.

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

Member Function Documentation

◆ add_request()

◆ cancel_request()

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_.

◆ get_queue()

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_.

◆ make_queue()

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_.

◆ set_priority_op()

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

◆ mutex_

◆ queues_


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