All those options work, but you could also just follow the Ra code and implement a callback with the result. The Ra layers can then batch or stream the result as they wish.
Bert
Sent from Windows Mail
From: Philip Martin
Sent: Thursday, December 19, 2013 3:28 PM
To: Subversion Development
Philip Martin <philip.martin_at_wandisco.com> writes:
> Once we have all the paths arriving at the server in one request we can
> add new FS APIs to lock/unlock multiple paths, then sort the paths and
> write each index file only once.
I'm wondering what sort of API would be suitable here if we were to do
this. We currently have
svn_error_t *
svn_fs_lock(svn_lock_t **lock,
svn_fs_t *fs,
const char *path,
const char *token,
const char *comment,
svn_boolean_t is_dav_comment,
apr_time_t expiration_date,
svn_revnum_t current_rev,
svn_boolean_t steal_lock,
apr_pool_t *pool);
Suppose we were to pass an array of paths and tokens, and return an
array of locks:
svn_error_t *
svn_fs_lock(apr_array_header_t **locks,
svn_fs_t *fs,
apr_array_header_t *paths,
apr_array_header_t *tokens,
const char *comment,
svn_boolean_t is_dav_comment,
apr_time_t expiration_date,
svn_revnum_t current_rev,
svn_boolean_t steal_lock,
apr_pool_t *pool);
That could be implemented but the tricky bit is error handling when some
paths can be locked and others cannot. When the single path function is
invoked multiple times the result is some paths locked while others
generate warnings such as:
svn: warning: apr_err=SVN_ERR_FS_NOT_FOUND
svn: warning: W160013: Path '/A/B/C/h' doesn't exist in HEAD revision
svn: warning: apr_err=SVN_ERR_FS_PATH_ALREADY_LOCKED
svn: warning: W160035: Path '/A/B/C/g' is already locked by user 'pm' in filesystem 'd79b647c-16e3-4f8b-8e91-65796fcf634a'
A multiple path function would probably want to preserve the behaviour
that allows locking and unlocking a partial set of paths, after all we
rely on this in out own code. The locks array would be OK, we could
return NULL elements for paths that are not locked, but how do we return
the corresponding errors?
Do we chain the errors together in the single return error? Do we
return an array of errors as well as an array of locks?
--
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2013-12-19 16:19:45 CET