Aloha,
I'm implementing a replica management abstraction on top of the Globus
RLS C API. So far, I was quite successful but I got stuck when I
tried to retrieve a list of all available LFNs from a LRC. AFAIK
there's no API call to do that directly, so I used
globus_rls_client_lrc_get_lfn_wc() function with "*" as a wildcard
which should give me a list of all LFNs. The code looks like this:
std::vector<std::string> LFNList;
globus_result_t result = GLOBUS_FALSE;
int offset=0; globus_list_t * result_list;
result = globus_rls_client_lrc_get_lfn_wc(RLSHandle,
"*",
rls_pattern_unix,
&offset,
200, // reslimit
&result_list);
if (result != GLOBUS_RLS_SUCCESS) {
throw globus_rls_replica_adaptor::exception(result);
}
else
{
globus_list_t *p;
globus_rls_string2_t *str2;
for (p = result_list; p; p = globus_list_rest(p)) {
str2 = (globus_rls_string2_t *) globus_list_first(p);
LFNList.push_back(std::string(str2->s1));
}
globus_rls_client_free_list(p);
globus_rls_client_free_list(result_list);
}
It seems to work but I'm not very satisfied with the results:
* It's _incredibly_ sloooooow
* If a LFN has n different PFNs, the LFN shows up n-times in the
result list
* If I don't use "*" as wildcard string (e.g. "/MY/REPLICAS/*") the
app crashes after some time:
test_rls_replica(9291,0xa0672f60) malloc: *** mmap(size=2097152)
failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
test_rls_replica(9291,0xa0672f60) malloc: *** mmap(size=2097152)
failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
terminate called after throwing an instance of 'St9bad_alloc'
what(): St9bad_alloc
Has anybody experienced something similar or does anybody know a
better solution to list LFNs? Any help is much appreciated!
Cheers,
Ole