| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.18) on Wed Mar 01 02:01:42 GMT 2023 --> |
| <title>CacheCore (Heron Java API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2023-03-01"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery/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="../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../jquery/jquery-3.6.0.min.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-ui.min.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="CacheCore (Heron Java API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <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="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.heron.metricscachemgr.metricscache</a></div> |
| <h2 title="Class CacheCore" class="title">Class CacheCore</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.heron.metricscachemgr.metricscache.CacheCore</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public class <span class="typeNameLabel">CacheCore</span> |
| extends java.lang.Object</pre> |
| <div class="block">Cache Engine to store metrics and exceptions in memory and to respond to query, |
| implementing insertion and selection methods: |
| 1. Storage for metrics: timestamp_start -(tree)-> [sparse: bucket_id -(map)-> metric bucket] |
| 2. Storage for exceptions: idxComponentInstance -(hash)-> exception bucket |
| 3. Index for metrics: |
| a. metricName -(map)-> idxMetricName (int: locator) |
| b. component -(map)-> instance -(map)-> idxComponentInstance (int: locator) |
| bucket_id is Long from idxComponentInstance Integer and idxMetricName Integer combined |
| 4. Index for exceptions: |
| component -(map)-> instance -(map)-> idxComponentInstance (int: locator) |
| 5. Query pattern: component-instance (equality), metricName (equality), timestamp (range) |
| Different from tmanager: |
| 1. order bucket by metric timestamp rather than metric message arriving time |
| 2. free buckets for instances that are gone during scaling process |
| 3. lock for multiple threads |
| Same as tmanager: |
| 1. support same protobuf message/request format</div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(java.time.Duration,java.time.Duration,long)">CacheCore</a></span>​(java.time.Duration maxInterval, |
| java.time.Duration interval, |
| long maxException)</code></th> |
| <td class="colLast"> |
| <div class="block">constructor: CacheCore needs two intervals to configure metrics time window |
| and one number to limit exception count</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addMetricException(org.apache.heron.proto.tmanager.TopologyManager.PublishMetrics)">addMetricException</a></span>​(<a href="../../proto/tmanager/TopologyManager.PublishMetrics.html" title="class in org.apache.heron.proto.tmanager">TopologyManager.PublishMetrics</a> metrics)</code></th> |
| <td class="colLast"> |
| <div class="block">compatible with heron::tmanager::TMetricsCollector</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#componentInstanceExists(java.lang.String,java.lang.String)">componentInstanceExists</a></span>​(java.lang.String componentName, |
| java.lang.String instanceId)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="query/ExceptionResponse.html" title="class in org.apache.heron.metricscachemgr.metricscache.query">ExceptionResponse</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getExceptions(org.apache.heron.metricscachemgr.metricscache.query.ExceptionRequest)">getExceptions</a></span>​(<a href="query/ExceptionRequest.html" title="class in org.apache.heron.metricscachemgr.metricscache.query">ExceptionRequest</a> request)</code></th> |
| <td class="colLast"> |
| <div class="block">for internal process use</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="query/MetricResponse.html" title="class in org.apache.heron.metricscachemgr.metricscache.query">MetricResponse</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMetrics(org.apache.heron.metricscachemgr.metricscache.query.MetricRequest,org.apache.heron.spi.metricsmgr.metrics.MetricsFilter)">getMetrics</a></span>​(<a href="query/MetricRequest.html" title="class in org.apache.heron.metricscachemgr.metricscache.query">MetricRequest</a> request, |
| <a href="../../spi/metricsmgr/metrics/MetricsFilter.html" title="class in org.apache.heron.spi.metricsmgr.metrics">MetricsFilter</a> metricNameType)</code></th> |
| <td class="colLast"> |
| <div class="block">for internal process use</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#metricExists(java.lang.String)">metricExists</a></span>​(java.lang.String name)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#purge()">purge</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#startPurge(org.apache.heron.common.basics.WakeableLooper)">startPurge</a></span>​(<a href="../../common/basics/WakeableLooper.html" title="class in org.apache.heron.common.basics">WakeableLooper</a> wakeableLooper)</code></th> |
| <td class="colLast"> |
| <div class="block">start purge looper task</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#stopPurge()">stopPurge</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">stop metric purge looper</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>(java.time.Duration,java.time.Duration,long)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>CacheCore</h4> |
| <pre>public CacheCore​(java.time.Duration maxInterval, |
| java.time.Duration interval, |
| long maxException)</pre> |
| <div class="block">constructor: CacheCore needs two intervals to configure metrics time window |
| and one number to limit exception count</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>maxInterval</code> - metric: cache how long time?</dd> |
| <dd><code>interval</code> - metric: purge how often?</dd> |
| <dd><code>maxException</code> - exception: cache how many?</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="componentInstanceExists(java.lang.String,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>componentInstanceExists</h4> |
| <pre class="methodSignature">public boolean componentInstanceExists​(java.lang.String componentName, |
| java.lang.String instanceId)</pre> |
| </li> |
| </ul> |
| <a id="metricExists(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>metricExists</h4> |
| <pre class="methodSignature">public boolean metricExists​(java.lang.String name)</pre> |
| </li> |
| </ul> |
| <a id="addMetricException(org.apache.heron.proto.tmanager.TopologyManager.PublishMetrics)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addMetricException</h4> |
| <pre class="methodSignature">public void addMetricException​(<a href="../../proto/tmanager/TopologyManager.PublishMetrics.html" title="class in org.apache.heron.proto.tmanager">TopologyManager.PublishMetrics</a> metrics)</pre> |
| <div class="block">compatible with heron::tmanager::TMetricsCollector</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>metrics</code> - The metrics to be added</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getMetrics(org.apache.heron.metricscachemgr.metricscache.query.MetricRequest,org.apache.heron.spi.metricsmgr.metrics.MetricsFilter)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getMetrics</h4> |
| <pre class="methodSignature">public <a href="query/MetricResponse.html" title="class in org.apache.heron.metricscachemgr.metricscache.query">MetricResponse</a> getMetrics​(<a href="query/MetricRequest.html" title="class in org.apache.heron.metricscachemgr.metricscache.query">MetricRequest</a> request, |
| <a href="../../spi/metricsmgr/metrics/MetricsFilter.html" title="class in org.apache.heron.spi.metricsmgr.metrics">MetricsFilter</a> metricNameType)</pre> |
| <div class="block">for internal process use</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>request</code> - <p> |
| idxMetricName == null: query all metrics |
| idxMetricName == []: query none metric |
| idxMetricName == [a, b, c .. ]: query metric a, b and c, .. |
| <p> |
| idxComponentInstance == null: query all components |
| idxComponentInstance == []: query none component |
| idxComponentInstance == [c1->null, ..]: query all instances of c1, .. |
| idxComponentInstance == [c1->[], ..]: query none instance of c1, .. |
| idxComponentInstance == [c1->[a, b, c, ..], ..]: query instance a, b, c, .. of c1, .. |
| <p> |
| assert: startTime <= endTime</dd> |
| <dd><code>metricNameType</code> - map: metric name to type</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>query result</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getExceptions(org.apache.heron.metricscachemgr.metricscache.query.ExceptionRequest)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getExceptions</h4> |
| <pre class="methodSignature">public <a href="query/ExceptionResponse.html" title="class in org.apache.heron.metricscachemgr.metricscache.query">ExceptionResponse</a> getExceptions​(<a href="query/ExceptionRequest.html" title="class in org.apache.heron.metricscachemgr.metricscache.query">ExceptionRequest</a> request)</pre> |
| <div class="block">for internal process use</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>request</code> - <p> |
| idxComponentInstance == null: query all components |
| idxComponentInstance == []: query none component |
| idxComponentInstance == [c1->null, ..]: query all instances of c1, .. |
| idxComponentInstance == [c1->[], ..]: query none instance of c1, .. |
| idxComponentInstance == [c1->[a, b, c, ..], ..]: query instance a, b, c, .. of c1, ..</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>query result</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="purge()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>purge</h4> |
| <pre class="methodSignature">public void purge()</pre> |
| </li> |
| </ul> |
| <a id="startPurge(org.apache.heron.common.basics.WakeableLooper)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>startPurge</h4> |
| <pre class="methodSignature">public void startPurge​(<a href="../../common/basics/WakeableLooper.html" title="class in org.apache.heron.common.basics">WakeableLooper</a> wakeableLooper)</pre> |
| <div class="block">start purge looper task</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>wakeableLooper</code> - the looper to run timer</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="stopPurge()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>stopPurge</h4> |
| <pre class="methodSignature">public void stopPurge()</pre> |
| <div class="block">stop metric purge looper</div> |
| </li> |
| </ul> |
| <a id="toString()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public java.lang.String toString()</pre> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code>toString</code> in class <code>java.lang.Object</code></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <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="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| </footer> |
| </body> |
| </html> |