Skip to content
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

Use rename LRO on HN buckets #1140

Merged

Conversation

arunkumarchacko
Copy link
Contributor

No description provided.

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

1 similar comment
@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

3 similar comments
@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@@ -173,6 +174,10 @@ public void close() {
}
}

public void renameHnFolder(URI src, URI dst) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this be taken care by ForwardingGoogleCloudStorage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change in made in the ForwardingGoogleCloudStroage as well. Not sure if I understood the comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant to say why we need to override it in GCSClientImpl? I don't see implementation of it is not deviating from ForwardingGoogleCloudStorage implementation.

@@ -122,6 +126,9 @@ public class GoogleCloudStorageImpl implements GoogleCloudStorage {
.setEnsureEmptyObjectsMetadataMatch(false)
.build();

private static Cache<String, Boolean> cache =
Copy link
Contributor

Choose a reason for hiding this comment

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

cache for what?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that we need to check if the bucket is HN enabled before we use rename operation. We are caching this information, rather than calling this before each rename.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand that, I meant to say we can improve of variable name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair point.

@@ -444,8 +456,19 @@ public void createBucket(String bucketName, CreateBucketOptions options) throws
Bucket bucket =
new Bucket()
.setName(bucketName)
.setHierarchicalNamespace(
Copy link
Contributor

@singhravidutt singhravidutt Apr 23, 2024

Choose a reason for hiding this comment

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

  1. This flow uses Apiary client to make calls to gcs. HN buckets have visibility in Apiary also?

  2. We we are adding another attribute(setHierarchicalNamespace) to bucket object. What could be the potential impact on existing customers who aren't using HN?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the createBucket flow. We do not support creating HN bucket from connector since we wont know if customer expect to create an HN bucket or non-HN bucket. But we need it for testing purposed. This change is just for testing since it need to create an HN bucket to test.

Copy link
Contributor

Choose a reason for hiding this comment

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

one way of removing any impact on existing customer is to put it under options.getHierarchicalNamespaceEnabled() for eg:

Bucket bucket =
        new Bucket()
            .setName(bucketName)
            .setLocation(options.getLocation())
            .setStorageClass(options.getStorageClass());
if(options.getHierarchicalNamespaceEnabled()) {
    bucket =
        new Bucket()
            .setName(bucketName)
            .setLocation(options.getLocation())
            .setHierarchicalNamespace(.....
            .setStorageClass(options.getStorageClass());
    
    bucket.setIamConfiguration(
          new Bucket.IamConfiguration()
              .setUniformBucketLevelAccess(
                  new Bucket.IamConfiguration.UniformBucketLevelAccess().setEnabled(true)));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

as discussed offline this will be fixed in follow up PR cc: @arunkumarchacko

}

@Override
public void renameHnFolder(URI src, URI dst) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we validate that both src and dst have same Authority i.e. bucket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I will fix this in a later change.

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

2 similar comments
@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@arunkumarchacko arunkumarchacko merged commit 01f76d3 into GoogleCloudDataproc:branch-3.0.x Apr 30, 2024
4 checks passed
@arunkumarchacko arunkumarchacko deleted the renameLro.3.0 branch April 30, 2024 12:32
arunkumarchacko added a commit to arunkumarchacko/hadoop-connectors that referenced this pull request Jun 20, 2024
guljain pushed a commit that referenced this pull request Jun 21, 2024
* Use rename LRO on HN buckets (#1140)

* Disable Cloud build for test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants