IGNITE-5460 Added cache group name.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b843f078 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b843f078 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b843f078 Branch: refs/heads/ignite-5272 Commit: b843f078fa97c6a34dd4bb375c534bfa798bcda2 Parents: 0879ca8 Author: Alexey Kuznetsov <[email protected]> Authored: Tue Jun 13 09:50:33 2017 +0700 Committer: Alexey Kuznetsov <[email protected]> Committed: Tue Jun 13 09:50:33 2017 +0700 ---------------------------------------------------------------------- .../internal/visor/cache/VisorCacheConfiguration.java | 13 +++++++++++++ .../visor/commands/cache/VisorCacheCommand.scala | 1 + modules/web-console/backend/app/mongo.js | 1 + .../configuration/generator/ConfigurationGenerator.js | 8 ++++++-- .../modules/states/configuration/caches/general.pug | 4 ++++ 5 files changed, 25 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b843f078/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 f40df80..f7330f7 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 @@ -48,6 +48,9 @@ public class VisorCacheConfiguration extends VisorDataTransferObject { /** Cache name. */ private String name; + /** Cache group name. */ + private String grpName; + /** Cache mode. */ private CacheMode mode; @@ -174,6 +177,7 @@ public class VisorCacheConfiguration extends VisorDataTransferObject { */ public VisorCacheConfiguration(IgniteEx ignite, CacheConfiguration ccfg) { name = ccfg.getName(); + grpName = ccfg.getGroupName(); mode = ccfg.getCacheMode(); atomicityMode = ccfg.getAtomicityMode(); eagerTtl = ccfg.isEagerTtl(); @@ -226,6 +230,13 @@ public class VisorCacheConfiguration extends VisorDataTransferObject { } /** + * @return Cache group name. + */ + @Nullable public String getGroupName() { + return grpName; + } + + /** * @return Cache mode. */ public CacheMode getMode() { @@ -503,6 +514,7 @@ public class VisorCacheConfiguration extends VisorDataTransferObject { /** {@inheritDoc} */ @Override protected void writeExternalData(ObjectOutput out) throws IOException { U.writeString(out, name); + U.writeString(out, grpName); U.writeEnum(out, mode); U.writeEnum(out, atomicityMode); out.writeBoolean(eagerTtl); @@ -545,6 +557,7 @@ public class VisorCacheConfiguration extends VisorDataTransferObject { /** {@inheritDoc} */ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException { name = U.readString(in); + grpName = U.readString(in); mode = CacheMode.fromOrdinal(in.readByte()); atomicityMode = CacheAtomicityMode.fromOrdinal(in.readByte()); eagerTtl = in.readBoolean(); http://git-wip-us.apache.org/repos/asf/ignite/blob/b843f078/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala ---------------------------------------------------------------------- diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala index 680522f..10350f2 100755 --- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala +++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala @@ -837,6 +837,7 @@ object VisorCacheCommand { cacheT #= ("Name", "Value") + cacheT += ("Group", cfg.getGroupName) cacheT += ("Mode", cfg.getMode) cacheT += ("Atomicity Mode", safe(cfg.getAtomicityMode)) cacheT += ("Statistic Enabled", bool2Str(cfg.isStatisticsEnabled)) http://git-wip-us.apache.org/repos/asf/ignite/blob/b843f078/modules/web-console/backend/app/mongo.js ---------------------------------------------------------------------- diff --git a/modules/web-console/backend/app/mongo.js b/modules/web-console/backend/app/mongo.js index 8e75719..e3ae30d 100644 --- a/modules/web-console/backend/app/mongo.js +++ b/modules/web-console/backend/app/mongo.js @@ -141,6 +141,7 @@ module.exports.factory = function(passportMongo, settings, pluginMongo, mongoose const CacheSchema = new Schema({ space: {type: ObjectId, ref: 'Space', index: true, required: true}, name: {type: String}, + groupName: {type: String}, clusters: [{type: ObjectId, ref: 'Cluster'}], domains: [{type: ObjectId, ref: 'DomainModel'}], cacheMode: {type: String, enum: ['PARTITIONED', 'REPLICATED', 'LOCAL']}, http://git-wip-us.apache.org/repos/asf/ignite/blob/b843f078/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js index a55fdf1..dc29751 100644 --- a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js +++ b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js @@ -1717,8 +1717,12 @@ export default class IgniteConfigurationGenerator { // Generate cache general group. static cacheGeneral(cache, available, ccfg = this.cacheConfigurationBean(cache)) { - ccfg.stringProperty('name') - .enumProperty('cacheMode') + ccfg.stringProperty('name'); + + if (available('2.1.0')) + ccfg.stringProperty('groupName'); + + ccfg.enumProperty('cacheMode') .enumProperty('atomicityMode'); if (ccfg.valueOf('cacheMode') === 'PARTITIONED' && ccfg.valueOf('backups')) { http://git-wip-us.apache.org/repos/asf/ignite/blob/b843f078/modules/web-console/frontend/app/modules/states/configuration/caches/general.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/modules/states/configuration/caches/general.pug b/modules/web-console/frontend/app/modules/states/configuration/caches/general.pug index 8eda4a1..91af451 100644 --- a/modules/web-console/frontend/app/modules/states/configuration/caches/general.pug +++ b/modules/web-console/frontend/app/modules/states/configuration/caches/general.pug @@ -32,6 +32,10 @@ include /app/helpers/jade/mixins .col-sm-6 .settings-row +text('Name:', `${model}.name`, '"cacheName"', 'true', 'Input name', 'Cache name') + .settings-row(ng-if='$ctrl.available("2.1.0")') + +text('Group:', `${model}.groupName`, '"groupName"', 'false', 'Input group name', + 'Cache group name.<br/>\ + Caches with the same group name share single underlying "physical" cache (partition set), but are logically isolated.') .settings-row +clusters(model, 'Associate clusters with the current cache') .settings-row
