summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2012-04-11 15:59:00 +0200
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2012-04-11 16:54:46 +0200
commit6b7df60a752422b1f6ff07bb2682c21e18a43985 (patch)
tree3e56bd3f4ee34a228777d00ff328ef1c53cb1df1 /doc
parent20549eedb5b5e852c0e384cd76bfbff14168dbda (diff)
parent7ef36e3c5a88560eb4e3a81c2c9f14059739108b (diff)
Merge remote-tracking branch 'gerrit/master' into hbtreehbtree
Conflicts: src/daemon/daemon.pri src/daemon/jsondbview.cpp src/partition/jsondbindex.cpp src/partition/jsondbindex.h src/partition/jsondbindexquery.h src/partition/jsondbmanagedbtree.cpp src/partition/jsondbmanagedbtree.h src/partition/jsondbmanagedbtreetxn.cpp src/partition/jsondbmanagedbtreetxn.h src/partition/jsondbobjecttable.cpp src/partition/jsondbobjecttable.h src/partition/jsondbpartition.cpp src/partition/jsondbpartition.h tests/auto/auto.pro tests/auto/partition/testpartition.cpp tests/benchmarks/benchmarks.pro Change-Id: I963adefd6d32fca9b3537981306b67538c759034
Diffstat (limited to 'doc')
-rw-r--r--doc/src/partitions.qdoc57
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/src/partitions.qdoc b/doc/src/partitions.qdoc
index 64911c2..f1c52b5 100644
--- a/doc/src/partitions.qdoc
+++ b/doc/src/partitions.qdoc
@@ -41,6 +41,63 @@ The various partitions in a set are accessed via the \l {Partition} element in Q
C++, the partition is selected by \c setPartition() on a
\l {QJsonDbReadRequest}, \l {QJsonDbWriteRequest} or \l {QJsonDbWatcher}.
+\section1 Defining Partitions
+
+Partitions in JSON DB are defined via .json files. The filenames must be of the
+form \c partitions*.json. JSON DB searches a series of directories looking for
+such files and the search order is defined as follows:
+
+\list
+\li If a directory is passed as the final argument to the JSON DB binary (jsondb)
+then this location is searched first. If no argument is specified, the current
+working directory is searched.
+\li If the JSONDB_CONFIG_SEARCH_PATH environment variable points to a colon-separated
+list of directories, these are searched next.
+\li Finally, /etc/jsondb is searched.
+\endlist
+
+The partition definition files consist of an array of objects which define the
+partitions:
+\code
+[
+ {
+ "name" : "com.qt-project.partition1",
+ "default" : true
+ },
+ {
+ "name" : "com.qt-project.partition2",
+ "path" : "/var/run/jsondb/partition2"
+ }
+]
+\endcode
+
+The allowed properties:
+
+\table
+\row
+
+\row
+\li name
+\li The name of the partition, specified on all requests to the database.
+If more than one partition specifies the same \c name property, JSON DB
+only loads the first one it finds. See \l {Partition::name} and
+\l {QJsonDbRequest::partition}.
+
+\row
+\li path
+\li The path where the partition files should be stored. If not specified, it
+defaults to the current working directory.
+
+\row
+\li default
+\li If this boolean property is \c true, then requests which do not specify
+a partition will default this partition. If more than one partition is marked
+as default, JSON DB chooses one arbitrarily.
+\endtable
+
+If no partitions.json files are created, then the database defaults to a single
+partition with the name "default".
+
\section1 The Ephemeral Partition
JSON DB offers a partition called \c Ephemeral. Objects written to this