PrG_Superfile_Overview.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <sect1 id="SuperFile_Overview" role="nobrk">
  5. <title>SuperFile Overview</title>
  6. <para>First, let's define some terms:</para>
  7. <para><informaltable colsep="0" frame="none" rowsep="0">
  8. <tgroup cols="2">
  9. <colspec align="left" colwidth="81.35pt" />
  10. <colspec />
  11. <tbody>
  12. <row>
  13. <entry><emphasis role="bold">Logical File</emphasis></entry>
  14. <entry>A single logical entity whose multiple physical parts (one
  15. on each node of the cluster) are internally managed by the
  16. Distributed File Utility (DFU).</entry>
  17. </row>
  18. <row>
  19. <entry><emphasis role="bold">Dataset</emphasis></entry>
  20. <entry>A Logical File declared as a DATASET.</entry>
  21. </row>
  22. <row>
  23. <entry><emphasis role="bold">SuperFile</emphasis></entry>
  24. <entry>A managed list of sub-files (Logical Files) treated as a
  25. single logical entity. The sub-files do not need DATASET
  26. declarations (although they may have). A SuperFile must be
  27. declared as a DATASET for use in ECL, and is treated in ECL code
  28. just like any other Dataset. The complexities of managing the
  29. multiple sub-files are left up to the DFU (just as it manages the
  30. physical parts of each sub-file).</entry>
  31. </row>
  32. </tbody>
  33. </tgroup>
  34. </informaltable></para>
  35. <para><emphasis role="bold">Each sub-file in a SuperFile must have the same
  36. structure type (THOR, CSV, or XML) and the same field layout.</emphasis> A
  37. sub-file may itself be a SuperFile, allowing you to build multi-level
  38. hierarchies that allow easy maintenance. The functions that build and
  39. maintain SuperFiles are all in the File standard library (see the
  40. <emphasis>Standard Library Reference</emphasis>).</para>
  41. <para>The major advantage of using SuperFiles is the easy maintenance of the
  42. set of sub-files. This means that updating the actual data a query reads can
  43. be as simple as adding a new sub-file to an existing SuperFile.</para>
  44. <sect2 id="SuperFile_Existence_Functions">
  45. <title>SuperFile Existence Functions</title>
  46. <para>The following functions govern SuperFile creation, deletion, and
  47. existence detection:</para>
  48. <programlisting>CreateSuperFile()
  49. DeleteSuperFile()
  50. SuperFileExists()</programlisting>
  51. <para>You must first create a SuperFile using the CreateSuperFile()
  52. function before you can perform any other SuperFile operations on that
  53. file. The SuperFileExists() function tells you if a SuperFile with the
  54. specified name exists, and DeleteSuperFile() removes a SuperFile from the
  55. system.</para>
  56. </sect2>
  57. <sect2 id="SuperFile_Inquiry_Functions">
  58. <title>SuperFile Inquiry Functions</title>
  59. <para>The following functions provide information about a given
  60. SuperFile:</para>
  61. <programlisting>GetSuperFileSubCount()
  62. GetSuperFileSubName()
  63. FindSuperFileSubName()
  64. SuperFileContents()
  65. LogicalFileSuperOwners() </programlisting>
  66. <para>The GetSuperFileSubCount() function allows you to determine the
  67. number of sub-files in a given SuperFile. The GetSuperFileSubName()
  68. function returns the name of the sub-file at a given position in the list
  69. of sub-files. The FindSuperFileSubName() function returns the ordinal
  70. position of a given sub-file in the list of sub-files. The
  71. SuperFileContents() function returns a recordset of logical sub-file names
  72. contained in the SuperFile. The LogicalFileSuperOwners function returns a
  73. list of all the SuperFiles that contain a specified sub-file.</para>
  74. </sect2>
  75. <sect2 id="SuperFile_Maintenance_Functions">
  76. <title>SuperFile Maintenance Functions</title>
  77. <para>The following functions allow you to maintain the list of sub-files
  78. that comprise a SuperFile:</para>
  79. <programlisting>AddSuperFile()
  80. RemoveSuperFile()
  81. ClearSuperFile()
  82. SwapSuperFile()
  83. ReplaceSuperFile()</programlisting>
  84. <para>The AddSuperFile() function adds a sub-file to the SuperFile. The
  85. RemoveSuperFile() function deletes a sub-file from the SuperFile. The
  86. ClearSuperFile() function deletes all sub-files from the SuperFile. The
  87. SwapSuperFile() function moves swaps all sub-files between two SuperFiles.
  88. The ReplaceSuperFile() function replaces one sub-file in the SuperFile
  89. with another.</para>
  90. <para>All of these functions must be called within a transaction frame to
  91. ensure there are no problems with SuperFile usage.</para>
  92. </sect2>
  93. <sect2 id="SuperFile_Transactions">
  94. <title>SuperFile Transactions</title>
  95. <para>The SuperFile Maintenance functions (only) must be called within a
  96. transaction frame if there is a possibility another process may try to use
  97. the superfile during sub-file maintenance. The transaction frame locks out
  98. all other operations for the duration of the transaction. This way,
  99. maintenance work can be accomplished without causing problems with any
  100. query that might use the SuperFile. This means two things:</para>
  101. <para>1) The SEQUENTIAL action must be used to ensure sequential execution
  102. of the function calls within the transaction frame.</para>
  103. <para>2) The StartSuperFileTransaction() and FinishSuperFileTransaction()
  104. functions are used to “lock” the SuperFile during maintenance, and always
  105. surround the SuperFile Maintenance function calls within the SEQUENTIAL
  106. action.</para>
  107. <para><emphasis role="bold">Any function other than the Maintenance
  108. Functions listed above that might be present inside a transaction frame
  109. might appear to be part of the transaction, but are not.</emphasis> This
  110. can lead to confusion if you, for example, include a call to
  111. ClearSuperFile() (which is valid for use within the transaction frame) and
  112. follow it with a call to DeleteSuperFile() (which is <emphasis
  113. role="underline">not</emphasis> valid for use within the transaction
  114. frame) then you will get an error, because the delete operation will occur
  115. outside the transaction frame, and before the ClearSuperFile() function
  116. has a chance to do its work.</para>
  117. </sect2>
  118. <sect2 id="Other_Useful_Functions">
  119. <title>Other Useful Functions</title>
  120. <para>The following functions, while not specifically designed for
  121. SuperFile use, are generally useful in creating and maintaining
  122. SuperFiles:</para>
  123. <programlisting>RemoteDirectory()
  124. ExternalLogicalFilename()
  125. LogicalFileList()
  126. LogicalFileSuperOwners()
  127. </programlisting>
  128. <para>Use of these functions will be described in the subsequent set of
  129. SuperFile articles.</para>
  130. </sect2>
  131. </sect1>