Skip to content
Browse files

UI change for bucket per node quota behaviour

Change-Id: Ie6e0fd0a949433c6b310bff6160f2098c3a00c94
Reviewed-on: http://review.northscale.com/3196
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Sean Lynch <seanl@literati.org>
Tested-by: Sean Lynch <seanl@literati.org>
  • Loading branch information...
1 parent 7974382 commit 782cfa51878faf8c65c002b4d1b5279dfdeb5d96 Aliaksey Kandratsenka committed with seanlynch Oct 10, 2010
Showing with 8 additions and 18 deletions.
  1. +3 −3 deps/menelaus/priv/js/manage-buckets.js
  2. +4 −10 deps/menelaus/src/menelaus_web_buckets.erl
  3. +1 −5 src/ns_bucket.erl
View
6 deps/menelaus/priv/js/manage-buckets.js
@@ -362,7 +362,6 @@ var BucketDetailsDialog = mkClass({
ramSummary.otherBuckets);
ramGauge.css('visibility', ramSummary ? 'visible' : 'hidden');
- var memcachedSummary = summaries.memcachedSummary;
var memcachedSummaryJQ = self.dialog.find('.memcached-summary');
var memcachedSummaryVisible = ramSummary && ramSummary.perNodeMegs;
if (memcachedSummaryVisible)
@@ -613,7 +612,8 @@ var BucketsSection = {
this.settingsWidget.reset();
},
startCreate: function () {
- var totals = DAO.cells.currentPoolDetails.value.storageTotals;
+ var poolDetails = DAO.cells.currentPoolDetails.value;
+ var totals = poolDetails.storageTotals;
if (totals.ram.quotaTotal == totals.ram.quotaUsed) {
genericDialog({
buttons: {ok: true},
@@ -625,7 +625,7 @@ var BucketsSection = {
var initValues = {uri: '/pools/default/buckets',
bucketType: 'membase',
authType: 'sasl',
- quota: {rawRAM: totals.ram.quotaTotal - totals.ram.quotaUsed},
+ quota: {rawRAM: Math.floor((totals.ram.quotaTotal - totals.ram.quotaUsed) / poolDetails.nodes.length)},
replicaNumber: 1}
var dialog = new BucketDetailsDialog(initValues, true);
dialog.startDialog();
View
14 deps/menelaus/src/menelaus_web_buckets.erl
@@ -324,8 +324,8 @@ handle_setup_default_bucket_post(Req) ->
-record(ram_summary, {
total, % total cluster quota
other_buckets,
- per_node, % memcached bucket type specific
- nodes_count, % memcached bucket type specific
+ per_node, % per node quota of this bucket
+ nodes_count, % node count of this bucket
this_alloc,
this_used, % part of this bucket which is used already
free}). % total - other_buckets - this_alloc.
@@ -563,14 +563,8 @@ ram_summary_to_proplist(V) ->
interpret_ram_quota(CurrentBucket, ParsedProps, ClusterStorageTotals, UsageGetter) ->
RAMQuota = proplists:get_value(ram_quota, ParsedProps),
NodesCount = proplists:get_value(nodesCount, ClusterStorageTotals),
- {ParsedQuota, PerNode} =
- case proplists:get_value(bucketType, ParsedProps) of
- memcached ->
- {RAMQuota * NodesCount,
- RAMQuota div 1048576};
- _ ->
- {RAMQuota, 0}
- end,
+ ParsedQuota = RAMQuota * NodesCount,
+ PerNode = RAMQuota div 1048576,
ClusterTotals = proplists:get_value(ram, ClusterStorageTotals),
OtherBuckets = proplists:get_value(quotaUsed, ClusterTotals)
- case CurrentBucket of
View
6 src/ns_bucket.erl
@@ -158,11 +158,7 @@ live_bucket_nodes(Bucket) ->
ram_quota(Bucket) ->
case proplists:get_value(ram_quota, Bucket) of
X when is_integer(X) ->
- case proplists:get_value(type, Bucket) of
- memcached ->
- X * length(ns_cluster_membership:active_nodes());
- _ -> X
- end
+ X * length(proplists:get_value(servers, Bucket, []))
end.
%% returns cluster-wide ram_quota. For memcached buckets it's

0 comments on commit 782cfa5

Please sign in to comment.
Something went wrong with that request. Please try again.