BIND 10 #2850: Define and implement ZoneTableSegmentMapped

BIND 10 Development do-not-reply at isc.org
Fri Mar 15 07:02:11 UTC 2013


#2850: Define and implement ZoneTableSegmentMapped
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:
  jinmei                             |                Status:  new
                       Type:  task   |             Milestone:  Next-Sprint-
                   Priority:         |  Proposed
  medium                             |              Keywords:
                  Component:  data   |             Sensitive:  0
  source                             |           Sub-Project:  DNS
               CVSS Scoring:         |  Estimated Difficulty:  0
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
  shared memory data source          |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
 Subtask of #2830.  Depend on #2833.

 Should be an obvious extension for supporting mapped-file segments.

 The `ZoneTableHeader` in this segment should be referenced as a named
 address, using `get/setNamedAddress("zone-table-header")`.

 We'll add a new virtual method.  See below.

 {{{#!cpp
 class ZoneTableSegmentMapped {
 public:

     // Unmap the current file (if mapped) and map the specified one.
     //
     // mode is one of: CREATE, READ_WRITE, READ_ONLY
     // if CREATE, remove any existing file will be removed and new one is
     // created in the read-write mode.  If READ_WRITE, the specified file
     // must exist and will be opened in the read-write mode.  If
 READ_ONLY,
     // the specified file must exist and will be opened in the read-only
 mode.
     //
     // If the current one was in the read-write mode, shrink the segment
 using
     // shrinkToFit then update the checksum.  checksum should be
     // calculated by: retrieve a uint32_t field by
     // getNamedAddress("zone_table_checksum"), clear it, call
     // MemorySegmentMapped::getCheckSum(), and write that value to the
     // field.
     //
     // If the new map is in the read-write mode, validate the checksum in
     // the same way.
     //
     // params should look like:
     //   {"mapped-file": "/var/bind10/mapped-files/zone-sqlite3.mapped.0"}
     //
     // On failure throw an exception; it should basically be considered
 fatal
     // at a higher layer.
     virtual void reset(MemorySegmentMode mode, ConstElementPtr params);
 private:
     // Internally holds MemorySegmentMapped.  Cleared on construction,
     // and has to be set by reset().
     scoped_ptr<isc::util::MemorySegmentMapped> mem_sgmt_;
 };
 }}}

 Also, if not yet, make `getZoneWriter` non virtual at this point.
 zone writer won't depend on the underlying memory segment in the end.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2850>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list