Skip to content

feat: version filters #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 23, 2021
Merged

feat: version filters #6

merged 9 commits into from
Nov 23, 2021

Conversation

kboroszko
Copy link
Collaborator

@kboroszko kboroszko commented Nov 8, 2021

This PR adds support for Bigtable version filters.


This change is Reviewable

Copy link

@dopiera dopiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 7 files reviewed, 6 unresolved discussions (waiting on @dopiera and @kboroszko)


tensorflow_io/core/kernels/bigtable/bigtable_dataset_kernel.cc, line 326 at r1 (raw file):

filter_resource_

Given my limited understanding of the lifetimes of these object I think I'd be calmer if we kept the filter rather than the reference to the resource.


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.h, line 49 at r1 (raw file):

  }

  google::cloud::bigtable::Filter& filter() { return filter_; }

I think we should either return a cref or a value or call this member function in a way indicating that it returns a reference.

BTW, don't we need to care about concurrency here?


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.cc, line 48 at r1 (raw file):

      : AbstractBigtableResourceOp<BigtableFilterResource>(ctx) {
    VLOG(1) << "BigtableTimestampRangeFilterOp ctor ";
    OP_REQUIRES_OK(ctx, ctx->GetAttr("start", &start_));

Given that the type is essentially and int, why not make it a bit easier to the reader to figure out what it is and call it start_ts_us or at least start_us to indicate it's a timestamp expressed in microseconds?


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.cc, line 57 at r1 (raw file):

  mutable mutex mu_;

You don't need the mutex, do you?


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.cc, line 59 at r1 (raw file):

  int64_t start_;
  int64_t end_;

These can be const.


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.cc, line 86 at r1 (raw file):

  mutable mutex mu_;

I don't think you need the mutex

Copy link

@dopiera dopiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good in general, I left a couple of nitpicks.

Reviewable status: 0 of 7 files reviewed, 6 unresolved discussions (waiting on @dopiera and @kboroszko)

Copy link
Collaborator Author

@kboroszko kboroszko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 7 files reviewed, 6 unresolved discussions (waiting on @dopiera)


tensorflow_io/core/kernels/bigtable/bigtable_dataset_kernel.cc, line 326 at r1 (raw file):

Previously, dopiera (Marek Dopiera) wrote…
filter_resource_

Given my limited understanding of the lifetimes of these object I think I'd be calmer if we kept the filter rather than the reference to the resource.

Done.


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.h, line 49 at r1 (raw file):

Previously, dopiera (Marek Dopiera) wrote…

I think we should either return a cref or a value or call this member function in a way indicating that it returns a reference.

BTW, don't we need to care about concurrency here?

We set it in the constructor and never change it afterwards, so I'd say we don't since it's read-only. I changed it to const. How about that?


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.cc, line 48 at r1 (raw file):

Previously, dopiera (Marek Dopiera) wrote…

Given that the type is essentially and int, why not make it a bit easier to the reader to figure out what it is and call it start_ts_us or at least start_us to indicate it's a timestamp expressed in microseconds?

Done.


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.cc, line 57 at r1 (raw file):

Previously, dopiera (Marek Dopiera) wrote…
  mutable mutex mu_;

You don't need the mutex, do you?

Done.


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.cc, line 59 at r1 (raw file):

Previously, dopiera (Marek Dopiera) wrote…
  int64_t start_;
  int64_t end_;

These can be const.

They can't because I must set them in the constructor with ctx->GetAttr(name, ptr_to_value).


tensorflow_io/core/kernels/bigtable/bigtable_version_filters.cc, line 86 at r1 (raw file):

Previously, dopiera (Marek Dopiera) wrote…
  mutable mutex mu_;

I don't think you need the mutex

Done.

Copy link

@dopiera dopiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 11 files reviewed, 1 unresolved discussion (waiting on @dopiera)

@kboroszko kboroszko merged commit a8e6bba into master Nov 23, 2021
@kboroszko kboroszko deleted the kb/filters2 branch November 23, 2021 09:24
kboroszko added a commit that referenced this pull request Nov 23, 2021
This PR adds support for Bigtable version filters.
dopiera pushed a commit that referenced this pull request Nov 24, 2021
This PR adds support for Bigtable version filters.
dopiera pushed a commit that referenced this pull request Dec 3, 2021
This PR adds support for Bigtable version filters.
dopiera pushed a commit that referenced this pull request Dec 3, 2021
This PR adds support for Bigtable version filters.
kboroszko added a commit that referenced this pull request Dec 13, 2021
This PR adds support for Bigtable version filters.
kboroszko added a commit that referenced this pull request Dec 20, 2021
This PR adds support for Bigtable version filters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants