com.avaje.ebean.config
Class AutofetchConfig

java.lang.Object
  extended by com.avaje.ebean.config.AutofetchConfig

public class AutofetchConfig
extends Object

Defines the Autofetch behaviour for a EbeanServer.


Constructor Summary
AutofetchConfig()
           
 
Method Summary
 int getGarbageCollectionWait()
          Return the time in millis to wait after a system gc to collect profiling information.
 String getLogDirectory()
          Return the log directory to put the autofetch log.
 String getLogDirectoryWithEval()
          Return the log directory substituting any expressions such as ${catalina.base} etc.
 AutofetchMode getMode()
          Return the mode used when autofetch has not been explicit defined on a query.
 int getProfileUpdateFrequency()
          Return the frequency in seconds to update the autofetch tuned queries from the profiled information.
 int getProfilingBase()
          Return the base number of queries to profile before changing to profile only a percentage of following queries (profileRate).
 int getProfilingMin()
          Return the minimum number of queries to profile before autofetch will start tuning the queries.
 double getProfilingRate()
          Return the rate (%) of queries to be profiled after the 'base' amount of profiling.
 boolean isProfiling()
          Return true if profiling information should be collected.
 boolean isQueryTuning()
          Return true if the queries are being tuned.
 boolean isQueryTuningAddVersion()
          Return true if the version property should be added when the query is tuned.
 boolean isUseFileLogging()
          Return true if a log file should be used to log the changes in autofetch query tuning.
 void loadSettings(com.avaje.ebean.config.ConfigPropertyMap p)
          Load the settings from the properties file.
 void setGarbageCollectionWait(int garbageCollectionWait)
          Set the time in millis to wait after a System.gc() to collect profiling information.
 void setLogDirectory(String logDirectory)
          Set the directory to put the autofetch log in.
 void setMode(AutofetchMode mode)
          Set the mode used when autofetch has not been explicit defined on a query.
 void setProfileUpdateFrequency(int profileUpdateFrequency)
          Set the frequency in seconds to update the autofetch tuned queries from the profiled information.
 void setProfiling(boolean profiling)
          Set to true if profiling information should be collected.
 void setProfilingBase(int profilingBase)
          Set the based number of queries to profile.
 void setProfilingMin(int profilingMin)
          Set the minimum number of queries to profile before autofetch will start tuning the queries.
 void setProfilingRate(double profilingRate)
          Set the rate (%) of queries to be profiled after the 'base' amount of profiling.
 void setQueryTuning(boolean queryTuning)
          Set to true if the queries should be tuned by autofetch.
 void setQueryTuningAddVersion(boolean queryTuningAddVersion)
          Set to true to force the version property to be always added by the query tuning.
 void setUseFileLogging(boolean useFileLogging)
          Set to true if a log file should be used to log the changes in autofetch query tuning.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutofetchConfig

public AutofetchConfig()
Method Detail

getMode

public AutofetchMode getMode()
Return the mode used when autofetch has not been explicit defined on a query.


setMode

public void setMode(AutofetchMode mode)
Set the mode used when autofetch has not been explicit defined on a query.


isQueryTuning

public boolean isQueryTuning()
Return true if the queries are being tuned.


setQueryTuning

public void setQueryTuning(boolean queryTuning)
Set to true if the queries should be tuned by autofetch.


isQueryTuningAddVersion

public boolean isQueryTuningAddVersion()
Return true if the version property should be added when the query is tuned.

If this is false then the version property will be added when profiling detects that the bean is possibly going to be modified.


setQueryTuningAddVersion

public void setQueryTuningAddVersion(boolean queryTuningAddVersion)
Set to true to force the version property to be always added by the query tuning.

If this is false then the version property will be added when profiling detects that the bean is possibly going to be modified.


isProfiling

public boolean isProfiling()
Return true if profiling information should be collected.


setProfiling

public void setProfiling(boolean profiling)
Set to true if profiling information should be collected.

The profiling information is collected and then used to generate the tuned queries for autofetch.


getProfilingMin

public int getProfilingMin()
Return the minimum number of queries to profile before autofetch will start tuning the queries.


setProfilingMin

public void setProfilingMin(int profilingMin)
Set the minimum number of queries to profile before autofetch will start tuning the queries.


getProfilingBase

public int getProfilingBase()
Return the base number of queries to profile before changing to profile only a percentage of following queries (profileRate).


setProfilingBase

public void setProfilingBase(int profilingBase)
Set the based number of queries to profile.


getProfilingRate

public double getProfilingRate()
Return the rate (%) of queries to be profiled after the 'base' amount of profiling.


setProfilingRate

public void setProfilingRate(double profilingRate)
Set the rate (%) of queries to be profiled after the 'base' amount of profiling.


isUseFileLogging

public boolean isUseFileLogging()
Return true if a log file should be used to log the changes in autofetch query tuning.


setUseFileLogging

public void setUseFileLogging(boolean useFileLogging)
Set to true if a log file should be used to log the changes in autofetch query tuning.


getLogDirectory

public String getLogDirectory()
Return the log directory to put the autofetch log.


getLogDirectoryWithEval

public String getLogDirectoryWithEval()
Return the log directory substituting any expressions such as ${catalina.base} etc.


setLogDirectory

public void setLogDirectory(String logDirectory)
Set the directory to put the autofetch log in.


getProfileUpdateFrequency

public int getProfileUpdateFrequency()
Return the frequency in seconds to update the autofetch tuned queries from the profiled information.


setProfileUpdateFrequency

public void setProfileUpdateFrequency(int profileUpdateFrequency)
Set the frequency in seconds to update the autofetch tuned queries from the profiled information.


getGarbageCollectionWait

public int getGarbageCollectionWait()
Return the time in millis to wait after a system gc to collect profiling information.

The profiling information is collected on object finalise. As such we generally don't want to trigger GC (let the JVM do its thing) but on shutdown the autofetch manager will trigger System.gc() and then wait (default 100 millis) to hopefully collect profiling information - especially for short run unit tests.


setGarbageCollectionWait

public void setGarbageCollectionWait(int garbageCollectionWait)
Set the time in millis to wait after a System.gc() to collect profiling information.


loadSettings

public void loadSettings(com.avaje.ebean.config.ConfigPropertyMap p)
Load the settings from the properties file.



Copyright © 2010. All Rights Reserved.