aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zma...@apache.org
Subject [37/37] aurora git commit: Import of Twitter Commons.
Date Tue, 25 Aug 2015 18:19:51 GMT
Import of Twitter Commons.

This patch imports the Java portion of Twitter Commons into our tree. It copies
the following files from sha bc7248d:
````
src/java/com/twitter/common/application/AbstractApplication.java
src/java/com/twitter/common/application/AppLauncher.java
src/java/com/twitter/common/application/Application.java
src/java/com/twitter/common/application/http/DefaultQuitHandler.java
src/java/com/twitter/common/application/http/GraphViewer.java
src/java/com/twitter/common/application/http/HttpAssetConfig.java
src/java/com/twitter/common/application/http/HttpFilterConfig.java
src/java/com/twitter/common/application/http/HttpServletConfig.java
src/java/com/twitter/common/application/http/Registration.java
src/java/com/twitter/common/application/Lifecycle.java
src/java/com/twitter/common/application/modules/AppLauncherModule.java
src/java/com/twitter/common/application/modules/LifecycleModule.java
src/java/com/twitter/common/application/modules/LocalServiceRegistry.java
src/java/com/twitter/common/application/modules/LogModule.java
src/java/com/twitter/common/application/modules/StatsExportModule.java
src/java/com/twitter/common/application/modules/StatsModule.java
src/java/com/twitter/common/application/modules/ThriftModule.java
src/java/com/twitter/common/application/ShutdownRegistry.java
src/java/com/twitter/common/application/ShutdownStage.java
src/java/com/twitter/common/application/StartupRegistry.java
src/java/com/twitter/common/application/StartupStage.java
src/java/com/twitter/common/args/apt/CmdLineProcessor.java
src/java/com/twitter/common/args/apt/Configuration.java
src/java/com/twitter/common/args/Arg.java
src/java/com/twitter/common/args/ArgFilters.java
src/java/com/twitter/common/args/ArgParser.java
src/java/com/twitter/common/args/Args.java
src/java/com/twitter/common/args/ArgScanner.java
src/java/com/twitter/common/args/ArgumentInfo.java
src/java/com/twitter/common/args/CmdLine.java
src/java/com/twitter/common/args/constraints/CanExecute.java
src/java/com/twitter/common/args/constraints/CanExecuteFileVerifier.java
src/java/com/twitter/common/args/constraints/CanRead.java
src/java/com/twitter/common/args/constraints/CanReadFileVerifier.java
src/java/com/twitter/common/args/constraints/CanWrite.java
src/java/com/twitter/common/args/constraints/CanWriteFileVerifier.java
src/java/com/twitter/common/args/constraints/Exists.java
src/java/com/twitter/common/args/constraints/ExistsFileVerifier.java
src/java/com/twitter/common/args/constraints/IsDirectory.java
src/java/com/twitter/common/args/constraints/IsDirectoryFileVerifier.java
src/java/com/twitter/common/args/constraints/NotEmpty.java
src/java/com/twitter/common/args/constraints/NotEmptyIterableVerifier.java
src/java/com/twitter/common/args/constraints/NotEmptyStringVerifier.java
src/java/com/twitter/common/args/constraints/NotNegative.java
src/java/com/twitter/common/args/constraints/NotNegativeNumberVerifier.java
src/java/com/twitter/common/args/constraints/NotNull.java
src/java/com/twitter/common/args/constraints/NotNullVerifier.java
src/java/com/twitter/common/args/constraints/Positive.java
src/java/com/twitter/common/args/constraints/PositiveNumberVerifier.java
src/java/com/twitter/common/args/constraints/Range.java
src/java/com/twitter/common/args/constraints/RangeNumberVerifier.java
src/java/com/twitter/common/args/NoParser.java
src/java/com/twitter/common/args/OptionInfo.java
src/java/com/twitter/common/args/Parser.java
src/java/com/twitter/common/args/ParserOracle.java
src/java/com/twitter/common/args/parsers/AmountParser.java
src/java/com/twitter/common/args/parsers/BooleanParser.java
src/java/com/twitter/common/args/parsers/ByteParser.java
src/java/com/twitter/common/args/parsers/CharacterParser.java
src/java/com/twitter/common/args/parsers/ClassParser.java
src/java/com/twitter/common/args/parsers/DateParser.java
src/java/com/twitter/common/args/parsers/DoubleParser.java
src/java/com/twitter/common/args/parsers/DurationParser.java
src/java/com/twitter/common/args/parsers/EnumParser.java
src/java/com/twitter/common/args/parsers/FileParser.java
src/java/com/twitter/common/args/parsers/FloatParser.java
src/java/com/twitter/common/args/parsers/InetSocketAddressParser.java
src/java/com/twitter/common/args/parsers/IntegerParser.java
src/java/com/twitter/common/args/parsers/ListParser.java
src/java/com/twitter/common/args/parsers/LongParser.java
src/java/com/twitter/common/args/parsers/MapParser.java
src/java/com/twitter/common/args/parsers/NonParameterizedTypeParser.java
src/java/com/twitter/common/args/parsers/NumberParser.java
src/java/com/twitter/common/args/parsers/PairParser.java
src/java/com/twitter/common/args/parsers/PatternParser.java
src/java/com/twitter/common/args/parsers/RangeParser.java
src/java/com/twitter/common/args/parsers/SetParser.java
src/java/com/twitter/common/args/parsers/ShortParser.java
src/java/com/twitter/common/args/parsers/StringParser.java
src/java/com/twitter/common/args/parsers/TypeParameterizedParser.java
src/java/com/twitter/common/args/parsers/UnitParser.java
src/java/com/twitter/common/args/parsers/URIParser.java
src/java/com/twitter/common/args/parsers/URLParser.java
src/java/com/twitter/common/args/Parsers.java
src/java/com/twitter/common/args/Positional.java
src/java/com/twitter/common/args/PositionalInfo.java
src/java/com/twitter/common/args/TypeUtil.java
src/java/com/twitter/common/args/Verifier.java
src/java/com/twitter/common/args/VerifierFor.java
src/java/com/twitter/common/args/Verifiers.java
src/java/com/twitter/common/base/CachingSupplier.java
src/java/com/twitter/common/base/CallableExceptionalSupplier.java
src/java/com/twitter/common/base/Closure.java
src/java/com/twitter/common/base/Closures.java
src/java/com/twitter/common/base/Command.java
src/java/com/twitter/common/base/Commands.java
src/java/com/twitter/common/base/Either.java
src/java/com/twitter/common/base/ExceptionalClosure.java
src/java/com/twitter/common/base/ExceptionalCommand.java
src/java/com/twitter/common/base/ExceptionalFunction.java
src/java/com/twitter/common/base/ExceptionalFunctions.java
src/java/com/twitter/common/base/ExceptionalSupplier.java
src/java/com/twitter/common/base/ExceptionTransporter.java
src/java/com/twitter/common/base/Function.java
src/java/com/twitter/common/base/MorePreconditions.java
src/java/com/twitter/common/base/MoreSuppliers.java
src/java/com/twitter/common/base/Supplier.java
src/java/com/twitter/common/base/SupplierE.java
src/java/com/twitter/common/collections/Bits.java
src/java/com/twitter/common/collections/BoundedQueue.java
src/java/com/twitter/common/collections/Iterables2.java
src/java/com/twitter/common/collections/Multimaps.java
src/java/com/twitter/common/collections/Pair.java
src/java/com/twitter/common/inject/Bindings.java
src/java/com/twitter/common/inject/DefaultProvider.java
src/java/com/twitter/common/inject/ProviderMethodModule.java
src/java/com/twitter/common/inject/TimedInterceptor.java
src/java/com/twitter/common/io/Base64ZlibCodec.java
src/java/com/twitter/common/io/Codec.java
src/java/com/twitter/common/io/CompatibilityCodec.java
src/java/com/twitter/common/io/FileUtils.java
src/java/com/twitter/common/io/JsonCodec.java
src/java/com/twitter/common/io/Streamer.java
src/java/com/twitter/common/io/ThriftCodec.java
src/java/com/twitter/common/logging/BufferedLog.java
src/java/com/twitter/common/logging/Glog.java
src/java/com/twitter/common/logging/julbridge/JULBridgeHandler.java
src/java/com/twitter/common/logging/julbridge/JULBridgeLevelConverter.java
src/java/com/twitter/common/logging/julbridge/JULBridgeLogManager.java
src/java/com/twitter/common/logging/Log.java
src/java/com/twitter/common/logging/log4j/GlogLayout.java
src/java/com/twitter/common/logging/LogFormatter.java
src/java/com/twitter/common/logging/LogUtil.java
src/java/com/twitter/common/logging/RootLogConfig.java
src/java/com/twitter/common/net/Environment.java
src/java/com/twitter/common/net/http/filters/AbstractHttpFilter.java
src/java/com/twitter/common/net/http/filters/HttpStatsFilter.java
src/java/com/twitter/common/net/http/GuiceServletConfig.java
src/java/com/twitter/common/net/http/handlers/AbortHandler.java
src/java/com/twitter/common/net/http/handlers/AssetHandler.java
src/java/com/twitter/common/net/http/handlers/ContentionPrinter.java
src/java/com/twitter/common/net/http/handlers/HealthHandler.java
src/java/com/twitter/common/net/http/handlers/HttpServletRequestParams.java
src/java/com/twitter/common/net/http/handlers/LogConfig.java
src/java/com/twitter/common/net/http/handlers/LogPrinter.java
src/java/com/twitter/common/net/http/handlers/QuitHandler.java
src/java/com/twitter/common/net/http/handlers/StringTemplateServlet.java
src/java/com/twitter/common/net/http/handlers/TextResponseHandler.java
src/java/com/twitter/common/net/http/handlers/ThreadStackPrinter.java
src/java/com/twitter/common/net/http/handlers/ThriftServlet.java
src/java/com/twitter/common/net/http/handlers/TimeSeriesDataSource.java
src/java/com/twitter/common/net/http/handlers/VarsHandler.java
src/java/com/twitter/common/net/http/handlers/VarsJsonHandler.java
src/java/com/twitter/common/net/http/HttpServerDispatch.java
src/java/com/twitter/common/net/http/JettyHttpServerDispatch.java
src/java/com/twitter/common/net/http/RequestLogger.java
src/java/com/twitter/common/net/InetSocketAddressHelper.java
src/java/com/twitter/common/net/loadbalancing/LeastConnectedStrategy.java
src/java/com/twitter/common/net/loadbalancing/LoadBalancer.java
src/java/com/twitter/common/net/loadbalancing/LoadBalancerImpl.java
src/java/com/twitter/common/net/loadbalancing/LoadBalancingStrategy.java
src/java/com/twitter/common/net/loadbalancing/MarkDeadStrategy.java
src/java/com/twitter/common/net/loadbalancing/MarkDeadStrategyWithHostCheck.java
src/java/com/twitter/common/net/loadbalancing/RandomStrategy.java
src/java/com/twitter/common/net/loadbalancing/RequestTracker.java
src/java/com/twitter/common/net/loadbalancing/RoundRobinStrategy.java
src/java/com/twitter/common/net/loadbalancing/StaticLoadBalancingStrategy.java
src/java/com/twitter/common/net/loadbalancing/SubsetStrategy.java
src/java/com/twitter/common/net/loadbalancing/TrafficMonitorAdapter.java
src/java/com/twitter/common/net/monitoring/ConnectionMonitor.java
src/java/com/twitter/common/net/monitoring/TrafficMonitor.java
src/java/com/twitter/common/net/pool/Connection.java
src/java/com/twitter/common/net/pool/ConnectionFactory.java
src/java/com/twitter/common/net/pool/ConnectionPool.java
src/java/com/twitter/common/net/pool/DynamicHostSet.java
src/java/com/twitter/common/net/pool/DynamicHostSetUtil.java
src/java/com/twitter/common/net/pool/DynamicPool.java
src/java/com/twitter/common/net/pool/MetaPool.java
src/java/com/twitter/common/net/pool/ObjectPool.java
src/java/com/twitter/common/net/pool/ResourceExhaustedException.java
src/java/com/twitter/common/net/ProxyAuthorizer.java
src/java/com/twitter/common/net/ProxyConfig.java
src/java/com/twitter/common/net/UrlHelper.java
src/java/com/twitter/common/net/UrlResolver.java
src/java/com/twitter/common/net/UrlResolverUtil.java
src/java/com/twitter/common/net/UrlTokenizerUtil.java
src/java/com/twitter/common/objectsize/ObjectSizeCalculator.java
src/java/com/twitter/common/quantity/Amount.java
src/java/com/twitter/common/quantity/Data.java
src/java/com/twitter/common/quantity/Time.java
src/java/com/twitter/common/quantity/Unit.java
src/java/com/twitter/common/stats/ApproximateHistogram.java
src/java/com/twitter/common/stats/CounterMap.java
src/java/com/twitter/common/stats/CounterMapWithTopKey.java
src/java/com/twitter/common/stats/Elapsed.java
src/java/com/twitter/common/stats/Entropy.java
src/java/com/twitter/common/stats/Histogram.java
src/java/com/twitter/common/stats/Histograms.java
src/java/com/twitter/common/stats/JvmStats.java
src/java/com/twitter/common/stats/MovingAverage.java
src/java/com/twitter/common/stats/MovingWindowDelta.java
src/java/com/twitter/common/stats/NumericStatExporter.java
src/java/com/twitter/common/stats/Percentile.java
src/java/com/twitter/common/stats/PipelineStats.java
src/java/com/twitter/common/stats/Precision.java
src/java/com/twitter/common/stats/PrintableHistogram.java
src/java/com/twitter/common/stats/Rate.java
src/java/com/twitter/common/stats/Ratio.java
src/java/com/twitter/common/stats/RecordingStat.java
src/java/com/twitter/common/stats/RecordingStatImpl.java
src/java/com/twitter/common/stats/RequestStats.java
src/java/com/twitter/common/stats/ReservoirSampler.java
src/java/com/twitter/common/stats/SampledStat.java
src/java/com/twitter/common/stats/Significance.java
src/java/com/twitter/common/stats/SlidingStats.java
src/java/com/twitter/common/stats/Stat.java
src/java/com/twitter/common/stats/StatImpl.java
src/java/com/twitter/common/stats/Statistics.java
src/java/com/twitter/common/stats/StatisticsInterface.java
src/java/com/twitter/common/stats/StatRegistry.java
src/java/com/twitter/common/stats/Stats.java
src/java/com/twitter/common/stats/StatsProvider.java
src/java/com/twitter/common/stats/testing/RealHistogram.java
src/java/com/twitter/common/stats/TimeSeries.java
src/java/com/twitter/common/stats/TimeSeriesRepository.java
src/java/com/twitter/common/stats/TimeSeriesRepositoryImpl.java
src/java/com/twitter/common/stats/Windowed.java
src/java/com/twitter/common/stats/WindowedApproxHistogram.java
src/java/com/twitter/common/stats/WindowedHistogram.java
src/java/com/twitter/common/stats/WindowedStatistics.java
src/java/com/twitter/common/testing/easymock/EasyMockTest.java
src/java/com/twitter/common/testing/easymock/IterableEquals.java
src/java/com/twitter/common/testing/junit/rules/Retry.java
src/java/com/twitter/common/testing/mockito/MockitoTest.java
src/java/com/twitter/common/testing/TearDownRegistry.java
src/java/com/twitter/common/thrift/callers/Caller.java
src/java/com/twitter/common/thrift/callers/CallerDecorator.java
src/java/com/twitter/common/thrift/callers/DeadlineCaller.java
src/java/com/twitter/common/thrift/callers/DebugCaller.java
src/java/com/twitter/common/thrift/callers/RetryingCaller.java
src/java/com/twitter/common/thrift/callers/StatTrackingCaller.java
src/java/com/twitter/common/thrift/callers/ThriftCaller.java
src/java/com/twitter/common/thrift/Config.java
src/java/com/twitter/common/thrift/monitoring/TMonitoredNonblockingServerSocket.java
src/java/com/twitter/common/thrift/monitoring/TMonitoredProcessor.java
src/java/com/twitter/common/thrift/monitoring/TMonitoredServerSocket.java
src/java/com/twitter/common/thrift/testing/MockTSocket.java
src/java/com/twitter/common/thrift/testing/TestThriftTypes.java
src/java/com/twitter/common/thrift/Thrift.java
src/java/com/twitter/common/thrift/ThriftConnectionFactory.java
src/java/com/twitter/common/thrift/ThriftException.java
src/java/com/twitter/common/thrift/ThriftFactory.java
src/java/com/twitter/common/thrift/TResourceExhaustedException.java
src/java/com/twitter/common/thrift/TTimeoutException.java
src/java/com/twitter/common/thrift/TTransportConnection.java
src/java/com/twitter/common/thrift/Util.java
src/java/com/twitter/common/util/BackoffDecider.java
src/java/com/twitter/common/util/BackoffHelper.java
src/java/com/twitter/common/util/BackoffStrategy.java
src/java/com/twitter/common/util/BuildInfo.java
src/java/com/twitter/common/util/caching/Cache.java
src/java/com/twitter/common/util/caching/CachingMethodProxy.java
src/java/com/twitter/common/util/caching/LRUCache.java
src/java/com/twitter/common/util/Clock.java
src/java/com/twitter/common/util/CommandExecutor.java
src/java/com/twitter/common/util/concurrent/BackingOffFutureTask.java
src/java/com/twitter/common/util/concurrent/ExceptionHandlingExecutorService.java
src/java/com/twitter/common/util/concurrent/ExceptionHandlingScheduledExecutorService.java
src/java/com/twitter/common/util/concurrent/ExecutorServiceShutdown.java
src/java/com/twitter/common/util/concurrent/ForwardingExecutorService.java
src/java/com/twitter/common/util/concurrent/MoreExecutors.java
src/java/com/twitter/common/util/concurrent/RetryingFutureTask.java
src/java/com/twitter/common/util/concurrent/TaskConverter.java
src/java/com/twitter/common/util/DateUtils.java
src/java/com/twitter/common/util/FileUtils.java
src/java/com/twitter/common/util/logging/ResourceLoggingConfigurator.java
src/java/com/twitter/common/util/logging/UnresettableLogManager.java
src/java/com/twitter/common/util/LowResClock.java
src/java/com/twitter/common/util/ParsingUtil.java
src/java/com/twitter/common/util/QueueDrainer.java
src/java/com/twitter/common/util/Random.java
src/java/com/twitter/common/util/RangeNormalizer.java
src/java/com/twitter/common/util/RateLimitedCommandExecutor.java
src/java/com/twitter/common/util/RetryingRunnable.java
src/java/com/twitter/common/util/Sampler.java
src/java/com/twitter/common/util/StartWatch.java
src/java/com/twitter/common/util/Stat.java
src/java/com/twitter/common/util/StateMachine.java
src/java/com/twitter/common/util/templating/StringTemplateHelper.java
src/java/com/twitter/common/util/testing/FakeClock.java
src/java/com/twitter/common/util/testing/FakeTicker.java
src/java/com/twitter/common/util/Timer.java
src/java/com/twitter/common/util/TruncatedBinaryBackoff.java
src/java/com/twitter/common/webassets/bootstrap/BootstrapModule.java
src/java/com/twitter/common/webassets/jquery/JQueryModule.java
src/java/com/twitter/common/zookeeper/Candidate.java
src/java/com/twitter/common/zookeeper/CandidateImpl.java
src/java/com/twitter/common/zookeeper/CompoundServerSet.java
src/java/com/twitter/common/zookeeper/DistributedLock.java
src/java/com/twitter/common/zookeeper/DistributedLockImpl.java
src/java/com/twitter/common/zookeeper/Group.java
src/java/com/twitter/common/zookeeper/guice/client/flagged/FlaggedClientConfig.java
src/java/com/twitter/common/zookeeper/guice/client/ZooKeeperClientModule.java
src/java/com/twitter/common/zookeeper/guice/ServerSetModule.java
src/java/com/twitter/common/zookeeper/Partitioner.java
src/java/com/twitter/common/zookeeper/ServerSet.java
src/java/com/twitter/common/zookeeper/ServerSetImpl.java
src/java/com/twitter/common/zookeeper/ServerSets.java
src/java/com/twitter/common/zookeeper/SingletonService.java
src/java/com/twitter/common/zookeeper/StaticServerSet.java
src/java/com/twitter/common/zookeeper/testing/BaseZooKeeperTest.java
src/java/com/twitter/common/zookeeper/testing/ZooKeeperTestServer.java
src/java/com/twitter/common/zookeeper/ZooKeeperClient.java
src/java/com/twitter/common/zookeeper/ZooKeeperMap.java
src/java/com/twitter/common/zookeeper/ZooKeeperNode.java
src/java/com/twitter/common/zookeeper/ZooKeeperUtils.java
src/resources/com/twitter/common/application/http/graphview/dygraph-combined.js
src/resources/com/twitter/common/application/http/graphview/dygraph-extra.js
src/resources/com/twitter/common/application/http/graphview/grapher.js
src/resources/com/twitter/common/application/http/graphview/graphview.html
src/resources/com/twitter/common/application/http/graphview/parser.js
src/resources/com/twitter/common/net/http/handlers/logconfig.st
src/resources/com/twitter/common/net/http/handlers/logprinter.st
src/resources/com/twitter/common/net/http/handlers/thrift.st
src/resources/com/twitter/common/webassets/bootstrap/2.1.1/css/bootstrap-responsive.min.css
src/resources/com/twitter/common/webassets/bootstrap/2.1.1/css/bootstrap.min.css
src/resources/com/twitter/common/webassets/bootstrap/2.1.1/img/glyphicons-halflings-white.png
src/resources/com/twitter/common/webassets/bootstrap/2.1.1/img/glyphicons-halflings.png
src/resources/com/twitter/common/webassets/bootstrap/2.1.1/js/bootstrap.min.js
src/resources/com/twitter/common/webassets/bootstrap/2.3.2/css/bootstrap-responsive.min.css
src/resources/com/twitter/common/webassets/bootstrap/2.3.2/css/bootstrap.min.css
src/resources/com/twitter/common/webassets/bootstrap/2.3.2/img/glyphicons-halflings-white.png
src/resources/com/twitter/common/webassets/bootstrap/2.3.2/img/glyphicons-halflings.png
src/resources/com/twitter/common/webassets/bootstrap/2.3.2/js/bootstrap.min.js
src/resources/com/twitter/common/webassets/jquery/js/jquery-1.8.2.min.js
src/thrift/com/twitter/thrift/endpoint.thrift
tests/java/com/twitter/common/application/AppLauncherTest.java
tests/java/com/twitter/common/application/modules/LifecycleModuleTest.java
tests/java/com/twitter/common/application/modules/LocalServiceRegistryTest.java
tests/java/com/twitter/common/application/modules/StartStatPollerTest.java
tests/java/com/twitter/common/args/argfilterstest/ArgsRoot.java
tests/java/com/twitter/common/args/argfilterstest/subpackageA/ArgsA.java
tests/java/com/twitter/common/args/argfilterstest/subpackageA/subsubpackage1/ArgsA1.java
tests/java/com/twitter/common/args/argfilterstest/subpackageB/ArgsB.java
tests/java/com/twitter/common/args/argfilterstest/subpackageBwithSuffix/ArgsBWithSuffix.java
tests/java/com/twitter/common/args/ArgFiltersTest.java
tests/java/com/twitter/common/args/ArgScannerTest.java
tests/java/com/twitter/common/args/ArgsTest.java
tests/java/com/twitter/common/args/ArgTest.java
tests/java/com/twitter/common/args/OptionInfoTest.java
tests/java/com/twitter/common/args/ParsersTest.java
tests/java/com/twitter/common/base/CachingSupplierTest.java
tests/java/com/twitter/common/base/ClosuresTest.java
tests/java/com/twitter/common/base/CommandsTest.java
tests/java/com/twitter/common/base/EitherTest.java
tests/java/com/twitter/common/base/ExceptionalFunctionsTest.java
tests/java/com/twitter/common/base/ExceptionTransporterTest.java
tests/java/com/twitter/common/base/MorePreconditionsTest.java
tests/java/com/twitter/common/base/MoreSuppliersTest.java
tests/java/com/twitter/common/collections/BitsTest.java
tests/java/com/twitter/common/collections/BoundedQueueTest.java
tests/java/com/twitter/common/collections/Iterables2Test.java
tests/java/com/twitter/common/collections/PairTest.java
tests/java/com/twitter/common/inject/BindingsTest.java
tests/java/com/twitter/common/inject/DefaultProviderTest.java
tests/java/com/twitter/common/io/Base64ZlibCodecTest.java
tests/java/com/twitter/common/io/CodecTestUtilities.java
tests/java/com/twitter/common/io/CompatibilityCodecTest.java
tests/java/com/twitter/common/io/FileUtilsTest.java
tests/java/com/twitter/common/io/JsonCodecTest.java
tests/java/com/twitter/common/io/ThriftCodecTest.java
tests/java/com/twitter/common/logging/BufferedLogTest.java
tests/java/com/twitter/common/logging/julbridge/JULBridgeHandlerTest.java
tests/java/com/twitter/common/logging/julbridge/JULBridgeLevelConverterTest.java
tests/java/com/twitter/common/logging/julbridge/JULBridgeLogManagerTest.java
tests/java/com/twitter/common/logging/LogFormatterTest.java
tests/java/com/twitter/common/logging/LogUtilTest.java
tests/java/com/twitter/common/logging/RootLogConfigTest.java
tests/java/com/twitter/common/net/http/filters/HttpStatsFilterIntegrationTest.java
tests/java/com/twitter/common/net/http/filters/HttpStatsFilterTest.java
tests/java/com/twitter/common/net/http/handlers/AssetHandlerTest.java
tests/java/com/twitter/common/net/http/handlers/HttpServletRequestParamsTest.java
tests/java/com/twitter/common/net/http/handlers/LogPrinterTest.java
tests/java/com/twitter/common/net/http/handlers/StatSupplierTestBase.java
tests/java/com/twitter/common/net/http/handlers/TimeSeriesDataSourceTest.java
tests/java/com/twitter/common/net/http/handlers/VarsHandlerTest.java
tests/java/com/twitter/common/net/http/handlers/VarsJsonHandlerTest.java
tests/java/com/twitter/common/net/http/RequestLoggerTest.java
tests/java/com/twitter/common/net/InetSocketAddressHelperTest.java
tests/java/com/twitter/common/net/loadbalancing/LeastConnectedStrategyTest.java
tests/java/com/twitter/common/net/loadbalancing/LoadBalancerImplTest.java
tests/java/com/twitter/common/net/loadbalancing/MarkDeadStrategyTest.java
tests/java/com/twitter/common/net/loadbalancing/MarkDeadStrategyWithHostCheckTest.java
tests/java/com/twitter/common/net/loadbalancing/RandomStrategyTest.java
tests/java/com/twitter/common/net/loadbalancing/RoundRobinStrategyTest.java
tests/java/com/twitter/common/net/loadbalancing/SubsetStrategyTest.java
tests/java/com/twitter/common/net/monitoring/TrafficMonitorTest.java
tests/java/com/twitter/common/net/pool/ConnectionPoolTest.java
tests/java/com/twitter/common/net/pool/DynamicHostSetUtilTest.java
tests/java/com/twitter/common/net/pool/DynamicPoolTest.java
tests/java/com/twitter/common/net/UrlHelperTest.java
tests/java/com/twitter/common/net/UrlResolverTest.java
tests/java/com/twitter/common/net/UrlResolverUtilTest.java
tests/java/com/twitter/common/net/UrlTokenizerUtilTest.java
tests/java/com/twitter/common/objectsize/ObjectSizeCalculatorTest.java
tests/java/com/twitter/common/quantity/AmountTest.java
tests/java/com/twitter/common/stats/ApproximateHistogramTest.java
tests/java/com/twitter/common/stats/ElapsedTest.java
tests/java/com/twitter/common/stats/EntropyTest.java
tests/java/com/twitter/common/stats/MergedHistogramTest.java
tests/java/com/twitter/common/stats/MovingAverageTest.java
tests/java/com/twitter/common/stats/MovingWindowDeltaTest.java
tests/java/com/twitter/common/stats/NumericStatExporterTest.java
tests/java/com/twitter/common/stats/PercentileTest.java
tests/java/com/twitter/common/stats/PipelineStatsTest.java
tests/java/com/twitter/common/stats/PrintableHistogramTest.java
tests/java/com/twitter/common/stats/RateTest.java
tests/java/com/twitter/common/stats/ReservoirSamplerTest.java
tests/java/com/twitter/common/stats/StatisticsTest.java
tests/java/com/twitter/common/stats/StatsTest.java
tests/java/com/twitter/common/stats/TimeSeriesRepositoryImplTest.java
tests/java/com/twitter/common/stats/WindowedHistogramTest.java
tests/java/com/twitter/common/stats/WindowedStatsTest.java
tests/java/com/twitter/common/stats/WindowedTest.java
tests/java/com/twitter/common/testing/easymock/EasyMockTestTest.java
tests/java/com/twitter/common/testing/easymock/IterableEqualsTest.java
tests/java/com/twitter/common/testing/junit/rules/RetryTest.java
tests/java/com/twitter/common/testing/TearDownRegistryTest.java
tests/java/com/twitter/common/thrift/callers/AbstractCallerTest.java
tests/java/com/twitter/common/thrift/callers/DeadlineCallerTest.java
tests/java/com/twitter/common/thrift/callers/RetryingCallerTest.java
tests/java/com/twitter/common/thrift/ThriftConnectionFactoryTest.java
tests/java/com/twitter/common/thrift/ThriftFactoryTest.java
tests/java/com/twitter/common/thrift/ThriftTest.java
tests/java/com/twitter/common/util/BackoffDeciderTest.java
tests/java/com/twitter/common/util/BackoffHelperTest.java
tests/java/com/twitter/common/util/caching/CachingMethodProxyTest.java
tests/java/com/twitter/common/util/caching/LRUCacheTest.java
tests/java/com/twitter/common/util/concurrent/ExceptionHandlingExecutorServiceTest.java
tests/java/com/twitter/common/util/concurrent/ExceptionHandlingScheduledExecutorServiceTest.java
tests/java/com/twitter/common/util/LowResClockTest.java
tests/java/com/twitter/common/util/QueueDrainerTest.java
tests/java/com/twitter/common/util/RateLimitedCommandExecutorTest.java
tests/java/com/twitter/common/util/SamplerTest.java
tests/java/com/twitter/common/util/StateMachineTest.java
tests/java/com/twitter/common/util/templating/StringTemplateHelperTest.java
tests/java/com/twitter/common/util/testing/FakeClockTest.java
tests/java/com/twitter/common/util/TruncatedBinaryBackoffTest.java
tests/java/com/twitter/common/zookeeper/CandidateImplTest.java
tests/java/com/twitter/common/zookeeper/CompoundServerSetTest.java
tests/java/com/twitter/common/zookeeper/DistributedLockTest.java
tests/java/com/twitter/common/zookeeper/GroupTest.java
tests/java/com/twitter/common/zookeeper/guice/ServerSetModuleTest.java
tests/java/com/twitter/common/zookeeper/PartitionerTest.java
tests/java/com/twitter/common/zookeeper/ServerSetImplTest.java
tests/java/com/twitter/common/zookeeper/ServerSetsTest.java
tests/java/com/twitter/common/zookeeper/SingletonServiceTest.java
tests/java/com/twitter/common/zookeeper/StaticServerSetTest.java
tests/java/com/twitter/common/zookeeper/ZooKeeperClientTest.java
tests/java/com/twitter/common/zookeeper/ZooKeeperMapTest.java
tests/java/com/twitter/common/zookeeper/ZooKeeperNodeTest.java
tests/java/com/twitter/common/zookeeper/ZooKeeperUtilsTest.java
tests/resources/com/twitter/common/util/templating/template.st
````

The majority of the code was placed under a 'commons' subproject so it does not
need to share the same checkstyle configuration as the main aurora code. Since
pants is capable of compiling annotation processors related code concurrently and
gradle is not, the CmdLineProcessor annotation processor and related
dependencies were moved into its own gradle project called 'commons-args'.

In order for this import to compile and have tests pass a few minor changes were
done to the source files. The first set of changes were done to deal with the
thrift version incompatibility between Twitter Commons and Aurora. Twitter
Commons depended on thrift 0.5.0 and Aurora currently depends on thrift 0.9.0.
There was a source incompatible API chance in
org.apache.thrift.async.AsyncMethodCallback interface and the following files
had minor changes made so the code would compile:

````
commons/src/main/java/com/twitter/common/thrift/callers/Caller.java
commons/src/main/java/com/twitter/common/thrift/callers/CallerDecorator.java
commons/src/main/java/com/twitter/common/thrift/callers/RetryingCaller.java
commons/src/main/java/com/twitter/common/thrift/callers/ThriftCaller.java
commons/src/test/java/com/twitter/common/thrift/ThriftFactoryTest.java
commons/src/test/java/com/twitter/common/thrift/ThriftTest.java
````

These classes are not used in Aurora directly but are instead used in the
testing of com.twitter.common.zookeeper components so the nature of the changes
do not need to be reviewed.

The second set of changes involves removing use of junit annotations. Three
files used junit annotaions from twitter common (`@TestParallel` and
`@TestSerial`) that are not available in tree but instead as another dependency.
To prevent adding another dependency to the build the following files were
modified to remove use of the annotations.

````
commons/src/test/java/com/twitter/common/stats/ApproximateHistogramTest.java
commons/src/test/java/com/twitter/common/stats/WindowedStatsTest.java
commons/src/test/java/com/twitter/common/testing/junit/rules/RetryTest.java
````

The third change involves adding the META-INF resource file for the
CmdLineProcessor annotation processor:
`commons-args/src/main/resources/META-INF/services/javax.annotation.processing.Processor`.
This annotation is necessary for javac to discover the annotation processor and
invoke it. The pants build tool automatically generated this file but gradle
does not.

The final change involves ignoring a single failing test:
`com.twitter.common.zookeeper.ServerSetImplTest#testJsonCodecCompatibility`.
This test fails with thrift 0.9.0 due to internal thrift changes. A TODO was
added to fix it later.

Testing Done:
./gradlew clean build
e2e tests pass

Bugs closed: AURORA-1213

Reviewed at https://reviews.apache.org/r/37666/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/86a547b9
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/86a547b9
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/86a547b9

Branch: refs/heads/master
Commit: 86a547b922ba250ba210004001fd8aa5f5f127a8
Parents: cb84ed2
Author: Zameer Manji <zmanji@apache.org>
Authored: Tue Aug 25 11:08:51 2015 -0700
Committer: Zameer Manji <zmanji@apache.org>
Committed: Tue Aug 25 11:08:51 2015 -0700

----------------------------------------------------------------------
 .gitignore                                      |    6 +-
 build.gradle                                    |  105 +-
 .../main/java/com/twitter/common/args/Arg.java  |  129 ++
 .../java/com/twitter/common/args/ArgParser.java |   15 +
 .../java/com/twitter/common/args/CmdLine.java   |   57 +
 .../java/com/twitter/common/args/NoParser.java  |   26 +
 .../java/com/twitter/common/args/Parser.java    |   38 +
 .../com/twitter/common/args/ParserOracle.java   |   34 +
 .../com/twitter/common/args/Positional.java     |   43 +
 .../java/com/twitter/common/args/Verifier.java  |   40 +
 .../com/twitter/common/args/VerifierFor.java    |   21 +
 .../common/args/apt/CmdLineProcessor.java       |  680 +++++++
 .../twitter/common/args/apt/Configuration.java  |  530 +++++
 .../javax.annotation.processing.Processor       |    1 +
 .../common/application/AbstractApplication.java |   32 +
 .../twitter/common/application/AppLauncher.java |  205 ++
 .../twitter/common/application/Application.java |   32 +
 .../twitter/common/application/Lifecycle.java   |   97 +
 .../common/application/ShutdownRegistry.java    |  102 +
 .../common/application/ShutdownStage.java       |   34 +
 .../common/application/StartupRegistry.java     |   55 +
 .../common/application/StartupStage.java        |   34 +
 .../application/http/DefaultQuitHandler.java    |   46 +
 .../common/application/http/GraphViewer.java    |   53 +
 .../application/http/HttpAssetConfig.java       |   54 +
 .../application/http/HttpFilterConfig.java      |   26 +
 .../application/http/HttpServletConfig.java     |   68 +
 .../common/application/http/Registration.java   |  142 ++
 .../application/modules/AppLauncherModule.java  |   53 +
 .../application/modules/LifecycleModule.java    |  198 ++
 .../modules/LocalServiceRegistry.java           |  261 +++
 .../common/application/modules/LogModule.java   |  120 ++
 .../application/modules/StatsExportModule.java  |   88 +
 .../common/application/modules/StatsModule.java |  149 ++
 .../application/modules/ThriftModule.java       |   44 +
 .../com/twitter/common/args/ArgFilters.java     |  128 ++
 .../com/twitter/common/args/ArgScanner.java     |  563 ++++++
 .../main/java/com/twitter/common/args/Args.java |  227 +++
 .../com/twitter/common/args/ArgumentInfo.java   |  250 +++
 .../com/twitter/common/args/OptionInfo.java     |  204 ++
 .../java/com/twitter/common/args/Parsers.java   |  117 ++
 .../com/twitter/common/args/PositionalInfo.java |  119 ++
 .../java/com/twitter/common/args/TypeUtil.java  |  123 ++
 .../java/com/twitter/common/args/Verifiers.java |   95 +
 .../common/args/constraints/CanExecute.java     |   33 +
 .../constraints/CanExecuteFileVerifier.java     |   43 +
 .../common/args/constraints/CanRead.java        |   33 +
 .../args/constraints/CanReadFileVerifier.java   |   43 +
 .../common/args/constraints/CanWrite.java       |   33 +
 .../args/constraints/CanWriteFileVerifier.java  |   43 +
 .../twitter/common/args/constraints/Exists.java |   33 +
 .../args/constraints/ExistsFileVerifier.java    |   43 +
 .../common/args/constraints/IsDirectory.java    |   33 +
 .../constraints/IsDirectoryFileVerifier.java    |   43 +
 .../common/args/constraints/NotEmpty.java       |   33 +
 .../constraints/NotEmptyIterableVerifier.java   |   44 +
 .../constraints/NotEmptyStringVerifier.java     |   42 +
 .../common/args/constraints/NotNegative.java    |   33 +
 .../constraints/NotNegativeNumberVerifier.java  |   42 +
 .../common/args/constraints/NotNull.java        |   33 +
 .../args/constraints/NotNullVerifier.java       |   42 +
 .../common/args/constraints/Positive.java       |   33 +
 .../constraints/PositiveNumberVerifier.java     |   42 +
 .../twitter/common/args/constraints/Range.java  |   43 +
 .../args/constraints/RangeNumberVerifier.java   |   77 +
 .../common/args/parsers/AmountParser.java       |   89 +
 .../common/args/parsers/BooleanParser.java      |   33 +
 .../twitter/common/args/parsers/ByteParser.java |   32 +
 .../common/args/parsers/CharacterParser.java    |   36 +
 .../common/args/parsers/ClassParser.java        |   51 +
 .../twitter/common/args/parsers/DateParser.java |   44 +
 .../common/args/parsers/DoubleParser.java       |   32 +
 .../common/args/parsers/DurationParser.java     |   83 +
 .../twitter/common/args/parsers/EnumParser.java |   39 +
 .../twitter/common/args/parsers/FileParser.java |   34 +
 .../common/args/parsers/FloatParser.java        |   32 +
 .../args/parsers/InetSocketAddressParser.java   |   35 +
 .../common/args/parsers/IntegerParser.java      |   32 +
 .../twitter/common/args/parsers/ListParser.java |   55 +
 .../twitter/common/args/parsers/LongParser.java |   32 +
 .../twitter/common/args/parsers/MapParser.java  |   71 +
 .../parsers/NonParameterizedTypeParser.java     |   44 +
 .../common/args/parsers/NumberParser.java       |   44 +
 .../twitter/common/args/parsers/PairParser.java |   60 +
 .../common/args/parsers/PatternParser.java      |   38 +
 .../common/args/parsers/RangeParser.java        |   33 +
 .../twitter/common/args/parsers/SetParser.java  |   57 +
 .../common/args/parsers/ShortParser.java        |   32 +
 .../common/args/parsers/StringParser.java       |   32 +
 .../args/parsers/TypeParameterizedParser.java   |   68 +
 .../twitter/common/args/parsers/URIParser.java  |   39 +
 .../twitter/common/args/parsers/URLParser.java  |   39 +
 .../twitter/common/args/parsers/UnitParser.java |   57 +
 .../twitter/common/base/CachingSupplier.java    |   71 +
 .../base/CallableExceptionalSupplier.java       |   35 +
 .../java/com/twitter/common/base/Closure.java   |   28 +
 .../java/com/twitter/common/base/Closures.java  |  136 ++
 .../java/com/twitter/common/base/Command.java   |   26 +
 .../java/com/twitter/common/base/Commands.java  |   80 +
 .../java/com/twitter/common/base/Either.java    |  345 ++++
 .../common/base/ExceptionTransporter.java       |   87 +
 .../twitter/common/base/ExceptionalClosure.java |   38 +
 .../twitter/common/base/ExceptionalCommand.java |   34 +
 .../common/base/ExceptionalFunction.java        |   40 +
 .../common/base/ExceptionalFunctions.java       |  156 ++
 .../common/base/ExceptionalSupplier.java        |   36 +
 .../java/com/twitter/common/base/Function.java  |   32 +
 .../twitter/common/base/MorePreconditions.java  |  147 ++
 .../com/twitter/common/base/MoreSuppliers.java  |  106 +
 .../java/com/twitter/common/base/Supplier.java  |   31 +
 .../java/com/twitter/common/base/SupplierE.java |   28 +
 .../com/twitter/common/collections/Bits.java    |  119 ++
 .../common/collections/BoundedQueue.java        |   79 +
 .../twitter/common/collections/Iterables2.java  |  151 ++
 .../twitter/common/collections/Multimaps.java   |  137 ++
 .../com/twitter/common/collections/Pair.java    |  130 ++
 .../com/twitter/common/inject/Bindings.java     |  319 +++
 .../twitter/common/inject/DefaultProvider.java  |  169 ++
 .../common/inject/ProviderMethodModule.java     |   35 +
 .../twitter/common/inject/TimedInterceptor.java |  109 +
 .../com/twitter/common/io/Base64ZlibCodec.java  |  156 ++
 .../main/java/com/twitter/common/io/Codec.java  |   56 +
 .../twitter/common/io/CompatibilityCodec.java   |   97 +
 .../java/com/twitter/common/io/FileUtils.java   |  196 ++
 .../java/com/twitter/common/io/JsonCodec.java   |  127 ++
 .../java/com/twitter/common/io/Streamer.java    |   57 +
 .../java/com/twitter/common/io/ThriftCodec.java |  107 +
 .../com/twitter/common/logging/BufferedLog.java |  281 +++
 .../java/com/twitter/common/logging/Glog.java   |  211 ++
 .../java/com/twitter/common/logging/Log.java    |   48 +
 .../twitter/common/logging/LogFormatter.java    |   67 +
 .../com/twitter/common/logging/LogUtil.java     |   93 +
 .../twitter/common/logging/RootLogConfig.java   |  326 +++
 .../logging/julbridge/JULBridgeHandler.java     |  199 ++
 .../julbridge/JULBridgeLevelConverter.java      |  102 +
 .../logging/julbridge/JULBridgeLogManager.java  |   89 +
 .../common/logging/log4j/GlogLayout.java        |  103 +
 .../com/twitter/common/net/Environment.java     |   50 +
 .../common/net/InetSocketAddressHelper.java     |  139 ++
 .../com/twitter/common/net/ProxyAuthorizer.java |   44 +
 .../com/twitter/common/net/ProxyConfig.java     |   33 +
 .../java/com/twitter/common/net/UrlHelper.java  |  159 ++
 .../com/twitter/common/net/UrlResolver.java     |  449 +++++
 .../com/twitter/common/net/UrlResolverUtil.java |  151 ++
 .../twitter/common/net/UrlTokenizerUtil.java    | 1908 ++++++++++++++++++
 .../common/net/http/GuiceServletConfig.java     |   44 +
 .../common/net/http/HttpServerDispatch.java     |  126 ++
 .../net/http/JettyHttpServerDispatch.java       |  286 +++
 .../twitter/common/net/http/RequestLogger.java  |  117 ++
 .../net/http/filters/AbstractHttpFilter.java    |   50 +
 .../net/http/filters/HttpStatsFilter.java       |  145 ++
 .../common/net/http/handlers/AbortHandler.java  |   74 +
 .../common/net/http/handlers/AssetHandler.java  |  192 ++
 .../net/http/handlers/ContentionPrinter.java    |   91 +
 .../common/net/http/handlers/HealthHandler.java |   85 +
 .../http/handlers/HttpServletRequestParams.java |   74 +
 .../common/net/http/handlers/LogConfig.java     |  135 ++
 .../common/net/http/handlers/LogPrinter.java    |  414 ++++
 .../common/net/http/handlers/QuitHandler.java   |   74 +
 .../http/handlers/StringTemplateServlet.java    |   83 +
 .../net/http/handlers/TextResponseHandler.java  |   61 +
 .../net/http/handlers/ThreadStackPrinter.java   |   44 +
 .../common/net/http/handlers/ThriftServlet.java |   73 +
 .../net/http/handlers/TimeSeriesDataSource.java |  137 ++
 .../common/net/http/handlers/VarsHandler.java   |   64 +
 .../net/http/handlers/VarsJsonHandler.java      |   77 +
 .../loadbalancing/LeastConnectedStrategy.java   |  173 ++
 .../common/net/loadbalancing/LoadBalancer.java  |   79 +
 .../net/loadbalancing/LoadBalancerImpl.java     |  125 ++
 .../loadbalancing/LoadBalancingStrategy.java    |   83 +
 .../net/loadbalancing/MarkDeadStrategy.java     |  224 ++
 .../MarkDeadStrategyWithHostCheck.java          |  100 +
 .../net/loadbalancing/RandomStrategy.java       |   60 +
 .../net/loadbalancing/RequestTracker.java       |   40 +
 .../net/loadbalancing/RoundRobinStrategy.java   |   52 +
 .../StaticLoadBalancingStrategy.java            |   64 +
 .../net/loadbalancing/SubsetStrategy.java       |   92 +
 .../loadbalancing/TrafficMonitorAdapter.java    |   71 +
 .../net/monitoring/ConnectionMonitor.java       |   39 +
 .../common/net/monitoring/TrafficMonitor.java   |  262 +++
 .../com/twitter/common/net/pool/Connection.java |   51 +
 .../common/net/pool/ConnectionFactory.java      |   59 +
 .../twitter/common/net/pool/ConnectionPool.java |  337 ++++
 .../twitter/common/net/pool/DynamicHostSet.java |   79 +
 .../common/net/pool/DynamicHostSetUtil.java     |   52 +
 .../twitter/common/net/pool/DynamicPool.java    |  172 ++
 .../com/twitter/common/net/pool/MetaPool.java   |  343 ++++
 .../com/twitter/common/net/pool/ObjectPool.java |   85 +
 .../net/pool/ResourceExhaustedException.java    |   30 +
 .../common/objectsize/ObjectSizeCalculator.java |  430 ++++
 .../com/twitter/common/quantity/Amount.java     |  211 ++
 .../java/com/twitter/common/quantity/Data.java  |   54 +
 .../java/com/twitter/common/quantity/Time.java  |   65 +
 .../java/com/twitter/common/quantity/Unit.java  |   36 +
 .../common/stats/ApproximateHistogram.java      |  566 ++++++
 .../com/twitter/common/stats/CounterMap.java    |  141 ++
 .../common/stats/CounterMapWithTopKey.java      |   92 +
 .../java/com/twitter/common/stats/Elapsed.java  |   70 +
 .../java/com/twitter/common/stats/Entropy.java  |   54 +
 .../com/twitter/common/stats/Histogram.java     |   46 +
 .../com/twitter/common/stats/Histograms.java    |   26 +
 .../java/com/twitter/common/stats/JvmStats.java |  243 +++
 .../com/twitter/common/stats/MovingAverage.java |   71 +
 .../twitter/common/stats/MovingWindowDelta.java |  100 +
 .../common/stats/NumericStatExporter.java       |  128 ++
 .../com/twitter/common/stats/Percentile.java    |  201 ++
 .../com/twitter/common/stats/PipelineStats.java |  137 ++
 .../com/twitter/common/stats/Precision.java     |   37 +
 .../common/stats/PrintableHistogram.java        |   93 +
 .../java/com/twitter/common/stats/Rate.java     |  149 ++
 .../java/com/twitter/common/stats/Ratio.java    |  101 +
 .../com/twitter/common/stats/RecordingStat.java |   36 +
 .../twitter/common/stats/RecordingStatImpl.java |   49 +
 .../com/twitter/common/stats/RequestStats.java  |  145 ++
 .../twitter/common/stats/ReservoirSampler.java  |   84 +
 .../com/twitter/common/stats/SampledStat.java   |   46 +
 .../com/twitter/common/stats/Significance.java  |   62 +
 .../com/twitter/common/stats/SlidingStats.java  |   96 +
 .../java/com/twitter/common/stats/Stat.java     |   40 +
 .../java/com/twitter/common/stats/StatImpl.java |   38 +
 .../com/twitter/common/stats/StatRegistry.java  |   32 +
 .../com/twitter/common/stats/Statistics.java    |   96 +
 .../common/stats/StatisticsInterface.java       |   73 +
 .../java/com/twitter/common/stats/Stats.java    |  411 ++++
 .../com/twitter/common/stats/StatsProvider.java |   91 +
 .../com/twitter/common/stats/TimeSeries.java    |   41 +
 .../common/stats/TimeSeriesRepository.java      |   60 +
 .../common/stats/TimeSeriesRepositoryImpl.java  |  200 ++
 .../java/com/twitter/common/stats/Windowed.java |  139 ++
 .../common/stats/WindowedApproxHistogram.java   |  156 ++
 .../twitter/common/stats/WindowedHistogram.java |  113 ++
 .../common/stats/WindowedStatistics.java        |  160 ++
 .../common/stats/testing/RealHistogram.java     |   45 +
 .../common/testing/TearDownRegistry.java        |   54 +
 .../common/testing/easymock/EasyMockTest.java   |  124 ++
 .../common/testing/easymock/IterableEquals.java |   77 +
 .../common/testing/junit/rules/Retry.java       |  161 ++
 .../common/testing/mockito/MockitoTest.java     |   34 +
 .../java/com/twitter/common/thrift/Config.java  |  305 +++
 .../thrift/TResourceExhaustedException.java     |   42 +
 .../common/thrift/TTimeoutException.java        |   41 +
 .../common/thrift/TTransportConnection.java     |   73 +
 .../java/com/twitter/common/thrift/Thrift.java  |  393 ++++
 .../common/thrift/ThriftConnectionFactory.java  |  369 ++++
 .../twitter/common/thrift/ThriftException.java  |   29 +
 .../twitter/common/thrift/ThriftFactory.java    |  657 ++++++
 .../java/com/twitter/common/thrift/Util.java    |  237 +++
 .../twitter/common/thrift/callers/Caller.java   |  102 +
 .../common/thrift/callers/CallerDecorator.java  |   81 +
 .../common/thrift/callers/DeadlineCaller.java   |   96 +
 .../common/thrift/callers/DebugCaller.java      |   76 +
 .../common/thrift/callers/RetryingCaller.java   |  227 +++
 .../thrift/callers/StatTrackingCaller.java      |  106 +
 .../common/thrift/callers/ThriftCaller.java     |  160 ++
 .../TMonitoredNonblockingServerSocket.java      |   83 +
 .../thrift/monitoring/TMonitoredProcessor.java  |   65 +
 .../monitoring/TMonitoredServerSocket.java      |  114 ++
 .../common/thrift/testing/MockTSocket.java      |   48 +
 .../common/thrift/testing/TestThriftTypes.java  |  174 ++
 .../com/twitter/common/util/BackoffDecider.java |  666 ++++++
 .../com/twitter/common/util/BackoffHelper.java  |  155 ++
 .../twitter/common/util/BackoffStrategy.java    |   40 +
 .../java/com/twitter/common/util/BuildInfo.java |  111 +
 .../java/com/twitter/common/util/Clock.java     |   73 +
 .../twitter/common/util/CommandExecutor.java    |   45 +
 .../java/com/twitter/common/util/DateUtils.java |   60 +
 .../java/com/twitter/common/util/FileUtils.java |   54 +
 .../com/twitter/common/util/LowResClock.java    |  111 +
 .../com/twitter/common/util/ParsingUtil.java    |   56 +
 .../com/twitter/common/util/QueueDrainer.java   |   56 +
 .../java/com/twitter/common/util/Random.java    |   81 +
 .../twitter/common/util/RangeNormalizer.java    |   91 +
 .../common/util/RateLimitedCommandExecutor.java |   93 +
 .../twitter/common/util/RetryingRunnable.java   |  134 ++
 .../java/com/twitter/common/util/Sampler.java   |   57 +
 .../com/twitter/common/util/StartWatch.java     |   51 +
 .../main/java/com/twitter/common/util/Stat.java |  360 ++++
 .../com/twitter/common/util/StateMachine.java   |  586 ++++++
 .../java/com/twitter/common/util/Timer.java     |   74 +
 .../common/util/TruncatedBinaryBackoff.java     |   77 +
 .../com/twitter/common/util/caching/Cache.java  |   49 +
 .../common/util/caching/CachingMethodProxy.java |  265 +++
 .../twitter/common/util/caching/LRUCache.java   |  173 ++
 .../util/concurrent/BackingOffFutureTask.java   |   59 +
 .../ExceptionHandlingExecutorService.java       |   81 +
 ...ceptionHandlingScheduledExecutorService.java |  108 +
 .../concurrent/ExecutorServiceShutdown.java     |   74 +
 .../concurrent/ForwardingExecutorService.java   |  104 +
 .../common/util/concurrent/MoreExecutors.java   |  109 +
 .../util/concurrent/RetryingFutureTask.java     |   84 +
 .../common/util/concurrent/TaskConverter.java   |   80 +
 .../logging/ResourceLoggingConfigurator.java    |   52 +
 .../util/logging/UnresettableLogManager.java    |   51 +
 .../util/templating/StringTemplateHelper.java   |   83 +
 .../twitter/common/util/testing/FakeClock.java  |   81 +
 .../twitter/common/util/testing/FakeTicker.java |   56 +
 .../webassets/bootstrap/BootstrapModule.java    |   93 +
 .../common/webassets/jquery/JQueryModule.java   |   39 +
 .../com/twitter/common/zookeeper/Candidate.java |   82 +
 .../twitter/common/zookeeper/CandidateImpl.java |  184 ++
 .../common/zookeeper/CompoundServerSet.java     |  211 ++
 .../common/zookeeper/DistributedLock.java       |   42 +
 .../common/zookeeper/DistributedLockImpl.java   |  289 +++
 .../com/twitter/common/zookeeper/Group.java     |  711 +++++++
 .../twitter/common/zookeeper/Partitioner.java   |  175 ++
 .../com/twitter/common/zookeeper/ServerSet.java |  117 ++
 .../twitter/common/zookeeper/ServerSetImpl.java |  609 ++++++
 .../twitter/common/zookeeper/ServerSets.java    |  135 ++
 .../common/zookeeper/SingletonService.java      |  318 +++
 .../common/zookeeper/StaticServerSet.java       |  132 ++
 .../common/zookeeper/ZooKeeperClient.java       |  496 +++++
 .../twitter/common/zookeeper/ZooKeeperMap.java  |  414 ++++
 .../twitter/common/zookeeper/ZooKeeperNode.java |  336 +++
 .../common/zookeeper/ZooKeeperUtils.java        |  170 ++
 .../common/zookeeper/guice/ServerSetModule.java |  273 +++
 .../guice/client/ZooKeeperClientModule.java     |  238 +++
 .../client/flagged/FlaggedClientConfig.java     |   85 +
 .../zookeeper/testing/BaseZooKeeperTest.java    |  157 ++
 .../zookeeper/testing/ZooKeeperTestServer.java  |  225 +++
 .../http/graphview/dygraph-combined.js          |    2 +
 .../application/http/graphview/dygraph-extra.js |  354 ++++
 .../application/http/graphview/grapher.js       |  368 ++++
 .../application/http/graphview/graphview.html   |   87 +
 .../common/application/http/graphview/parser.js |  340 ++++
 .../common/net/http/handlers/logconfig.st       |   62 +
 .../common/net/http/handlers/logprinter.st      |  198 ++
 .../twitter/common/net/http/handlers/thrift.st  |   82 +
 .../2.1.1/css/bootstrap-responsive.min.css      |    9 +
 .../bootstrap/2.1.1/css/bootstrap.min.css       |    9 +
 .../2.1.1/img/glyphicons-halflings-white.png    |  Bin 0 -> 8777 bytes
 .../2.1.1/img/glyphicons-halflings.png          |  Bin 0 -> 12799 bytes
 .../bootstrap/2.1.1/js/bootstrap.min.js         |    6 +
 .../2.3.2/css/bootstrap-responsive.min.css      |    9 +
 .../bootstrap/2.3.2/css/bootstrap.min.css       |    9 +
 .../2.3.2/img/glyphicons-halflings-white.png    |  Bin 0 -> 8777 bytes
 .../2.3.2/img/glyphicons-halflings.png          |  Bin 0 -> 12799 bytes
 .../bootstrap/2.3.2/js/bootstrap.min.js         |    6 +
 .../webassets/jquery/js/jquery-1.8.2.min.js     |    2 +
 .../thrift/com/twitter/thrift/endpoint.thrift   |  115 ++
 .../common/application/AppLauncherTest.java     |   77 +
 .../modules/LifecycleModuleTest.java            |  124 ++
 .../modules/LocalServiceRegistryTest.java       |  157 ++
 .../modules/StartStatPollerTest.java            |   50 +
 .../com/twitter/common/args/ArgFiltersTest.java |  108 +
 .../com/twitter/common/args/ArgScannerTest.java |  851 ++++++++
 .../java/com/twitter/common/args/ArgTest.java   |   37 +
 .../java/com/twitter/common/args/ArgsTest.java  |   76 +
 .../com/twitter/common/args/OptionInfoTest.java |  111 +
 .../com/twitter/common/args/ParsersTest.java    |   84 +
 .../common/args/argfilterstest/ArgsRoot.java    |   32 +
 .../args/argfilterstest/subpackageA/ArgsA.java  |   32 +
 .../subpackageA/subsubpackage1/ArgsA1.java      |   32 +
 .../args/argfilterstest/subpackageB/ArgsB.java  |   32 +
 .../subpackageBwithSuffix/ArgsBWithSuffix.java  |   32 +
 .../common/base/CachingSupplierTest.java        |   67 +
 .../com/twitter/common/base/ClosuresTest.java   |  176 ++
 .../com/twitter/common/base/CommandsTest.java   |   87 +
 .../com/twitter/common/base/EitherTest.java     |  253 +++
 .../common/base/ExceptionTransporterTest.java   |   60 +
 .../common/base/ExceptionalFunctionsTest.java   |  169 ++
 .../common/base/MorePreconditionsTest.java      |  103 +
 .../twitter/common/base/MoreSuppliersTest.java  |  110 +
 .../twitter/common/collections/BitsTest.java    |  302 +++
 .../common/collections/BoundedQueueTest.java    |   60 +
 .../common/collections/Iterables2Test.java      |  110 +
 .../twitter/common/collections/PairTest.java    |   53 +
 .../com/twitter/common/inject/BindingsTest.java |  128 ++
 .../common/inject/DefaultProviderTest.java      |   68 +
 .../twitter/common/io/Base64ZlibCodecTest.java  |   81 +
 .../twitter/common/io/CodecTestUtilities.java   |   37 +
 .../common/io/CompatibilityCodecTest.java       |  104 +
 .../com/twitter/common/io/FileUtilsTest.java    |  109 +
 .../com/twitter/common/io/JsonCodecTest.java    |  108 +
 .../com/twitter/common/io/ThriftCodecTest.java  |   57 +
 .../twitter/common/logging/BufferedLogTest.java |  144 ++
 .../common/logging/LogFormatterTest.java        |   59 +
 .../com/twitter/common/logging/LogUtilTest.java |   64 +
 .../common/logging/RootLogConfigTest.java       |  320 +++
 .../logging/julbridge/JULBridgeHandlerTest.java |  100 +
 .../julbridge/JULBridgeLevelConverterTest.java  |   83 +
 .../julbridge/JULBridgeLogManagerTest.java      |   78 +
 .../common/net/InetSocketAddressHelperTest.java |  114 ++
 .../com/twitter/common/net/UrlHelperTest.java   |  123 ++
 .../com/twitter/common/net/UrlResolverTest.java |  174 ++
 .../twitter/common/net/UrlResolverUtilTest.java |  165 ++
 .../common/net/UrlTokenizerUtilTest.java        |   97 +
 .../common/net/http/RequestLoggerTest.java      |   90 +
 .../filters/HttpStatsFilterIntegrationTest.java |  153 ++
 .../net/http/filters/HttpStatsFilterTest.java   |  214 ++
 .../net/http/handlers/AssetHandlerTest.java     |  383 ++++
 .../handlers/HttpServletRequestParamsTest.java  |   69 +
 .../net/http/handlers/LogPrinterTest.java       |   74 +
 .../net/http/handlers/StatSupplierTestBase.java |   39 +
 .../http/handlers/TimeSeriesDataSourceTest.java |  159 ++
 .../net/http/handlers/VarsHandlerTest.java      |   65 +
 .../net/http/handlers/VarsJsonHandlerTest.java  |   60 +
 .../LeastConnectedStrategyTest.java             |  289 +++
 .../net/loadbalancing/LoadBalancerImplTest.java |  144 ++
 .../net/loadbalancing/MarkDeadStrategyTest.java |  335 +++
 .../MarkDeadStrategyWithHostCheckTest.java      |  149 ++
 .../net/loadbalancing/RandomStrategyTest.java   |   99 +
 .../loadbalancing/RoundRobinStrategyTest.java   |  107 +
 .../net/loadbalancing/SubsetStrategyTest.java   |  101 +
 .../net/monitoring/TrafficMonitorTest.java      |  125 ++
 .../common/net/pool/ConnectionPoolTest.java     |  258 +++
 .../common/net/pool/DynamicHostSetUtilTest.java |   61 +
 .../common/net/pool/DynamicPoolTest.java        |  171 ++
 .../objectsize/ObjectSizeCalculatorTest.java    |  216 ++
 .../com/twitter/common/quantity/AmountTest.java |  120 ++
 .../common/stats/ApproximateHistogramTest.java  |  309 +++
 .../com/twitter/common/stats/ElapsedTest.java   |   70 +
 .../com/twitter/common/stats/EntropyTest.java   |   61 +
 .../common/stats/MergedHistogramTest.java       |   97 +
 .../twitter/common/stats/MovingAverageTest.java |   86 +
 .../common/stats/MovingWindowDeltaTest.java     |  103 +
 .../common/stats/NumericStatExporterTest.java   |  147 ++
 .../twitter/common/stats/PercentileTest.java    |  207 ++
 .../twitter/common/stats/PipelineStatsTest.java |  150 ++
 .../common/stats/PrintableHistogramTest.java    |   30 +
 .../java/com/twitter/common/stats/RateTest.java |  242 +++
 .../common/stats/ReservoirSamplerTest.java      |   63 +
 .../twitter/common/stats/StatisticsTest.java    |  119 ++
 .../com/twitter/common/stats/StatsTest.java     |  113 ++
 .../stats/TimeSeriesRepositoryImplTest.java     |  132 ++
 .../common/stats/WindowedHistogramTest.java     |  237 +++
 .../twitter/common/stats/WindowedStatsTest.java |  189 ++
 .../com/twitter/common/stats/WindowedTest.java  |  113 ++
 .../common/testing/TearDownRegistryTest.java    |   49 +
 .../testing/easymock/EasyMockTestTest.java      |   63 +
 .../testing/easymock/IterableEqualsTest.java    |   53 +
 .../common/testing/junit/rules/RetryTest.java   |  233 +++
 .../thrift/ThriftConnectionFactoryTest.java     |  143 ++
 .../common/thrift/ThriftFactoryTest.java        |  245 +++
 .../com/twitter/common/thrift/ThriftTest.java   |  934 +++++++++
 .../thrift/callers/AbstractCallerTest.java      |   59 +
 .../thrift/callers/DeadlineCallerTest.java      |  122 ++
 .../thrift/callers/RetryingCallerTest.java      |  153 ++
 .../twitter/common/util/BackoffDeciderTest.java |  327 +++
 .../twitter/common/util/BackoffHelperTest.java  |  176 ++
 .../twitter/common/util/LowResClockTest.java    |  172 ++
 .../twitter/common/util/QueueDrainerTest.java   |   62 +
 .../util/RateLimitedCommandExecutorTest.java    |  118 ++
 .../com/twitter/common/util/SamplerTest.java    |   70 +
 .../twitter/common/util/StateMachineTest.java   |  420 ++++
 .../common/util/TruncatedBinaryBackoffTest.java |   93 +
 .../util/caching/CachingMethodProxyTest.java    |  260 +++
 .../common/util/caching/LRUCacheTest.java       |   84 +
 .../ExceptionHandlingExecutorServiceTest.java   |  111 +
 ...ionHandlingScheduledExecutorServiceTest.java |  124 ++
 .../templating/StringTemplateHelperTest.java    |   80 +
 .../common/util/testing/FakeClockTest.java      |   73 +
 .../common/zookeeper/CandidateImplTest.java     |  231 +++
 .../common/zookeeper/CompoundServerSetTest.java |  220 ++
 .../common/zookeeper/DistributedLockTest.java   |  177 ++
 .../com/twitter/common/zookeeper/GroupTest.java |  334 +++
 .../common/zookeeper/PartitionerTest.java       |  164 ++
 .../common/zookeeper/ServerSetImplTest.java     |  441 ++++
 .../common/zookeeper/ServerSetsTest.java        |   35 +
 .../common/zookeeper/SingletonServiceTest.java  |  352 ++++
 .../common/zookeeper/StaticServerSetTest.java   |   72 +
 .../common/zookeeper/ZooKeeperClientTest.java   |  254 +++
 .../common/zookeeper/ZooKeeperMapTest.java      |  421 ++++
 .../common/zookeeper/ZooKeeperNodeTest.java     |  284 +++
 .../common/zookeeper/ZooKeeperUtilsTest.java    |  141 ++
 .../zookeeper/guice/ServerSetModuleTest.java    |   63 +
 .../twitter/common/util/templating/template.st  |    7 +
 settings.gradle                                 |    2 +-
 467 files changed, 60481 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 8684097..6c37128 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,20 +4,22 @@
 *.iws
 *.pyc
 *~
-/.coverage
 .gradle
+/.coverage
 /.idea/*
 /.pants.*
 /.vagrant/*
 /api/dist/*
 /atlassian-ide-plugin.xml
-/build/*
 /build-support/*.pex
 /build-support/*.venv
 /build-support/python/*.venv
 /build-support/virtualenv-*
+/build/*
 /buildSrc/build/*
 /buildSrc/dist/*
+/commons-args/dist/*
+/commons/dist/*
 /dist/*
 /gradle-app.setting
 /out/*

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 57fec4e..5052708 100644
--- a/build.gradle
+++ b/build.gradle
@@ -39,6 +39,7 @@ allprojects {
 
   repositories {
     mavenCentral()
+    // TODO(zmanji): Remove dependency on Twitter maven.
     maven {
       url 'https://maven.twttr.com/'
     }
@@ -88,6 +89,15 @@ For more details, please see https://issues.apache.org/jira/browse/AURORA-1169
   ext.guavaRev = '16.0'
   ext.slf4jRev = '1.7.12'
   ext.thriftRev = '0.9.1'
+  ext.guiceRev = '3.0'
+  ext.servletRev = '2.5'
+  ext.stringTemplateRev = '3.2.1'
+  ext.zookeeperRev = '3.3.4'
+  ext.jerseyRev = '1.18.1'
+  // This can be removed onced the mockito dep is gone
+  ext.objenesisRev = '1.3'
+  ext.jsrRev = '2.0.1'
+  ext.commonsLangRev = '2.6'
 
   configurations {
     compile {
@@ -106,11 +116,65 @@ For more details, please see https://issues.apache.org/jira/browse/AURORA-1169
         force "org.hamcrest:hamcrest-core:1.3"
         force "org.apache.thrift:libthrift:${thriftRev}"
         force "org.slf4j:slf4j-jdk14:${slf4jRev}"
+        force "org.objenesis:objenesis:${objenesisRev}"
       }
     }
   }
 }
 
+/* This gradle project contains the annotation procesor from
+ * com.twitter.common.args and related dependencies. It needs to be outside of
+ * the commons project because gradle needs to compile the annotation processor
+ * first.
+ */
+project(':commons-args') {
+  dependencies {
+    compile "com.google.guava:guava:${guavaRev}"
+    compile "com.google.code.findbugs:jsr305:${jsrRev}"
+    compile "commons-lang:commons-lang:${commonsLangRev}"
+  }
+}
+
+project(':commons') {
+  apply plugin: org.apache.aurora.build.ThriftPlugin
+  thrift {
+    version = thriftRev
+  }
+
+  dependencies {
+    compile project(':commons-args')
+
+    compile "com.google.code.findbugs:jsr305:${jsrRev}"
+    compile "com.google.code.gson:gson:${gsonRev}"
+    compile "com.google.guava:guava:${guavaRev}"
+    compile "com.google.inject.extensions:guice-multibindings:${guiceRev}"
+    compile "com.google.inject:guice:${guiceRev}"
+    compile "com.sun.jersey.contribs:jersey-guice:${jerseyRev}"
+    compile "com.sun.jersey:jersey-core:${jerseyRev}"
+    compile "com.sun.jersey:jersey-json:${jerseyRev}"
+    compile "com.sun.jersey:jersey-server:${jerseyRev}"
+    compile "com.sun.jersey:jersey-servlet:${jerseyRev}"
+    compile "commons-io:commons-io:2.1"
+    compile "commons-lang:commons-lang:${commonsLangRev}"
+    compile "javax.servlet:servlet-api:${servletRev}"
+    compile "joda-time:joda-time:2.3"
+    compile "log4j:log4j:${log4jRev}"
+    compile "org.antlr:stringtemplate:${stringTemplateRev}"
+    compile "org.apache.zookeeper:zookeeper:${zookeeperRev}"
+    compile "org.easymock:easymock:3.2"
+    compile "org.mockito:mockito-core:1.9.0"
+    compile "org.slf4j:slf4j-jdk14:${slf4jRev}"
+
+    // TODO(zmanji): Remove dependency on this old jetty package
+    compile 'org.mortbay.jetty:jetty:6.1.25'
+    // TODO(zmanji): Remove dependency on this very old google package
+    compile 'com.google.testing:test-libraries-for-java:1.1.1'
+
+    testCompile "junit:junit:${junitRev}"
+    testCompile "com.sun.jersey:jersey-client:${jerseyRev}"
+  }
+}
+
 project(':api') {
   apply plugin: org.apache.aurora.build.ThriftPlugin
   apply plugin: org.apache.aurora.build.ThriftEntitiesPlugin
@@ -255,8 +319,6 @@ sourceSets {
 }
 
 dependencies {
-  def guiceRev = '3.0'
-  def jerseyRev = '1.18.1'
   def shiroRev = '1.2.3'
 
   def gsonDep = "com.google.code.gson:gson:${gsonRev}"
@@ -266,6 +328,7 @@ dependencies {
   def jettyDep = '7.6.15.v20140411'
 
   compile project(':api')
+  compile project(':commons')
 
   compile 'aopalliance:aopalliance:1.0'
   compile 'com.google.code.findbugs:jsr305:2.0.1'
@@ -279,16 +342,16 @@ dependencies {
   compile "com.sun.jersey:jersey-servlet:${jerseyRev}"
   compile "com.sun.jersey.contribs:jersey-guice:${jerseyRev}"
   compile 'javax.inject:javax.inject:1'
-  compile 'javax.servlet:servlet-api:2.5'
+  compile "javax.servlet:servlet-api:${servletRev}"
   compile "log4j:log4j:${log4jRev}"
-  compile 'org.antlr:stringtemplate:3.2.1'
+  compile "org.antlr:stringtemplate:${stringTemplateRev}"
   compile 'org.apache.mesos:mesos:0.23.0'
   compile("org.apache.shiro:shiro-guice:${shiroRev}") {
     // TODO(ksweeney): Remove this exclusion when https://issues.apache.org/jira/browse/SHIRO-496 is resolved.
     exclude group: 'com.google.guava'
   }
   compile "org.apache.shiro:shiro-web:${shiroRev}"
-  compile 'org.apache.zookeeper:zookeeper:3.3.4'
+  compile "org.apache.zookeeper:zookeeper:${zookeeperRev}"
   compile "org.eclipse.jetty:jetty-rewrite:${jettyDep}"
   compile "org.eclipse.jetty:jetty-server:${jettyDep}"
   compile "org.eclipse.jetty:jetty-servlet:${jettyDep}"
@@ -297,40 +360,8 @@ dependencies {
   compile 'org.mybatis:mybatis-guice:3.6'
   compile 'org.quartz-scheduler:quartz:2.2.1'
   compile "org.slf4j:slf4j-jdk14:${slf4jRev}"
-  compile 'com.twitter.common.logging:log4j:0.0.7'
-  compile 'com.twitter.common.zookeeper.guice:client-flagged:0.0.5'
-  compile 'com.twitter.common.zookeeper.guice:client:0.0.5'
-  compile 'com.twitter.common.zookeeper:candidate:0.0.64'
-  compile 'com.twitter.common.zookeeper:client:0.0.56'
-  compile 'com.twitter.common.zookeeper:group:0.0.69'
-  compile 'com.twitter.common.zookeeper:server-set:1.0.74'
-  compile 'com.twitter.common.zookeeper:singleton-service:0.0.85'
-  compile 'com.twitter.common:application-module-applauncher:0.0.51'
-  compile 'com.twitter.common:application-module-lifecycle:0.0.48'
-  compile 'com.twitter.common:application-module-stats:0.0.44'
-  compile 'com.twitter.common:application:0.0.73'
-  compile 'com.twitter.common:args:0.2.9'
-  compile 'com.twitter.common:base:0.0.87'
-  compile 'com.twitter.common:collections:0.0.74'
-  compile 'com.twitter.common:dynamic-host-set:0.0.44'
-  compile 'com.twitter.common:inject-timed:0.0.11'
-  compile 'com.twitter.common:inject:0.0.35'
-  compile 'com.twitter.common:jdk-logging:0.0.44'
-  compile 'com.twitter.common:logging:0.0.61'
-  compile 'com.twitter.common:net-http-handlers-time-series:0.0.51'
-  compile 'com.twitter.common:net-util:0.0.80'
-  compile 'com.twitter.common:quantity:0.0.71'
-  compile 'com.twitter.common:stats:0.0.91'
-  compile 'com.twitter.common:thrift:0.0.68'
-  compile 'com.twitter.common:util-executor-service-shutdown:0.0.49'
-  compile 'com.twitter.common:util-templating:0.0.25'
-  compile 'com.twitter.common:util-testing:0.0.10'
-  compile 'com.twitter.common:util:0.0.94'
 
   testCompile "com.sun.jersey:jersey-client:${jerseyRev}"
-  testCompile 'com.twitter.common:testing-easymock:0.0.4'
-  testCompile 'com.twitter.common:util-system-mocks:0.0.72'
-  testCompile 'com.twitter.common:zookeeper-testing:0.0.45'
   testCompile "junit:junit:${junitRev}"
 
   configurations.compile {

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/Arg.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/Arg.java b/commons-args/src/main/java/com/twitter/common/args/Arg.java
new file mode 100644
index 0000000..2f18029
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/Arg.java
@@ -0,0 +1,129 @@
+// =================================================================================================
+// Copyright 2011 Twitter, Inc.
+// -------------------------------------------------------------------------------------------------
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this work except in compliance with the License.
+// You may obtain a copy of the License in the LICENSE file, or at:
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =================================================================================================
+
+package com.twitter.common.args;
+
+import javax.annotation.Nullable;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
+
+/**
+ * Wrapper class for the value of an argument.  For proper behavior, an {@code Arg} should always
+ * be annotated with {@link CmdLine}, which will define the command line interface to the argument.
+ */
+public class Arg<T> {
+
+  @Nullable private final T defaultValue;
+  @Nullable private T value;
+  private boolean hasDefault = true;
+  private boolean valueApplied = false;
+  private boolean valueObserved = false;
+
+  /**
+   * Creates an arg that has no default value, meaning that its value can only ever be retrieved
+   * if it has been externally set.
+   */
+  public Arg() {
+    this(null);
+    hasDefault = false;
+  }
+
+  /**
+   * Creates an arg that has a default value, and may optionally be set.
+   *
+   * @param defaultValue The default value for the arg.
+   */
+  public Arg(@Nullable T defaultValue) {
+    this.defaultValue = defaultValue;
+    value = defaultValue;
+  }
+
+  synchronized void set(@Nullable T appliedValue) {
+    Preconditions.checkState(!valueApplied, "A value cannot be applied twice to an argument.");
+    Preconditions.checkState(!valueObserved, "A value cannot be changed after it was read.");
+    valueApplied = true;
+    value = appliedValue;
+  }
+
+  @VisibleForTesting
+  synchronized void reset() {
+    valueApplied = false;
+    valueObserved = false;
+    value = hasDefault ? defaultValue : null;
+  }
+
+  public boolean hasDefault() {
+    return hasDefault;
+  }
+
+  /**
+   * Gets the value of the argument.  If a value has not yet been applied to the argument, or the
+   * argument did not provide a default value, {@link IllegalStateException} will be thrown.
+   *
+   * @return The argument value.
+   */
+  @Nullable
+  public synchronized T get() {
+    // TODO(William Farner): This has a tendency to break bad-arg reporting by ArgScanner.  Fix.
+    Preconditions.checkState(valueApplied || hasDefault,
+        "A value may only be retrieved from a variable that has a default or has been set.");
+    valueObserved = true;
+    return uncheckedGet();
+  }
+
+  /**
+   * Checks whether a value has been applied to the argument (i.e., apart from the default).
+   *
+   * @return {@code true} if a value from the command line has been applied to this arg,
+   *         {@code false} otherwise.
+   */
+  public synchronized boolean hasAppliedValue() {
+    return valueApplied;
+  }
+
+  /**
+   * Gets the value of the argument, without checking whether a default was available or if a
+   * value was applied.
+   *
+   * @return The argument value.
+   */
+  @Nullable
+  synchronized T uncheckedGet() {
+    return value;
+  }
+
+  /**
+   * Convenience factory method to create an arg that has no default value.
+   *
+   * @param <T> Type of arg value.
+   * @return A new arg.
+   */
+  public static <T> Arg<T> create() {
+    return new Arg<T>();
+  }
+
+  /**
+   * Convenience factory method to create an arg with a default value.
+   *
+   * @param value Default argument value.
+   * @param <T> Type of arg value.
+   * @return A new arg.
+   */
+  public static <T> Arg<T> create(@Nullable T value) {
+    return new Arg<T>(value);
+  }
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/ArgParser.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/ArgParser.java b/commons-args/src/main/java/com/twitter/common/args/ArgParser.java
new file mode 100644
index 0000000..9900f6f
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/ArgParser.java
@@ -0,0 +1,15 @@
+package com.twitter.common.args;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+/**
+ * Annotation to register a command line argument parser globally.
+ */
+@Target(TYPE)
+@Retention(SOURCE)
+public @interface ArgParser {
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/CmdLine.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/CmdLine.java b/commons-args/src/main/java/com/twitter/common/args/CmdLine.java
new file mode 100644
index 0000000..13453d9
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/CmdLine.java
@@ -0,0 +1,57 @@
+// =================================================================================================
+// Copyright 2011 Twitter, Inc.
+// -------------------------------------------------------------------------------------------------
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this work except in compliance with the License.
+// You may obtain a copy of the License in the LICENSE file, or at:
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =================================================================================================
+
+package com.twitter.common.args;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Annotation for a command line argument.
+ */
+@Target(FIELD)
+@Retention(RUNTIME)
+public @interface CmdLine {
+  /**
+   * The short name of the argument, as supplied on the command line.  The argument can also be
+   * accessed by the canonical name, which is {@code com.foo.bar.MyArgClass.arg_name}.
+   * If the global scope contains more than one argument with the same name, all colliding arguments
+   * must be disambiguated with the canonical form.
+   *
+   * The argument name must match the format {@code [\w\-\.]+}.
+   */
+  String name();
+
+  /**
+   * The help string to display on the command line in a usage message.
+   */
+  String help();
+
+  /**
+   * The parser class to use for parsing this argument.  The parser must return the same type as
+   * the field being annotated.
+   */
+  Class<? extends Parser<?>> parser() default NoParser.class;
+
+  /**
+   * The flag to indicate whether an argument file is accepted for this argument.
+   *
+   */
+  boolean argFile() default false;
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/NoParser.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/NoParser.java b/commons-args/src/main/java/com/twitter/common/args/NoParser.java
new file mode 100644
index 0000000..f58beaf
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/NoParser.java
@@ -0,0 +1,26 @@
+// =================================================================================================
+// Copyright 2014 Twitter, Inc.
+// -------------------------------------------------------------------------------------------------
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this work except in compliance with the License.
+// You may obtain a copy of the License in the LICENSE file, or at:
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =================================================================================================
+
+package com.twitter.common.args;
+
+/**
+ * A sentinel parser type for internal use indicating no parser has been selected yet.
+ */
+abstract class NoParser implements Parser<Object> {
+  private NoParser() {
+    throw new UnsupportedOperationException("Not intended for construction.");
+  }
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/Parser.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/Parser.java b/commons-args/src/main/java/com/twitter/common/args/Parser.java
new file mode 100644
index 0000000..947ef0c
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/Parser.java
@@ -0,0 +1,38 @@
+// =================================================================================================
+// Copyright 2011 Twitter, Inc.
+// -------------------------------------------------------------------------------------------------
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this work except in compliance with the License.
+// You may obtain a copy of the License in the LICENSE file, or at:
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =================================================================================================
+
+package com.twitter.common.args;
+
+import java.lang.reflect.Type;
+
+/**
+ * An interface to a command line argument parser.
+ *
+ * @param <T> The base class this parser can parse all subtypes of.
+ */
+public interface Parser<T> {
+  /**
+   * Parses strings as arguments of a given subtype of {@code T}.
+   *
+   * @param parserOracle The registered parserOracle for delegation.
+   * @param type The target type of the parsed argument.
+   * @param raw The raw value of the argument.
+   * @return A value of the given type parsed from the raw value.
+   * @throws IllegalArgumentException if the raw value could not be parsed into a value of the
+   *     given type.
+   */
+  T parse(ParserOracle parserOracle, Type type, String raw) throws IllegalArgumentException;
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/ParserOracle.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/ParserOracle.java b/commons-args/src/main/java/com/twitter/common/args/ParserOracle.java
new file mode 100644
index 0000000..f9fccd4
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/ParserOracle.java
@@ -0,0 +1,34 @@
+// =================================================================================================
+// Copyright 2011 Twitter, Inc.
+// -------------------------------------------------------------------------------------------------
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this work except in compliance with the License.
+// You may obtain a copy of the License in the LICENSE file, or at:
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =================================================================================================
+
+package com.twitter.common.args;
+
+import com.google.common.reflect.TypeToken;
+
+/**
+ * A registry of Parsers for different supported argument types.
+ */
+public interface ParserOracle {
+
+  /**
+   * Gets the parser associated with a class.
+   *
+   * @param type Type to get the parser for.
+   * @return The parser for {@code cls}.
+   * @throws IllegalArgumentException If no parser was found for {@code cls}.
+   */
+  <T> Parser<T> get(TypeToken<T> type) throws IllegalArgumentException;
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/Positional.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/Positional.java b/commons-args/src/main/java/com/twitter/common/args/Positional.java
new file mode 100644
index 0000000..92cf660
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/Positional.java
@@ -0,0 +1,43 @@
+// =================================================================================================
+// Copyright 2012 Twitter, Inc.
+// -------------------------------------------------------------------------------------------------
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this work except in compliance with the License.
+// You may obtain a copy of the License in the LICENSE file, or at:
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =================================================================================================
+
+package com.twitter.common.args;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Annotation to mark an {@link Arg} for gathering the positional command line arguments.
+ */
+@Retention(RUNTIME)
+@Target(FIELD)
+public @interface Positional {
+  /**
+   * The help string to display on the command line in a usage message.
+   */
+  String help();
+
+  /**
+   * The parser class to use for parsing the positional arguments.  The parser must return the same
+   * type as the field being annotated.
+   */
+  Class<? extends Parser<?>> parser() default NoParser.class;
+
+  // TODO: https://github.com/twitter/commons/issues/353, Consider to add argFile for positional.
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/Verifier.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/Verifier.java b/commons-args/src/main/java/com/twitter/common/args/Verifier.java
new file mode 100644
index 0000000..763cd69
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/Verifier.java
@@ -0,0 +1,40 @@
+// =================================================================================================
+// Copyright 2011 Twitter, Inc.
+// -------------------------------------------------------------------------------------------------
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this work except in compliance with the License.
+// You may obtain a copy of the License in the LICENSE file, or at:
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// =================================================================================================
+
+package com.twitter.common.args;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * Typedef for a constraint verifier.
+ */
+public interface Verifier<T> {
+  /**
+   * Verifies the value against the annotation.
+   *
+   * @param value Value that is being applied.
+   * @throws IllegalArgumentException if the value is invalid.
+   */
+  void verify(T value, Annotation annotation) throws IllegalArgumentException;
+
+  /**
+   * Returns a representation of the constraint this verifier checks.
+   *
+   * @param argType The type of the {@link com.twitter.common.args.Arg} this annotation applies to.
+   * @return A representation of the constraint this verifier checks.
+   */
+  String toString(Class<? extends T> argType, Annotation annotation);
+}

http://git-wip-us.apache.org/repos/asf/aurora/blob/86a547b9/commons-args/src/main/java/com/twitter/common/args/VerifierFor.java
----------------------------------------------------------------------
diff --git a/commons-args/src/main/java/com/twitter/common/args/VerifierFor.java b/commons-args/src/main/java/com/twitter/common/args/VerifierFor.java
new file mode 100644
index 0000000..39ce525
--- /dev/null
+++ b/commons-args/src/main/java/com/twitter/common/args/VerifierFor.java
@@ -0,0 +1,21 @@
+package com.twitter.common.args;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+/**
+ * Annotation to register a command line argument verifier.
+ */
+@Target(TYPE)
+@Retention(SOURCE)
+public @interface VerifierFor {
+  /**
+   * Returns the annotation that marks a field for verification by the annotated
+   * {@link com.twitter.common.args.Verifier} class.
+   */
+  Class<? extends Annotation> value();
+}


Mime
View raw message