-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add GCS Writer Sink and fix Gcs naming #11328
Conversation
✅ Deploy Preview for meta-velox canceled.
|
dd238f3
to
7f01fe0
Compare
d864ae7
to
3efec9f
Compare
10bbb77
to
9da7598
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @majetideepak. Looks good overall; added a bunch of minor comments.
@@ -26,6 +26,14 @@ constexpr std::string_view kGCSScheme{"gs://"}; | |||
|
|||
} // namespace | |||
|
|||
static std::string_view kLoremIpsum = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be defined in a test header somewhere?
|
||
namespace facebook::velox::filesystems { | ||
namespace { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline after namespace definition
return preexistingBucketPath() + preexistingObjectName(); | ||
public: | ||
void SetUp() { | ||
testbench_ = std::make_shared<GCSTestbench>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be called GcsTestBench
instead (same for the file)? Also, what is up with the "bench" in the name? Is this a benchmark utility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses the storage-testbench library. That is probably why. I renamed it to GcsEmulator
https://github.com/googleapis/storage-testbench
|
||
filesystems::GCSFileSystem gcfs(testGcsOptions()); | ||
filesystems::GCSFileSystem gcfs(testbench_->hiveConfig()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. Acronyms are not all upper cases (GcsFileSystem
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed everywhere.
class GCSTestbench : public testing::Environment { | ||
public: | ||
GCSTestbench() { | ||
auto port = std::to_string(facebook::velox::exec::test::getFreePorts(1)[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getFreePort()
instead
serverProcess_.terminate(); | ||
serverProcess_.wait(); | ||
} | ||
if (serverProcess_.valid() && serverProcess_.valid()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intended (checking the same condition twice?). Also, curly braces missing
|
||
namespace facebook::velox::filesystems { | ||
|
||
class GCSTestbench : public testing::Environment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's rename this to something more descriptive and intuitive. "bench" implies benchmarking which is not the intent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Named it as GcsEmulator
.
|
||
objectName_ = "test-object-name"; | ||
google::cloud::StatusOr<gcs::ObjectMetadata> object = | ||
client.InsertObject(bucketName_, objectName_, kLoremIpsum); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably move the loremIpsum stuff here.
ead10a1
to
4ee20f9
Compare
class GcsFileSystemTest : public testing::Test { | ||
public: | ||
void SetUp() { | ||
testbench_ = std::make_shared<GcsEmulator>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could also call this variable something else (emulator_
)?
@pedroerp has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @majetideepak
166dd74
to
2936186
Compare
@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
2936186
to
4cf63d6
Compare
@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Summary: Rename GCS to Gcs in code. Refactor GCS code. Refactor InsertTests so that both S3 and GCS can reuse the implementation. Pull Request resolved: facebookincubator#11328 Reviewed By: DanielHunte Differential Revision: D65069865 Pulled By: kgpai fbshipit-source-id: 4020722f97d9a246d1ed765b697c4f1e8d3a0c2b
Rename GCS to Gcs in code.
Refactor GCS code.
Refactor InsertTests so that both S3 and GCS can reuse the implementation.