Skip to content

Commit

Permalink
[feature] Add method getDefaultInitialSize to CacheManager interface
Browse files Browse the repository at this point in the history
  • Loading branch information
shabanovd authored and adamretter committed Jul 12, 2015
1 parent 799e244 commit df1bdac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/org/exist/storage/CacheManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

public interface CacheManager {

public final static String BTREE_CACHE = "BTREE";
public final static String DATA_CACHE = "DATA";
String BTREE_CACHE = "BTREE";
String DATA_CACHE = "DATA";

/**
* Register a cache, i.e. put it under control of
Expand Down Expand Up @@ -79,4 +79,11 @@ public interface CacheManager {
* @return Current size of all Caches in bytes (unit of measurement is implementation defined)
*/
long getCurrentSize();

/**
* Returns the default initial size for all caches.
*
* @return Default initial size.
*/
int getDefaultInitialSize();
}
7 changes: 6 additions & 1 deletion src/org/exist/storage/CollectionCacheManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ public long getCurrentSize() {
return collectionCache.getRealSize();
}

@Override
public int getDefaultInitialSize() {
return DEFAULT_CACHE_SIZE;
}

private void registerMBean(String instanceName) {
final Agent agent = AgentFactory.getInstance();
try {
Expand All @@ -126,5 +131,5 @@ private void registerMBean(String instanceName) {
} catch (final DatabaseConfigurationException e) {
LOG.warn("Exception while registering cache mbean.", e);
}
}
}
}

0 comments on commit df1bdac

Please sign in to comment.