Skip to content

Commit 69ce53c

Browse files
committed
Fix for MONDRIAN-1224. Updates doc with details on how access the CacheControl API from an olap4j connection.
1 parent 2dc5c8d commit 69ce53c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/cache_control.html

+13
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ <h3>Contents</h3>
3232
<li><a href="#A_simple_example">A simple example</a></li>
3333
<li><a href="#More_about_cell_regions">More about cell regions</a></li>
3434
<li><a href="#Merging_and_truncating_segments">Merging and truncating segments</a></li>
35+
<li><a href="#Accessing_the_CacheControl_API_through_olap4j">Accessing the CacheControl API through olap4j</a></li>
3536
</ol>
3637
</li>
3738
<li><a href="#Other_cache_control_topics">Other cache control topics</a><ol>
@@ -304,6 +305,18 @@ <h4>3.3. Merging and truncating segments<a name="Merging_and_truncating_segments
304305

305306
<p>It might also be useful to be able to merge segments which have the same dimensionality, to reduce fragmentation if the cache is flushed repeatedly over slightly different bounds. There are some limitations on when this can be done, since predicates can only constrain one column: it would not be possible to merge the segments
306307
<code>{(State=TX, Quarter=Q2)}</code> and <code>{(State=WA, Quarter=Q3)}</code> into a single segment, for example. An alternative solution to fragmentation would be to simply remove all segments of a particular dimensionality if fragmentation is detected.</p>
308+
309+
<h4>3.4. Accessing the CacheControl API through olap4j<a name="Accessing_the_CacheControl_API_through_olap4j">&nbsp;</a></h4>
310+
311+
<p>The CacheControl API is specific to Mondrian and is part of its private APIs. If your application was written at a higher abstraction level, say using olap4j,
312+
you will need to 'unwrap' the connection first and gain access to its private functions. With an olap4j connection, this can be done like so:</p>
313+
314+
<blockquote><code>
315+
OlapConnection olapConnection;<br/>
316+
Connection privateConnection = olapConnection.unwrap(RolapConnection.class);<br/>
317+
CacheControl cacheControl = privateConnection.getCacheControl(null);<br/>
318+
</code></blockquote>
319+
307320
<h3>4. Other cache control topics<a name="Other_cache_control_topics">&nbsp;</a></h3>
308321

309322
<h4>4.1. Flushing the dimension cache<a name="Flushing_the_dimension_cache">&nbsp;</a></h4>

0 commit comments

Comments
 (0)