abstractmemorymonitor.html

来自「基于mondrian 开源框架进行OLAP多维分析」· HTML 代码 · 共 725 行 · 第 1/3 页

HTML
725
字号
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/util/AbstractMemoryMonitor.html#notifyListeners(long, long)">notifyListeners</A></B>(long&nbsp;usedMemory,                long&nbsp;maxMemory)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Notifies all <code>Listener</code>s that memory is running short.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/util/AbstractMemoryMonitor.html#notifyNewLowThreshold(long)">notifyNewLowThreshold</A></B>(long&nbsp;newLowThreshold)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Derived classes implement this method if they wish to be notified when there is a new lowest threshold.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/util/AbstractMemoryMonitor.html#removeAllListener()">removeAllListener</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clear out all <code>Listener</code>s and turnoff JVM memory notification.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/util/AbstractMemoryMonitor.html#removeListener(mondrian.util.MemoryMonitor.Listener)">removeListener</A></B>(<A HREF="../../mondrian/util/MemoryMonitor.Listener.html" title="interface in mondrian.util">MemoryMonitor.Listener</A>&nbsp;listener)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a <code>Listener</code> from the <code>MemoryMonitor</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/util/AbstractMemoryMonitor.html#resetFromTest()">resetFromTest</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This should only be called when one is switching from a test <code>MemoryMonitor</code> back to the default system <code>MemoryMonitor</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/util/AbstractMemoryMonitor.html#updateListenerThreshold(mondrian.util.MemoryMonitor.Listener, int)">updateListenerThreshold</A></B>(<A HREF="../../mondrian/util/MemoryMonitor.Listener.html" title="interface in mondrian.util">MemoryMonitor.Listener</A>&nbsp;listener,                        int&nbsp;percentage)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changes the threshold percentage of a given <code>Listener</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/util/AbstractMemoryMonitor.html#usagePercentage()">usagePercentage</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns how much memory is currently being used as a percentage.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_mondrian.util.MemoryMonitor"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from interface mondrian.util.<A HREF="../../mondrian/util/MemoryMonitor.html" title="interface in mondrian.util">MemoryMonitor</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../mondrian/util/MemoryMonitor.html#getMaxMemory()">getMaxMemory</A>, <A HREF="../../mondrian/util/MemoryMonitor.html#getUsedMemory()">getUsedMemory</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="AbstractMemoryMonitor()"><!-- --></A><H3>AbstractMemoryMonitor</H3><PRE>protected <B>AbstractMemoryMonitor</B>()</PRE><DL><DD>Constructor of this base class.<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getLogger()"><!-- --></A><H3>getLogger</H3><PRE>protected abstract org.apache.log4j.Logger <B>getLogger</B>()</PRE><DL><DD>Returns the <code>Logger</code>.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the <code>Logger</code>.</DL></DD></DL><HR><A NAME="getLowThreshold()"><!-- --></A><H3>getLowThreshold</H3><PRE>protected long <B>getLowThreshold</B>()</PRE><DL><DD>Returns the current lowest threshold of all registered <code>Listener</code>s.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the lowest threshold.</DL></DD></DL><HR><A NAME="getDefaultThresholdPercentage()"><!-- --></A><H3>getDefaultThresholdPercentage</H3><PRE>public int <B>getDefaultThresholdPercentage</B>()</PRE><DL><DD>Returns the default memory notification percentage. <p>This is the value of the Mondrian <A HREF="../../mondrian/olap/MondrianProperties.html#MemoryMonitorThreshold"><CODE>MondrianProperties.MemoryMonitorThreshold</CODE></A> property.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the default threshold percentage.</DL></DD></DL><HR><A NAME="addListener(mondrian.util.MemoryMonitor.Listener)"><!-- --></A><H3>addListener</H3><PRE>public boolean <B>addListener</B>(<A HREF="../../mondrian/util/MemoryMonitor.Listener.html" title="interface in mondrian.util">MemoryMonitor.Listener</A>&nbsp;listener)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../mondrian/util/MemoryMonitor.html#addListener(mondrian.util.MemoryMonitor.Listener)">MemoryMonitor</A></CODE></B></DD><DD>Adds a <code>Listener</code> using the default threshold percentage. <p>If the threshold is below the Java5 memory managment system's threshold, then the Listener is notified from within this method.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../mondrian/util/MemoryMonitor.html#addListener(mondrian.util.MemoryMonitor.Listener)">addListener</A></CODE> in interface <CODE><A HREF="../../mondrian/util/MemoryMonitor.html" title="interface in mondrian.util">MemoryMonitor</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the <code>Listener</code> to be added.<DT><B>Returns:</B><DD><code>true</code> if the <code>Listener</code> was added and <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="addListener(mondrian.util.MemoryMonitor.Listener, int)"><!-- --></A><H3>addListener</H3><PRE>public boolean <B>addListener</B>(<A HREF="../../mondrian/util/MemoryMonitor.Listener.html" title="interface in mondrian.util">MemoryMonitor.Listener</A>&nbsp;listener,                           int&nbsp;percentage)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../mondrian/util/MemoryMonitor.html#addListener(mondrian.util.MemoryMonitor.Listener, int)">MemoryMonitor</A></CODE></B></DD><DD>Adds a <code>Listener</code> to the <code>MemoryMonitor</code> with a given threshold percentage. <p>If the threshold is below the Java5 memory managment system's threshold, then the Listener is notified from within this method.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../mondrian/util/MemoryMonitor.html#addListener(mondrian.util.MemoryMonitor.Listener, int)">addListener</A></CODE> in interface <CODE><A HREF="../../mondrian/util/MemoryMonitor.html" title="interface in mondrian.util">MemoryMonitor</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the <code>Listener</code> to be added.<DD><CODE>percentage</CODE> - the threshold percentage for this   <code>Listener</code>.<DT><B>Returns:</B><DD><code>true</code> if the <code>Listener</code> was   added and <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="updateListenerThreshold(mondrian.util.MemoryMonitor.Listener, int)"><!-- --></A><H3>updateListenerThreshold</H3><PRE>public void <B>updateListenerThreshold</B>(<A HREF="../../mondrian/util/MemoryMonitor.Listener.html" title="interface in mondrian.util">MemoryMonitor.Listener</A>&nbsp;listener,                                    int&nbsp;percentage)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../mondrian/util/MemoryMonitor.html#updateListenerThreshold(mondrian.util.MemoryMonitor.Listener, int)">MemoryMonitor</A></CODE></B></DD><DD>Changes the threshold percentage of a given <code>Listener</code>. <p>If the new value is below the system's current value, then the <code>Listener</code> will have its notification callback called while in this method - so a client should always check if its notification method was called immediately after calling this method. <p>This method can be used if, for example, an algorithm has different approaches that result in different memory usage profiles; one, large memory but fast and a second which is low-memory but slow. The algorithm starts with the large memory approach, receives a low memory notification, switches to the low memory approach and changes when it should be notified for this new approach. The first approach need to be notified at a lower percentage because it uses lots of memory, possibly quickly; while the second

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?