A specific version of a component in AI2.
Enumeration implementation that supports automatic Spray JSON serialization of a case object as a JsString, or using java native serialization for Spark jobs.
Enumeration implementation that supports automatic Spray JSON serialization of a case object as a JsString, or using java native serialization for Spark jobs.
Usage: (format: OFF)
sealed abstract class MyEnum extends Enum[MyEnum] object MyEnum extends EnumCompanion[MyEnum] { case object One extends MyEnum case object Two extends MyEnum register(One, Two) } // JSON serialization: MyEnum.One.toJson // JsString("One") MyEnum.Two.toJson // JsString("Two") JsString("One").convertTo[MyEnum] // MyEnum.One JsString("Two").convertTo[MyEnum] // MyEnum.Two
(format: ON)
Superclass for Enum companion objects providing enum registration and JSON serialization
Represents a git version.
Represents a git version.
the output of git sha1
in the repository
commit date in milliseconds
the url of the git repo
This trait is meant to be mixed into a class to provide logging and logging configuration.
This trait is meant to be mixed into a class to provide logging and logging configuration.
The enclosed methods provide a Scala-style logging signature where the message is a block instead of a string. This way the message string is not constructed unless the message will be logged.
A class that provides seekability to an interface similar to scala.io.Source.
A class that provides seekability to an interface similar to scala.io.Source. This is required because scala.io.Source only provides character offsets, while FileChannel (and other seekable Java interfaces) take byte offsets for seeking. The only limitation is that the file must be either UTF-8 or ISO-8859-1 encoded.
This also has a getLines()
method to iterate over lines. Any reads done on this iterator
are reflected in the main Source, and reads on the Source are reflected in the
Iterator[String]
. The iterator returned by getLines()
will create another buffer of
bufferSize
bytes, so bear this in mind when estimating memory usage.
java.lang.IllegalArgumentException
if bufferSize
is less than 4, or codec
is not
UTF-8 or ISO-8859-1
Input stream wrapping a Source object, using the codec to convert characters to bytes.
Input stream wrapping a Source object, using the codec to convert characters to bytes. Not thread-safe.
Represents the version of this component.
Represents the version of this component. Should be built with the fromResources
method on the
companion object.
the git version (commit information) of the build.
the version of the artifact in the build.
a cacheKey of the project. Changes on git commits to src of project and dependency changes.
Import to provide enhancements via implicit class conversion for making working with com.typesafe.config.Config more Scala-friendly (no nulls!).
Import to provide enhancements via implicit class conversion for making working with com.typesafe.config.Config more Scala-friendly (no nulls!).
Also provides a spray.json.RootJsonFormat[Config]
.
Various convenient utilities for reading files and resources.
Common spray.json.JsonFormats, spray.json.JsonReaders, and spray.json.JsonWriters
Helpers for streaming lists of JSON objects to and from disk.
Various convenient utilities for math operations.
Various convenient utilities for Scala constructs.
Creates an Iterator from an InputStream.
Creates an Iterator from an InputStream. The InputStream is automatically closed once the Iterator has been fully consumed. Example:
StreamClosingIterator(new FileInputStream("foo.txt"))(Source.fromInputStream(_).getLines())
Methods for measuring the amount of time a method takes.
Util methods for java.net.URL.
Utilities for making it easier to work with spray-json for common use cases.
Utilities for making it easier to work with spray-json for common use cases.
Usage: (format: OFF)
import spray.json._ import org.allenai.common.json._ val json: JsObject = ... val packed = json.pack("foo" -> 5) // creates a new JsObject with the added field packed[Int]("foo") // returns 5 packed.get[Int]("foo") // returns Some(5)
(format: ON)
A specific version of a component in AI2. This fully-describes a running system - it contains enough information to re-deploy the version that generated the ComponentId instance.
a human-readable name of the component
the version of the component that was running