HTRACE-210. Remove TrueIfTracingSampler (cmccabe)
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 @@
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 @@
* @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) {
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();
- }
-
-}