comparison audioDB.h @ 548:e18843dc0aea

Implement a rudimentary API for audioDB::liszt The API is rudimentary because we've dropped support for the incremental retrieval of tracks and their number of vectors (at the API level; the SOAP and command-line support is still there -- no changes should be visible). This is potentially bad for the large-scale databases, of course; one million tracks will take of the order of 16MB of RAM, more if I'm unlucky about how std::string.c_str() is implemented. Both this liszt operation and querying (and sampling, forthcoming...) would benefit from a `cursor-like' interface to retrieval results: for an API like that, instead of getting a struct with the data there, you get a cookie with which you can ask the database for successive results. This would be neat for all sorts of reasons. In the meantime, at least this change fixes SOAP memory leaks related to liszt. Make liszt.o part of LIBOBJS rather than ordinary OBJS, so that the liszt functionality is actually compiled into the library. Add a test for this library functionality; also modify the command-line test file to run the SOAP server on its own port.
author mas01cr
date Wed, 11 Feb 2009 12:38:03 +0000
parents 57e459f62788
children 4bd5533d4bf4
comparison
equal deleted inserted replaced
547:5a248cedd3e9 548:e18843dc0aea
271 271
272 public: 272 public:
273 audioDB(const unsigned argc, const char *argv[]); 273 audioDB(const unsigned argc, const char *argv[]);
274 audioDB(const unsigned argc, const char *argv[], struct soap *soap, adb__queryResponse *adbQueryResponse); 274 audioDB(const unsigned argc, const char *argv[], struct soap *soap, adb__queryResponse *adbQueryResponse);
275 audioDB(const unsigned argc, const char *argv[], adb__statusResponse *adbStatusResponse); 275 audioDB(const unsigned argc, const char *argv[], adb__statusResponse *adbStatusResponse);
276 audioDB(const unsigned argc, const char *argv[], adb__lisztResponse *adbLisztResponse); 276 audioDB(const unsigned argc, const char *argv[], struct soap *soap, adb__lisztResponse *adbLisztResponse);
277 277
278 void cleanup(); 278 void cleanup();
279 ~audioDB(); 279 ~audioDB();
280 int processArgs(const unsigned argc, const char* argv[]); 280 int processArgs(const unsigned argc, const char* argv[]);
281 void get_lock(int fd, bool exclusive); 281 void get_lock(int fd, bool exclusive);
289 unsigned random_track(unsigned *propTable, unsigned total); 289 unsigned random_track(unsigned *propTable, unsigned total);
290 void sample(const char *dbName); 290 void sample(const char *dbName);
291 void l2norm(const char* dbName); 291 void l2norm(const char* dbName);
292 void power_flag(const char *dbName); 292 void power_flag(const char *dbName);
293 void dump(const char* dbName); 293 void dump(const char* dbName);
294 void liszt(const char* dbName, unsigned offset, unsigned numLines, adb__lisztResponse* adbLisztResponse=0); 294 void liszt(const char* dbName, unsigned offset, unsigned numLines, struct soap *soap=0, adb__lisztResponse* adbLisztResponse=0);
295 295
296 // LSH indexing parameters and data structures 296 // LSH indexing parameters and data structures
297 LSH* lsh; 297 LSH* lsh;
298 bool lsh_in_core; // load LSH tables for query into core (true) or keep on disk (false) 298 bool lsh_in_core; // load LSH tables for query into core (true) or keep on disk (false)
299 bool lsh_use_u_functions; 299 bool lsh_use_u_functions;