| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (16) --> |
| <title>CompressedRecordArray (OpenJ9 JDK 16)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: module: openj9.dtfj, package: com.ibm.j9ddr.corereaders.tdump.zebedee.util, class: CompressedRecordArray"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="com.ibm.j9ddr.corereaders.tdump.zebedee.util.CompressedRecordArray class"> |
| <meta name="keywords" content="add()"> |
| <meta name="keywords" content="close()"> |
| <meta name="keywords" content="get()"> |
| <meta name="keywords" content="memoryUsage()"> |
| <meta name="keywords" content="main()"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../../../../script-dir/jquery-3.5.1.min.js"></script> |
| <script type="text/javascript" src="../../../../../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var evenRowColor = "even-row-color"; |
| var oddRowColor = "odd-row-color"; |
| var tableTab = "table-tab"; |
| var activeTableTab = "active-table-tab"; |
| var pathtoroot = "../../../../../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar.top"> |
| <div class="skip-nav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <div class="about-language"><div style="margin-top: 9px;"><strong>OpenJ9 JDK 16</strong></div></div> |
| <ul id="navbar.top.firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../../../../../index.html">Overview</a></li> |
| <li><a href="../../../../../../../module-summary.html">Module</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="class-use/CompressedRecordArray.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../../../index-files/index-1.html">Index</a></li> |
| <li><a href="../../../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip.navbar.top"> |
| <!-- --> |
| </span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="module-label-in-type">Module</span> <a href="../../../../../../../module-summary.html">openj9.dtfj</a></div> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">com.ibm.j9ddr.corereaders.tdump.zebedee.util</a></div> |
| <h1 title="Class CompressedRecordArray" class="title">Class CompressedRecordArray</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link" target="_blank">java.lang.Object</a> |
| <div class="inheritance">com.ibm.j9ddr.corereaders.tdump.zebedee.util.CompressedRecordArray</div> |
| </div> |
| <section class="description"> |
| <dl class="notes"> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link" target="_blank">Serializable</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">CompressedRecordArray</span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link" target="_blank">Object</a> |
| implements <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link" target="_blank">Serializable</a></span></div> |
| <div class="block">This class represents an array of records which are stored in a compressed format whilst |
| still allowing random access to them. Each record in turn is simply an array of ints. Each |
| record must be the same length. To implement this we divide the array of records up into |
| blocks. There is an index and a bit stream. The index gives the start of each block in the |
| bit stream. Each block contains a set of records stored in an encoded format. A header at |
| the beginning defines the encoding used. The encoding is chosen dynamically to give the |
| best compression. Deltas (ie the differences between values in adjacent records) are stored |
| rather than the values themselves which gives good results for certain types of data. |
| The number of records per block is |
| configurable and there is a space/time trade-off to be made because a large number of |
| records per block will give better compression at the cost of more time to extract each |
| record (because you have to start at the beginning of the block and then uncompress each |
| record in turn until you reach the one you want). |
| <p> |
| I wrote a test to measure the performance on some real life data |
| (in fact this data is the reason I wrote this class in the first place). The data |
| consists of a file containing z/OS fpos_t objects obtained by calling fgetpos |
| sequentially for every block (4060 bytes) in an svcdump. Each fpos_t object is |
| actually an array of 8 ints containing obscure info about the disk geometry or |
| something, but the important thing is that it changes in a reasonably regular |
| fashion and so is a good candidate for compression via deltas. The original file |
| had a length of 3401088. Here are the results which suggest that a block size of |
| 32 (log2 of 5) is a good choice (the time is that taken to write the data and then read it |
| back again to check): |
| <p> |
| <table border="1"><tr><th>log2</th><th>block size</th><th>memory usage</th><th>time (ms)</th></tr> |
| <tr><td>0</td><td>1</td><td>4191388</td><td>782</td></tr> |
| <tr><td>1</td><td>2</td><td>2706992</td><td>691</td></tr> |
| <tr><td>2</td><td>4</td><td>1217920</td><td>621</td></tr> |
| <tr><td>3</td><td>8</td><td>790472</td><td>620</td></tr> |
| <tr><td>4</td><td>16</td><td>516772</td><td>721</td></tr> |
| <tr><td>5</td><td>32</td><td>340448</td><td>942</td></tr> |
| <tr><td>6</td><td>64</td><td>334304</td><td>1362</td></tr> |
| <tr><td>7</td><td>128</td><td>334304</td><td>2223</td></tr> |
| <tr><td>8</td><td>256</td><td>340448</td><td>3966</td></tr> |
| <tr><td>9</td><td>512</td><td>355808</td><td>7470</td></tr> |
| </table> |
| <p></div> |
| <dl class="notes"> |
| <dt>See Also:</dt> |
| <dd><a href="../../../../../../../../serialized-form.html#com.ibm.j9ddr.corereaders.tdump.zebedee.util.CompressedRecordArray">Serialized Form</a></dd> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor.summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table two-column-summary"> |
| <div class="table-header col-first">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-constructor-name even-row-color"><code><span class="member-name-link"><a href="#%3Cinit%3E(int,int)">CompressedRecordArray</a></span>​(int blockSizeLog2, |
| int recordSize)</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Create a new CompressedRecordArray.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method.summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"><code><span class="member-name-link"><a href="#add(int%5B%5D)">add</a></span>​(int[] record)</code></div> |
| <div class="col-last even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"> |
| <div class="block">Add a new record.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"><code><span class="member-name-link"><a href="#close()">close</a></span>()</code></div> |
| <div class="col-last odd-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"> |
| <div class="block">Close this CompressedRecordArray.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"><code><span class="member-name-link"><a href="#get(int,int%5B%5D)">get</a></span>​(int recordNumber, |
| int[] record)</code></div> |
| <div class="col-last even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"> |
| <div class="block">Get the given record number.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table-tab1 method-summary-table-tab4 method-summary-table"><code>static void</code></div> |
| <div class="col-second odd-row-color method-summary-table-tab1 method-summary-table-tab4 method-summary-table"><code><span class="member-name-link"><a href="#main(java.lang.String%5B%5D)">main</a></span>​(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link" target="_blank">String</a>[] args)</code></div> |
| <div class="col-last odd-row-color method-summary-table-tab1 method-summary-table-tab4 method-summary-table"> |
| <div class="block">This method is provided to test the CompressedRecordArray.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"><code>int</code></div> |
| <div class="col-second even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"><code><span class="member-name-link"><a href="#memoryUsage()">memoryUsage</a></span>()</code></div> |
| <div class="col-last even-row-color method-summary-table-tab2 method-summary-table-tab4 method-summary-table"> |
| <div class="block">Give a rough estimate of how many bytes of storage we use.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods.inherited.from.class.java.lang.Object">Methods declared in class java.lang.<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link" target="_blank">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link" target="_blank">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link" target="_blank">equals</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link" target="_blank">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link" target="_blank">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link" target="_blank">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link" target="_blank">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link" target="_blank">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link" target="_blank">toString</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link" target="_blank">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link" target="_blank">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link" target="_blank">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor.detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>(int,int)"> |
| <h3>CompressedRecordArray</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">CompressedRecordArray</span>​<span class="parameters">(int blockSizeLog2, |
| int recordSize)</span></div> |
| <div class="block">Create a new CompressedRecordArray. A size of 5 for blockSizeLog2 gives good results.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>blockSizeLog2</code> - the number of records in each block expressed as a power of 2</dd> |
| <dd><code>recordSize</code> - the number of ints in each record</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method.detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="add(int[])"> |
| <h3>add</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">add</span>​<span class="parameters">(int[] record)</span></div> |
| <div class="block">Add a new record. Data is copied from the given array.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>record</code> - an array of ints which forms the record to be added</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="close()"> |
| <h3>close</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">close</span>()</div> |
| <div class="block">Close this CompressedRecordArray. This must be called before any reading is done |
| and no more records may be added afterwards.</div> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="get(int,int[])"> |
| <h3>get</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">get</span>​<span class="parameters">(int recordNumber, |
| int[] record)</span></div> |
| <div class="block">Get the given record number. To save on GC overhead the user supplies the |
| int array to copy the record into.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>recordNumber</code> - the sequential number of the record to read</dd> |
| <dd><code>record</code> - the array to copy the record into</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="memoryUsage()"> |
| <h3>memoryUsage</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">memoryUsage</span>()</div> |
| <div class="block">Give a rough estimate of how many bytes of storage we use. This is the actual storage |
| allocated so may be more that what is in use at any one time.</div> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="main(java.lang.String[])"> |
| <h3>main</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type">void</span> <span class="element-name">main</span>​<span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link" target="_blank">String</a>[] args)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Exception.html" title="class or interface in java.lang" class="external-link" target="_blank">Exception</a></span></div> |
| <div class="block">This method is provided to test the CompressedRecordArray. We need to change this to use |
| unit tests at some point.</div> |
| <dl class="notes"> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Exception.html" title="class or interface in java.lang" class="external-link" target="_blank">Exception</a></code> - if anything bad happens</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small><a href="https://www.eclipse.org/openj9/" target="_blank">Eclipse OpenJ9 website.</a><br> To raise a bug report or suggest an improvement create an <a href="https://github.com/eclipse-openj9/openj9/issues" target="_blank">Eclipse Openj9 issue.</a><br> Copyright © 1998, 2021, IBM Corp. and others.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |