You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@htrace.apache.org by cm...@apache.org on 2015/07/17 22:27:44 UTC

incubator-htrace git commit: HTRACE-210. Remove TrueIfTracingSampler (cmccabe)

Repository: incubator-htrace
Updated Branches:
  refs/heads/master f5b00236e -> bee26c52c


HTRACE-210. Remove TrueIfTracingSampler (cmccabe)


Project: http://git-wip-us.apache.org/repos/asf/incubator-htrace/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-htrace/commit/bee26c52
Tree: http://git-wip-us.apache.org/repos/asf/incubator-htrace/tree/bee26c52
Diff: http://git-wip-us.apache.org/repos/asf/incubator-htrace/diff/bee26c52

Branch: refs/heads/master
Commit: bee26c52c77c3b31e7f1ef5516b1fc42cd629ad5
Parents: f5b0023
Author: Colin Patrick Mccabe <cm...@cloudera.com>
Authored: Fri Jul 17 13:27:27 2015 -0700
Committer: Colin Patrick Mccabe <cm...@cloudera.com>
Committed: Fri Jul 17 13:27:27 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/htrace/Trace.java  |  3 +-
 .../htrace/impl/TrueIfTracingSampler.java       | 39 --------------------
 2 files changed, 1 insertion(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/bee26c52/htrace-core/src/main/java/org/apache/htrace/Trace.java
----------------------------------------------------------------------
diff --git a/htrace-core/src/main/java/org/apache/htrace/Trace.java b/htrace-core/src/main/java/org/apache/htrace/Trace.java
index 6e69118..5234d95 100644
--- a/htrace-core/src/main/java/org/apache/htrace/Trace.java
+++ b/htrace-core/src/main/java/org/apache/htrace/Trace.java
@@ -19,7 +19,6 @@ package org.apache.htrace;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.htrace.impl.MilliSpan;
-import org.apache.htrace.impl.TrueIfTracingSampler;
 import org.apache.htrace.wrappers.TraceCallable;
 import org.apache.htrace.wrappers.TraceRunnable;
 
@@ -72,7 +71,7 @@ public class Trace {
    * @param description   The description field for the new span to create.
    */
   public static TraceScope startSpan(String description) {
-    return startSpan(description, TrueIfTracingSampler.INSTANCE);
+    return startSpan(description, NeverSampler.INSTANCE);
   }
 
   public static TraceScope startSpan(String description, TraceInfo tinfo) {

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/bee26c52/htrace-core/src/main/java/org/apache/htrace/impl/TrueIfTracingSampler.java
----------------------------------------------------------------------
diff --git a/htrace-core/src/main/java/org/apache/htrace/impl/TrueIfTracingSampler.java b/htrace-core/src/main/java/org/apache/htrace/impl/TrueIfTracingSampler.java
deleted file mode 100644
index 433a325..0000000
--- a/htrace-core/src/main/java/org/apache/htrace/impl/TrueIfTracingSampler.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.htrace.impl;
-
-import org.apache.htrace.HTraceConfiguration;
-import org.apache.htrace.Sampler;
-import org.apache.htrace.Trace;
-
-/**
- * A Sampler that returns true if and only if tracing is enabled for the current thread.
- */
-public class TrueIfTracingSampler implements Sampler<Object> {
-
-  public static final TrueIfTracingSampler INSTANCE =
-    new TrueIfTracingSampler(null);
-
-  public TrueIfTracingSampler(HTraceConfiguration conf) {
-  }
-
-  @Override
-  public boolean next(Object info) {
-    return Trace.isTracing();
-  }
-
-}