mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dles...@apache.org
Subject svn commit: r1683963 [3/3] - in /mesos/site: publish/ publish/documentation/configuration/ publish/documentation/latest/configuration/ publish/documentation/latest/mesos-c++-style-guide/ publish/documentation/latest/powered-by-mesos/ publish/documentat...
Date Sat, 06 Jun 2015 22:17:28 GMT
Modified: mesos/site/source/documentation/latest/configuration.md
URL: http://svn.apache.org/viewvc/mesos/site/source/documentation/latest/configuration.md?rev=1683963&r1=1683962&r2=1683963&view=diff
==============================================================================
--- mesos/site/source/documentation/latest/configuration.md (original)
+++ mesos/site/source/documentation/latest/configuration.md Sat Jun  6 22:17:28 2015
@@ -1035,7 +1035,7 @@ file:///path/to/file (where file contain
       'cgroups/cpu,cgroups/mem', or network/port_mapping
       (configure with flag: --with-network-isolator to enable),
       or 'external', or load an alternate isolator module using
-      the <code>--modules</code> flag. (default: posix/cpu,posix/mem)
+      the <code>--modules</code> flag. Note that this flag is only relevant for
the Mesos Containerizer. (default: posix/cpu,posix/mem)
     </td>
   </tr>
   <tr>
@@ -1230,6 +1230,24 @@ file:///path/to/file (where file contain
     </td>
   </tr>
   <tr>
+    <td>
+      --fetcher_cache_size=VALUE
+    </td>
+    <td>
+      Size of the fetcher cache in Bytes.
+      (default: 2 GB)
+    </td>
+  </tr>
+  <tr>
+    <td>
+      --fetcher_cache_dir=VALUE
+    </td>
+    <td>
+      Parent directory for fetcher cache directories (one subdirectory per slave). By default
this directory is held inside the work directory, so everything can be deleted or archived
in one swoop, in particular during testing. However, a typical production scenario is to use
a separate cache volume. First, it is not meant to be backed up. Second, you want to avoid
that sandbox directories and the cache directory can interfere with each other in unpredictable
ways by occupying shared space. So it is recommended to set the cache directory explicitly.
+      (default: /tmp/mesos/fetch)
+    </td>
+  </tr>
+  <tr>
     <td>
       --work_dir=VALUE
     </td>

Modified: mesos/site/source/documentation/latest/mesos-c++-style-guide.md
URL: http://svn.apache.org/viewvc/mesos/site/source/documentation/latest/mesos-c%2B%2B-style-guide.md?rev=1683963&r1=1683962&r2=1683963&view=diff
==============================================================================
--- mesos/site/source/documentation/latest/mesos-c++-style-guide.md (original)
+++ mesos/site/source/documentation/latest/mesos-c++-style-guide.md Sat Jun  6 22:17:28 2015
@@ -108,6 +108,133 @@ Try<Duration> failoverTimeout =
 * Elements outside classes (classes, structs, global functions, etc.) should be spaced apart
by 2 blank lines.
 * Elements inside classes (member variables and functions) should not be spaced apart by
more than 1 blank line.
 
+## Capture by Reference
+
+We disallow capturing **temporaries** by reference. See [MESOS-2629](https://issues.apache.org/jira/browse/MESOS-2629)
for the rationale.
+
+```
+Future<Nothing> f() { return Nothing(); }
+Future<bool> g() { return false; }
+
+struct T
+{
+  T(const char* data) : data(data) {}
+  const T& member() const { return *this; }
+  const char* data;
+};
+
+// 1: Don't use.
+const Future<Nothing>& future = f();
+
+// 1: Instead use.
+const Future<Nothing> future = f();
+
+// 2: Don't use.
+const Future<Nothing>& future = Future<Nothing>(Nothing());
+
+// 2: Instead use.
+const Future<Nothing> future = Future<Nothing>(Nothing());
+
+// 3: Don't use.
+const Future<bool>& future = f().then(lambda::bind(g));
+
+// 3: Instead use.
+const Future<bool> future = f().then(lambda::bind(g));
+
+// 4: Don't use (since the T that got constructed is a temporary!).
+const T& t = T("Hello").member();
+
+// 4: Preferred alias pattern (see below).
+const T t("Hello");
+const T& t_ = t.member();
+
+// 4: Can also use.
+const T t = T("Hello").member();
+```
+
+We allow capturing non-temporaries by *constant reference* when the intent is to **alias**.
+
+The goal is to make code more concise and improve readability. Use this if an expression
referencing a field by `const` is:
+
+* Used repeatedly.
+* Would benefit from a concise name to provide context for readability.
+* Will **not** be invalidated during the lifetime of the alias. Otherwise document this explicitly.
+
+```
+hashmap<int, hashset<int>> index;
+
+struct T
+{
+  int number;
+  string name;
+};
+
+// 1: Ok.
+const hashset<int>& values = index[2];
+
+// 2: Ok.
+for (auto iterator = index.begin(); iterator != index.end(); ++iterator) {
+  const hashset<int>& values = iterator->second;
+}
+
+// 3: Ok.
+foreachpair (const int& key, hashset<int>& values, index) {}
+foreachvalue (const hashset<int>& values, index) {}
+foreachkey (const int& key, index) {}
+
+// 4: Avoid aliases in most circumstances as they can be dangerous.
+//    This is an example of a dangling alias!
+vector<string> strings{"hello"};
+
+string& s = strings[0];
+
+strings.erase(strings.begin());
+
+s += "world"; // THIS IS A DANGLING REFERENCE!
+```
+
+## File Headers
+
+* Mesos source files must contain the "ASF" header:
+
+```
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+```
+
+* Stout and libprocess source files must contain the "Apache License Version 2.0" header:
+
+```
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+```
+
 ## C++11
 
 We support C++11 and require GCC 4.8+ or Clang 3.5+ compilers. The whitelist of supported
C++11 features is:
@@ -134,7 +261,9 @@ Try<Owned<LocalAuthorizer>> authorizer =
 ```
 
 * Rvalue references.
+* Explicitly-defaulted functions.
 * Variadic templates.
+* Delegating constructors.
 * Mutexes.
   * `std::mutex`
   * `std::lock_guard<std::mutex>`

Modified: mesos/site/source/documentation/latest/powered-by-mesos.md
URL: http://svn.apache.org/viewvc/mesos/site/source/documentation/latest/powered-by-mesos.md?rev=1683963&r1=1683962&r2=1683963&view=diff
==============================================================================
--- mesos/site/source/documentation/latest/powered-by-mesos.md (original)
+++ mesos/site/source/documentation/latest/powered-by-mesos.md Sat Jun  6 22:17:28 2015
@@ -77,7 +77,9 @@ layout: documentation
 * [Whisk](http://www.whisk.com)
 * [Wizcorp](http://www.wizcorp.jp)
 * [WooRank](http://www.woorank.com)
+* [Yelp](http://www.yelp.com)
 * [Yieldbot](http://www.yieldbot.com)
+* [Yodle](http://www.yodle.com)
 * [Xogito](http://www.xogito.com)
 
 ## Software projects built on Mesos



Mime
View raw message