MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RetrieveGcsFs

Function RetrieveGcsFs

tensorflow/contrib/cloud/kernels/gcs_config_ops.cc:45–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43constexpr char kOAuthScope[] = "https://www.googleapis.com/auth/cloud-platform";
44
45Status RetrieveGcsFs(OpKernelContext* ctx, RetryingGcsFileSystem** fs) {
46 DCHECK(fs != nullptr);
47 *fs = nullptr;
48
49 FileSystem* filesystem = nullptr;
50 TF_RETURN_IF_ERROR(
51 ctx->env()->GetFileSystemForFile("gs://fake/file.text", &filesystem));
52 if (filesystem == nullptr) {
53 return errors::FailedPrecondition("The GCS file system is not registered.");
54 }
55
56 *fs = dynamic_cast<RetryingGcsFileSystem*>(filesystem);
57 if (*fs == nullptr) {
58 return errors::Internal(
59 "The filesystem registered under the 'gs://' scheme was not a "
60 "tensorflow::RetryingGcsFileSystem*.");
61 }
62 return Status::OK();
63}
64
65template <typename T>
66Status ParseScalarArgument(OpKernelContext* ctx, StringPiece argument_name,

Callers 2

ComputeMethod · 0.85
ComputeMethod · 0.85

Calls 4

FailedPreconditionFunction · 0.85
InternalFunction · 0.85
GetFileSystemForFileMethod · 0.45
envMethod · 0.45

Tested by

no test coverage detected