You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2013/06/14 10:25:04 UTC
[07/32] git commit: updated
refs/heads/1781-reorganize-and-improve-docs to 11fd32a
Describe uuids config section. Tweak a bit related API section.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/64c7d45b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/64c7d45b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/64c7d45b
Branch: refs/heads/1781-reorganize-and-improve-docs
Commit: 64c7d45b64ebbd17be024cb06fb54446001d3b1f
Parents: 5bc869e
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Jun 11 17:51:54 2013 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Jun 11 21:28:40 2013 +0400
----------------------------------------------------------------------
share/doc/build/Makefile.am | 3 +
share/doc/src/api/misc.rst | 11 ++--
share/doc/src/config/index.rst | 1 +
share/doc/src/config/uuids.rst | 127 ++++++++++++++++++++++++++++++++++++
4 files changed, 138 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/64c7d45b/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index 42b43a8..06ba89b 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -62,6 +62,7 @@ html_files = \
html/_sources/config/os-daemons.txt \
html/_sources/config/ssl.txt \
html/_sources/config/update-notification.txt \
+ html/_sources/config/uuids.txt \
html/_sources/config/vendor.txt \
html/_sources/config/vhosts.txt \
html/_sources/config/proxying.txt \
@@ -116,6 +117,7 @@ html_files = \
html/config/os-daemons.html \
html/config/ssl.html \
html/config/update-notification.html \
+ html/config/uuids.html \
html/config/vendor.html \
html/config/vhosts.html \
html/config/proxying.html \
@@ -168,6 +170,7 @@ src_files = \
../src/config/os-daemons.rst \
../src/config/ssl.rst \
../src/config/update-notification.rst \
+ ../src/config/uuids.rst \
../src/config/vendor.rst \
../src/config/vhosts.rst \
../src/config/proxying.rst \
http://git-wip-us.apache.org/repos/asf/couchdb/blob/64c7d45b/share/doc/src/api/misc.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/api/misc.rst b/share/doc/src/api/misc.rst
index a41d9d0..36e425a 100644
--- a/share/doc/src/api/misc.rst
+++ b/share/doc/src/api/misc.rst
@@ -781,10 +781,12 @@ Returns:
]
}
-The UUID type is determined by the UUID type setting in the CouchDB
-configuration. See :ref:`api/config/section/key.put`.
+The UUID type is determined by the :ref:`UUID algorithm <config/uuids/algorithm>`
+setting in the CouchDB configuration.
-For example, changing the UUID type to ``random``:
+The UUID type could be changed in anytime through
+:ref:`Config API <api/config/section/key.put>`. For example, changing the UUID
+type to ``random`` use next HTTP request:
.. code-block:: http
@@ -794,7 +796,7 @@ For example, changing the UUID type to ``random``:
"random"
-When obtaining a list of UUIDs:
+When obtaining a list of UUIDs you'll see the changes:
.. code-block:: javascript
@@ -808,6 +810,7 @@ When obtaining a list of UUIDs:
]
}
+
.. _api/misc/favicon:
.. _api/misc/favicon.get:
http://git-wip-us.apache.org/repos/asf/couchdb/blob/64c7d45b/share/doc/src/config/index.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/config/index.rst b/share/doc/src/config/index.rst
index d351dc3..3305198 100644
--- a/share/doc/src/config/index.rst
+++ b/share/doc/src/config/index.rst
@@ -55,6 +55,7 @@ Content:
os-daemons
ssl
update-notification
+ uuids
vendor
vhosts
http://git-wip-us.apache.org/repos/asf/couchdb/blob/64c7d45b/share/doc/src/config/uuids.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/config/uuids.rst b/share/doc/src/config/uuids.rst
new file mode 100644
index 0000000..7e59094
--- /dev/null
+++ b/share/doc/src/config/uuids.rst
@@ -0,0 +1,127 @@
+.. 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.
+
+.. highlight:: ini
+
+.. _config/uuids:
+.. _config/uuids/algorithm:
+
+``[uuids]`` :: UUID Generation Algorithm
+========================================
+
+.. versionchanged:: 1.3 ``utc_id`` algorithm.
+
+CouchDB provides various algorithms to generate UUID value that will be used
+for document `_id` by default::
+
+ [uuids]
+ algorithm = sequential
+
+Available algorithms:
+
+- ``random``: 128 bits of random awesome. All awesome, all the time:
+
+ .. code-block:: javascript
+
+ {
+ "uuids": [
+ "5fcbbf2cb171b1d5c3bc6df3d4affb32",
+ "9115e0942372a87a977f1caf30b2ac29",
+ "3840b51b0b81b46cab99384d5cd106e3",
+ "b848dbdeb422164babf2705ac18173e1",
+ "b7a8566af7e0fc02404bb676b47c3bf7",
+ "a006879afdcae324d70e925c420c860d",
+ "5f7716ee487cc4083545d4ca02cd45d4",
+ "35fdd1c8346c22ccc43cc45cd632e6d6",
+ "97bbdb4a1c7166682dc026e1ac97a64c",
+ "eb242b506a6ae330bda6969bb2677079"
+ ]
+ }
+
+- ``sequential``: Monotonically increasing ids with random increments.
+ First 26 hex characters are random. Last 6 increment in random amounts until
+ an overflow occurs. On overflow, the random prefix is regenerated and the
+ process starts over:
+
+ .. code-block:: javascript
+
+ {
+ "uuids": [
+ "4e17c12963f4bee0e6ec90da54804894",
+ "4e17c12963f4bee0e6ec90da5480512f",
+ "4e17c12963f4bee0e6ec90da54805c25",
+ "4e17c12963f4bee0e6ec90da54806ba1",
+ "4e17c12963f4bee0e6ec90da548072b3",
+ "4e17c12963f4bee0e6ec90da54807609",
+ "4e17c12963f4bee0e6ec90da54807718",
+ "4e17c12963f4bee0e6ec90da54807754",
+ "4e17c12963f4bee0e6ec90da54807e5d",
+ "4e17c12963f4bee0e6ec90da54808d28"
+ ]
+ }
+
+- ``utc_random``: Time since Jan 1, 1970 UTC with microseconds. First 14
+ characters are the time in hex. Last 18 are random:
+
+ .. code-block:: javascript
+
+ {
+ "uuids": [
+ "04dd32b3af699659b6db9486a9c58c62",
+ "04dd32b3af69bb1c2ac7ebfee0a50d88",
+ "04dd32b3af69d8591b99a8e86a76e0fb",
+ "04dd32b3af69f4a18a76efd89867f4f4",
+ "04dd32b3af6a1f7925001274bbfde952",
+ "04dd32b3af6a3fe8ea9b120ed906a57f",
+ "04dd32b3af6a5b5c518809d3d4b76654",
+ "04dd32b3af6a78f6ab32f1e928593c73",
+ "04dd32b3af6a99916c665d6bbf857475",
+ "04dd32b3af6ab558dd3f2c0afacb7d66"
+ ]
+ }
+
+- ``utc_id``: Time since Jan 1, 1970 UTC with microseconds,
+ plus ``utc_id_suffix`` string. First 14 characters are the time in hex.
+ :ref:`config/uuids/utc_id_suffix` string value is appended to these:
+
+ .. code-block:: javascript
+
+ {
+ "uuids": [
+ "04dd32bd5eabcc@mycouch",
+ "04dd32bd5eabee@mycouch",
+ "04dd32bd5eac05@mycouch",
+ "04dd32bd5eac28@mycouch",
+ "04dd32bd5eac43@mycouch",
+ "04dd32bd5eac58@mycouch",
+ "04dd32bd5eac6e@mycouch",
+ "04dd32bd5eac84@mycouch",
+ "04dd32bd5eac98@mycouch",
+ "04dd32bd5eacad@mycouch"
+ ]
+ }
+
+
+.. _config/uuids/utc_id_suffix:
+
+UTC ID Suffix
+-------------
+
+.. versionadded:: 1.3
+
+The utc_id_suffix value will be appended to UUIDs generated by the ``utc_id``
+algorithm. Replicating instances should have unique utc_id_suffix values to
+ensure uniqueness of ``utc_id`` ids::
+
+ [uuid]
+ utc_id_suffix = my-awesome-suffix
+