summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fixing and polishing of autotests.kvsCarlos Manuel Duclos Vergara2012-04-191-35/+40
| | | | | Change-Id: I84a7762e71e6211dadfe371a6e6526d105547ba2 Reviewed-by: Sergey Hambardzumyan <sergey.hambardzumyan@nokia.com>
* Fixing an almost unnoticeable memory leak.Carlos Manuel Duclos Vergara2012-04-192-2/+8
| | | | | Change-Id: I558143c536ae6a6826bc643b4df4e495deef619c Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Adding a policy for cursor.seekRange.Carlos Manuel Duclos Vergara2012-04-186-39/+278
| | | | | | | | | | | | There is on enum on QKeyValueStoreCursor.h called CursorMatchPolicy. It contains two values: EqualOrLess and EqualOrGreater. Cursor behavior was modified according to the irc discussion. Basically, if a cursor reaches the end of the list then it needs to be manually brought up to a valid point. Change-Id: Ide7c2ef3da21bb8c7dacfb363e08e284d40a2680 Reviewed-by: Carlos Duclos <carlos.duclos@nokia.com>
* Performance optimization.Carlos Manuel Duclos Vergara2012-04-175-71/+67
| | | | | | | | | When getting a value, instead of reading the whole record, we just read the value. We do not check the hash, since this was done at open time. Change-Id: I5bd4d881e9caf3c8dc47cf57566bea660f804ab3 Reviewed-by: Ali Akhtarzada <ali.akhtarzada@nokia.com>
* Removing Q_ASSERT.Carlos Manuel Duclos Vergara2012-04-131-1/+1
| | | | | | | | | | Throwing an assert here will lead to redesign of a lot of code on the server side, therefore we remove it. Notice that the compare function does not make sense for QKeyValueStore since QByteArray has its own. Change-Id: Ic9aa189f0d5a59b053e6a25e809640d559ea4524 Reviewed-by: Ali Akhtarzada <ali.akhtarzada@nokia.com> Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Adding license headers.Carlos Manuel Duclos Vergara2012-04-131-0/+41
| | | | | Change-Id: I8bcc2fbaa7d772c2f50cdcaaf5a087c6b716d3cb Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Adding license headers.Carlos Manuel Duclos Vergara2012-04-133-0/+123
| | | | | Change-Id: Ia48dcaf8e5e07157349205c9adc97511d6d48deb Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Adding QKeyValueStore.Denis Dzyubenko2012-04-1337-32/+3801
| | | | | | | | QKeyValueStore is a simple key-value storage system, that is very space efficient. Change-Id: I569bfe5c99b75057bc2cfcf60e13253af7524af2 Reviewed-by: Ali Akhtarzada <ali.akhtarzada@nokia.com>
* Replaced crc32 implementation with the one from zlibDenis Dzyubenko2012-03-295-56/+600
| | | | | | | Instead of calculating crc32 byte by byte it calculates it by four byte blocks. Change-Id: Ic804897e52133e3d718b129f761cd848919ce0b2 Reviewed-by: Ali Akhtarzada <ali.akhtarzada@nokia.com>
* Merge remote-tracking branch 'gerrit/master' into hbtreeDenis Dzyubenko2012-03-2858-510/+1774
|\ | | | | | | Change-Id: I3deb84bade6607fa99aebf7aff202ee3b2c2e8e6
| * Print state information in jsondb-clientKevin Simons2012-03-281-7/+18
| | | | | | | | | | Change-Id: Ie6993987faeefad4aa4b26c953dff7de371a04f9 Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Fix compilation problem due to QJson changeKevin Simons2012-03-281-3/+5
| | | | | | | | | | Change-Id: Ifdd95014363023120ab9092c3eb0818a02a80407 Reviewed-by: Jing Bai <jing.t.bai@nokia.com>
| * Make the client terminate properly when doing remove by queryKevin Simons2012-03-271-0/+3
| | | | | | | | | | Change-Id: I93001b6826f4d1e4ef2601fae058718c19a27f88 Reviewed-by: Jing Bai <jing.t.bai@nokia.com>
| * Default deterministic _uuid for Map views.Jamey Hicks2012-03-275-9/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the map function does not assign _uuid, then create _uuid for the emitted objects as follows. If targetKeyName is not provided: sourceUuids.sort() identifier = targetType + ":" + sourceUuids.join(":") If targetKeyName is provided sourceUuids.sort() identifier = targetType + ":" + sourceUuids.join(":") + ":" + object[targetKeyName].toString() object[_uuid] = createUuidFromString(identifier).toString() If targetKeyName is not provided and _uuid is not assigned by the map function, then there will be at most once view object per source object. Fixes Bug #6807 and Bug #8226 Change-Id: I000755a8a14e5842c1d1b52d9c12a64021ad0790 Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Documentation improvementsKevin Simons2012-03-279-78/+290
| | | | | | | | | | Change-Id: I5030043c72d5692c44099160bd1ec8e7e4c2c298 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * FIx the access to freed memory in client test case.Tapani Mikola2012-03-261-8/+12
| | | | | | | | | | Change-Id: Idba7f2cabdbdf3a4955bd1902f5e19c9aae9bb33 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * Fix the "return all historical data" caseKevin Simons2012-03-262-1/+43
| | | | | | | | | | | | | | | | | | Also handle the fact that Views don't have a _type index. Fixes Bug #6707. Change-Id: Iff42efbfbc0f6c4e71c70934ed2d6a237a5f7ee5 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * Updated ReduceJamey Hicks2012-03-266-77/+345
| | | | | | | | | | | | | | | | | | | | | | | | * Added sourceKeyFunction for determining source key as alternative to sourceKeyName * If targetValueName is null, use whole object returned from add/subtract as result of reduce. This will be the only behavior once all Reduces are converted. * Combined some redundant code in JsonDbReduceDefinition. * Added basic Reduce documentation. Change-Id: I258d9e24bb5fa620634b1168832ee4bbc1d58aca Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Add support for historical notifications to jsondb-clientKevin Simons2012-03-261-7/+20
| | | | | | | | | | | | Change-Id: Ia626c4a9a0088d8628becd6a5ea4639505ab4b77 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * add qmltypes for QtCreator code completionBai Jing2012-03-262-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | Now we call qmlplugindump to generate qmltypes file for jsondb so that user can get proper code completion hint in Creator. But by far it is not possible to do it while cross-compiling. So we only generate qmltypes for i586 build. Bug #7347 Change-Id: I22c7ad3d335fe0a2cd42c6f31cd0ea7c98f634ac Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
| * Move all validation of Map/Reduce definition to object creation timeKevin Simons2012-03-234-26/+43
| | | | | | | | | | | | | | | | | | This fixes some major memory issues. Also includes a fix for creating a static instance of QJSEngine for function validation, as that was also a source of memory leaking. Change-Id: Ibb705b2abab2aa004ee79f2770d7561f040e9623 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * Removes support for deprecated Map definition form.Jamey Hicks2012-03-232-64/+31
| | | | | | | | | | | | | | Fixes Bug #3370. Change-Id: I3d45468d2a8a5a28b13a248f16054f3c9ca91a2b Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * Only index specified objectTypes.Jamey Hicks2012-03-2311-31/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If objectTypes are specified in an Index definition, then only index objects whose type is contained in objectTypes in this index. Removed unused index created by JsonDbReduceDefinition because it caused conflicting indexes to be created. Fixed non-conforming schema "extends" syntax for the Map/Reduce used in an affected auto test. Fixes Bug #6216. Change-Id: Ic3bda2e7541093b0b5fec42545a3ef9465a3745f Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * QLatin1Literal -> QLatin1String in jsondb-clientKevin Simons2012-03-233-18/+18
| | | | | | | | | | | | | | Also fixed a typo Change-Id: I6bd1a322f12d629b2998b36406018657a270a02c Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * Handle eager updates with non-view source types with a queued connectionKevin Simons2012-03-232-8/+20
| | | | | | | | | | | | | | | | This allows the call to write the source type to return to the caller before the eager view update is processed. Change-Id: I0a3853b10a2562d604a48ce180af2215c9c2b782 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * Support arbitrary JSON terms in "contains" queriesKevin Simons2012-03-233-3/+91
| | | | | | | | | | | | | | | | Fixes Bug #3395. Change-Id: I1cb9859aba5d557af456aa90880a39a8f30c4d09 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * Support the query without partition propertyLiang Qi2012-03-223-9/+54
| | | | | | | | | | | | | | | | Fixes Bug #7995. Change-Id: I01b56f408e18aec3366dc841817f954d36c55a69 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * reduce verbosity of unindexable termsJamey Hicks2012-03-221-3/+0
| | | | | | | | | | Change-Id: I85a7d758c3a01b86ec6ae418d2975478c286cf8a Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Fixed a warning in JsonDbCollator QString from string literalDenis Dzyubenko2012-03-221-1/+1
| | | | | | | | | | Change-Id: Ibed91324c1e1075ef0555b54ec74e8d8378cc73e Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Fixed build of aodbread toolDenis Dzyubenko2012-03-222-69/+25
| | | | | | | | | | | | Change-Id: I8700ecd23e133b8e1e13dd58488b19f718efca38 Reviewed-by: Kevin Simons <kevin.simons@nokia.com> Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * Make sure internal View indexes survive restartKevin Simons2012-03-225-9/+27
| | | | | | | | | | | | | | | | | | Since the internal indexes used for Views are not represented by Index objects in the database, they need to be initialized each time the View is opened. Change-Id: I589c399942d159e841377cdfa4025e1d05b7ed3f Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * added JsonDbObject::createUuidFromString()Jamey Hicks2012-03-212-19/+30
| | | | | | | | | | Change-Id: I647eb019af53fd2ce43c0c404b9930ecec58d7b5 Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Check for syntax errors in validateDefinition for views.Jamey Hicks2012-03-215-55/+80
| | | | | | | | | | | | | | | | | | | | Changes the behavior so that syntax errors in the javascript files are detected at object creation time, rather than the first time the view is updated. The idea is to give developers more immediate feedback on errors. Change-Id: Ieb9df1e2997085fc0ca3e7610f2c2d6f757926fe Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Fix "notExists" query on indexed properties.Jamey Hicks2012-03-215-2/+67
| | | | | | | | | | | | | | | | | | | | | | | | If the query engine chooses to use an index on property "x" for a query with a "notExists" constraint on that property, the result set will always be empty. This change notes which indexes cannot be used due to "notExists" and chooses a different one to execute the query. Fixes Bug #7182. Change-Id: I15a0a998a0e1dce345d7056167700c0acbff1255 Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * remove dead code from compileIndexQuery.Jamey Hicks2012-03-211-13/+2
| | | | | | | | | | Change-Id: I7bac50f039b7936a0a193d92cdda5e4275f94249 Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Make it an error to create a notification with an empty queryKevin Simons2012-03-211-0/+8
| | | | | | | | | | Change-Id: Ib645a465b37b30a34e93717cd27c85efc8655764 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * Fix chained eager view updatesKevin Simons2012-03-216-2/+34
| | | | | | | | | | Change-Id: I4c350f26dad21f82e8a7e309359b36c0dea28a82 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * Make default connections thread-localJoão Abecasis2012-03-212-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QJsonDbConnection is advertised as not being thread-safe, making the default connection useless outside the main thread. While application writers can work-around this with explicit locking around the default conenction, library code was essentially forced to create and manage their own connections. With this change, defaultConnection becomes more generally useful, safe and available for library use. Change-Id: Ib73a6fd7d0878df8d1a1cbb3c03a878998a7c8b0 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * Remove the "empty query returns everything" bug/featureKevin Simons2012-03-215-5/+21
| | | | | | | | | | Change-Id: Ib19f0c213bb24df9a188fdd6c6fe5dcadbc5fe59 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * Improve _schemaType, Map & Reduce access controlTapani Mikola2012-03-218-4/+235
| | | | | | | | | | | | | | | | | | Check sourceType(s) for read access and targetType for write access when creating a Map or Reduce object. Check name for write access when creating a _schemaType. Change-Id: I1c21dbb70f8834ad4f9a49a10c9818586b1f4692 Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Include the default partition in mPartitionsKevin Simons2012-03-201-3/+5
| | | | | | | | | | | | | | Otherwise it doesn't get used in memory freeing, closing, etc. Change-Id: Ic4ec3dcc39d592e806b99a9d158dcbbe5f7c503c Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| * Revert accidental change to QJsonDbWatcher::error() signal.Jamey Hicks2012-03-202-6/+6
| | | | | | | | | | | | Change-Id: I351e6537c07424db1dabc028dd0b7080da8cc904 Reviewed-by: Liang Qi <liang.qi@nokia.com> Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
| * Objects which stop matching a watcher query should not have _deleted : trueKevin Simons2012-03-202-1/+4
| | | | | | | | | | | | | | | | | | | | When an object stops matching a watcher query, we send a notification that the object has been "removed". However, it shouldn't contain the _deleted property or else applications will believe the object has actually been removed from the database. Change-Id: I160fedf503d76d89baa0511b6cf6c6be030be19b Reviewed-by: Jing Bai <jing.t.bai@nokia.com>
| * Fixed a memory leak in JsonDbCollatorDenis Dzyubenko2012-03-202-12/+13
| | | | | | | | | | | | Change-Id: Ib395af249f59193aac3939f7c7bb1ae540d22832 Reviewed-by: Kevin Simons <kevin.simons@nokia.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
* | Fixed previous transactionless cursor patchDenis Dzyubenko2012-03-235-41/+41
| | | | | | | | | | | | | | | | | | | | With Hbtree it is no longer possible to open a read transaction while write transaction is active, or worse to begin a read transaction, and then begin a write transaction that can rewrite pages that were supposed to be held by the read transaction. Change-Id: Ie008883b959772ae9f2f31173c3176198c556f2b Reviewed-by: Ali Akhtarzada <ali.akhtarzada@nokia.com>
* | hbtree moveNode and merge order fixAli Akhtarzada2012-03-232-54/+570
| | | | | | | | | | | | | | | | | | | | | | | | Move node was not setting the parent key correctly and the merge order should be right to left always when the page being rebalanced is the left most page of a branch. Also added more test cases and deterministically random versions for a number of tests Change-Id: I2b1496fb053ef53bd5c6536cf80dcfaf6a68171a Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* | Fixed residue bug in hbtree, added stress testsAli Akhtarzada2012-03-222-158/+143
| | | | | | | | | | | | | | | | | | | | Collecible pages were being added even after a page was deemed not to be collectible becaseu the residue was not being cleared after a sync. Added cache prune to all txn functions Added a lot more test case coverage Change-Id: I86f3fe8044b741005a5206b314779679e704756a Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* | Fixed trasnfer of nodes in hbtree rebalanceAli Akhtarzada2012-03-223-67/+158
| | | | | | | | | | | | | | | | Moving a node from one page to another was adding overflow pages as reusable even though it was technically a transfer so was wrong. Change-Id: I6cd12192da4181896405527a56af1b91b66e79b2 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* | Hbtree bug fixesAli Akhtarzada2012-03-225-280/+450
| | | | | | | | | | | | | | Fixed rebalancing, cursors, caching and marker pages Change-Id: I2cdc1b8b9666efdc92a33fd9897a5fddfef850d4 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* | Fixed hbtree cache and got rid of extra sync readAli Akhtarzada2012-03-203-13/+12
| | | | | | | | | | | | | | The LRU queue should be updated in getPage, not in cacheFind. Change-Id: I75f2f4e64a7c6687a7760239490ab7121af50945 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>