Skip to content
Commits on Apr 7, 2016
  1. @hsharsha

    Remove unwanted start/end reduce context

    Change-Id: I939e75c9689d41c806a34d77f93f69a3ab7a5ff5
    Reviewed-on: http://review.couchbase.org/62451
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    hsharsha committed Apr 1, 2016
Commits on Mar 14, 2016
  1. @vmx

    CBD-1453: Adapt to CMake macro changes

    The ERL_BUILD CMake macro was changed to make incremental builds possible.
    Adapt to those changes.
    
    Change-Id: Iae6d0a9043ed1b74f2c104d9b251f45715ac04fd
    Reviewed-on: http://review.couchbase.org/61151
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    vmx committed with vmx Mar 9, 2016
Commits on Feb 15, 2016
  1. @vmx

    MB-7013: Fix Markdown syntax of the README.

    There was a code block that wasn't properly idented.
    
    Change-Id: Ibfd600d95b6b4ff48bc64e90393bd1ec360ff5e9
    Reviewed-on: http://review.couchbase.org/59947
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Feb 15, 2016
Commits on Jan 22, 2016
  1. @vmx

    MB-17460: Fix compaction for empty spatial views

    When you tried to compact a spatial view that didn't contain any data
    after rebalance, it failed. The problem was a wrongly encoded root
    node in case of an empty tree.
    
    Change-Id: Icafe750e043e99f6d981b3afb34b6be577b7a561
    Reviewed-on: http://review.couchbase.org/58741
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    vmx committed with vmx Jan 18, 2016
Commits on Jan 18, 2016
  1. @vmx

    Fix typespec

    Dialyzer complains about a case that can't happen, that's due to a
    missing value in a typespec. The warning was:
    
        spatial_view.erl:117: The pattern <'nil', MbbB> can never match the type <[[number()]],_>
    
    Change-Id: I3178369d741e5a900375f914ba2efad5b094049b
    Reviewed-on: http://review.couchbase.org/58693
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: buildbot <build@couchbase.com>
    vmx committed with vmx Jan 15, 2016
Commits on Jan 15, 2016
  1. @vmx

    MB-17382: Expand bounding box on subsequent calls

    There can be several flushes of the KVs during the initial indexing.
    Make sure the bounding box is calculated for the whole data set and
    not just the current call.
    
    Change-Id: I1d4e7f544a981a047d26cb2fe7e70116b57c86ac
    Reviewed-on: http://review.couchbase.org/58692
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Jan 15, 2016
Commits on Jan 7, 2016
  1. @vmx

    MB-7013: Update Apache CouchDB section in the README

    Change-Id: If371b5317a3bd36e8c3012e162a0b024d154e721
    Reviewed-on: http://review.couchbase.org/58339
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    vmx committed Jan 7, 2016
Commits on Aug 10, 2015
  1. @vmx

    MB-15975: Always find a split candidate

    There was a case where no split candidate was found. It happens when
    there are large nodes (e.g. due to large geometries) where the splitting
    rules need to be relaxed.
    
    In this particular case it happens when there are two nodes where the
    minimum fill rule can't be achieved for both nodes. It is then ignored.
    Instead the first partition of the split candidate is filled up to the
    maximum fill rate.
    
    If the last node in a list of nodes leads to this overflow, it will still
    be part of the first partition. This would lead to an empty second partition.
    
    The fix is to always make sure the second partition has at least one node.
    
    Change-Id: I1971306f20fbc0afe917b8754bd8e430f43a58c1
    Reviewed-on: http://review.couchbase.org/54222
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: buildbot <build@couchbase.com>
    vmx committed with vmx Aug 7, 2015
Commits on Jun 22, 2015
  1. @vmx

    MB-15256: Don't allow mixed views in design documents

    A design document may only contain mapreduce *or* spatial views. If
    you try to add a design document with mixed views an error is thrown:
    
        $ curl -X PUT 'http://localhost:8092/default/_design/mapreduce' -d '{"views":{"mr":{"map":"function (doc, meta) {\n  emit(meta.id, null);\n}"}}}' -H 'Content-Type: application/json'
        {"ok":true,"id":"_design/mapreduce"}
    
        $ curl -X PUT 'http://localhost:9500/default/_design/spatial' -d '{"spatial":{"sp":"function (doc) {\n  if (doc.geometry) {\n    emit([doc.geometry], null);\n  }\n}"}}' -H 'Content-Type: application/json'
        {"ok":true,"id":"_design/spatial"}
    
        $ curl -X PUT 'http://localhost:9500/default/_design/mixed' -d '{"views":{"mr":{"map":"function (doc, meta) {\n  emit(meta.id, null);\n}"}}, "spatial":{"sp":"function (doc) {\n  if (doc.geometry) {\n    emit([doc.geometry], null);\n  }\n}"}}' -H 'Content-Type: application/json'
        {"error":"invalid_design_document","reason":"A design document may only contain mapreduce *or* spatial views"}
    
    Change-Id: I03a91ef02a8f4cbc30e0396022264acb8d23591b
    Reviewed-on: http://review.couchbase.org/52068
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Jun 15, 2015
Commits on Jun 18, 2015
  1. @vmx

    MB-15315: Re-introducing validation for spatial views

    During the rewrite of the spatial views for Couchbase 3.x the validation
    of the spatial views [1] got lost. This commits adds it back.
    
    [1]: f89b626
    
    Change-Id: Id8e397f01c3abcefba02d6d7f50a53c8d111986b
    Reviewed-on: http://review.couchbase.org/52065
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    vmx committed with vmx Jun 15, 2015
Commits on May 6, 2015
  1. @vmx

    MB-14779: Throw error when key is not an array or GeoJSON geometry

    In spatial views the key need to follow certain rules. It must be either
    an array of numbers, an array with a leading GeoJSON geometry or (for
    legacy support) a single GeoJSON geometry. If something else is emitted,
    like a boolean a string or `null`, throw an error:
    
        The key must be an array of numbers which might
        have a GeoJSON geometry as first element.
    
    Change-Id: I23211c916a3145f58150e25b50f887128f555e13
    Reviewed-on: http://review.couchbase.org/50564
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx May 4, 2015
Commits on Apr 20, 2015
  1. @vmx

    MB-14470: Make spatial views work with active replica partitions

    If some replica partitions are active, the spatial view merger failed.
    
    Change-Id: I3adaa16d6b4c53f189fd582fe43dd682a5dd0082
    Reviewed-on: http://review.couchbase.org/49741
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    vmx committed with vmx Apr 15, 2015
Commits on Apr 15, 2015
  1. @vmx

    MB-14401: Unit test for emitting a large geometry as key

    Change-Id: I2bc309cb8fe55ab074919c1ea63ba9826e4943b8
    Reviewed-on: http://review.couchbase.org/49617
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Apr 13, 2015
Commits on Feb 27, 2015
  1. @vmx

    MB-13502 Get view name from indexer specific record

    Change-Id: I06d6638642dc8be576103246294b67873c0f1e28
    Reviewed-on: http://review.couchbase.org/47182
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Feb 19, 2015
Commits on Feb 23, 2015
  1. @vmx

    MB-13125: Make multiple emits with same key possible

    Spatial views now support multiple emits with the same key. An example
    would be an application where you emit all things that are located at
    a single address (point). This address would have a restaurant at the
    ground floor and a marketing agency above.
    
        var key = [doc.lon, doc.lan];
        emit(key, "restaurant");
        emit(key, "marketing agency");
    
    Change-Id: I62843399e6e915c9efe06471270c292e0d6d6f85
    Reviewed-on: http://review.couchbase.org/45977
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Jan 16, 2015
Commits on Feb 20, 2015
  1. @vmx

    Use the discovered dialyzer

    Instead of expecting to have dialyzer in the search path, use the
    path that CMake discovered.
    
    Change-Id: Idd60ca05064216c603c135a059777c37b5b6c470
    Reviewed-on: http://review.couchbase.org/47083
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Dave Rigby <daver@couchbase.com>
    vmx committed with vmx Feb 19, 2015
Commits on Feb 3, 2015
  1. @vmx

    MB-13125: Use indexer specific function

    The `view_insert_doc_query_results/6` was moved into the indexer
    specific module, hence the spatial views need an implementation of
    it.
    
    This is a preparation to support emitting several values with the same
    key in spatial views.
    
    Change-Id: Ic3e89bb28f54d14659c160174beff5409f1d5421
    Reviewed-on: http://review.couchbase.org/45976
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Jan 16, 2015
  2. @vmx

    Add test for multiple emits

    Within a spatial view function you can call emit more than once.
    
    Change-Id: Ib8da46015939d46ef4c577385ce018c72c078a05
    Reviewed-on: http://review.couchbase.org/45458
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Jan 13, 2015
Commits on Jan 28, 2015
  1. @vmx

    MB-13084: Use `couch_set_view_updater` module

    Instead of having our own implementation of the
    `index_builder_wait_loop`, share a single one with the mapreduce
    views.
    
    Change-Id: Ic73469efb9366d606a495bb7fd4223c115305fb8
    Reviewed-on: http://review.couchbase.org/45457
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    vmx committed with vmx Jan 12, 2015
Commits on Jan 23, 2015
  1. @vmx

    MB-13192: Use the escript found by CMake

    Instead of relying `escript` to be set via `PATH` correctly, use
    the `escript` that was found by CMake (`${ESCRIPT_EXECUTABLE}`).
    
    Change-Id: I406276998dab802613d5859ce8ee0c8b4c734834
    Reviewed-on: http://review.couchbase.org/45783
    Reviewed-by: Dave Rigby <daver@couchbase.com>
    Tested-by: buildbot <build@couchbase.com>
    vmx committed with vmx Jan 23, 2015
Commits on Jan 22, 2015
  1. @vmx

    MB-13084: `#writer_acc{}` record is no longer used

    The spatial views code no longer needs access to `#writer_acc{}` record
    which is used internally in the `couch_set_view_updater` module.
    
    Change-Id: Ib304a80ae8c8c4c041a4e724a3ff9d2f8730978c
    Reviewed-on: http://review.couchbase.org/45456
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Jan 12, 2015
  2. @vmx

    MB-13084: Implement `view_name/2`

    The updater needs the `view_name/2` function for a proper error
    message.
    
    Change-Id: Id87df97eab147866768cba6e9733bcc26aacae2e
    Reviewed-on: http://review.couchbase.org/45455
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Jan 12, 2015
  3. @vmx

    MB-13084: Remove no longer needed callbacks

    Some callbacks are no longer needed after a lot of code from the
    couch_set_views was moved into Couchstore.
    
    Change-Id: Ia5ad3c3487cadcbc0d29da2939139875df6b7d05
    Reviewed-on: http://review.couchbase.org/45454
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Jan 12, 2015
Commits on Jan 16, 2015
  1. @vmx

    CBIDXT-253: Encode geometries as WKB (Well-Known Binary)

    The geometries were stored as Erlang terms on disk. This is bad for
    interoperability. The geometries are now stored as WKB (Well-Known Binary).
    
    Change-Id: I41b8cf811ee9e4382a0a0b4e49913496a5d329cb
    Reviewed-on: http://review.couchbase.org/45342
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: buildbot <build@couchbase.com>
    vmx committed with vmx Jan 12, 2015
  2. @vmx

    CBIDXT-253: Build the wkb library

    Use CMake to build the wkb library.
    
    Change-Id: I3f3b7e53432b54da60991850b6fc3edc5c040489
    Reviewed-on: http://review.couchbase.org/45341
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    vmx committed with vmx Jan 12, 2015
  3. @vmx

    CBIDXT-253: Add wkb library

    Add the wkb library in order to encode geometries as Well-Known Binary (WKB).
    
    The library was originally a WKB writer only and created by Cloudant. It's
    licensed under the Apache License 2.0.
    
    I extended it with a WKB reader.
    
    This commit includes the full library, but without the build system, as it
    originally uses rebar, but Couchbase uses CMake.
    
    Change-Id: I04096132ed7d559bf7dd0ec6d5b137c804e249ca
    Reviewed-on: http://review.couchbase.org/45340
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Jan 12, 2015
Commits on Jan 14, 2015
  1. @vmx

    Use existing function (DRY)

    There is already a function to decode the MBB, use that one
    instead of re-implementing it.
    
    Change-Id: If9405e1952bfb7f98d10409a23526cdbf5add8f6
    Reviewed-on: http://review.couchbase.org/45087
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Jan 8, 2015
  2. @vmx

    CBIDXT-255: Add tests for compaction

    Change-Id: I15a1a6ad7f0b69c3610e57d43f1be468dd213da8
    Reviewed-on: http://review.couchbase.org/45093
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Jan 8, 2015
  3. @vmx

    MB-12903: Update the spatial view from the tmp files

    The spatial view files are not updated from the temporary files the
    updater writes to disk. This is similar to the way the mapreduce views
    work. The difference is that the spatial views are still updated from
    Erlang and not with the C-based native updater.
    
    Change-Id: I212c0d1a0110558e805accecb3a5940667d60744
    Reviewed-on: http://review.couchbase.org/44386
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
    vmx committed with vmx Dec 15, 2014
Commits on Jan 8, 2015
  1. @vmx

    MB-12903: Implementation of `convert_back_index_kvs_to_binary/2`

    Adding an implementation of `convert_back_index_kvs_to_binary/2` that the
    updater can use. It's very similar to the mapreduce view implementaiton
    except for the key encoding.
    
    Change-Id: I24d16421a3489f6127d4c72bc4c18f3382db0047
    Reviewed-on: http://review.couchbase.org/44385
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Dec 15, 2014
  2. @vmx

    MB-12903: Implement functions for updater

    The index updater needs some indexer specific function. This commit
    implements and exports such function.
    
    Change-Id: Ifcc679b0c4c0553c4d98b106a2b3ebc6f5ccb746
    Reviewed-on: http://review.couchbase.org/44384
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Dec 15, 2014
  3. @vmx

    MB-12903: Make key encoding more uniform

    The returned keys from `calc_mbb/1` were a flat list of doubles, which is
    never the case in other places of the code. The key is either a list of
    2-tuples to 2-element lists containing doubles. Hence change to the commonly
    used format of a list of 2-element lists containing doubles.
    
    Change-Id: If3172be587a3e5c96a120edde1b04c4d50de96e8
    Reviewed-on: http://review.couchbase.org/44383
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Dec 15, 2014
Commits on Jan 7, 2015
  1. @vmx

    Add type spec for `maybe_process_key/1`

    Change-Id: If70a96340a024199bda6ee0bdef2b0700827b799
    Reviewed-on: http://review.couchbase.org/44382
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    vmx committed with vmx Dec 15, 2014
Commits on Dec 9, 2014
  1. @vmx

    MB-12852: Re-introduce _info handler

    To get information about a spatial view group/design document there is
    now the per node `_info` handler at
    `/_spatial_view/bucketname/_design/designname/_info`. It should be used
    for debugging purpose only as it is an expensive call.
    
    Change-Id: I1102211653d4ed26ae40823a0db071a1df1cd1bc
    Reviewed-on: http://review.couchbase.org/43960
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    vmx committed with vmx Dec 4, 2014
  2. @vmx

    MB-12852: Return correct disk size

    The function to return the correct disk size in the `_info` handler
    wasn't yet implemented.
    
    Change-Id: I0ffca9b281f9c473628165127709377f8d077cb5
    Reviewed-on: http://review.couchbase.org/44106
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    vmx committed with vmx Dec 8, 2014
Something went wrong with that request. Please try again.