001: /**
002: * Sequoia: Database clustering technology.
003: * Copyright (C) 2002-2004 French National Institute For Research In Computer
004: * Science And Control (INRIA).
005: * Contact: sequoia@continuent.org
006: *
007: * Licensed under the Apache License, Version 2.0 (the "License");
008: * you may not use this file except in compliance with the License.
009: * You may obtain a copy of the License at
010: *
011: * http://www.apache.org/licenses/LICENSE-2.0
012: *
013: * Unless required by applicable law or agreed to in writing, software
014: * distributed under the License is distributed on an "AS IS" BASIS,
015: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016: * See the License for the specific language governing permissions and
017: * limitations under the License.
018: *
019: * Initial developer(s): Nicolas Modrzyk.
020: * Contributor(s):
021: */package org.continuent.sequoia.common.jmx.mbeans;
022:
023: import org.continuent.sequoia.common.exceptions.DataCollectorException;
024: import org.continuent.sequoia.common.jmx.monitoring.AbstractDataCollector;
025:
026: /**
027: * DataCollector interface to used via JMX. This interface defines the entry
028: * point to collect dynamic data for all Sequoia components.
029: *
030: * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
031: */
032: public interface DataCollectorMBean {
033:
034: // ****************************************//
035: // *************** Controller Data ********//
036: // ****************************************//
037:
038: /**
039: * Get general information on the load of the controller. Get the number of
040: * threads and total memory used up
041: *
042: * @throws DataCollectorException if collection of information fails
043: * @return array of strings
044: */
045: String[][] retrieveControllerLoadData()
046: throws DataCollectorException;
047:
048: /**
049: * Get dynamic data of the different virtual databases, like pending
050: * connections size, currentNb of threads and number of active threads.
051: *
052: * @throws DataCollectorException if collection of information fails
053: * @return array of strings
054: */
055: String[][] retrieveVirtualDatabasesData()
056: throws DataCollectorException;
057:
058: /**
059: * Try to see if a virtual database exists from its name
060: *
061: * @param name of the virtual database
062: * @return true if exists, false otherwise
063: */
064: boolean hasVirtualDatabase(String name);
065:
066: // ****************************************//
067: // *************** Database Data **********//
068: // ****************************************//
069:
070: /**
071: * Get the current SQL statistics for all databases
072: *
073: * @throws DataCollectorException if collection of information fails
074: * @return the statistics
075: */
076: String[][] retrieveSQLStats() throws DataCollectorException;
077:
078: /**
079: * Get the current cache content for all databases
080: *
081: * @throws DataCollectorException if collection of information fails
082: * @return the cache content
083: */
084: String[][] retrieveCacheData() throws DataCollectorException;
085:
086: /**
087: * Get the current cache stats content for all databases
088: *
089: * @throws DataCollectorException if collection of information fails
090: * @return the cache stats content
091: */
092: String[][] retrieveCacheStatsData() throws DataCollectorException;
093:
094: /**
095: * Get the current list of backends data for all databases
096: *
097: * @throws DataCollectorException if collection of information fails
098: * @return the backend list content
099: */
100: String[][] retrieveBackendsData() throws DataCollectorException;
101:
102: /**
103: * Get the current list of current users and associated data for all databases
104: *
105: * @throws DataCollectorException if collection of information fails
106: * @return data on users
107: */
108: String[][] retrieveClientsData() throws DataCollectorException;
109:
110: /**
111: * Get the current SQL statistics
112: *
113: * @param virtualDatabasename of the database to get the data from
114: * @return the statistics
115: * @throws DataCollectorException if collection of information fails
116: */
117: String[][] retrieveSQLStats(String virtualDatabasename)
118: throws DataCollectorException;
119:
120: /**
121: * Get the current cache content
122: *
123: * @param virtualDatabasename of the database to get the data from
124: * @return the cache content
125: * @throws DataCollectorException if collection of information fails
126: */
127: String[][] retrieveCacheData(String virtualDatabasename)
128: throws DataCollectorException;
129:
130: /**
131: * Get the current cache stats content
132: *
133: * @param virtualDatabasename of the database to get the data from
134: * @return the cache stats content
135: * @throws DataCollectorException if collection of information fails
136: */
137: String[][] retrieveCacheStatsData(String virtualDatabasename)
138: throws DataCollectorException;
139:
140: /**
141: * Get the current list of backends data
142: *
143: * @param virtualDatabasename of the database to get the data from
144: * @return the backend list content
145: * @throws DataCollectorException if collection of information fails
146: */
147: String[][] retrieveBackendsData(String virtualDatabasename)
148: throws DataCollectorException;
149:
150: /**
151: * Retrive information about the scheduler, like number of pending requests,
152: * number of writes executed and number of read executed
153: *
154: * @param virtualDatabasename of the database to get the data from
155: * @return data on the associated scheduler
156: * @throws DataCollectorException if collection of data fails
157: */
158: String[][] retrieveSchedulerData(String virtualDatabasename)
159: throws DataCollectorException;
160:
161: /**
162: * Get the current list of current users and associated data
163: *
164: * @param virtualDatabasename of the database to get the data from
165: * @return data on users
166: * @throws DataCollectorException if collection of information fails
167: */
168: String[][] retrieveClientsData(String virtualDatabasename)
169: throws DataCollectorException;
170:
171: // ****************************************//
172: // *************** Fine grain Data ********//
173: // ****************************************//
174: /**
175: * Get some data information on a fine grain approach
176: *
177: * @param collector for the data to be accessed
178: * @return <code>long</code> value of the data
179: * @throws DataCollectorException if collection of information fails
180: */
181: long retrieveData(AbstractDataCollector collector)
182: throws DataCollectorException;
183:
184: /**
185: * Get starting point for exchanging data on a particular target
186: *
187: * @param dataType as given in the DataCollection interface
188: * @param targetName if needed (like backendname,clientName ...)
189: * @param virtualDbName if needed
190: * @return collector instance
191: * @throws DataCollectorException if fails to get proper collector instance
192: * @see org.continuent.sequoia.common.jmx.monitoring.DataCollection
193: */
194: AbstractDataCollector retrieveDataCollectorInstance(int dataType,
195: String targetName, String virtualDbName)
196: throws DataCollectorException;
197:
198: /**
199: * Gets content data of the recovery log
200: *
201: * @param databaseName the virtual database name
202: * @return data on the recovery log
203: * @throws DataCollectorException if collection of information fails
204: */
205: String[][] retrieveRecoveryLogData(String databaseName)
206: throws DataCollectorException;
207:
208: }
|