You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2013/09/20 18:43:11 UTC

svn commit: r1525050 [4/4] - in /qpid/branches/linearstore/qpid: cpp/src/ cpp/src/qpid/legacystore/jrnl/ cpp/src/qpid/linearstore/ cpp/src/qpid/linearstore/jrnl/ cpp/src/qpid/linearstore/jrnl/utils/ tools/src/py/linearstore/

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/wmgr.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/wmgr.h?rev=1525050&r1=1525049&r2=1525050&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/wmgr.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/wmgr.h Fri Sep 20 16:43:10 2013
@@ -67,9 +67,9 @@ namespace qls_jrnl
         aio_cb** _fhdr_aio_cb_arr;      ///< Array of iocb pointers for file header writes
         uint32_t _cached_offset_dblks;  ///< Amount of unwritten data in page (dblocks)
         std::deque<data_tok*> _ddtokl;  ///< Deferred dequeue data_tok list
-        uint32_t _jfsize_dblks;         ///< Journal file size in dblks (NOT sblks!)
-        uint32_t _jfsize_pgs;           ///< Journal file size in cache pages
-        uint16_t _num_jfiles;           ///< Number of files used in iocb mallocs
+//        uint32_t _jfsize_dblks;         ///< Journal file size in dblks (NOT sblks!)
+//        uint32_t _jfsize_pgs;           ///< Journal file size in cache pages
+//        uint16_t _num_jfiles;           ///< Number of files used in iocb mallocs
 
         // TODO: Convert _enq_busy etc into a proper threadsafe lock
         // TODO: Convert to enum? Are these encodes mutually exclusive?

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/management-schema.xml
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/management-schema.xml?rev=1525050&r1=1525049&r2=1525050&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/management-schema.xml (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/management-schema.xml Fri Sep 20 16:43:10 2013
@@ -22,15 +22,15 @@
   <class name="Store">
     <property name="brokerRef"               type="objId"  access="RO" references="qpid.Broker" index="y" parentRef="y"/>
     <property name="location"                type="sstr"   access="RO"              desc="Logical directory on disk"/>
-    <property name="defaultInitialFileCount" type="uint16" access="RO" unit="file"  desc="Default number of files initially allocated to each journal"/>
-    <property name="defaultDataFileSize"     type="uint32" access="RO" unit="RdPg"  desc="Default size of each journal data file"/>
+    <!--property name="defaultInitialFileCount" type="uint16" access="RO" unit="file"  desc="Default number of files initially allocated to each journal"/-->
+    <!--property name="defaultDataFileSize"     type="uint32" access="RO" unit="RdPg"  desc="Default size of each journal data file"/-->
     <property name="tplIsInitialized"        type="bool"   access="RO"              desc="Transaction prepared list has been initialized by a transactional prepare"/>
     <property name="tplDirectory"            type="sstr"   access="RO"              desc="Transaction prepared list directory"/>
     <property name="tplWritePageSize"        type="uint32" access="RO" unit="byte"  desc="Page size in transaction prepared list write-page-cache"/>
     <property name="tplWritePages"           type="uint32" access="RO" unit="wpage" desc="Number of pages in transaction prepared list write-page-cache"/>
-    <property name="tplInitialFileCount"     type="uint16" access="RO" unit="file"  desc="Number of files initially allocated to transaction prepared list journal"/>
-    <property name="tplDataFileSize"         type="uint32" access="RO" unit="byte"  desc="Size of each journal data file in transaction prepared list journal"/>
-    <property name="tplCurrentFileCount"     type="uint32" access="RO" unit="file"  desc="Number of files currently allocated to transaction prepared list journal"/>
+    <!--property name="tplInitialFileCount"     type="uint16" access="RO" unit="file"  desc="Number of files initially allocated to transaction prepared list journal"/-->
+    <!--property name="tplDataFileSize"         type="uint32" access="RO" unit="byte"  desc="Size of each journal data file in transaction prepared list journal"/-->
+    <!--property name="tplCurrentFileCount"     type="uint32" access="RO" unit="file"  desc="Number of files currently allocated to transaction prepared list journal"/-->
 
     <statistic name="tplTransactionDepth"    type="hilo32"  unit="txn"    desc="Number of currently enqueued prepared transactions"/>
     <statistic name="tplTxnPrepares"         type="count64" unit="record" desc="Total transaction prepares on transaction prepared list"/>
@@ -48,11 +48,11 @@
     <property name="writePages"         type="uint32" access="RO" unit="wpage" desc="Number of pages in write-page-cache"/>
     <property name="readPageSize"       type="uint32" access="RO" unit="byte"  desc="Page size in read-page-cache"/>
     <property name="readPages"          type="uint32" access="RO" unit="rpage" desc="Number of pages in read-page-cache"/>
-    <property name="initialFileCount"   type="uint16" access="RO" unit="file"  desc="Number of files initially allocated to this journal"/>
-    <property name="autoExpand"         type="bool"   access="RO"              desc="Auto-expand enabled"/>
-    <property name="currentFileCount"   type="uint16" access="RO" unit="file"  desc="Number of files currently allocated to this journal"/>
-    <property name="maxFileCount"       type="uint16" access="RO" unit="file"  desc="Max number of files allowed for this journal"/>
-    <property name="dataFileSize"       type="uint32" access="RO" unit="byte"  desc="Size of each journal data file"/>
+    <!--property name="initialFileCount"   type="uint16" access="RO" unit="file"  desc="Number of files initially allocated to this journal"/-->
+    <!--property name="autoExpand"         type="bool"   access="RO"              desc="Auto-expand enabled"/-->
+    <!--property name="currentFileCount"   type="uint16" access="RO" unit="file"  desc="Number of files currently allocated to this journal"/-->
+    <!--property name="maxFileCount"       type="uint16" access="RO" unit="file"  desc="Max number of files allowed for this journal"/-->
+    <!--property name="dataFileSize"       type="uint32" access="RO" unit="byte"  desc="Size of each journal data file"/-->
 
     <statistic name="recordDepth"       type="hilo32"  unit="record" desc="Number of currently enqueued records (durable messages)"/>
     <statistic name="enqueues"          type="count64" unit="record" desc="Total enqueued records on journal"/>
@@ -76,13 +76,13 @@
     <statistic name="writePageCacheDepth" type="hilo32"  unit="wpage"  desc="Current depth of write-page-cache"/>
     <statistic name="readPageCacheDepth"  type="hilo32"  unit="rpage"  desc="Current depth of read-page-cache"/>
 
-    <method name="expand" desc="Increase number of files allocated for this journal">
+    <!--method name="expand" desc="Increase number of files allocated for this journal">
       <arg name="by" type="uint32" dir="I" desc="Number of files to increase journal size by"/>
-    </method>
+    </method-->
   </class>
 
   <eventArguments>
-    <arg name="autoExpand" type="bool"   desc="Journal auto-expand enabled"/>
+    <!--arg name="autoExpand" type="bool"   desc="Journal auto-expand enabled"/-->
     <arg name="fileSize"   type="uint32" desc="Journal file size in bytes"/>
     <arg name="jrnlId"     type="sstr"   desc="Journal Id"/>
     <arg name="numEnq"     type="uint32" desc="Number of recovered enqueues"/>

Modified: qpid/branches/linearstore/qpid/tools/src/py/linearstore/efptool.py
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/tools/src/py/linearstore/efptool.py?rev=1525050&r1=1525049&r2=1525050&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/tools/src/py/linearstore/efptool.py (original)
+++ qpid/branches/linearstore/qpid/tools/src/py/linearstore/efptool.py Fri Sep 20 16:43:10 2013
@@ -30,6 +30,8 @@ DEFAULT_SBLK_SIZE = 4096 # 32 dblks
 DEFAULT_SBLK_SIZE_KB = DEFAULT_SBLK_SIZE / 1024
 DEFAULT_EFP_DIR_NAME = 'efp'
 DEFAULT_JRNL_EXTENTION = '.jrnl'
+DEFAULT_FHDR_MAGIC = 'QLSf'
+DEFAULT_JRNL_VERSION = 2
 
 def get_directory_size(directory_name):
     ''' Decode the directory name in the format NNNk to a numeric size, where NNN is a number string '''
@@ -52,7 +54,7 @@ class InvalidPartitionDirectoryError(Efp
 
 class Header:
     ''' Abstract class for encoding the initial part of the header struct which is common across all journal headers '''
-    FORMAT = '=4sBBHQ'
+    FORMAT = '<4s2HQ'
     HDR_VER = 2
     def __init__(self, magic, hdr_ver, flags, rid):
         self.magic = magic
@@ -64,26 +66,27 @@ class Header:
         return self.magic == r'\0'*4
     def encode(self):
         ''' Encode the members of this struct to a binary string for writing to disk '''
-        return pack(Header.FORMAT, self.magic, self.hdr_ver, 0xff, self.flags, self.rid)
+        return pack(Header.FORMAT, self.magic, self.hdr_ver, self.flags, self.rid)
 
 
 class FileHeader(Header):
     ''' Class for encoding journal file headers to disk '''
-    FORMAT = '=3Q2L2QH'
-    def __init__(self, magic, hdr_ver, flags, rid, fro, ts_sec, ts_ns, file_cnt, file_size, file_number, file_name):
+    FORMAT = '<2HL5QH'
+    def __init__(self, magic, hdr_ver, flags, rid, fhdr_size_sblks, efp_partition, file_size_kib, fro, ts_sec, ts_ns, file_number, queue_name):
         Header.__init__(self, magic, hdr_ver, flags, rid)
+        self.fhdr_size_sblks = fhdr_size_sblks
+        self.efp_partition = efp_partition
+        self.file_size_kib = file_size_kib
         self.fro = fro
         self.ts_sec = ts_sec
         self.ts_ns = ts_ns
-        self.file_cnt = file_cnt
-        self.file_size = file_size
         self.file_number = file_number
-        self.file_name = file_name
+        self.queue_name = queue_name
     def encode(self):
         ''' Encode the members of this struct to a binary string for writing to disk '''
-        return Header.encode(self) + pack(FileHeader.FORMAT, self.fro, self.ts_sec, self.ts_ns, self.file_cnt,
-                                          0xffffffff, self.file_size, self.file_number,
-                                          len(self.file_name)) + self.file_name
+        return Header.encode(self) + pack(FileHeader.FORMAT, self.fhdr_size_sblks, self.efp_partition.partition_num,
+                                          0xffffffff, self.file_size_kib, self.fro, self.ts_sec, self.ts_ns,
+                                          self.file_number, len(self.queue_name)) + self.queue_name
 
 
 class EfpArgParser(argparse.ArgumentParser):
@@ -214,7 +217,7 @@ class EmptyFilePool:
     def create_new_efp_file(self):
         ''' Create a single new empty journal file of the prescribed size for this EFP '''
         file_name = str(uuid4()) + DEFAULT_JRNL_EXTENTION
-        file_header = FileHeader(r'\0\0\0\0', 0, 0, 0, 0, 0, 0, 0, self.file_size_kb, 0, file_name)
+        file_header = FileHeader(DEFAULT_FHDR_MAGIC, DEFAULT_JRNL_VERSION, 0, 0, 1, self.partition, self.file_size_kb, 0, 0, 0, 0, '')
         efh = file_header.encode()
         efh_bytes = len(efh)
         f = open(os.path.join(self.directory, file_name), 'wb')
@@ -258,11 +261,14 @@ class Partition:
         return s
     def validate_efp_directory(self):
         ''' Check that the partition directory is valid '''
-        if os.path.exists(self.efp_directory):
-            if not os.path.isdir(self.efp_directory):
-                raise InvalidPartitionDirectoryError
+        if os.path.isdir(self.root_path):
+            if os.path.exists(self.efp_directory):
+                if not os.path.isdir(self.efp_directory):
+                    raise InvalidPartitionDirectoryError
+            else:
+                os.mkdir(self.efp_directory)
         else:
-            os.mkdir(self.efp_directory)
+            raise InvalidPartitionDirectoryError
         # TODO: Add checks for permissions to write and sufficient space
     def read(self):
         ''' Read the partition, identifying EFP directories. Read each EFP directory found. '''



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org