Repository: mesos
Updated Branches:
  refs/heads/master e9eb5bb4f -> e6c76b0e2


Update attributes doc to reflect current supported attributes types.

Review: https://reviews.apache.org/r/36173


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e6c76b0e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e6c76b0e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e6c76b0e

Branch: refs/heads/master
Commit: e6c76b0e2d7d0faeb136ffea0dbc88d2abddda24
Parents: e9eb5bb
Author: Timothy Chen <[email protected]>
Authored: Fri Jul 3 14:28:59 2015 -0700
Committer: Timothy Chen <[email protected]>
Committed: Mon Jul 6 10:24:07 2015 -0700

----------------------------------------------------------------------
 docs/attributes-resources.md | 50 +++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e6c76b0e/docs/attributes-resources.md
----------------------------------------------------------------------
diff --git a/docs/attributes-resources.md b/docs/attributes-resources.md
index 0ae8b59..1ea5dde 100644
--- a/docs/attributes-resources.md
+++ b/docs/attributes-resources.md
@@ -6,39 +6,45 @@ layout: documentation
 
 The Mesos system has two basic methods to describe the slaves that comprise a 
cluster.  One of these is managed by the Mesos master, the other is simply 
passed onwards to the frameworks using the cluster.
 
-## Attributes
+## Types
 
-The attributes are simply key value string pairs that Mesos passes along when 
it sends offers to frameworks.
+The types of values that are supported by Attributes and Resources in Mesos 
are scalar, ranges, sets and text.
 
-    attributes : attribute ( ";" attribute )*
+The following are the definitions of these types:
 
-    attribute : labelString ":" ( labelString | "," )+
+    scalar : floatValue
 
-## Resources
+    floatValue : ( intValue ( "." intValue )? ) | ...
 
-The Mesos system can manage 3 different *types* of resources: scalars, ranges, 
and sets.  These are used to represent the different resources that a Mesos 
slave has to offer.  For example, a scalar resource type could be used to 
represent the amount of memory on a slave.  Each resource is identified by a 
key string.
+    intValue : [0-9]+
 
-    resources : resource ( ";" resource )*
+    range : "[" rangeValue ( "," rangeValue )* "]"
 
-    resource : key ":" ( scalar | range | set )
+    rangeValue : scalar "-" scalar
 
-    key : labelString ( "(" resourceRole ")" )?
+    set : "{" text ( "," text )* "}"
 
-    scalar : floatValue
+    text : [a-zA-Z0-9_/.-]
 
-    range : "[" rangeValue ( "," rangeValue )* "]"
+## Attributes
 
-    rangeValue : scalar "-" scalar
+Attributes are key value pairs (where value is optional) that Mesos passes 
along when it sends offers to frameworks. An attribute value supports 3 
different *types*: scalar, range or text.
 
-    set : "{" labelString ( "," labelString )* "}"
+    attributes : attribute ( ";" attribute )*
 
-    resourceRole : labelString | "*"
+    attribute : text ":" ( scalar | range | text )
 
-    labelString : [a-zA-Z0-9_/.-]
+## Resources
 
-    floatValue : ( intValue ( "." intValue )? ) | ...
+The Mesos system can manage 3 different *types* of resources: scalars, ranges, 
and sets.  These are used to represent the different resources that a Mesos 
slave has to offer.  For example, a scalar resource type could be used to 
represent the amount of memory on a slave.  Each resource is identified by a 
key string.
 
-    intValue : [0-9]+
+    resources : resource ( ";" resource )*
+
+    resource : key ":" ( scalar | range | set )
+
+    key : text ( "(" resourceRole ")" )?
+
+    resourceRole : text | "*"
 
 ## Predefined Uses & Conventions
 
@@ -56,7 +62,7 @@ In particular, a slave without `cpus` and `mem` resources 
will never have its re
 Here are some examples for configuring the Mesos slaves.
 
     
--resources='cpus:24;mem:24576;disk:409600;ports:[21000-24000];bugs:{a,b,c}'
-    --attributes='rack:abc;zone:west;os:centos5,full'
+    --attributes='rack:abc;zone:west;os:centos5;level:10;keys:[1000-1500]'
 
 In this case, we have three different types of resources, scalars, a range, 
and a set.  They are called `cpus`, `mem`, `disk`, and the range type is 
`ports`.
 
@@ -68,6 +74,8 @@ In this case, we have three different types of resources, 
scalars, a range, and
 
 In the case of attributes, we end up with three attributes:
 
-  - `rack` with value `abc`
-  - `zone` with value `west`
-  - `os` with value `centos5,full`
+  - `rack` with text value `abc`
+  - `zone` with text value `west`
+  - `os` with text value `centos5`
+  - `level` with scalar value 10
+  - `keys` with range value `1000` through `1500` (inclusive)
\ No newline at end of file

Reply via email to