[split] birdcage: util-cache is a scala_artifact

In order to appropriately suffix the util-cache artifact with the scala version during pants publishing, it needs to use the 'scala_artifact' constructor.

RB_ID=493729
[split] {finagle,util}-core: Slurry of PartialFunction micro-optimizations

Problem

PartialFunction has an isDefinedAt which must be called before
proper invocation.  However, PartialFunction#isDefinedAt and
PartialFunction#apply often entail many of the same costs (ie object
allocation due to unapply for literal PartialFunctions).

Solution

PartialFunction has a helper PartialFunction#applyOrElse so that
we only have to call it once.  However, applyOrElse takes a function,
so we must make singleton all-purpose functions to avoid extra
allocations.

Result

PartialFunction evaluation is cheaper.

RB_ID=492081
[split] util-app: add an option so that we can let apps fail fast if reading argument before args are parsed.

RB_ID=491925
[split] Reader.writable.fail: make reentrant

Problem

Since Reader.writable uses reentrant synchronization, it must ensure
that Reader.writable.state is set before potentially recursing via
setting promises.

This isn't a problem with vanilla Finagle services since everything is
run under an unwinding scheduler; however the TFE does direct
dispatch, and, in some circumstances, Reader.writable.fail is the
scheduler root.

Solution

Fix Reader.writable.state before setting the promise.

RB_ID=494715
[split] util-core: remove Sieve example

Problem

Sieve is example code that is included as part of the public API.

Solution

Remove it and shave microseconds off a clean build.

RB_ID=495925
[split] Java tests for Duration, Time and Timer

RB_ID=492573
[split] util, finagle: add missing @RunWith annotation

Problem

The junit test runner for scala needs classes to have
the `@RunWith(classOf[JUnitRunner])` annotation attached
to classes in order to run them.

Solution

Add the annotation.

RB_ID=495921
[split] =Merge branch 'master' into sq_reserved/498209_util-6.22.2_1029222833

RB_ID=498209
TBR=true
NO-QUEUE=true
[split] Improve Buf constructor and extractor APIs

Problems:

- Buf <-> ChannelBuffer conversion may do wasteful wrapping in some cases
- Converting a Buf to an Array[Byte] is a common task; and there is no convenient reusable way to do this.
- Semantics around when data is copied or potentially mutable is not clear.

Solution:

- Introduce explicit Copied and Direct semantics for all Buf types.
- Do not directly expose mutable data structures from Buf types.
- Introduce 'coerce' functions to support casting of Buf types.
- Introduce 'extract' functions to help with coersion+access.
- Deprecate old (ambiguous) constructors.

Result:
- More predictable use of Buf.
- Significant allocation improvements for Buf.equals, Buf.hash, etc

RB_ID=461763
[split] update ScalaDoc for Logger.configure and use a more compatible Base64.encodeToString

RB_ID=493231
[split] Reduce allocation in ConcatBuf.{hashCode,equals}

Problem:

ConcatBufs are completely copied on equality and hashCode computation.

Solution:

Incrementally compute equality and hashCode on the underlying Bufs.

RB_ID=496107
[split] Cut over from maven publishing to pants publishing.

RB_ID=502437
[split] util-core: Add Java compilation tests from Closable, Awaitable and CloseAwaitably classes

RB_ID=498243
[split] util-core: make FuturePoolTest more reliable

Problem

CI had marked this test as being flakey.

Solution

Make it more robust in face of slowness and race conditions.

RB_ID=502905
[split] Kill maven, kill it with fire

Removes all pom.xml files except:
 scrooge/scrooge-maven-plugin/pom.xml
 macaw-swift/**/pom.xml
 parents/**/pom.xml

RB_ID=502053
TBR=true
[split] Remove more poms

Not sure how these slipped by last time, removing more poms. Will skip adding the rest of the company out of shame and since they already shipited it.

RB_ID=505101
TBR=true
NO-QUEUE=true
[split] finagle/util - Make multithreaded tests more patient

Problem

By default, the `eventually` method in scalatest times the test out
after 150 milliseconds.  This makes some of our unit tests appear flaky
when random pauses or busy CI machines stall on test execution.  The
symptom of these types of failures look like this:

       org.scalatest.exceptions.TestFailedDueToTimeoutException: The
       code passed to eventually never returned normally. Attempted 1
       times over 159.628854 milliseconds.

The default patience config for scalatest[1] should try every 15ms, so
with only one retry it's clear that the CI machine is slowed for some
reason.

Solution

Mix in the IntegrationPatience trait which increases the timeout of the
`eventually` to 15 seconds.

1. http://www.artima.com/docs-scalatest-2.0.M5/org/scalatest/concurrent/PatienceConfiguration.html

RB_ID=504031
[split] util-core: Add Java compilation tests for Var, Event and Activity

RB_ID=505341
[split] util-logging: avoid constant scribe reconnects

Problem

ScribeHandler doesn't update lastConnectAttempt until after trying to connect

RB_ID=505975
[split] util-logging: ScribeHandler needs volatile fields that are used across threads

Problem

Last commit removed volatile from lastTransmission that is used in logger thread
and ScribeFlusher. New field lastConnectAttempt is now used in both the test and
ScribeFlusher threads as well.

RB_ID=506691