phuchuynh9994 commented on a change in pull request #6809:
URL: https://github.com/apache/incubator-pinot/pull/6809#discussion_r616301172



##########
File path: 
pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java
##########
@@ -63,20 +63,21 @@
 
   @Override
   public void init(PinotConfiguration config) {
-    LOGGER.info("Configs are: {}, {}",
-            PROJECT_ID,
-            config.getProperty(PROJECT_ID));
+    Credentials credentials;
 
-    checkArgument(!isNullOrEmpty(config.getProperty(PROJECT_ID)));
-    checkArgument(!isNullOrEmpty(config.getProperty(GCP_KEY)));
-    String projectId = config.getProperty(PROJECT_ID);
-    String gcpKey = config.getProperty(GCP_KEY);
     try {
-      storage = StorageOptions.newBuilder()
-          .setProjectId(projectId)
-          
.setCredentials(GoogleCredentials.fromStream(Files.newInputStream(Paths.get(gcpKey))))
-          .build()
-          .getService();
+      StorageOptions.Builder storageBuilder = StorageOptions.newBuilder();
+      if (!isNullOrEmpty(config.getProperty(PROJECT_ID)) && 
!isNullOrEmpty(config.getProperty(GCP_KEY))) {
+        LOGGER.info("Configs are: {}, {}", PROJECT_ID, 
config.getProperty(PROJECT_ID));
+        String projectId = config.getProperty(PROJECT_ID);
+        String gcpKey = config.getProperty(GCP_KEY);
+        storageBuilder.setProjectId(projectId);

Review comment:
       PROJECT_ID is a part of service account. 
   I think in passing credentials manually way, we dont need PROOECT_ID also. 
   Ref doc: 
https://cloud.google.com/docs/authentication/production#linux-or-macos




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to