comparison soap.cpp @ 329:8f11ea4d9cd2

Added some extra logging to alert the user to which query is called
author mas01mc
date Sat, 30 Aug 2008 14:33:24 +0000
parents 7ff56cce3297
children b1c48012cd3d
comparison
equal deleted inserted replaced
328:7ff56cce3297 329:8f11ea4d9cd2
30 30
31 // WS_QUERY (CLIENT SIDE) 31 // WS_QUERY (CLIENT SIDE)
32 void audioDB::ws_query(const char*dbName, const char *featureFileName, const char* hostport){ 32 void audioDB::ws_query(const char*dbName, const char *featureFileName, const char* hostport){
33 struct soap soap; 33 struct soap soap;
34 adb__queryResponse adbQueryResponse; 34 adb__queryResponse adbQueryResponse;
35 35 VERB_LOG(1, "Calling fileName query on database %s with featureFile=%s\n", dbName, featureFileName);
36 soap_init(&soap); 36 soap_init(&soap);
37 if(soap_call_adb__query(&soap,hostport,NULL, 37 if(soap_call_adb__query(&soap,hostport,NULL,
38 (char*)dbName,(char*)featureFileName,(char*)trackFileName,(char*)timesFileName, 38 (char*)dbName,(char*)featureFileName,(char*)trackFileName,(char*)timesFileName,
39 queryType, queryPoint, pointNN, trackNN, sequenceLength, adbQueryResponse)==SOAP_OK){ 39 queryType, queryPoint, pointNN, trackNN, sequenceLength, adbQueryResponse)==SOAP_OK){
40 //std::std::cerr << "result list length:" << adbQueryResponse.result.__sizeRlist << std::std::endl; 40 //std::std::cerr << "result list length:" << adbQueryResponse.result.__sizeRlist << std::std::endl;
66 asqp.relative_threshold = relative_threshold; 66 asqp.relative_threshold = relative_threshold;
67 asqp.absolute_threshold = absolute_threshold; 67 asqp.absolute_threshold = absolute_threshold;
68 asqp.usingQueryPoint = usingQueryPoint; 68 asqp.usingQueryPoint = usingQueryPoint;
69 asqp.lsh_exact = lsh_exact; 69 asqp.lsh_exact = lsh_exact;
70 */ 70 */
71 71 VERB_LOG(1, "Calling %s query on database %s with %s=%s\n", strlen(trackKey)?"KEY":"FILENAME", dbName, strlen(trackKey)?"KEY":"FILENAME",
72 strlen(trackKey)?trackKey:featureFileName);
72 soap_init(&soap); 73 soap_init(&soap);
73 if(queryType==O2_SEQUENCE_QUERY || queryType==O2_N_SEQUENCE_QUERY){ 74 if(queryType==O2_SEQUENCE_QUERY || queryType==O2_N_SEQUENCE_QUERY){
74 if(soap_call_adb__sequenceQueryByKey(&soap,hostport,NULL, 75 if(soap_call_adb__sequenceQueryByKey(&soap,hostport,NULL,
75 (char*)dbName, 76 (char*)dbName,
76 (char*)trackKey, 77 (char*)trackKey,
117 } 118 }
118 119
119 // Literal translation of command line to web service 120 // Literal translation of command line to web service
120 int adb__query(struct soap* soap, xsd__string dbName, xsd__string qKey, xsd__string keyList, xsd__string timesFileName, xsd__int qType, xsd__int qPos, xsd__int pointNN, xsd__int trackNN, xsd__int seqLen, adb__queryResponse &adbQueryResponse){ 121 int adb__query(struct soap* soap, xsd__string dbName, xsd__string qKey, xsd__string keyList, xsd__string timesFileName, xsd__int qType, xsd__int qPos, xsd__int pointNN, xsd__int trackNN, xsd__int seqLen, adb__queryResponse &adbQueryResponse){
121 char queryType[256]; 122 char queryType[256];
123
124 fprintf(stderr,"Calling fileName query on database %s with featureFile=%s\n", dbName, qKey);
125
122 for(int k=0; k<256; k++) 126 for(int k=0; k<256; k++)
123 queryType[k]='\0'; 127 queryType[k]='\0';
124 if(qType == O2_POINT_QUERY) 128 if(qType == O2_POINT_QUERY)
125 strncpy(queryType, "point", strlen("point")); 129 strncpy(queryType, "point", strlen("point"));
126 else if (qType == O2_SEQUENCE_QUERY) 130 else if (qType == O2_SEQUENCE_QUERY)
198 char pointNNStr[256]; 202 char pointNNStr[256];
199 char trackNNStr[256]; 203 char trackNNStr[256];
200 char seqLenStr[256]; 204 char seqLenStr[256];
201 char absolute_thresholdStr[256]; 205 char absolute_thresholdStr[256];
202 char qtypeStr[256]; 206 char qtypeStr[256];
207
208 fprintf(stderr, "Calling %s query on database %s with %s=%s\n", strlen(trackKey)?"KEY":"FILENAME", dbName, strlen(trackKey)?"KEY":"FILENAME",
209 strlen(trackKey)?trackKey:featureFileName);
203 210
204 /* When the branch is merged, move this to a header and use it 211 /* When the branch is merged, move this to a header and use it
205 elsewhere */ 212 elsewhere */
206 #define INTSTRINGIFY(val, str) \ 213 #define INTSTRINGIFY(val, str) \
207 snprintf(str, 256, "%d", val); 214 snprintf(str, 256, "%d", val);