Skip to content

Commit

Permalink
Merge a9ff433 into 5ae7cb0
Browse files Browse the repository at this point in the history
  • Loading branch information
heuermh committed Feb 17, 2020
2 parents 5ae7cb0 + a9ff433 commit 6783166
Show file tree
Hide file tree
Showing 18 changed files with 110 additions and 0 deletions.
Expand Up @@ -27,6 +27,7 @@ import org.bdgenomics.utils.instrumentation.Alignment.Alignment
*
* There must be an equal number of items in each row and in the header.
*/
@deprecated("to be removed in version 0.3.0")
class ASCIITable(header: Array[ASCIITableHeader], rows: Array[Array[String]]) {

rows.foreach(row => {
Expand Down Expand Up @@ -99,4 +100,5 @@ class ASCIITable(header: Array[ASCIITableHeader], rows: Array[Array[String]]) {

}

@deprecated("to be removed in version 0.3.0")
case class ASCIITableHeader(name: String, alignment: Alignment = Alignment.Right)
Expand Up @@ -20,6 +20,7 @@ package org.bdgenomics.utils.instrumentation
/**
* Represents alignment of a cell in a table
*/
@deprecated("to be removed in version 0.3.0")
object Alignment extends Enumeration {
type Alignment = Value
val Left, Right, Center = Value
Expand Down
Expand Up @@ -27,6 +27,7 @@ import scala.concurrent.duration.Duration
* - Durations greater than one minute, but less than one hour are formatted as "X mins X secs"
* - Durations less than one minute are formatted with two digits after the decimal point. Zeros are suppressed.
*/
@deprecated("to be removed in version 0.3.0")
object DurationFormatting {

private val TwoDigitNumberFormatter = new DecimalFormat(".0#")
Expand Down
Expand Up @@ -23,6 +23,7 @@ import java.io.PrintWriter
/**
* Helper functions for instrumentation
*/
@deprecated("to be removed in version 0.3.0")
object InstrumentationFunctions {

def renderTable(name: String, timers: Seq[Monitor[_]], header: Seq[TableHeader]): String = {
Expand Down
Expand Up @@ -51,6 +51,7 @@ import scala.util.DynamicVariable
*
* To switch-on recording of metrics for a specific thread, the companion [[Metrics]] object must be used.
*/
@deprecated("to be removed in version 0.3.0")
abstract class Metrics(val clock: Clock = new Clock()) extends Serializable {
/**
* Creates a timer with the specified name.
Expand All @@ -72,6 +73,7 @@ abstract class Metrics(val clock: Clock = new Clock()) extends Serializable {
* Attempting to record metrics when the initialize method has not been called will not produce an error, and incurs very
* little overhead. However, attempting to call the print method to print the metrics will produce an error.
*/
@deprecated("to be removed in version 0.3.0")
object Metrics {

private implicit val accumulableParam = new ServoTimersAccumulableParam()
Expand Down Expand Up @@ -341,6 +343,7 @@ object Metrics {

}

@deprecated("to be removed in version 0.3.0")
class Clock extends Serializable {
def nanoTime() = System.nanoTime()
}
Expand Up @@ -31,6 +31,7 @@ import scala.concurrent.duration._
* @note This class relies on being run in the same process as the driver. However,
* this is the way that Spark seems to work.
*/
@deprecated("to be removed in version 0.3.0")
class MetricsListener(val metrics: RecordedMetrics) extends SparkListener {

private val sparkMetrics = metrics.sparkMetrics
Expand Down
Expand Up @@ -29,6 +29,7 @@ import scala.collection.mutable
* Note: this class is intended to be used in a thread-local context, and therefore it is not
* thread-safe. Do not attempt to call it concurrently from multiple threads!
*/
@deprecated("to be removed in version 0.3.0")
class MetricsRecorder(val accumulable: Accumulable[ServoTimers, RecordedTiming],
existingTimings: Option[Seq[TimingPath]] = None) extends Serializable {

Expand Down
Expand Up @@ -34,6 +34,7 @@ import scala.collection.mutable.ArrayBuffer
* - formatFunction (optional): a function which formats the value extracted from the monitor as a [[String]]
* - alignment (optional): specifies how the data in a cell is aligned; defaults to right-alignment
*/
@deprecated("to be removed in version 0.3.0")
class MonitorTable(headerRow: Array[TableHeader], rows: Array[Monitor[_]]) {

override def toString: String = {
Expand Down Expand Up @@ -65,9 +66,11 @@ class MonitorTable(headerRow: Array[TableHeader], rows: Array[Monitor[_]]) {
/**
* Specifies the title of a column, as well as how data is extracted to form the cells of this column
*/
@deprecated("to be removed in version 0.3.0")
case class TableHeader(name: String, valueExtractor: ValueExtractor, formatFunction: Option[(Any) => String] = None,
alignment: Alignment.Alignment = Alignment.Right)

@deprecated("to be removed in version 0.3.0")
object ValueExtractor {
/**
* Creates a [[ValueExtractor]] which extracts values from [[Monitor]]s matching the specified tag.
Expand All @@ -93,6 +96,7 @@ object ValueExtractor {
}
}

@deprecated("to be removed in version 0.3.0")
trait ValueExtractor {
def extractValue(monitor: Monitor[_]): Option[Any]
}
Expand Down
Expand Up @@ -20,6 +20,7 @@ package org.bdgenomics.utils.instrumentation
/**
* Currently this consists only of metrics collected from Spark, but there may be others in the future.
*/
@deprecated("to be removed in version 0.3.0")
class RecordedMetrics {

val sparkMetrics = new RecordedSparkMetrics()
Expand Down
Expand Up @@ -41,6 +41,7 @@ import scala.collection.mutable
* @param name the name of this timer; this is propagated to sub-monitors
* @param tags the tags for this timer; these are propagated to sub-monitors
*/
@deprecated("to be removed in version 0.3.0")
class ServoTimer(name: String, @transient tags: Tag*) extends ConfigurableMonitor(name, tags)
with CompositeMonitor[Object] {

Expand Down Expand Up @@ -216,6 +217,7 @@ class ServoTimer(name: String, @transient tags: Tag*) extends ConfigurableMonito
}
}

@deprecated("to be removed in version 0.3.0")
abstract class ConfigurableMonitor(val name: String, @transient tags: Seq[Tag])
extends Taggable with Serializable {

Expand Down Expand Up @@ -255,6 +257,7 @@ abstract class ConfigurableMonitor(val name: String, @transient tags: Seq[Tag])

private class SerializableTag(val key: String, val value: String) extends Serializable

@deprecated("to be removed in version 0.3.0")
object ServoTimer {

private final val StatisticTagKey = "statistic"
Expand All @@ -276,6 +279,7 @@ object ServoTimer {

}

@deprecated("to be removed in version 0.3.0")
trait Taggable {
def addTag(tag: Tag)
}
Expand Up @@ -25,6 +25,7 @@ import scala.collection.mutable
/**
* Implementation of [[AccumulableParam]] that records timings and returns a [[ServoTimers]] with the accumulated timings.
*/
@deprecated("to be removed in version 0.3.0")
class ServoTimersAccumulableParam extends AccumulableParam[ServoTimers, RecordedTiming] {
override def addAccumulator(timers: ServoTimers, newTiming: RecordedTiming): ServoTimers = {
timers.recordTiming(newTiming)
Expand All @@ -46,6 +47,7 @@ class ServoTimersAccumulableParam extends AccumulableParam[ServoTimers, Recorded
* specifies all of its ancestors. Timings can be recorded using the `recordTiming` method, which will
* either update an existing timer if the specified [[TimingPath]] exists already, or will create a new timer.
*/
@deprecated("to be removed in version 0.3.0")
class ServoTimers extends Serializable {

val timerMap = new ConcurrentHashMap[TimingPath, ServoTimer]()
Expand Down Expand Up @@ -85,11 +87,13 @@ class ServoTimers extends Serializable {
/**
* Specifies a timing that is to recorded
*/
@deprecated("to be removed in version 0.3.0")
case class RecordedTiming(timingNanos: Long, pathToRoot: TimingPath) extends Serializable

/**
* Specifies a timer name, along with all of its ancestors.
*/
@deprecated("to be removed in version 0.3.0")
class TimingPath(val timerName: String, val parentPath: Option[TimingPath], val sequenceId: Int = 0,
val isRDDOperation: Boolean = false, val shouldRecord: Boolean = true) extends Serializable {

Expand Down Expand Up @@ -164,6 +168,7 @@ class TimingPath(val timerName: String, val parentPath: Option[TimingPath], val

}

@deprecated("to be removed in version 0.3.0")
class TimingPathKey(val timerName: String, val sequenceId: Int,
val isRDDOperation: Boolean, val shouldRecord: Boolean = true) {
private val cachedHashCode = computeHashCode()
Expand Down
Expand Up @@ -31,6 +31,7 @@ import scala.concurrent.duration._
/**
* Allows metrics for Spark to be captured and rendered in tabular form.
*/
@deprecated("to be removed in version 0.3.0")
abstract class SparkMetrics {

private val taskTimers = new mutable.ArrayBuffer[TaskTimer]()
Expand Down Expand Up @@ -131,12 +132,14 @@ abstract class SparkMetrics {

}

@deprecated("to be removed in version 0.3.0")
protected object SparkMetrics {
final val HostTagKey = "host"
final val StageNameTagKey = "stageName"
final val StageIdTagKey = "stageId"
}

@deprecated("to be removed in version 0.3.0")
class TaskTimer(name: String) {
val overallTimings = buildTimer(name)
val timingsByHost = new mutable.HashMap[String, ServoTimer]
Expand Down Expand Up @@ -168,6 +171,8 @@ class TaskTimer(name: String) {
}
}

@deprecated("to be removed in version 0.3.0")
case class SparkTaskContext(executorId: String, stageId: Int)

@deprecated("to be removed in version 0.3.0")
case class StageTiming(stageId: Int, stageName: Option[String], duration: Duration)
@@ -0,0 +1,23 @@
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG 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.bdgenomics.utils

/**
* Deprecated in version 0.2.16, will be removed in version 0.3.0.
*/
package object instrumentation {}
Expand Up @@ -17,6 +17,7 @@
*/
package org.bdgenomics.utils.metrics

@deprecated("to be removed in version 0.3.0")
class Collection[T](val values: Seq[T]) extends Serializable {
}

Expand Down
Expand Up @@ -20,6 +20,7 @@ package org.bdgenomics.utils.metrics
import java.io.{ StringWriter, Writer }
import org.bdgenomics.utils.metrics.aggregators.Aggregated

@deprecated("to be removed in version 0.3.0")
class Histogram[T](val valueToCount: Map[T, Int]) extends Aggregated[T] with Serializable {

/**
Expand Down Expand Up @@ -82,6 +83,7 @@ class Histogram[T](val valueToCount: Map[T, Int]) extends Aggregated[T] with Ser
}
}

@deprecated("to be removed in version 0.3.0")
object Histogram {

def apply[T](valueToCount: Map[T, Int]): Histogram[T] =
Expand Down
Expand Up @@ -20,6 +20,7 @@ package org.bdgenomics.utils.metrics.aggregators
import java.io.Writer
import org.bdgenomics.utils.metrics.{ Collection, Histogram }

@deprecated("to be removed in version 0.3.0")
trait Aggregator[SingleType, AggType <: Aggregated[SingleType]] extends Serializable {

/**
Expand All @@ -46,15 +47,18 @@ trait Aggregator[SingleType, AggType <: Aggregated[SingleType]] extends Serializ

}

@deprecated("to be removed in version 0.3.0")
trait Writable {
def write(stream: Writer)
}

@deprecated("to be removed in version 0.3.0")
trait Aggregated[+T] extends Writable with Serializable {
def count(): Long
def countIdentical(): Long
}

@deprecated("to be removed in version 0.3.0")
class AggregatedCollection[T, U <: Aggregated[T]](val values: Seq[U])
extends Aggregated[Collection[Seq[T]]]
with Serializable {
Expand All @@ -68,10 +72,12 @@ class AggregatedCollection[T, U <: Aggregated[T]](val values: Seq[U])
}
}

@deprecated("to be removed in version 0.3.0")
object AggregatedCollection {
def apply[T, U <: Aggregated[T]](values: Seq[U]) = new AggregatedCollection[T, U](values)
}

@deprecated("to be removed in version 0.3.0")
class CombinedAggregator[Single, Agg <: Aggregated[Single]](aggs: Seq[Aggregator[Single, Agg]])
extends Aggregator[Collection[Seq[Single]], AggregatedCollection[Single, Agg]] {

Expand All @@ -96,6 +102,7 @@ class CombinedAggregator[Single, Agg <: Aggregated[Single]](aggs: Seq[Aggregator
})
}

@deprecated("to be removed in version 0.3.0")
class UniqueAggregator[T] extends Aggregator[T, UniqueWritable[T]] {
/**
* An initial value for the aggregation
Expand All @@ -110,6 +117,7 @@ class UniqueAggregator[T] extends Aggregator[T, UniqueWritable[T]] {
def combine(first: UniqueWritable[T], second: UniqueWritable[T]): UniqueWritable[T] = first.union(second)
}

@deprecated("to be removed in version 0.3.0")
class HistogramAggregator[T] extends Aggregator[T, Histogram[T]] {
/**
* An initial value for the aggregation
Expand All @@ -125,6 +133,7 @@ class HistogramAggregator[T] extends Aggregator[T, Histogram[T]] {

}

@deprecated("to be removed in version 0.3.0")
class UniqueWritable[T](vals: T*) extends Aggregated[T] with Serializable {

val count = vals.size.toLong
Expand Down
@@ -0,0 +1,23 @@
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG 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.bdgenomics.utils.metrics

/**
* Deprecated in version 0.2.16, will be removed in version 0.3.0.
*/
package object aggregators {}
@@ -0,0 +1,23 @@
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG 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.bdgenomics.utils

/**
* Deprecated in version 0.2.16, will be removed in version 0.3.0.
*/
package object metrics {}

0 comments on commit 6783166

Please sign in to comment.