Opened 9 years ago

Closed 3 years ago

#710 closed enhancement (incomplete)

Public API for allowing custom Remote Protocol Server implementation

Reported by: German M. Bravo Owned by: Olly Betts
Priority: normal Milestone:
Component: Backend-Remote Version: git master
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

To be able to implement a Remote Protocol Server with only the xapian public API, four changes are needed:

  • Add Xapian::Enquire::prepare_mset(): prepares an enquire to get a MSet. Xapian::Weight::Internal is filled with the statistics and a MultiMatch is initialized.
  • Add stats serialisation methods: Xapian::Enquire::serialise_stats() and Xapian::Enquire::unserialise_stats(). These are used by MSG_QUERY and MSG_GETMSET.
  • Add Xapian::MSet::serialise() and Xapian::MSet::unserialise(). Used by MSG_GETMSET.
  • Add Xapian::RSet::serialise() and Xapian::RSet::unserialise(). Used by MSG_QUERY.

The implementation of a custom remote server is desirable for allowing integrations to expose a custom remote server protocol which will permit the creation of full-blown xapian servers with remote or clustering support to efficiently access indexes remotely. An example of such kind of server is Xapiand https://github.com/Kronuz/Xapiand

Attachments (4)

remote_protocol_server_on_public_api.diff (10.6 KB ) - added by German M. Bravo 9 years ago.
Fixed, it now passes all tests
remote_protocol_server_on_public_api.2.diff (9.8 KB ) - added by German M. Bravo 9 years ago.
710-remote_protocol_server_on_public_api.diff (9.8 KB ) - added by German M. Bravo 9 years ago.
710-remote_server_public_api.diff (15.1 KB ) - added by German M. Bravo 9 years ago.

Download all attachments as: .zip

Change History (13)

by German M. Bravo, 9 years ago

Fixed, it now passes all tests

by German M. Bravo, 9 years ago

by German M. Bravo, 9 years ago

by German M. Bravo, 9 years ago

comment:1 by Olly Betts, 8 years ago

Component: Backend-GlassBackend-Remote
Milestone: 1.4.x1.4.2
Status: newassigned

comment:2 by Olly Betts, 8 years ago

While this apparently passes all existing tests, there aren't any feature tests for the new API methods AFAICS.

Last edited 8 years ago by Olly Betts (previous) (diff)

comment:3 by German M. Bravo, 8 years ago

I'm still not familiar with the tests policies, so I'm not really sure at all what tests would be desirable for this. At any rate, I have a fork of xapian in GitHub which has this (and my other patches) as single commits, those could be more up-to-date, I can't remember: https://github.com/Kronuz/xapian/commits/master

comment:4 by Olly Betts, 8 years ago

Milestone: 1.4.21.4.3

I'm still not familiar with the tests policies, so I'm not really sure at all what tests would be desirable for this.

From HACKING:

2) Make sure the tests are right
--------------------------------

 * If you're adding a feature, also add feature tests for it.  These both
   ensure that the feature isn't broken to start with and detect if later
   changes stop it working as intended.

 * If you've fixed a bug, make sure there's a regression test which
   fails on the existing code and succeeds after your changes.

 * Make sure all existing tests continue to pass.

For a new API feature we want to be confident that it works as documented (and as intended!) and that future changes to the code which might break it will be caught before they get into a release, and ideally before they are even merged. Perfection in this regard is that the test suite exercises every line of the source code - that can be hard to fully achieve without disproportionate effort, but the other extreme of a new API method with no test coverage whatsoever is really not acceptable.

I was hoping to merge at least some of this before 1.4.2, but I'd like to get 1.4.2 into the next Debian stable release which basically means we're out of time, so I'm bumping the milestone.

comment:5 by Olly Betts, 8 years ago

Milestone: 1.4.31.4.4

Ticket retargeted after milestone closed

comment:6 by Olly Betts, 8 years ago

Milestone: 1.4.41.4.5

Ticket retargeted after milestone closed

comment:7 by Olly Betts, 7 years ago

Milestone: 1.4.51.4.x

Moving to the 1.4.x milestone. It'd be good to merge this, but I'm not comfortable merging a feature of this scope without any feature tests, and it seems nobody's actively working on adding such tests.

comment:8 by Olly Betts, 5 years ago

Milestone: 1.4.x
Priority: highnormal

We're still lacking feature tests for the new API this adds.

comment:9 by Olly Betts, 3 years ago

Resolution: incomplete
Status: assignedclosed

It's been 5 years since I explained the automated test requirements in detail and there's been no updates since, nor even an indication that any updates would be forthcoming, so I'm going to close this as incomplete.

Note: See TracTickets for help on using tickets.