suyanhanx commented on code in PR #2892:
URL: 
https://github.com/apache/incubator-opendal/pull/2892#discussion_r1300113383


##########
core/src/services/gdrive/core.rs:
##########
@@ -20,30 +20,31 @@ use std::fmt::Debug;
 use std::fmt::Formatter;
 use std::sync::Arc;
 
+use bytes;
 use http::header;
-use http::request::Builder;
 use http::Request;
 use http::Response;
 use http::StatusCode;
 use serde::Deserialize;
+use serde_json::json;
 use tokio::sync::Mutex;
 
 use super::error::parse_error;
-use crate::raw::build_rooted_abs_path;
-use crate::raw::new_json_deserialize_error;
-use crate::raw::new_request_build_error;
-use crate::raw::percent_encode_path;
-use crate::raw::AsyncBody;
-use crate::raw::HttpClient;
-use crate::raw::IncomingAsyncBody;
+use crate::raw::*;
 use crate::types::Result;
 use crate::Error;
 use crate::ErrorKind;
 
 pub struct GdriveCore {
     pub root: String,
     pub access_token: String,
+
     pub client: HttpClient,
+
+    /// Cache the mapping from path to file id
+    ///
+    /// Google Drive uses file id to identify a file.
+    /// As the path is immutable, we can cache the mapping from path to file 
id.

Review Comment:
   Will do it in next PR.



##########
core/src/services/gdrive/core.rs:
##########
@@ -20,30 +20,31 @@ use std::fmt::Debug;
 use std::fmt::Formatter;
 use std::sync::Arc;
 
+use bytes;
 use http::header;
-use http::request::Builder;
 use http::Request;
 use http::Response;
 use http::StatusCode;
 use serde::Deserialize;
+use serde_json::json;
 use tokio::sync::Mutex;
 
 use super::error::parse_error;
-use crate::raw::build_rooted_abs_path;
-use crate::raw::new_json_deserialize_error;
-use crate::raw::new_request_build_error;
-use crate::raw::percent_encode_path;
-use crate::raw::AsyncBody;
-use crate::raw::HttpClient;
-use crate::raw::IncomingAsyncBody;
+use crate::raw::*;
 use crate::types::Result;
 use crate::Error;
 use crate::ErrorKind;
 
 pub struct GdriveCore {
     pub root: String,
     pub access_token: String,
+
     pub client: HttpClient,
+
+    /// Cache the mapping from path to file id
+    ///
+    /// Google Drive uses file id to identify a file.
+    /// As the path is immutable, we can cache the mapping from path to file 
id.

Review Comment:
   Will do it in the next PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to