ui: replace json adapters with implicit conversions #181

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

franklinhu commented Oct 17, 2012

No description provided.

@johanoskarsson johanoskarsson commented on an outdated diff Oct 17, 2012

.../main/scala/com/twitter/zipkin/conversions/json.scala
+ */
+object json {
+
+ /* BinaryAnnotation */
+ class WrappedBinaryAnnotation(b: BinaryAnnotation) {
+ lazy val toJson = {
+ val value = b.annotationType match {
+ case AnnotationType(0, _) => if (b.value.get() != 0) true else false // bool
+ case AnnotationType(1, _) => new String(b.value.array(), b.value.position(), b.value.remaining()) // bytes
+ case AnnotationType(2, _) => b.value.getShort // i16
+ case AnnotationType(3, _) => b.value.getInt // i32
+ case AnnotationType(4, _) => b.value.getLong // i64
+ case AnnotationType(5, _) => b.value.getDouble // double
+ case AnnotationType(6, _) => new String(b.value.array(), b.value.position(), b.value.remaining()) // string
+ case _ => {
+ throw new Exception("Uh oh")
@johanoskarsson

johanoskarsson Oct 17, 2012

Contributor

Something more descriptive?

Contributor

johanoskarsson commented Oct 17, 2012

+1

@adriancole adriancole added a commit that referenced this pull request Jun 3, 2016

@adriancole adriancole Renames transport to collector and settles on CollectorComponent
This completes work of removing I/O from exposed constructors. By using
CollectorComponent, you can defer I/O to the `start` method.

This also moves all code formerly called transport to collector packages
in preparation of adding a reporter package.

Finally, this consolidates code duplication around the collectors.

Fixes #187
See #181
c095c35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment