Repository: incubator-ignite Updated Branches: refs/heads/ignite-843 b9decf5db -> 7a9e3bfe0
# IGNITE-843 WIP on caches screen. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7a9e3bfe Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7a9e3bfe Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7a9e3bfe Branch: refs/heads/ignite-843 Commit: 7a9e3bfe0bbbdd45b8727c8d3ce5dfa6622ea035 Parents: b9decf5 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Tue Jun 9 17:30:07 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Tue Jun 9 17:30:07 2015 +0700 ---------------------------------------------------------------------- modules/webconfig/nodejs/db.js | 86 +++++++++++++----- .../nodejs/public/form-models/caches.json | 94 +++++++++++++++++++- .../public/javascripts/controllers/caches.js | 18 ++-- modules/webconfig/nodejs/views/caches.jade | 2 +- .../nodejs/views/includes/controls.jade | 35 +++++--- 5 files changed, 186 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a9e3bfe/modules/webconfig/nodejs/db.js ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/db.js b/modules/webconfig/nodejs/db.js index ac9f147..40c0466 100644 --- a/modules/webconfig/nodejs/db.js +++ b/modules/webconfig/nodejs/db.js @@ -31,17 +31,17 @@ var AccountSchema = new Schema({ username: String }); -AccountSchema.plugin(passportLocalMongoose, { usernameField: 'email' }); +AccountSchema.plugin(passportLocalMongoose, {usernameField: 'email'}); exports.Account = mongoose.model('Account', AccountSchema); // Define space model. -exports.Space = mongoose.model('Space', new Schema({ +exports.Space = mongoose.model('Space', new Schema({ name: String, - owner: { type: ObjectId, ref: 'Account' }, + owner: {type: ObjectId, ref: 'Account'}, usedBy: [{ - permission: { type: String, enum: ['VIEW', 'FULL']}, - account: { type: ObjectId, ref: 'Account' } + permission: {type: String, enum: ['VIEW', 'FULL']}, + account: {type: ObjectId, ref: 'Account'} }] })); @@ -54,23 +54,59 @@ var DiscoveryObj = { // Define cache model. var CacheSchema = new Schema({ - space: { type: ObjectId, ref: 'Space' }, + space: {type: ObjectId, ref: 'Space'}, name: String, - mode: { type: String, enum: ['PARTITIONED', 'REPLICATED', 'LOCAL'] }, + mode: {type: String, enum: ['PARTITIONED', 'REPLICATED', 'LOCAL']}, + atomicityMode: {type: String, enum: ['ATOMIC', 'TRANSACTIONAL']}, + backups: Number, - atomicity: { type: String, enum: ['ATOMIC', 'TRANSACTIONAL'] } + memoryMode: {type: String, enum: ['ONHEAP_TIERED', 'OFFHEAP_TIERED', 'OFFHEAP_VALUES']}, + offHeapMaxMemory: Number, + swapEnabled: Boolean, + + rebalanceMode: {type: String, enum: ['SYNC', 'ASYNC', 'NONE']}, + rebalanceThreadPoolSize: Number, + rebalanceBatchSize: Number, + rebalanceOrder: Number, + rebalanceDelay: Number, + rebalanceTimeout: Number, + rebalanceThrottle: Number, + + readThrough: Boolean, + writeThrough: Boolean, + + writeBehindEnabled: Boolean, + writeBehindBatchSize: Number, + writeBehindFlushSize: Number, + writeBehindFlushFrequency: Number, + writeBehindFlushThreadCount: Number, + + invalidate: Boolean, + defaultLockTimeout: Number, + transactionManagerLookupClassName: String, + + sqlEscapeAll: Boolean, + sqlOnheapRowCacheSize: Boolean, + longQueryWarningTimeout: Number, + indexedTypes: [String], + sqlFunctionClasses: [String], + statisticsEnabled: Boolean, + managementEnabled: Boolean, + readFromBackup: Boolean, + copyOnRead: Boolean, + maxConcurrentAsyncOperations: Number }); -exports.Cache = mongoose.model('Cache', CacheSchema); +exports.Cache = mongoose.model('Cache', CacheSchema); // Define discovery model. -exports.Discovery = mongoose.model('Discovery', new Schema(DiscoveryObj)); +exports.Discovery = mongoose.model('Discovery', new Schema(DiscoveryObj)); var ClusterSchema = new Schema({ - space: { type: ObjectId, ref: 'Space' }, + space: {type: ObjectId, ref: 'Space'}, name: String, discovery: { - kind: { type: String, enum: ['Vm', 'Multicast', 'S3', 'Cloud', 'GoogleStorage', 'Jdbc', 'SharedFs'] }, + kind: {type: String, enum: ['Vm', 'Multicast', 'S3', 'Cloud', 'GoogleStorage', 'Jdbc', 'SharedFs']}, Vm: { addresses: [String] }, @@ -94,7 +130,7 @@ var ClusterSchema = new Schema({ projectName: String, bucketName: String, serviceAccountP12FilePath: String, - addrReqAttempts:String + addrReqAttempts: String }, Jdbc: { initSchema: Boolean @@ -105,18 +141,20 @@ var ClusterSchema = new Schema({ }, atomicConfiguration: { backups: Number, - cacheMode: { type: String, enum: ['LOCAL', 'REPLICATED', 'PARTITIONED'] }, + cacheMode: {type: String, enum: ['LOCAL', 'REPLICATED', 'PARTITIONED']}, atomicSequenceReserveSize: Number }, - caches: [{ type: ObjectId, ref: 'Cache' }], + caches: [{type: ObjectId, ref: 'Cache'}], cacheSanityCheckEnabled: Boolean, clockSyncSamples: Number, clockSyncFrequency: Number, - deploymentMode: { type: String, enum: ['PRIVATE', 'ISOLATED', 'SHARED', 'CONTINUOUS'] }, + deploymentMode: {type: String, enum: ['PRIVATE', 'ISOLATED', 'SHARED', 'CONTINUOUS']}, discoveryStartupDelay: Number, - includeEventTypes: [{ type: String, enum: ['EVTS_CHECKPOINT', 'EVTS_DEPLOYMENT', 'EVTS_ERROR', 'EVTS_DISCOVERY', - 'EVTS_JOB_EXECUTION', 'EVTS_TASK_EXECUTION', 'EVTS_CACHE', 'EVTS_CACHE_REBALANCE', 'EVTS_CACHE_LIFECYCLE', - 'EVTS_CACHE_QUERY', 'EVTS_SWAPSPACE', 'EVTS_IGFS'] }], + includeEventTypes: [{ + type: String, enum: ['EVTS_CHECKPOINT', 'EVTS_DEPLOYMENT', 'EVTS_ERROR', 'EVTS_DISCOVERY', + 'EVTS_JOB_EXECUTION', 'EVTS_TASK_EXECUTION', 'EVTS_CACHE', 'EVTS_CACHE_REBALANCE', 'EVTS_CACHE_LIFECYCLE', + 'EVTS_CACHE_QUERY', 'EVTS_SWAPSPACE', 'EVTS_IGFS'] + }], marshalLocalJobs: Boolean, marshCacheKeepAliveTime: Number, marshCachePoolSize: Number, @@ -141,14 +179,14 @@ var ClusterSchema = new Schema({ managementThreadPoolSize: Number, igfsThreadPoolSize: Number, transactionConfiguration: { - defaultTxConcurrency: { type: String, enum: ['OPTIMISTIC', 'PESSIMISTIC'] }, - transactionIsolation: { type: String, enum: ['READ_COMMITTED', 'REPEATABLE_READ', 'SERIALIZABLE'] }, + defaultTxConcurrency: {type: String, enum: ['OPTIMISTIC', 'PESSIMISTIC']}, + transactionIsolation: {type: String, enum: ['READ_COMMITTED', 'REPEATABLE_READ', 'SERIALIZABLE']}, defaultTxTimeout: Number, pessimisticTxLogLinger: Number, pessimisticTxLogSize: Number, txSerializableEnabled: Boolean }, - segmentationPolicy: { type: String, enum: ['RESTART_JVM', 'STOP', 'NOOP'] }, + segmentationPolicy: {type: String, enum: ['RESTART_JVM', 'STOP', 'NOOP']}, allSegmentationResolversPassRequired: Boolean, segmentationResolveAttempts: Number, utilityCacheKeepAliveTime: Number, @@ -156,9 +194,9 @@ var ClusterSchema = new Schema({ }); // Define cluster model. -exports.Cluster = mongoose.model('Cluster', ClusterSchema); +exports.Cluster = mongoose.model('Cluster', ClusterSchema); -exports.upsert = function(model, data, cb){ +exports.upsert = function (model, data, cb) { if (data._id) { var id = data._id; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a9e3bfe/modules/webconfig/nodejs/public/form-models/caches.json ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/public/form-models/caches.json b/modules/webconfig/nodejs/public/form-models/caches.json index d067121..c19eecd 100644 --- a/modules/webconfig/nodejs/public/form-models/caches.json +++ b/modules/webconfig/nodejs/public/form-models/caches.json @@ -77,6 +77,60 @@ "tip": [ "Flag indicating whether swap storage is enabled or not for this cache." ] + }, + { + "label": "Eviction policy", + "type": "dropdown-details", + "group": "evictionPolicy", + "model": "kind", + "placeholder": "Choose eviction policy", + "items": "evictionPolicies", + "tip": [ + "Cache expiration policy." + ], + "details": { + "LRU": [ + { + "label": "BatchSize", + "type": "text", + "model": "BatchSize", + "placeholder": "1" + }, + { + "label": "MaxMemorySize", + "type": "text", + "model": "MaxMemorySize", + "placeholder": "0", + "tip": [ + "Maximum allowed cache size in bytes." + ] + } + ], + "RND": [ + { + "label": "BatchSize", + "type": "text", + "model": "BatchSize", + "placeholder": "1" + } + ], + "FIFO": [ + { + "label": "BatchSize", + "type": "text", + "model": "BatchSize", + "placeholder": "1" + } + ], + "SORTED": [ + { + "label": "BatchSize", + "type": "text", + "model": "BatchSize", + "placeholder": "1" + } + ] + } } ] }, @@ -156,6 +210,27 @@ ] }, { + "label": "Store", + "fields": [ + { + "label": "Read-through", + "type": "check", + "model": "readThrough", + "tip": [ + "Flag indicating whether read-through caching should be used." + ] + }, + { + "label": "Write-through", + "type": "check", + "model": "writeThrough", + "tip": [ + "Flag indicating whether write-through caching should be used." + ] + } + ] + }, + { "label": "Write behind", "fields": [ { @@ -289,6 +364,22 @@ "label": "Misc", "fields": [ { + "label": "Statistics enabled", + "type": "check", + "model": "statisticsEnabled", + "tip": [ + "Flag indicating whether statistics gathering is enabled on a cache." + ] + }, + { + "label": "Management enabled", + "type": "check", + "model": "managementEnabled", + "tip": [ + "Flag indicating whether management is enabled on this cache." + ] + }, + { "label": "Read from backup", "type": "check", "model": "readFromBackup", @@ -307,9 +398,10 @@ ] }, { - "label": "Max concurrent async operations", + "label": "Max concurreny", "type": "text", "model": "maxConcurrentAsyncOperations", + "placeholder": "500", "tip": [ "Maximum number of allowed concurrent asynchronous operations.<br/>", "If 0 returned then number of concurrent asynchronous operations is unlimited." http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a9e3bfe/modules/webconfig/nodejs/public/javascripts/controllers/caches.js ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/public/javascripts/controllers/caches.js b/modules/webconfig/nodejs/public/javascripts/controllers/caches.js index c93aef0..2a10c6d 100644 --- a/modules/webconfig/nodejs/public/javascripts/controllers/caches.js +++ b/modules/webconfig/nodejs/public/javascripts/controllers/caches.js @@ -17,9 +17,9 @@ configuratorModule.controller('cachesController', ['$scope', '$modal', '$http', function($scope, $modal, $http) { $scope.templates = [ - {value: {mode: 'PARTITIONED', atomicity: 'TRANSACTIONAL'}, label: 'Partitioned'}, - {value: {mode: 'REPLICATED', atomicity: 'ATOMIC'}, label: 'Replicated'}, - {value: {mode: 'LOCAL', atomicity: 'ATOMIC'}, label: 'Local'} + {value: {mode: 'PARTITIONED', atomicityMode: 'ATOMIC'}, label: 'Partitioned'}, + {value: {mode: 'REPLICATED', atomicityMode: 'ATOMIC'}, label: 'Replicated'}, + {value: {mode: 'LOCAL', atomicityMode: 'ATOMIC'}, label: 'Local'} ]; $scope.atomicities = [ @@ -38,18 +38,18 @@ configuratorModule.controller('cachesController', ['$scope', '$modal', '$http', {value: 'PRIMARY', label: 'Primary'} ]; + $scope.memoryModes = [ + {value: 'ONHEAP_TIERED', label: 'ONHEAP_TIERED'}, + {value: 'OFFHEAP_TIERED', label: 'OFFHEAP_TIERED'}, + {value: 'OFFHEAP_VALUES', label: 'OFFHEAP_VALUES'} + ]; + $scope.rebalanceModes = [ {value: 'SYNC', label: 'Synchronous'}, {value: 'ASYNC', label: 'Asynchronous'}, {value: 'NONE', label: 'None'} ]; - $scope.memoryModes = [ - {value: 'ONHT', label: 'ONHEAP_TIERED'}, - {value: 'OFHT', label: 'OFFHEAP_TIERED'}, - {value: 'OFHV', label: 'OFFHEAP_VALUES'} - ]; - $scope.general = []; $scope.advanced = []; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a9e3bfe/modules/webconfig/nodejs/views/caches.jade ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/views/caches.jade b/modules/webconfig/nodejs/views/caches.jade index ed59d4f..23b0fd4 100644 --- a/modules/webconfig/nodejs/views/caches.jade +++ b/modules/webconfig/nodejs/views/caches.jade @@ -36,7 +36,7 @@ block content tbody tr(ng-repeat='row in rowCollection') td.col-sm-6(ng-class='{active: row._id == selectedItem._id}') - a(ng-click='selectItem(row)') {{$index + 1}}. {{row.name}}, {{row.mode | displayValue:modes:'Cache mode not set'}}, {{row.atomicity | displayValue:atomicities:'Cache atomicity not set'}} + a(ng-click='selectItem(row)') {{$index + 1}}. {{row.name}}, {{row.mode | displayValue:modes:'Cache mode not set'}}, {{row.atomicityMode | displayValue:atomicities:'Cache atomicity not set'}} .row.col-sm-12 hr form.form-horizontal(name='editForm' ng-if='backupItem') http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a9e3bfe/modules/webconfig/nodejs/views/includes/controls.jade ---------------------------------------------------------------------- diff --git a/modules/webconfig/nodejs/views/includes/controls.jade b/modules/webconfig/nodejs/views/includes/controls.jade index 220a778..b1b74cd 100644 --- a/modules/webconfig/nodejs/views/includes/controls.jade +++ b/modules/webconfig/nodejs/views/includes/controls.jade @@ -20,6 +20,12 @@ mixin tip mixin tip-detail i.tip.fa.fa-question-circle(ng-if='detail.tip' bs-tooltip='detail.tip.join("")' type='button') +mixin lbl + label.col-sm-2 {{field.label}}: + +mixin lbl-details + label.col-sm-2.details-label {{detail.label}}: + mixin details-row - var detailMdl = 'backupItem[field.group][backupItem[field.group][field.model]][detail.model]' @@ -29,18 +35,18 @@ mixin details-row label(ng-click='#{detailMdl} = !#{detailMdl}') {{detail.label}} +tip-detail div(ng-switch-when='text') - label.col-sm-2.details-label {{detail.label}}: - .col-sm-3 + +lbl-details + .col-sm-4 input.form-control(type='text' ng-model=detailMdl placeholder='{{detail.placeholder}}') +tip-detail div(ng-switch-when='dropdown') - label.col-sm-2.details-label {{detail.label}}: - .col-sm-3 + +lbl-details + .col-sm-4 button.form-control(bs-select ng-model=detailMdl data-template='/select' data-placeholder='{{detail.placeholder}}' bs-options='item.value as item.label for item in {{detail.items}}') +tip-detail div(ng-switch-when='dropdown-multiple') - label.col-sm-2.details-label {{detail.label}}: - .col-sm-3 + +lbl-details + .col-sm-4 button.form-control(bs-select ng-model=detailMdl data-multiple='1' data-template='/select' data-placeholder='{{detail.placeholder}}' bs-options='item.value as item.label for item in {{detail.items}}') +tip-detail div(ng-switch-when='addresses') @@ -68,29 +74,30 @@ mixin form-row label(ng-click='backupItem[field.model] = !backupItem[field.model]') {{field.label}} +tip div(ng-switch-when='text') - label.col-sm-2 {{field.label}}: - .col-sm-3 + +lbl + .col-sm-4 input.form-control(type='text' ng-model='backupItem[field.model]' placeholder='{{field.placeholder}}') +tip div(ng-switch-when='dropdown') - label.col-sm-2 {{field.label}}: - .col-sm-3 + +lbl + .col-sm-4 button.form-control(bs-select ng-model='backupItem[field.model]' data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}') +tip div(ng-switch-when='dropdown-multiple') - label.col-sm-2 {{field.label}}: - .col-sm-3 + +lbl + .col-sm-4 button.form-control(bs-select ng-model='backupItem[field.model]' data-multiple='1' data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}') +tip div(ng-switch-when='dropdown-details') - label.col-sm-2 {{field.label}}: - .col-sm-3 + +lbl + .col-sm-4 button.form-control(bs-select ng-model=masterMdl data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}') +tip .details-row(ng-repeat='detail in field.details[#{masterMdl}]') +details-row div(ng-switch-when='indexedTypes') div + label Indexed types: 2 button.btn.btn-primary(ng-click='editIndexedTypes()') Add indexed type +tip .col-sm-10.links(style='margin-left: 18px')