[ 
https://issues.apache.org/jira/browse/BEAM-14116?focusedWorklogId=743924&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-743924
 ]

ASF GitHub Bot logged work on BEAM-14116:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Mar/22 14:48
            Start Date: 18/Mar/22 14:48
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #17094:
URL: https://github.com/apache/beam/pull/17094#discussion_r829191770



##########
File path: 
sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtil.java
##########
@@ -466,7 +467,8 @@ SeekableByteChannel open(GcsPath path, 
GoogleCloudStorageReadOptions readOptions
         MonitoringInfoConstants.Labels.RESOURCE,
         GcpResourceIdentifiers.cloudStorageBucket(path.getBucket()));
     baseLabels.put(
-        MonitoringInfoConstants.Labels.GCS_PROJECT_ID, 
googleCloudStorageOptions.getProjectId());
+        MonitoringInfoConstants.Labels.GCS_PROJECT_ID,
+        MoreObjects.firstNonNull(googleCloudStorageOptions.getProjectId(), 
""));

Review comment:
       I'm trying to find documentation as to whether this label should be 
unset or whether it should be set to `""`.

##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MonitoringInfoMetricName.java
##########
@@ -56,13 +58,13 @@ private MonitoringInfoMetricName(String urn, Map<String, 
String> labels) {
   public String getNamespace() {
     if (labels.containsKey(MonitoringInfoConstants.Labels.NAMESPACE)) {

Review comment:
       Don't pay the map lookup cost twice:
   ```
   String rval = labels.get(KEY1);
   if (rval != null) {
     return rval;
   }
   rval = labels.get(KEY2);
   if (rval != null) {
     return rval;
   }
   ...
   ```

##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MonitoringInfoMetricName.java
##########
@@ -48,6 +45,11 @@ private MonitoringInfoMetricName(String urn, Map<String, 
String> labels) {
     // and ensure all necessary labels are set for the specific URN.
     this.urn = urn;
     for (Entry<String, String> entry : labels.entrySet()) {

Review comment:
       this.labels = ImmutableMap.copyOf(labels);

##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MonitoringInfoMetricName.java
##########
@@ -33,9 +33,6 @@
  * key instead of only a name+namespace. This is useful when defining system 
defined metrics with a
  * specific urn via a {@code CounterContainer}.
  */
-@SuppressWarnings({
-  "nullness" // TODO(https://issues.apache.org/jira/browse/BEAM-10402)
-})
 public class MonitoringInfoMetricName extends MetricName {
 
   private String urn;

Review comment:
       mark these fields final




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 743924)
    Time Spent: 1.5h  (was: 1h 20m)

> Fix Pub/Sub Lite IO and SDF performance issues with shuffles
> ------------------------------------------------------------
>
>                 Key: BEAM-14116
>                 URL: https://issues.apache.org/jira/browse/BEAM-14116
>             Project: Beam
>          Issue Type: Task
>          Components: io-java-gcp, runner-dataflow
>            Reporter: Daniel Collins
>            Assignee: Daniel Collins
>            Priority: P2
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to