# HG changeset patch # User mas01cr # Date 1220283305 0 # Node ID cc3f9d1ca2cdf4113cb5dcbf6374afa651ade83e # Parent a0493f86153145733ba88802c117cbc58c064ebb Ugly hack upon ugly hack: * extend adb__query() to take a bunch of other arguments that allow useful functionality through to the SOAP server; * alter the RadiusQuery reporter so that the count for tracks is returned through SOAP, punning one of the result fields for the purpose; * alter argv construction to be more dynamic, to reflect that the very presence of some arguments changes audioDB behaviour. Now test 0020 passes, only some 12 months after it was originally written, yay. Alter test 0050 also, so that the results are actually vaguely what would be expected from a radius search; they are not completely checked for correctness, but are (apart from the last two) the same as test 0040. I believe that the modifications are backward compatible; lightly testing with an old audioDB binary suggests that old-format SOAP queries continue to work. Currently too baby-encumbered to think of how to test this fully. diff -r a0493f861531 -r cc3f9d1ca2cd audioDBws.h --- a/audioDBws.h Sun Aug 31 08:45:22 2008 +0000 +++ b/audioDBws.h Mon Sep 01 15:35:05 2008 +0000 @@ -44,6 +44,6 @@ int adb__status(xsd__string dbName, struct adb__statusResponse &adbStatusResponse); // Query an existing adb database -int adb__query(xsd__string dbName, xsd__string qKey, xsd__string keyList, xsd__string timesFileName, xsd__int qType, xsd__int qPos, xsd__int pointNN, xsd__int segNN, xsd__int segLen, struct adb__queryResponse &adbQueryResponse); +int adb__query(xsd__string dbName, xsd__string qKey, xsd__string keyList, xsd__string timesFileName, xsd__string powerFileName, xsd__int qType, xsd__int qPos, xsd__int pointNN, xsd__int segNN, xsd__int segLen, xsd__double radius, xsd__double absolute_threshold, xsd__double relative_threshold, xsd__int exhaustive, xsd__int lsh_exact, struct adb__queryResponse &adbQueryResponse); int adb__sequenceQueryByKey(xsd__string dbName,xsd__string trackKey, xsd__string featureFileName, xsd__int queryType,xsd__string trackFileName,xsd__string timesFileName,xsd__int queryPoint,xsd__int pointNN,xsd__int trackNN,xsd__int sequenceLength,xsd__double radius,xsd__double absolute_threshold,xsd__int usingQueryPoint,xsd__int lsh_exact,struct adb__queryResponse &adbQueryResponse); diff -r a0493f861531 -r cc3f9d1ca2cd reporter.h --- a/reporter.h Sun Aug 31 08:45:22 2008 +0000 +++ b/reporter.h Mon Sep 01 15:35:05 2008 +0000 @@ -511,7 +511,7 @@ ((adb__queryResponse*)adbQueryResponse)->result.Rlist[k] = new char[O2_MAXFILESTR]; ((adb__queryResponse*)adbQueryResponse)->result.Dist[k] = 0; ((adb__queryResponse*)adbQueryResponse)->result.Qpos[k] = 0; - ((adb__queryResponse*)adbQueryResponse)->result.Spos[k] = 0; + ((adb__queryResponse*)adbQueryResponse)->result.Spos[k] = r.count; if(fileTable) snprintf(((adb__queryResponse*)adbQueryResponse)->result.Rlist[k], O2_MAXFILESTR, "%s", fileTable+r.trackID*O2_FILETABLE_ENTRY_SIZE); else diff -r a0493f861531 -r cc3f9d1ca2cd soap.cpp --- a/soap.cpp Sun Aug 31 08:45:22 2008 +0000 +++ b/soap.cpp Mon Sep 01 15:35:05 2008 +0000 @@ -33,18 +33,33 @@ struct soap soap; adb__queryResponse adbQueryResponse; VERB_LOG(1, "Calling fileName query on database %s with featureFile=%s\n", dbName, featureFileName); - soap_init(&soap); - if(soap_call_adb__query(&soap,hostport,NULL, - (char*)dbName,(char*)featureFileName,(char*)trackFileName,(char*)timesFileName, - queryType, queryPoint, pointNN, trackNN, sequenceLength, adbQueryResponse)==SOAP_OK){ - //std::std::cerr << "result list length:" << adbQueryResponse.result.__sizeRlist << std::std::endl; - for(int i=0; i testoutput -echo testfeature 1 0 0 > test-expected-output +echo testfeature 1 > test-expected-output cmp testoutput test-expected-output ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 1 -f testquery -w testpower -p 0 -R 1 > testoutput -echo testfeature 1 0 0 > test-expected-output +echo testfeature 1 > test-expected-output cmp testoutput test-expected-output ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 1 -f testquery -w testpower -p 1 -R 1 > testoutput -echo testfeature 1 1 0 > test-expected-output +echo testfeature 1 > test-expected-output cmp testoutput test-expected-output ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 1 -f testquery -w testpower -e -R 1 > testoutput -echo testfeature 1 0 0 > test-expected-output +echo testfeature 3 > test-expected-output cmp testoutput test-expected-output ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 1 -f testquery -w testpower -e -R 1 --lsh_exact > testoutput -echo testfeature 1 0 0 > test-expected-output +echo testfeature 3 > test-expected-output cmp testoutput test-expected-output # make index, sequenceLength=2 @@ -70,15 +70,15 @@ # query, sequenceLength=2 ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 2 -f testquery -w testpower -p 0 -R 1 > testoutput -echo testfeature 1.33333 0 0 > test-expected-output +echo testfeature 1 > test-expected-output cmp testoutput test-expected-output ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 2 -f testquery -w testpower -p 1 -R 1 > testoutput -echo testfeature 1 1 0 > test-expected-output +echo testfeature 1 > test-expected-output cmp testoutput test-expected-output ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 2 -f testquery -w testpower -p 0 -R 1 --lsh_exact > testoutput -echo testfeature 1.33333 0 0 > test-expected-output +echo testfeature 1 > test-expected-output cmp testoutput test-expected-output stop_server $!