[split] Revert "COORD-367: Update serverset2 to use (package-internal) ZK Facade."

This reverts commit d181820df0759a7ce4522feae6f8e41d42b9a8c1.

RB_ID=319325
NO-QUEUE=true
[split] finagle-core: Introduce StackServer

Motivation:
This is part of our efforts to have a uniform and flexible
stack representation for finagle clients and servers. This also
paves the way for implementing mux in ServerBuilder.

Modification:
- Implement the default finagle server stack in `StackServer`.
- Aggregate common elements shared between clients and servers.
- Improve scaladoc for new modules.

Result: StackServer can successfully listen and serve.

RB_ID=299493
[split] update birdcage to scrooge-maven-plugin 3.13.0 and scrooge-core to 3.13.1-SNAPSHOT

- update scrooge-maven-plugin to 3.13.0
- update scrooge-core to 3.13.1-SNAPSHOT
- update memory to xmx4G for particular projects
- renamed mediaservices-commons scribe.thrift to MediaScribe.thrift
- move observability/manhattan-client to observability/observability-manhattan-client

RB_ID=317669
[split] finagle-core: introduce a flag for debug tracing

It's sometimes very useful to ensure that *all* traces are printed.
Mostly during debugging sessions. This introduces a flag for just
this.

	% pants/script $tw/junk/httpclient.scala -com.twitter.finagle.tracing.debugTrace=true
	0326 18:00:06.786 62ac970a1c537366.62ac970a1c537366<:62ac970a1c537366] Message(Interpreter cache miss with namer OrElse(Dtab(/zk=>/$/com.twitter.serverset;/srvns#=>/$/com.twitter.srvns;/srvns=>/srvns#/prod;/s#=>/$/com.twitter.namerv1;/s#=>/$/com.twitter.namernsv1;/srv#=>/$/com.twitter.srv;/srv=>/srv#/prod;/s=>/srv/local),com.twitter.finagle.Namer$anon$1@1daa476d): 809.milliseconds+393.microseconds)
	0326 18:00:06.805 6485b580393ab0ed.6485b580393ab0ed<:6485b580393ab0ed] BinaryAnnotation(finagle.version,?)
	0326 18:00:06.812 6485b580393ab0ed.6485b580393ab0ed<:6485b580393ab0ed] ServerAddr(/0.0.0.0:8000)
	0326 18:00:06.816 6485b580393ab0ed.6485b580393ab0ed<:6485b580393ab0ed] ClientAddr(/172.25.129.83:62598)

RB_ID=319617
[split] Ketama memcache: accept weighted addresses

The Ketama memcache implementation looks specifically for inet
addresses -- it has to, since it has to have something to hash -- but
this precludes any weighted addresses that might be passed in.

We introduce new matchers for weighted address which are liberal:
absent a weight, it sets the weight to 1. We then use this in the
Ketama implementation.

In the future, we may consider propagating these weights all the way
down, since Ketama itself has a concept of weighting.

RB_ID=307519
[split] finagle-core: use DefaultLoadBalancerFactory

A previous change:

	commit 538abb7f11473e332f8395ebfb2becc6e1130bc6
	Author: Ruben Oanta <roanta@twitter.com>
	Date:   Wed Mar 26 18:03:06 2014 +0000

made use of the HeapBalancerFactory explicitly. This breaks the
-com.twitter.finagle.loadbalancer.defaultBalancer flag.

RB_ID=320031
[split] finagle-core: implement ServerBuilder in terms of StackServer.

Motivation:
Decrease barrier to entry for mux (and thriftmux) by making it
possible to use from ServerBuilder. This requires being able to
pass in a StackServer to ServerBuilder.

Modification:
The crux of the change is a new method in ServerBuilder `stack` which
allows for a StackServer to be injected.

RB_ID=313995
[split] finagle-core: remove redundant Netty3Timer param def

RB_ID=322185
[split] finagle-zipkin: Include service name in all traces

Motivation:
This was prompted by a bug report from public finaglers reporting that thriftmux traces all queries as the Unknown service.
But deeper than that, the service name is tied to the RPC method which happen at different layers of the stack.  There are lots of scenarios where services trace as "Unknown"

Modifications:
Annotating the service name is broken off from annotating the RPC method.  Also, the service name is now passed in to the tracing filter because without it tracing doesn't really work.

Result:
Service names for everybody!

RB_ID=321823
[split] scrooge: bump scrooge to 3.13.2-SNAPSHOT

RB_ID=324019
TBR=true
[split] Add com.twitter.io.Charsets and replace the use of org.jboss.netty.util.CharsetUtil

Motivation:

As a part of the first step for Netty 3 -> 4 migration, we should not
import nor use CharsetUtil.

Related issue: NETTY-18

Modifications:

- Introduce a new object 'com.twitter.io.Charsets' that replaces
  'org.jboss.netty.util.CharsetUtil'.
- Replace the use of CharsetUtil with Charsets in finagle and util

Result:

No classes under finagle and util use CharsetUtil:

  $ grep -rFl CharsetUtil finagle util | grep -vP '\.class$'
  finagle/doc/src/sphinx/code/client-server-anatomy/Netty3.scala

Note that Netty3.scala is an example that explains how Netty 3 works,
so I didn't change it.

RB_ID=320575
[split] finagle-core: thread through NullReporterFactory in ServerBuilder.

RB_ID=324033
[split] bump scrooge generator version

RB_ID=325085
TBR=true
[split] Parse names into trees; introduce separate evaluation.

Currently, names are flat -- sets of socket addresses -- leaving no
room for interpretation in the client. For example, a client might
wish to fail-over to an alternative name should the active destination
fail; we may also wish to support proportional balancing across
several zones.

This change represents names as trees--type NameTree[T] denotes name
trees with T-typed leaves--whose interior nodes may be composed
concurrently (representing a union) or as a set of alternatives (in
order of preference).

As it turns out, it is possible to encode our current abstract naming
mechanisms using name trees. In particular, Dtabs become a sort of
context under which name trees are bound. Such contexts are called
Namers, and provide an expansive lookup function: Path =>
NameTree[Path]. Binding relative to a namer is thus a process of
reaching a fixpoint while looking up paths using that namer. Dtab is
reimplemented as Namer.

Once a NameTree[Path] is fully bound--i.e. it has reached a fixpoint--
the NameTree[Path] is *evaluated* in order produce a concrete,
flattened set of addresses to which requests may be dispatched.
Currently evaluation follows a simple logic: the first nonempty
alternative is picked while unions are preserved.

Since we cannot resolve a Path directly into an Internet address, we
interpret paths beginning with /$/inet/ specially. The residual path
following denotes the IP host/port. (Technically, a port is not an IP
property, but we paper over this detail here, since we aim at least
currently to support only TCP and UDP addressing.)

We see that NameTrees act as a unification mechanism: Dtabs are
implemented as Namers and its semantics encoded directly into
NameTrees (using alternative composition). Furthemore, NameTrees
naturally tackle residual paths, which were only partially supported
previously, without introducing any further concepts or syntax. The
whole process of binding and evaluating an abstract name is tackled
entirely using NameTrees, using exactly one namespace.

Path names also have a concrete syntax with grammar

    tree       ::= name
                   weight '*' tree
                   tree '&' tree
                   tree '|' tree
                   '(' tree ')'

    name       ::= path | '~' | '$'

    path       ::= '/' labels

    labels     ::= label '/' label
                   label

    label      ::= litlabel | hexlabel

    hexlabel   ::= (\\x[a-f0-9][a-f0-9])+

    litlabel   ::= [0-9A-Za-z:.#$%-]+
    weight     ::= -?([0-9]++(\.[0-9]+*)?|[0-9]+*\.[0-9]++)([eE][+-]?[0-9]++)?[fFdD]?

As do Dtabs, which extend the above productions with

    dtab       ::= dentry ';' dtab | dentry
    dentry     ::= path '=>' tree

Some implementation notes:

 *	I had originally wanted to simply replace the 'Name'
	abstraction, but decided this would break too much. I think
	that with the current change, we can get away without a major
	version bump. (Since Dtabs, etc. were previously
	private[twitter].) It is, however, more complex than it needs
	to be because of it.

 *	I had weights, but took them out for now -- I'm still undecided
	on whether to keep these at the name level (so that evaluation
	results in a tree) or flatten them out as is done now in zk2.

 *	Activity is, in fact, a monad transformer over an 'Op' monad.
	I had the code arranged like this initially, but decided that
	this is simpler and more understandable, especially in the
	absence of more monad-generic code in util. If you're curious,
	though, you can see what it looks like:
		https://gist.github.com/mariusaeriksen/7343968dd75929458519

RB_ID=286441
TBR=true
[split] Finagle: Add server-side Stack wiring for Mux and ThriftMux

Problem:
In order to roll out ThriftMux, we need to be able to plug Mux into existing
services that use ServerBuilder.

Solution:
Add com.twitter.finagle.mux.exp.ThriftMuxStackServerFactory, which can be
passed directly to `StackBuilder.stack()`.

Result:
We reduce the barrier of entry for testing server-side ThriftMux to a one-line
change.

RB_ID=322125
[split] finagle-core: Enforce usage of c.t.finagle.util.DefaultLogger

Problem
It was recently pointed out that there are a few instances in finagle-core where
we do `Logger.getLogger("finagle")` rather than use the stock DefaultLogger. It
would be preferable to standardize on DefaultLogger, which scopes the logger to
"com.twitter.finagle".

Solution
Replace said instances with DefaultLogger.

Result
A consistent "root" scope for Finagle-internal log output.

RB_ID=326687
[split] finagle-core: Disable Monitor usage of in Netty3Listener

Problem
A recent change to ServerBuilder introduced unexpected behavior caused by
SourceTrackingMonitor being applied within Netty3Listener and exposing
ClosedChannelExceptions that previously occurred silently. This led to log
pollution and confusion among service owners.

com.twitter.finagle.netty3.ServerBridge#exceptionCaught already logs in certain
cases, so the monitor in the Netty pipeline is arguably redundant. Granted, this
inline logging goes to FINEST and WARNING, so it won't be seen by most deployed services.

Solution
We've never heard reports that the previously-set NullMonitor caused problems, so
we think it's acceptable to disable the Monitor usage within
Netty3Listener.scala. The `monitor` constructor argument is maintained for API
compatibility, but unused within the body of the class.

Result
We restore the previous behavior of not escalating Netty channel exceptions to
the SourceTrackingMonitor.

RB_ID=326933
[split] finagle-doc: refresh client stack docs

RB_ID=322919
[split] finagle-benchmark: Fix caliper failures due to new guava

Motivation
The recent version upgrade of guava (from 15 to 16) broke all our micro-benchmarks
because the (old) caliper library that we are using requires guava (ver<=15).

Modifications
- Force usage of guava 15 (in maven and pants)
- Update StatsReceiver benchmark
- Disable memory measuring for benchmarks that have non constant memory allocation pattern
- Clean-up inconsistent namespace

Result
All micro-benchmarks are now finishing without errors.

RB_ID=326239
[split] finagle: RetryPolicy filter, limit, combine I moved the RetryPolicy and Backoff classes out of the RetryFilter.scala file and into RetryPolicy.scala.  This makes it look like the whole thing is new, but the only additions are the instance methods .filter, .filterEach, and .limit, and the object method .combine.

The goal of filter, filterEach, and limit is to provide a means for assembling dynamic retry polices that can adapt retry strategies to back-pressure signals.

The goal of the combine method is to make it easier to build more complex retry policies from simpler policies; specifically, to make it easy to have different retry counts for different exception types (for example, 2 retries for WriteExceptions and 1 for TimeoutException), but with interleaved handling.  That way, it can handle a WriteException followed by a TimeoutException with the appropriate backoffs.

RB_ID=327379