~ubuntu-branches/ubuntu/trusty/ehcache/trusty

« back to all changes in this revision

Viewing changes to src/main/java/net/sf/ehcache/management/sampled/SampledCacheMBean.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2013-05-06 14:53:07 UTC
  • mfrom: (1.1.7) (2.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130506145307-v5bhw5yu70re00l3
Tags: 2.6.7-1
* Team upload.
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 *  Copyright 2003-2010 Terracotta, Inc.
 
2
 *  Copyright Terracotta, Inc.
3
3
 *
4
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
5
 *  you may not use this file except in compliance with the License.
16
16
 
17
17
package net.sf.ehcache.management.sampled;
18
18
 
19
 
import net.sf.ehcache.statistics.LiveCacheStatistics;
20
 
import net.sf.ehcache.statistics.sampled.SampledCacheStatistics;
21
 
 
22
19
/**
23
20
 * An MBean for Cache exposing cache statistics.
24
 
 * Extends from both {@link LiveCacheStatistics} and {@link SampledCacheStatistics}
25
 
 *
26
 
 * <p />
 
21
 * Extends from both {@link CacheSampler}
 
22
 * <p/>
 
23
 * <p/>
27
24
 *
28
25
 * @author <a href="mailto:asanoujam@terracottatech.com">Abhishek Sanoujam</a>
29
 
 * @since 1.7
30
26
 */
31
 
public interface SampledCacheMBean extends LiveCacheStatistics, SampledCacheStatistics {
 
27
public interface SampledCacheMBean extends CacheSampler {
32
28
    /**
33
29
     * CACHE_ENABLED
34
30
     */
60
56
    final String CACHE_STATISTICS_RESET = "CacheStatisticsReset";
61
57
 
62
58
    /**
63
 
     * Is the cache enabled?
64
 
     */
65
 
    boolean isEnabled();
66
 
 
67
 
    /**
68
59
     * Enabled/disable cache coherence mode for this node.
 
60
     *
69
61
     * @deprecated use {@link #setNodeBulkLoadEnabled(boolean)} instead
70
62
     */
71
63
    @Deprecated
72
64
    void setNodeCoherent(boolean coherent);
73
65
 
74
66
    /**
75
 
     * Enabled/disable bulk-load mode for this node.
76
 
     */
77
 
    void setNodeBulkLoadEnabled(boolean bulkLoadEnabled);
78
 
 
79
 
    /**
80
67
     * Is the cache coherent cluster-wide?
 
68
     *
81
69
     * @deprecated use {@link #isClusterBulkLoadEnabled()} instead
82
70
     */
83
71
    @Deprecated
84
72
    boolean isClusterCoherent();
85
73
 
86
74
    /**
87
 
     * Is the cache in bulk-load mode cluster-wide?
88
 
     */
89
 
    boolean isClusterBulkLoadEnabled();
90
 
 
91
 
    /**
92
75
     * Is the cache coherent locally?
 
76
     *
93
77
     * @deprecated use {@link #isNodeBulkLoadEnabled()} instead
94
78
     */
95
79
    @Deprecated
96
80
    boolean isNodeCoherent();
97
81
 
98
82
    /**
99
 
     * Is the cache in bulk-load mode locally?
100
 
     */
101
 
    boolean isNodeBulkLoadEnabled();
102
 
 
103
 
    /**
104
 
     * Enabled/disable the cache.
105
 
     */
106
 
    void setEnabled(boolean enabled);
107
 
 
108
 
    /**
109
 
     * Removes all cached items.
110
 
     */
111
 
    void removeAll();
112
 
 
113
 
    /**
114
 
     * Flushes all cache items from memory to the disk store, and from the
115
 
     * DiskStore to disk.
116
 
     */
117
 
    void flush();
118
 
 
119
 
    /**
120
 
     * Gets the status attribute of the Cache.
121
 
     *
122
 
     * @return The status value from the Status enum class
123
 
     */
124
 
    String getStatus();
125
 
 
126
 
    /**
127
 
     * Is the cache configured with Terracotta clustering?
128
 
     *
129
 
     * @return true if clustered with terracotta
130
 
     */
131
 
    boolean isTerracottaClustered();
132
 
 
133
 
    /**
134
 
     * Returns a textual description of a Terracotta-clustered cache's consistency mode.
135
 
     * @return "STRONG", "EVENTUAL", or "na" if the cache is not Terracotta-clustered
136
 
     */
137
 
    String getTerracottaConsistency();
138
 
 
139
 
    /**
140
 
     * Returns a textual description of a Terracotta-clustered cache's storage-strategy.
141
 
     * @return "CDV2", "CLASSIC", or "na" if the cache is not Terracotta-clustered
142
 
     */
143
 
    String getTerracottaStorageStrategy();
144
 
 
145
 
    /**
146
 
     * Clear both sampled and cumulative statistics
147
 
     */
148
 
    void clearStatistics();
149
 
 
150
 
    /**
151
 
     * Enables statistics collection
152
 
     */
153
 
    void enableStatistics();
154
 
 
155
 
    /**
156
 
     * Disables statistics collection. Also disables sampled statistics if it is
157
 
     * enabled.
158
 
     */
159
 
    void disableStatistics();
160
 
 
161
 
    /**
162
 
     * Controls the statistics. Also controls sampled statistics if it is
163
 
     * enabled.
164
 
     */
165
 
    void setStatisticsEnabled(boolean statsEnabled);
166
 
 
167
 
    /**
168
 
     * Enables statistics collection. As it requires that normal statistics
169
 
     * collection to be enabled, it enables it if its not already
170
 
     */
171
 
    void enableSampledStatistics();
172
 
 
173
 
    /**
174
 
     * Disables statistics collection
175
 
     */
176
 
    void disableSampledStatistics();
177
 
 
178
 
    /**
179
 
     * Configuration property accessor
180
 
     *
181
 
     * @return Max entries local heap config setting value
182
 
     */
183
 
    long getMaxEntriesLocalHeap();
184
 
 
185
 
    /**
186
 
     * setMaxEntriesLocalHeap
187
 
     * @param maxEntries
188
 
     */
189
 
    void setMaxEntriesLocalHeap(long maxEntries);
190
 
 
191
 
    /**
192
83
     * Configuration property accessor
193
84
     *
194
85
     * @return Max elements in memory config setting value
199
90
 
200
91
    /**
201
92
     * setMaxElementsInMemory
 
93
     *
202
94
     * @param maxElements
 
95
     * @deprecated use {@link #setMaxEntriesLocalHeap()} instead
203
96
     */
 
97
    @Deprecated
204
98
    void setMaxElementsInMemory(int maxElements);
205
 
 
206
 
    /**
207
 
     * Configuration property accessor
208
 
     *
209
 
     * @return Max bytes local heap config setting value
210
 
     */
211
 
    long getMaxBytesLocalHeap();
212
 
 
213
 
    /**
214
 
     * setMaxBytesLocalHeap
215
 
     * @param maxBytes
216
 
     */
217
 
    void setMaxBytesLocalHeap(long maxBytes);
218
 
 
219
 
    /**
220
 
     * setMaxBytesLocalHeap
221
 
     * @param maxBytes
222
 
     */
223
 
    void setMaxBytesLocalHeapAsString(String maxBytes);
224
 
 
225
 
    /**
226
 
     * Configuration property accessor
227
 
     *
228
 
     * @return Max bytes local heap config setting value as string
229
 
     */
230
 
    String getMaxBytesLocalHeapAsString();
231
 
 
232
 
    /**
233
 
     * Configuration property accessor
234
 
     *
235
 
     * @return Max bytes local offheap config setting value
236
 
     */
237
 
    long getMaxBytesLocalOffHeap();
238
 
 
239
 
    /**
240
 
     * Configuration property accessor
241
 
     *
242
 
     * @return Max bytes local offheap config setting value as string
243
 
     */
244
 
    String getMaxBytesLocalOffHeapAsString();
245
 
 
246
 
    /**
247
 
     * Configuration property accessor
248
 
     *
249
 
     * @return Max entries local disk config setting value
250
 
     */
251
 
    long getMaxEntriesLocalDisk();
252
 
 
253
 
    /**
254
 
     * setMaxEntriesLocalDisk
255
 
     * @param maxEntries
256
 
     */
257
 
    void setMaxEntriesLocalDisk(long maxEntries);
258
 
 
259
 
    /**
260
 
     * Configuration property accessor
261
 
     *
262
 
     * @return Max elements on disk config setting value
263
 
     * @deprecated use {@link #getMaxEntriesLocalDisk()} instead
264
 
     */
265
 
    @Deprecated
266
 
    int getMaxElementsOnDisk();
267
 
 
268
 
    /**
269
 
     * setMaxElementsOnDisk
270
 
     * @param maxElements
271
 
     */
272
 
    void setMaxElementsOnDisk(int maxElements);
273
 
 
274
 
    /**
275
 
     * Configuration property accessor
276
 
     *
277
 
     * @return Max bytes local disk config setting value
278
 
     */
279
 
    long getMaxBytesLocalDisk();
280
 
 
281
 
    /**
282
 
     * setMaxBytesLocalDisk
283
 
     * @param maxBytes
284
 
     */
285
 
    void setMaxBytesLocalDisk(long maxBytes);
286
 
 
287
 
    /**
288
 
     * setMaxBytesLocalDisk
289
 
     * @param maxBytes
290
 
     */
291
 
    void setMaxBytesLocalDiskAsString(String maxBytes);
292
 
 
293
 
    /**
294
 
     * Configuration property accessor
295
 
     *
296
 
     * @return Max bytes local disk config setting value as string
297
 
     */
298
 
    String getMaxBytesLocalDiskAsString();
299
 
 
300
 
    /**
301
 
     * Configuration property accessor
302
 
     *
303
 
     * @return a String representation of the policy
304
 
     */
305
 
    String getMemoryStoreEvictionPolicy();
306
 
 
307
 
    /**
308
 
     * setMemoryStoreEvictionPolicy
309
 
     * @param evictionPolicy
310
 
     */
311
 
    void setMemoryStoreEvictionPolicy(String evictionPolicy);
312
 
 
313
 
    /**
314
 
     * Configuration property accessor
315
 
     *
316
 
     * @return true if set to eternal in config
317
 
     */
318
 
    boolean isEternal();
319
 
 
320
 
    /**
321
 
     * setEternal
322
 
     * @param eternal
323
 
     */
324
 
    void setEternal(boolean eternal);
325
 
 
326
 
    /**
327
 
     * Configuration property accessor
328
 
     *
329
 
     * @return TTI in config
330
 
     */
331
 
    long getTimeToIdleSeconds();
332
 
 
333
 
    /**
334
 
     * setTimeToIdleSeconds
335
 
     * @param tti
336
 
     */
337
 
    void setTimeToIdleSeconds(long tti);
338
 
 
339
 
    /**
340
 
     * Configuration property accessor
341
 
     *
342
 
     * @return TTL in config
343
 
     */
344
 
    long getTimeToLiveSeconds();
345
 
 
346
 
    /**
347
 
     * setTimeToLiveSeconds
348
 
     * @param ttl
349
 
     */
350
 
    void setTimeToLiveSeconds(long ttl);
351
 
 
352
 
    /**
353
 
     * Configuration property accessor
354
 
     *
355
 
     * @return true if overflow to disk specified in config
356
 
     */
357
 
    boolean isOverflowToDisk();
358
 
 
359
 
    /**
360
 
     * setOverflowToDisk
361
 
     * @param overflowToDisk
362
 
     */
363
 
    void setOverflowToDisk(boolean overflowToDisk);
364
 
 
365
 
    /**
366
 
     * Configuration property accessor
367
 
     *
368
 
     * @return true if configured with disk persistence
369
 
     */
370
 
    boolean isDiskPersistent();
371
 
 
372
 
    /**
373
 
     * setDiskPersistent
374
 
     * @param diskPersistent
375
 
     */
376
 
    void setDiskPersistent(boolean diskPersistent);
377
 
 
378
 
    /**
379
 
     * Configuration property accessor
380
 
     *
381
 
     * @return Value for disk expiry thread interval in seconds specified in config
382
 
     */
383
 
    long getDiskExpiryThreadIntervalSeconds();
384
 
 
385
 
    /**
386
 
     * setDiskExpiryThreadIntervalSeconds
387
 
     * @param seconds
388
 
     */
389
 
    void setDiskExpiryThreadIntervalSeconds(long seconds);
390
 
 
391
 
    /**
392
 
     * Configuration property accessor
393
 
     *
394
 
     * @return true if logging is enabled on the cache
395
 
     */
396
 
    boolean isLoggingEnabled();
397
 
 
398
 
    /**
399
 
     * setLoggingEnabled
400
 
     * @param enabled
401
 
     */
402
 
    void setLoggingEnabled(boolean enabled);
403
 
 
404
 
    /**
405
 
     * Configuration property accessor
406
 
     *
407
 
     * @return true if the cache is pinned
408
 
     * @see net.sf.ehcache.config.PinningConfiguration
409
 
     */
410
 
    boolean isPinned();
411
 
 
412
 
    /**
413
 
     * Configuration property accessor
414
 
     *
415
 
     * @return the store to which this cache is pinned
416
 
     * @see net.sf.ehcache.config.PinningConfiguration
417
 
     */
418
 
    String getPinnedToStore();
419
 
 
420
 
    /**
421
 
     * Is there a registered Write-behind CacheWriter
422
 
     */
423
 
    boolean getHasWriteBehindWriter();
424
 
 
425
 
    /**
426
 
     * Returns the total length of all write-behind queues for this cache
427
 
     * @return writer-behind queue length
428
 
     */
429
 
    long getWriterQueueLength();
430
 
 
431
 
    /**
432
 
     * Returns the maximum size of any write-behind queues.
433
 
     * @return Maximum elements that can be queued for processing by the write-behind writer
434
 
     * @see net.sf.ehcache.config.CacheWriterConfiguration#getWriteBehindMaxQueueSize()
435
 
     */
436
 
    int getWriterMaxQueueSize();
437
 
 
438
 
    /**
439
 
     * Returns the number of configured write-behind queues/threads.
440
 
     * @return Number of configured processing queues/threads for use by the write-behind writer
441
 
     * @see net.sf.ehcache.config.CacheWriterConfiguration#getWriteBehindConcurrency()
442
 
     */
443
 
    int getWriterConcurrency();
444
 
 
445
 
    /**
446
 
     * Is the cache a transactional one
447
 
     * @see net.sf.ehcache.config.CacheConfiguration.TransactionalMode
448
 
     */
449
 
    boolean getTransactional();
450
 
 
451
 
    /**
452
 
     * @return Xa commit rate
453
 
     */
454
 
    long getTransactionCommitRate();
455
 
 
456
 
    /**
457
 
     * @return Xa rollback rate
458
 
     */
459
 
    long getTransactionRollbackRate();
460
 
 
461
 
    /**
462
 
     * Is the cache configured for search
463
 
     * @see net.sf.ehcache.config.Searchable
464
 
     */
465
 
    boolean getSearchable();
466
 
 
467
 
    /**
468
 
     * @return search rate
469
 
     */
470
 
    long getCacheSearchRate();
471
 
 
472
 
    /**
473
 
     * @return search time
474
 
     */
475
 
    long getCacheAverageSearchTime();
476
 
 
477
 
    /**
478
 
     * @return hit rate
479
 
     */
480
 
    long getCacheHitRate();
481
 
 
482
 
    /**
483
 
     * @return in-memory hit rate
484
 
     */
485
 
    long getCacheInMemoryHitRate();
486
 
 
487
 
    /**
488
 
     * @return off-heap hit rate
489
 
     */
490
 
    long getCacheOffHeapHitRate();
491
 
 
492
 
    /**
493
 
     * @return on-disk hit rate
494
 
     */
495
 
    long getCacheOnDiskHitRate();
496
 
 
497
 
    /**
498
 
     * @return miss rate
499
 
     */
500
 
    long getCacheMissRate();
501
 
 
502
 
    /**
503
 
     * @return in-memory miss rate
504
 
     */
505
 
    long getCacheInMemoryMissRate();
506
 
 
507
 
    /**
508
 
     * @return off-heap miss rate
509
 
     */
510
 
    long getCacheOffHeapMissRate();
511
 
 
512
 
    /**
513
 
     * @return on-disk miss rate
514
 
     */
515
 
    long getCacheOnDiskMissRate();
516
 
 
517
 
    /**
518
 
     * @return put rate
519
 
     */
520
 
    long getCachePutRate();
521
 
 
522
 
    /**
523
 
     * @return update rate
524
 
     */
525
 
    long getCacheUpdateRate();
526
 
 
527
 
    /**
528
 
     * @return remove rate
529
 
     */
530
 
    long getCacheRemoveRate();
531
 
 
532
 
    /**
533
 
     * @return eviction rate
534
 
     */
535
 
    long getCacheEvictionRate();
536
 
 
537
 
    /**
538
 
     * @return expiration rate
539
 
     */
540
 
    long getCacheExpirationRate();
541
 
 
542
 
    /**
543
 
     * @return average get time (ms.)
544
 
     */
545
 
    float getCacheAverageGetTime();
546
 
}
 
99
}
 
 
b'\\ No newline at end of file'