Copilot commented on code in PR #16884:
URL: https://github.com/apache/pinot/pull/16884#discussion_r2393511694


##########
pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java:
##########
@@ -70,9 +72,15 @@ public class GcsPinotFS extends BasePinotFS {
 
   @Override
   public void init(PinotConfiguration config) {
+    String version = GcsPinotFS.class.getPackage().getImplementationVersion();
+    if (version == null) {
+      version = "unknown";
+    }
+    String userAgent = "apache-pinot/" + version + " (GPN:apache-pinot)";

Review Comment:
   [nitpick] The User-Agent construction logic should be extracted to a private 
method or constant to improve maintainability and testability. This also allows 
for easier modification of the User-Agent format in the future.
   ```suggestion
     private static String buildUserAgent(String version) {
       return "apache-pinot/" + version + " (GPN:apache-pinot)";
     }
   
     @Override
     public void init(PinotConfiguration config) {
       String version = 
GcsPinotFS.class.getPackage().getImplementationVersion();
       if (version == null) {
         version = "unknown";
       }
       String userAgent = buildUserAgent(version);
   ```



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


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

Reply via email to