[split] util-core: remove Leaky and FutureBenchmark

Problem

Future.scala had kept on some of its freshman 15 ???
`c.t.u.Leaky` and `c.t.u.FutureBenchmark`.

These classes have long outlived their usefulness
and had been replaced by caliper benchmarks
in util-benchmark.

Solution

Removed the cruft.

RB_ID=468503
[split] [trivial] Future.sleep: short-circuit when duration <= 0

RB_ID=468913
[split] Avoid accumulation of listeners in Future.select

Problem

Future.select installs listeners on each future, but does not uninstall
them when the race is over. This causes an accumulation of listeners
each time futures are passed into select.

Solution

Use a detachable promise which will detach from the losers of the race
when it is over.

Result

No accumulation of listeners when using Future.select. In the following
code the listeners on `p` should be 0.

    val p = new Promise[Unit]
    val q = new Promise[Unit]
    Future.select(p, q)
    q.setDone()

Performance

Select      873.77 ns; ??=17.41 ns @ 10 trials, 104 instances, total 2344B
SelectIndex 875.16 ns; ??=22.95 ns @ 10 trials, 85 instances, total 2104B

(changed from)

Select      2381.51 ns; ??=1047.53 ns @ 10 trials, 43 instances, total 952B
SelectIndex (OutOfMemory)

RB_ID=466307
[split] util-logging: default to async logging for App's

Problem

The `com.twitter.app.App` mixin for logging does not use
asynchronous logging by default. This can cause blocking
on a Finagle thread which is a "bad thing".

Solution

Wrap default logging `Handler`s with `com.twitter.logging.QueueingHandler`s.

Added two Flags allowing for customization:

`com.twitter.logging.log.async`
 Default true, turns this functionality on/off.

`com.twitter.logging.log.async.maxsize`
 Default 4096, max size of the async buffer.

Result

More services will do the "right thing" with regards to not blocking
on Finagle threads.

RB_ID=470347
[split] util-core: Perf improvement to ConcatBuf#slice

Problem

ConcatBuf's slice method was calling concat for every Buf in the
new slice, and concat allocates a new Vector object for every
concatenation.

Solution

Since we know that we only need to slice the first and last item
of the new slice, and the interstitial ones will be unchanged, we
can get this method down to just three necessary allocations, the
new ConcatBuf, two for prepending and appending the first and last
ends of the slice.

Result

ConcatBuf#slice is constant in its GC pressure rather than linear.

old:

0% Scenario{vm=java, trial=0, benchmark=SimpleSlice} 81,898,250.00 ns; ??=809092.52 ns @ 6 trials, allocated 10,567,956 instances for a total of 394,485,000B
50% Scenario{vm=java, trial=0, benchmark=ComplexSlice} 1,161,000,000.00 ns; ??=320684887.56 ns @ 10 trials, allocated 110,692,536 instances for a total of 4,895,614,920B

new:

0% Scenario{vm=java, trial=0, benchmark=SimpleSlice} 81,533,980.77 ns; ??=7463158.54 ns @ 10 trials, allocated 5,480,854 instances for a total of 340,843,200B
50% Scenario{vm=java, trial=0, benchmark=ComplexSlice} 414,192,750.00 ns; ??=11997791.36 ns @ 10 trials, allocated 8,300,670 instances for a total of 675,817,536B

RB_ID=461809
[split] servo/forked/QueueExecutor: save and restore Locals

Problem

QueueExecutor enqueues functions but not their Local closure.

Solution

Add Local.closed to convert a () => R into a () => R whose context is
saved and restored upon invocation.

Used this in Servo.

RB_ID=475175
[split] util, ostrich, finagle: add koliver to owners

RB_ID=475285
[split] Fix Buf.ByteBuffer.slice

Problem

Buf.ByteBuffer.slice ignores position when updating limit.
Example: Allocate a ByteBuffer and construct a Buf from it.

    // pos=0 lim=3
    val b = Buf.ByteBuffer(java.nio.ByteBuffer.allocate(3))

Drop the first byte.

    // pos=1 lim=3
    b.slice(1, b.length)

Drop the first byte and get the first byte, this should be
equivalent to getting the second byte of the original b.

    // pos=1 lim=1
    b.slice(1, 3).slice(0, 1)

But because of the bug, the limit is updated to the wrong
index, resulting in an empty Buf.

Solution

Factor in the position when updating limit in a slice.

Result

Slice works again.

RB_ID=474895
[split] util-core: missing java dependency

RB_ID=478283
[split] birdcage: Add provides clause for util-app-java

Adds a BUILD `provides` clause for the util-app-java package, in order to allow it to be published by pants.

RB_ID=478867
[split] Upgrade pants in the birdcage to 1.0.9rc6.

RB_ID=473421
[split] Add evm,glen,jdonham,ver to OWNERS

RB_ID=479001
NO-QUEUE=true
[split] Add evm to OWNERS of {finagle,util}-core

RB_ID=476845
[split] util.RingBuffer: fix buffer size on drops

Problem
util.RingBuffer has a `drop` method that removes several elements from the buffer at a time. However, it doesn't reduce the internal size, which is expected. This operation does reset the size to 0 if we're removing all elements, but not if we drop fewer than all elements.

Solution
Decrease the count_ (internal size) when drop is performed
Also: deprecate it in favor of Guava (see review)

RB_ID=480321
[split] bump util to 6.22.1-SNAPSHOT

RB_ID=482027
TBR=true
NO-QUEUE=true