Project

General

Profile

Actions

Feature #1091

closed

librados: support pgls filter

Added by Colin McCabe almost 13 years ago. Updated over 9 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

pgls_filter support was removed in the librados API redesign while we were converting everything to iterators. I still have a TODO note to add it back in. I guess I should add that to the tracker.

There are, and were, no users. A unit test and some documentation would need to be written.

I guess if we wanted to do it right, we would need something like an abstract class ObjectFilter, a few Filters implementing that filter, and a constructor for librados::ObjectIterator that took an ObjectFilter.


Related issues 1 (0 open1 closed)

Is duplicate of Ceph - Feature #9262: Additional namespace issuesResolvedDavid Zafman08/27/2014

Actions
Actions #1

Updated by Yehuda Sadeh almost 13 years ago

Note that the filtering is being done on the osd side.

Actions #2

Updated by Colin McCabe almost 13 years ago

Yeah. If the filtering were done on the librados side, there would be little point to the API.

However, even though the filtering is done by the Objecter, we still need to export a reasonable API.

Actions #3

Updated by Greg Farnum almost 13 years ago

The Objecter is client-side. The filtering is done by the OSD, so as to preserve network bandwidth and reduce client memory use. So I don't recall what the filtering options are, but changing them will require work on the OSD and a communications protocol for them, not just Objecter stuff.

Actions #4

Updated by Yehuda Sadeh almost 13 years ago

The original librados list_filter() had the following:

void Rados::list_filter(Rados::ListCtx& ctx, bufferlist& filter, bufferlist *extra_info);

where filter encodes the filter type (as a string), following the specific filter parameters. Currently the osd supports two filters:
  • plain (IMO should be renamed to 'xattr'): filters only objects with a specific xattr value. Passed parameters are xattr name and value.
  • parent: searches for entries that have a specific parent ino. Passed parameter is the ino (as integer).

We should also be able to filter entries by their name. A more generic parameter passing for the name/xattr filtering should be:
<value type, e.g., xattr or name> <filter type, e.g. prefix/contains/suffix> <value> <...>

The extra_info parameter is for extra information in the response. In the 'parent' filter it holds the back pointer.

I assume that we can define a base class for the pgls_filter iterators and specialize it according to the filter type. However, we should also make a lower level generic api available.

Actions #5

Updated by Colin McCabe almost 13 years ago

I assume that we can define a base class for the pgls_filter iterators and
specialize it according to the filter type.

I think my favorite approach would be having functions like this:

librados::ObjectIterator begin_objects();
librados::ObjectIterator begin_objects_filtered(const PGListFilter &filter);

Then you have a class PGListFilter with some static methods

PGListFilter PGListFilter::create_by_name(const std::string &name);
PGListFilter PGListFilter::create_by_xattr(const std::string &xattr_key, const std::string &xattr_val);

I wouldn't make any kind of lower level API available in librados. We want the flexibility to change the implementation later. Letting people fool with binary buffers will confuse users and potentially lock us in to a suboptimal implementation.

Just my $0.02

C.

Actions #6

Updated by Sage Weil over 12 years ago

  • Target version set to 52
Actions #7

Updated by Sage Weil over 12 years ago

  • Target version deleted (52)
  • Translation missing: en.field_position set to 228
Actions #8

Updated by Sage Weil over 12 years ago

  • Translation missing: en.field_position deleted (227)
  • Translation missing: en.field_position set to 824
Actions #9

Updated by Loïc Dachary over 9 years ago

  • Status changed from New to Duplicate
Actions

Also available in: Atom PDF