phet commented on code in PR #3843:
URL: https://github.com/apache/gobblin/pull/3843#discussion_r1416857440


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/workflows/timing/EventTimer.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.gobblin.temporal.workflows.timing;
+
+import java.io.Closeable;
+
+import org.apache.gobblin.metrics.event.TimingEvent;
+
+
+/**
+ * A timer that can be used to track the duration of an event. This event 
differs from the {@link TimingEvent} in that
+ * this class is not meant to be used outside of {@link 
io.temporal.workflow.Workflow} code.
+ *
+ * It also differs from {@link Closeable} because the close method does not 
throw any checked exceptions
+ */
+public interface EventTimer extends Closeable {
+  void close();

Review Comment:
   being the same signature of `Closeable.close()` this doesn't really overload 
it,  does it?  semantically, what's the relationship you intend here?  are you 
redefining to restrict the checked exceptions?
   
   also, why does `EventTimer` have only `close`, but no method related to it 
being an event timer?  use of the try-with-resources hack for invocation might 
be clearer as:
   ```
   void submitTiming();
   
   // can this be used in an interface??? @Override 
   default void close() {
     submitTiming();
   }
   ```



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