Skip to content
Commits on Jan 22, 2016
  1. @vmx

    MB-17460: Fix compaction for empty spatial views

    vmx committed with vmx
    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>
Commits on Jan 18, 2016
  1. @vmx

    Fix typespec

    vmx committed with vmx
    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>
Commits on Jan 15, 2016
  1. @vmx

    MB-17382: Expand bounding box on subsequent calls

    vmx committed with vmx
    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>
Commits on Jan 7, 2016
  1. @vmx

    MB-7013: Update Apache CouchDB section in the README

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

    MB-15975: Always find a split candidate

    vmx committed with vmx
    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>
Commits on Jun 22, 2015
  1. @vmx

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

    vmx committed with vmx
    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>
Commits on Jun 18, 2015
  1. @vmx

    MB-15315: Re-introducing validation for spatial views

    vmx committed with vmx
    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>
Commits on May 6, 2015
  1. @vmx

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

    vmx committed with vmx
    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>
Commits on Apr 20, 2015
  1. @vmx

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

    vmx committed with vmx
    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>
Commits on Apr 15, 2015
  1. @vmx

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

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

    MB-13502 Get view name from indexer specific record

    vmx committed with vmx
    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>
Commits on Feb 23, 2015
  1. @vmx

    MB-13125: Make multiple emits with same key possible

    vmx committed with vmx
    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>
Commits on Feb 20, 2015
  1. @vmx

    Use the discovered dialyzer

    vmx committed with vmx
    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>
Commits on Feb 3, 2015
  1. @vmx

    MB-13125: Use indexer specific function

    vmx committed with vmx
    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>
  2. @vmx

    Add test for multiple emits

    vmx committed with vmx
    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>
Commits on Jan 28, 2015
  1. @vmx

    MB-13084: Use `couch_set_view_updater` module

    vmx committed with vmx
    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>
Commits on Jan 23, 2015
  1. @vmx

    MB-13192: Use the escript found by CMake

    vmx committed with vmx
    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>
Commits on Jan 22, 2015
  1. @vmx

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

    vmx committed with vmx
    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>
  2. @vmx

    MB-13084: Implement `view_name/2`

    vmx committed with vmx
    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>
  3. @vmx

    MB-13084: Remove no longer needed callbacks

    vmx committed with vmx
    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>
Commits on Jan 16, 2015
  1. @vmx

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

    vmx committed with vmx
    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>
  2. @vmx

    CBIDXT-253: Build the wkb library

    vmx committed with vmx
    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>
  3. @vmx

    CBIDXT-253: Add wkb library

    vmx committed with vmx
    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>
Commits on Jan 14, 2015
  1. @vmx

    Use existing function (DRY)

    vmx committed with vmx
    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>
  2. @vmx

    CBIDXT-255: Add tests for compaction

    vmx committed with vmx
    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>
  3. @vmx

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

    vmx committed with vmx
    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>
Commits on Jan 8, 2015
  1. @vmx

    MB-12903: Implementation of `convert_back_index_kvs_to_binary/2`

    vmx committed with vmx
    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>
  2. @vmx

    MB-12903: Implement functions for updater

    vmx committed with vmx
    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>
  3. @vmx

    MB-12903: Make key encoding more uniform

    vmx committed with vmx
    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>
Commits on Jan 7, 2015
  1. @vmx

    Add type spec for `maybe_process_key/1`

    vmx committed with vmx
    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>
Commits on Dec 9, 2014
  1. @vmx

    MB-12852: Re-introduce _info handler

    vmx committed with vmx
    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>
  2. @vmx

    MB-12852: Return correct disk size

    vmx committed with vmx
    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>
  3. @vmx

    MB-12852: Return correct result from view info

    vmx committed with vmx
    The root node might be empty or the key on the root node might not be
    set, hence the MBB needs to be calculated differently.
    
    Change-Id: Ifd4b3752491e602b263a7a5c929dc1534fae3790
    Reviewed-on: http://review.couchbase.org/44105
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
  4. @vmx

    MB-12819: Change signature calculation of spatial views

    vmx committed with vmx
    The spatial views now also take the name of the spatial view function
    into account (just like mapreduce views). When you change the name of
    the function and not the function itself, the view signature will still
    change and the view will be re-created.
    
    Re-sorting of the view functions within the JSON object won't change
    the function signature.
    
    Change-Id: Ifbe16f9ef2d40eebc6c583aa281e0df6de9e2ad0
    Reviewed-on: http://review.couchbase.org/43838
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
Commits on Nov 20, 2014
  1. @vzasade @alk

    MB-8872 allow ns_server to implement auth for _spatial_merge handler

    vzasade committed with alk
    needed for http://review.couchbase.org/43428/
    
    Change-Id: I2f0900459269746a51819478285e19fd02b56804
    Reviewed-on: http://review.couchbase.org/43429
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
Something went wrong with that request. Please try again.