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

ASF GitHub Bot logged work on HADOOP-17424:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Jan/21 03:35
            Start Date: 27/Jan/21 03:35
    Worklog Time Spent: 10m 
      Work Description: iwasakims commented on a change in pull request #2645:
URL: https://github.com/apache/hadoop/pull/2645#discussion_r565003016



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/Tracer.java
##########
@@ -0,0 +1,89 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.hadoop.tracing;
+
+public class Tracer {
+  // Singleton
+  private static Tracer globalTracer;
+
+  public final static String SPAN_RECEIVER_CLASSES_KEY =
+      "span.receiver.classes";
+
+  public Tracer() {
+    globalTracer = null;
+  }
+
+  // Keeping this function at the moment for HTrace compatiblity,
+  // in fact all threads share a single global tracer for OpenTracing.
+  public static Tracer curThreadTracer() {
+    return globalTracer;
+  }
+
+  /***
+   * Return active span.
+   * @return org.apache.hadoop.tracing.Span
+   */
+  public static Span getCurrentSpan() {
+    return null;
+  }
+
+  public TraceScope newScope(String description) {
+    return new TraceScope(new Span());
+  }
+
+  public Span newSpan(String description, SpanContext spanCtx) {
+    return new Span();
+  }
+
+  public TraceScope newScope(String description, SpanContext spanCtx) {
+    return new TraceScope(new Span());
+  }
+
+  public TraceScope newScope(String description, SpanContext spanCtx,
+      boolean finishSpanOnClose) {
+    return new TraceScope(new Span());
+  }
+
+  public TraceScope activateSpan(Span span) {
+    return new TraceScope(new Span());
+  }

Review comment:
       no-op tracer should return singleton TraceScope object (like NullScope 
of HTrace) in order to reduce garbages?




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


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

    Worklog Id:     (was: 542606)
    Time Spent: 5h 50m  (was: 5h 40m)

> Replace HTrace with No-Op tracer
> --------------------------------
>
>                 Key: HADOOP-17424
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17424
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> Remove HTrace dependency as it is depending on old jackson jars. Use a no-op 
> tracer for now to eliminate potential security issues.
> The plan is to move part of the code in 
> [PR#1846|https://github.com/apache/hadoop/pull/1846] out here for faster 
> review.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to