Repository: incubator-ignite Updated Branches: refs/heads/sprint-1 519daee13 -> d85ccfc30
# IGNITE-248 Added new properties to cache configuration. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d85ccfc3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d85ccfc3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d85ccfc3 Branch: refs/heads/sprint-1 Commit: d85ccfc301c4e9006af7fa6d15cf9c4c42581255 Parents: 519daee Author: AKuznetsov <akuznet...@gridgain.com> Authored: Sun Feb 15 18:19:10 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Sun Feb 15 18:19:10 2015 +0700 ---------------------------------------------------------------------- .../visor/cache/VisorCacheConfiguration.java | 144 +++++++++++++++++-- 1 file changed, 136 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d85ccfc3/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java index 1b28e38..384eb4e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfiguration.java @@ -122,9 +122,30 @@ public class VisorCacheConfiguration implements Serializable { /** Collection of type metadata. */ private Collection<VisorCacheTypeMetadata> typeMeta; - /** Check that cache have JDBC store. */ + /** Whether cache has JDBC store. */ private boolean jdbcStore; + /** Whether cache should operate in read-through mode. */ + private boolean readThrough; + + /** Whether cache should operate in write-through mode. */ + private boolean writeThrough; + + /** Whether statistics collection is enabled. */ + private boolean statisticsEnabled; + + /** Whether management is enabled. */ + private boolean mgmtEnabled; + + /** Class name of cache loader factory. */ + private String ldrFactory; + + /** Class name of cache writer factory. */ + private String writerFactory; + + /** Class name of expiry policy factory. */ + private String expiryPlcFactory; + /** * @param ignite Grid. * @param ccfg Cache configuration. @@ -172,9 +193,18 @@ public class VisorCacheConfiguration implements Serializable { cfg.defaultConfiguration(VisorCacheDefaultConfiguration.from(ccfg)); cfg.storeConfiguration(VisorCacheStoreConfiguration.from(ccfg)); cfg.writeBehind(VisorCacheWriteBehindConfiguration.from(ccfg)); + cfg.typeMeta(VisorCacheTypeMetadata.list(ccfg.getTypeMetadata())); cfg.jdbcStore(jdbcStore); + cfg.readThrough(ccfg.isReadThrough()); + cfg.writeThrough(ccfg.isWriteThrough()); + cfg.statisticsEnabled(ccfg.isStatisticsEnabled()); + cfg.managementEnabled(ccfg.isManagementEnabled()); + cfg.loaderFactory(compactClass(ccfg.getCacheLoaderFactory())); + cfg.writerFactory(compactClass(ccfg.getCacheWriterFactory())); + cfg.expiryPolicyFactory(compactClass(ccfg.getExpiryPolicyFactory())); + return cfg; } @@ -574,11 +604,6 @@ public class VisorCacheConfiguration implements Serializable { this.writeBehind = writeBehind; } - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(VisorCacheConfiguration.class, this); - } - /** * @param typeMeta New collection of type metadata. */ @@ -594,16 +619,119 @@ public class VisorCacheConfiguration implements Serializable { } /** - * @return Check that cache have JDBC store. + * @return {@code true} if cache has JDBC store. */ public boolean jdbcStore() { return jdbcStore; } /** - * @param jdbcStore Check that cache have JDBC store. + * @param jdbcStore {@code true} if cache has JDBC store. */ public void jdbcStore(boolean jdbcStore) { this.jdbcStore = jdbcStore; } + + /** + * @return Whether cache should operate in read-through mode. + */ + public boolean readThrough() { + return readThrough; + } + + /** + * @param readThrough New whether cache should operate in read-through mode. + */ + public void readThrough(boolean readThrough) { + this.readThrough = readThrough; + } + + /** + * @return Whether cache should operate in write-through mode. + */ + public boolean writeThrough() { + return writeThrough; + } + + /** + * @param writeThrough New whether cache should operate in write-through mode. + */ + public void writeThrough(boolean writeThrough) { + this.writeThrough = writeThrough; + } + + /** + * @return {@code true} if cache statistics enabled. + */ + public boolean statisticsEnabled() { + return statisticsEnabled; + } + + /** + * @param statisticsEnabled {@code true} if cache statistics enabled. + */ + public void statisticsEnabled(boolean statisticsEnabled) { + this.statisticsEnabled = statisticsEnabled; + } + + /** + * @return Whether management is enabled. + */ + public boolean managementEnabled() { + return mgmtEnabled; + } + + /** + * @param mgmtEnabled New whether management is enabled. + */ + public void managementEnabled(boolean mgmtEnabled) { + this.mgmtEnabled = mgmtEnabled; + } + + /** + * @return Class name of cache loader factory. + */ + public String loaderFactory() { + return ldrFactory; + } + + /** + * @param ldrFactory New class name of cache loader factory. + */ + public void loaderFactory(String ldrFactory) { + this.ldrFactory = ldrFactory; + } + + /** + * @return Class name of cache writer factory. + */ + public String writerFactory() { + return writerFactory; + } + + /** + * @param writerFactory New class name of cache writer factory. + */ + public void writerFactory(String writerFactory) { + this.writerFactory = writerFactory; + } + + /** + * @return Class name of expiry policy factory. + */ + public String expiryPolicyFactory() { + return expiryPlcFactory; + } + + /** + * @param expiryPlcFactory New class name of expiry policy factory. + */ + public void expiryPolicyFactory(String expiryPlcFactory) { + this.expiryPlcFactory = expiryPlcFactory; + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(VisorCacheConfiguration.class, this); + } }