Uses of Class
com.twitter.common.quantity.Amount

Packages that use Amount
com.twitter.common.application.modules   
com.twitter.common.args.parsers   
com.twitter.common.base   
com.twitter.common.logging   
com.twitter.common.metrics   
com.twitter.common.net.monitoring   
com.twitter.common.net.pool   
com.twitter.common.quantity   
com.twitter.common.stats   
com.twitter.common.thrift   
com.twitter.common.thrift.callers   
com.twitter.common.util   
com.twitter.common.util.concurrent   
com.twitter.common.util.testing   
com.twitter.common.zookeeper   
com.twitter.common.zookeeper.testing   
 

Uses of Amount in com.twitter.common.application.modules
 

Methods in com.twitter.common.application.modules that return Amount
static Amount<Long,Time> StatsModule.getSamplingInterval()
           
 

Uses of Amount in com.twitter.common.args.parsers
 

Methods in com.twitter.common.args.parsers that return Amount
static Amount<Long,Time> DurationParser.parse(String spec)
          Parses a duration of the form "1d23h59m59s" (as well as subvariants, i.e.
 

Uses of Amount in com.twitter.common.base
 

Constructors in com.twitter.common.base with parameters of type Amount
CachingSupplier(Supplier<T> wrapped, Amount<Long,Time> expiration)
          Creates a new caching supplier.
 

Uses of Amount in com.twitter.common.logging
 

Methods in com.twitter.common.logging with parameters of type Amount
 BufferedLog.Builder<T,R> BufferedLog.Builder.withFlushInterval(Amount<Integer,Time> flushInterval)
          Specifies the maximum amount of time that a log entry may wait in the buffer before an attempt is made to flush the buffer.
 

Uses of Amount in com.twitter.common.metrics
 

Methods in com.twitter.common.metrics with parameters of type Amount
 void MetricPoller.start(Amount<Long,Time> pollInterval)
          Initiates the poller.
 

Constructors in com.twitter.common.metrics with parameters of type Amount
Rate(String name, Supplier<T> valueAccessor, Amount<Long,Time> windowLength)
          Creates a rate using a supplier to access values.
 

Uses of Amount in com.twitter.common.net.monitoring
 

Constructors in com.twitter.common.net.monitoring with parameters of type Amount
TrafficMonitor(String serviceName, Amount<Long,Time> gcInterval)
          Creates a new traffic monitor with a custom cleanup interval.
 

Uses of Amount in com.twitter.common.net.pool
 

Fields in com.twitter.common.net.pool declared as Amount
static Amount<Long,Time> ObjectPool.NO_TIMEOUT
          A convenience constant representing a no timeout.
 

Methods in com.twitter.common.net.pool with parameters of type Amount
 S ConnectionFactory.create(Amount<Long,Time> timeout)
          Attempts to create a new connection within the given timeout and subject to this factory's connection population size policy.
 S ConnectionPool.get(Amount<Long,Time> timeout)
           
 T ObjectPool.get(Amount<Long,Time> timeout)
          Gets a resource; timing out if there are none available and it takes longer than specified to create a new one or wait for one to be released.
 Connection<T,E> DynamicPool.get(Amount<Long,Time> timeout)
           
 Connection<T,E> MetaPool.get(Amount<Long,Time> timeout)
           
 

Constructors in com.twitter.common.net.pool with parameters of type Amount
DynamicPool(DynamicHostSet<H> hostSet, Function<E,ObjectPool<Connection<T,E>>> endpointPoolFactory, LoadBalancer<E> loadBalancer, Closure<Collection<E>> onBackendsChosen, Amount<Long,Time> restoreInterval, Function<H,E> endpointExtractor, Predicate<H> livenessChecker)
          Creates a new ServerSetConnectionPool and blocks on an initial read and constructions of pools for the given serverSet.
MetaPool(ImmutableMap<E,ObjectPool<Connection<T,E>>> backends, LoadBalancer<E> loadBalancer, Closure<Collection<E>> onBackendsChosen, Amount<Long,Time> restoreInterval)
          Creates a connection pool that balances connections across multiple backend pools.
MetaPool(LoadBalancer<E> loadBalancer, Closure<Collection<E>> onBackendsChosen, Amount<Long,Time> restoreInterval)
          Creates a connection pool with no backends.
 

Uses of Amount in com.twitter.common.quantity
 

Methods in com.twitter.common.quantity that return Amount
static
<U extends Unit<U>>
Amount<Double,U>
Amount.of(double number, U unit)
          Creates an amount that uses a double value.
static
<U extends Unit<U>>
Amount<Float,U>
Amount.of(float number, U unit)
          Creates an amount that uses a float value.
static
<U extends Unit<U>>
Amount<Integer,U>
Amount.of(int number, U unit)
          Creates an amount that uses an int value.
static
<U extends Unit<U>>
Amount<Long,U>
Amount.of(long number, U unit)
          Creates an amount that uses a long value.
 

Methods in com.twitter.common.quantity with parameters of type Amount
 int Amount.compareTo(Amount<T,U> other)
           
 

Uses of Amount in com.twitter.common.stats
 

Constructors in com.twitter.common.stats with parameters of type Amount
NumericStatExporter(Closure<Map<String,? extends Number>> exportSink, ScheduledExecutorService executor, Amount<Long,Time> exportInterval)
          Creates a new numeric stat exporter that will export to the specified sink.
TimeSeriesRepositoryImpl(Amount<Long,Time> samplePeriod, Amount<Long,Time> retentionPeriod)
           
TimeSeriesRepositoryImpl(Amount<Long,Time> samplePeriod, Amount<Long,Time> retentionPeriod)
           
 

Uses of Amount in com.twitter.common.thrift
 

Methods in com.twitter.common.thrift that return Amount
 Amount<Long,Time> Config.getConnectTimeout()
          Returns the maximum time to wait for a connection to be established.
 Amount<Long,Time> Config.getRequestTimeout()
          Returns the maximum time to wait for any thrift call to complete.
 Amount<Integer,Time> ThriftServer.ServerSetup.getSocketTimeout()
           
 

Methods in com.twitter.common.thrift with parameters of type Amount
 void ThriftServer.awaitShutdown(Amount<Long,Time> timeout)
          Attempts to shut down this server, and waits for the shutdown operation to complete.
 Connection<org.apache.thrift.transport.TTransport,InetSocketAddress> ThriftConnectionFactory.create(Amount<Long,Time> timeout)
          FIXME: shouldn't this throw TimeoutException instead of returning null in the timeout cases as per the ConnectionFactory.create javadoc?
 T Config.AbstractBuilder.withConnectTimeout(Amount<Long,Time> timeout)
          Assigns the timeout for all connections established with the blocking client.
 ThriftFactory<T> ThriftFactory.withDeadConnectionRestoreInterval(Amount<Long,Time> connectionRestoreInterval)
          Specifies the interval at which dead endpoint connections should be checked and revived.
 T Config.AbstractBuilder.withRequestTimeout(Amount<Long,Time> timeout)
          Specifies that all calls be subject to a global timeout.
 ThriftFactory<T> ThriftFactory.withSocketTimeout(Amount<Long,Time> socketTimeout)
          Specifies the net read/write timeout to set via SO_TIMEOUT on the thrift blocking client or AsyncClient.setTimeout on the thrift async client.
 

Constructors in com.twitter.common.thrift with parameters of type Amount
ThriftConnectionFactory(InetSocketAddress endpoint, int maxConnections, ThriftConnectionFactory.TransportType transportType, Amount<Long,Time> socketTimeout)
          Creates a thrift connection factory.
ThriftConnectionFactory(InetSocketAddress endpoint, int maxConnections, ThriftConnectionFactory.TransportType transportType, Amount<Long,Time> socketTimeout, Closure<Connection<org.apache.thrift.transport.TTransport,InetSocketAddress>> postCreateCallback, boolean sslTransport)
           
ThriftConnectionFactory(String host, int port, int maxConnections, ThriftConnectionFactory.TransportType transportType, Amount<Long,Time> socketTimeout)
          Creates a thrift connection factory.
ThriftServer.ServerSetup(int port, org.apache.thrift.TProcessor processor, org.apache.thrift.protocol.TProtocolFactory protoFactory, int numThreads, Amount<Integer,Time> socketTimeout)
           
ThriftServer.ServerSetup(String name, int port, org.apache.thrift.TProcessor processor, org.apache.thrift.protocol.TProtocolFactory protoFactory, int numThreads, Amount<Integer,Time> socketTimeout)
           
ThriftServer.ServerSetup(String name, int port, org.apache.thrift.TProcessor processor, org.apache.thrift.protocol.TProtocolFactory protoFactory, int numThreads, Amount<Integer,Time> socketTimeout, TrafficMonitor<InetSocketAddress> monitor)
           
ThriftServer.ServerSetup(String name, int port, org.apache.thrift.TProcessor processor, org.apache.thrift.protocol.TProtocolFactory protoFactory, int numThreads, int queueSize, Amount<Integer,Time> socketTimeout)
           
ThriftServer.ServerSetup(String name, int port, org.apache.thrift.TProcessor processor, org.apache.thrift.protocol.TProtocolFactory protoFactory, int numThreads, int queueSize, Amount<Integer,Time> socketTimeout, TrafficMonitor<InetSocketAddress> monitor)
           
 

Uses of Amount in com.twitter.common.thrift.callers
 

Fields in com.twitter.common.thrift.callers declared as Amount
static Amount<Long,Time> RetryingCaller.NONBLOCKING_TIMEOUT
           
 

Methods in com.twitter.common.thrift.callers with parameters of type Amount
 Object Caller.call(Method method, Object[] args, org.apache.thrift.async.AsyncMethodCallback callback, Amount<Long,Time> connectTimeoutOverride)
          Invokes a method on an object, using the given arguments.
 Object StatTrackingCaller.call(Method method, Object[] args, org.apache.thrift.async.AsyncMethodCallback callback, Amount<Long,Time> connectTimeoutOverride)
           
 Object DebugCaller.call(Method method, Object[] args, org.apache.thrift.async.AsyncMethodCallback callback, Amount<Long,Time> connectTimeoutOverride)
           
 Object RetryingCaller.call(Method method, Object[] args, org.apache.thrift.async.AsyncMethodCallback callback, Amount<Long,Time> connectTimeoutOverride)
           
 Object DeadlineCaller.call(Method method, Object[] args, org.apache.thrift.async.AsyncMethodCallback callback, Amount<Long,Time> connectTimeoutOverride)
           
 Object ThriftCaller.call(Method method, Object[] args, org.apache.thrift.async.AsyncMethodCallback callback, Amount<Long,Time> connectTimeoutOverride)
           
 

Constructors in com.twitter.common.thrift.callers with parameters of type Amount
DeadlineCaller(Caller decoratedCaller, boolean async, ExecutorService executorService, Amount<Long,Time> timeout)
          Creates a new deadline caller.
ThriftCaller(ObjectPool<Connection<org.apache.thrift.transport.TTransport,InetSocketAddress>> connectionPool, RequestTracker<InetSocketAddress> requestTracker, Function<org.apache.thrift.transport.TTransport,T> clientFactory, Amount<Long,Time> timeout, boolean debug)
          Creates a new thrift caller.
 

Uses of Amount in com.twitter.common.util
 

Methods in com.twitter.common.util with parameters of type Amount
 void RateLimitedCommandExecutor.execute(String name, ExceptionalCommand task, Class exceptionClass, int numTries, Amount<Long,Time> retryDelay)
           
 void CommandExecutor.execute(String name, ExceptionalCommand task, Class exceptionClass, int maxTries, Amount<Long,Time> retryDelay)
          Enqueue a task to be executed with retry semantics defined.
 BackoffDecider.Builder BackoffDecider.Builder.withRecoveryPeriod(Amount<Long,Time> recoveryPeriod)
          Overrides the default recovery period behavior.
 BackoffDecider.Builder BackoffDecider.Builder.withRequestWindow(Amount<Long,Time> requestWindow)
          Sets the time window over which to analyze failures.
 

Constructors in com.twitter.common.util with parameters of type Amount
BackoffHelper(Amount<Long,Time> initialBackoff, Amount<Long,Time> maxBackoff)
          Creates a new BackoffHelper that uses truncated binary backoff starting at the given initialBackoff and maxing out at the given maxBackoff.
BackoffHelper(Amount<Long,Time> initialBackoff, Amount<Long,Time> maxBackoff)
          Creates a new BackoffHelper that uses truncated binary backoff starting at the given initialBackoff and maxing out at the given maxBackoff.
BackoffHelper(Amount<Long,Time> initialBackoff, Amount<Long,Time> maxBackoff, boolean stopAtMax)
          Creates a new BackoffHelper that uses truncated binary backoff starting at the given initialBackoff and maxing out at the given maxBackoff.
BackoffHelper(Amount<Long,Time> initialBackoff, Amount<Long,Time> maxBackoff, boolean stopAtMax)
          Creates a new BackoffHelper that uses truncated binary backoff starting at the given initialBackoff and maxing out at the given maxBackoff.
RateLimitedCommandExecutor(ScheduledExecutorService taskExecutor, Amount<Long,Time> intervalBetweenRequests, Runnable queueDrainer, BlockingQueue<RetryingRunnable> blockingQueue)
          Create a CommandExecutor that executes enquequed tasks in the task executor with specified interval between executions.
RetryingRunnable(String name, ExceptionalCommand<E> task, Class<E> exceptionClass, int numTries, Amount<Long,Time> retryDelay, CommandExecutor commandExecutor)
          Create a Task with name name that executes at most numTries in case of failure with an interval of retryDelay between attempts and sets tryNum to be the first (=1).
RetryingRunnable(String name, ExceptionalCommand<E> task, Class<E> exceptionClass, int numTries, Amount<Long,Time> retryDelay, CommandExecutor commandExecutor, int tryNum)
          Create a Task with name name that executes at most numTries in case of failure with an interval of retryDelay between attempts.
TruncatedBinaryBackoff(Amount<Long,Time> initialBackoff, Amount<Long,Time> maxBackoff)
          Same as main constructor, but this will always return true from shouldContinue().
TruncatedBinaryBackoff(Amount<Long,Time> initialBackoff, Amount<Long,Time> maxBackoff)
          Same as main constructor, but this will always return true from shouldContinue().
TruncatedBinaryBackoff(Amount<Long,Time> initialBackoff, Amount<Long,Time> maxBackoff, boolean stopAtMax)
          Creates a new TruncatedBinaryBackoff that will start by backing off for initialBackoff and then backoff of twice as long each time its called until reaching the maxBackoff at which point shouldContinue() will return false and any future backoffs will always wait for that amount of time.
TruncatedBinaryBackoff(Amount<Long,Time> initialBackoff, Amount<Long,Time> maxBackoff, boolean stopAtMax)
          Creates a new TruncatedBinaryBackoff that will start by backing off for initialBackoff and then backoff of twice as long each time its called until reaching the maxBackoff at which point shouldContinue() will return false and any future backoffs will always wait for that amount of time.
 

Uses of Amount in com.twitter.common.util.concurrent
 

Constructors in com.twitter.common.util.concurrent with parameters of type Amount
ExecutorServiceShutdown(ExecutorService executor, Amount<Long,Time> gracePeriod)
          Creates a new ExecutorServiceShutdown command that will try to gracefully shut down the given executor when executed.
 

Uses of Amount in com.twitter.common.util.testing
 

Methods in com.twitter.common.util.testing with parameters of type Amount
 void FakeClock.advance(Amount<Long,Time> period)
          Advances the current time by millis milliseconds.
 

Uses of Amount in com.twitter.common.zookeeper
 

Fields in com.twitter.common.zookeeper declared as Amount
static Amount<Integer,Time> ZooKeeperUtils.DEFAULT_ZK_SESSION_TIMEOUT
          An appropriate default session timeout for Twitter ZooKeeper clusters.
 

Methods in com.twitter.common.zookeeper with parameters of type Amount
 org.apache.zookeeper.ZooKeeper ZooKeeperClient.get(Amount<Long,Time> connectionTimeout)
          Returns the current active ZK connection or establishes a new one if none has yet been established or a previous connection was disconnected or had its session time out.
 

Constructors in com.twitter.common.zookeeper with parameters of type Amount
ZooKeeperClient(Amount<Integer,Time> sessionTimeout, InetSocketAddress zooKeeperServer, InetSocketAddress... zooKeeperServers)
          Creates an unconnected client that will lazily attempt to connect on the first call to ZooKeeperClient.get().
ZooKeeperClient(Amount<Integer,Time> sessionTimeout, Iterable<InetSocketAddress> zooKeeperServers)
          Creates an unconnected client that will lazily attempt to connect on the first call to ZooKeeperClient.get().
ZooKeeperClient(Amount<Integer,Time> sessionTimeout, ZooKeeperClient.Credentials credentials, InetSocketAddress zooKeeperServer, InetSocketAddress... zooKeeperServers)
          Creates an unconnected client that will lazily attempt to connect on the first call to ZooKeeperClient.get().
ZooKeeperClient(Amount<Integer,Time> sessionTimeout, ZooKeeperClient.Credentials credentials, Iterable<InetSocketAddress> zooKeeperServers)
          Creates an unconnected client that will lazily attempt to connect on the first call to ZooKeeperClient.get().
 

Uses of Amount in com.twitter.common.zookeeper.testing
 

Fields in com.twitter.common.zookeeper.testing declared as Amount
static Amount<Integer,Time> ZooKeeperTestServer.DEFAULT_SESSION_TIMEOUT
          The default session timeout for clients created by servers constructed with ZooKeeperTestServer.ZooKeeperTestServer(int, ShutdownRegistry).
 

Methods in com.twitter.common.zookeeper.testing with parameters of type Amount
 ZooKeeperClient ZooKeeperTestServer.createClient(Amount<Integer,Time> sessionTimeout)
          Returns a new unauthenticated zookeeper client connected to the in-process zookeeper server with a custom sessionTimeout.
 ZooKeeperClient ZooKeeperTestServer.createClient(Amount<Integer,Time> sessionTimeout, ZooKeeperClient.Credentials credentials)
          Returns a new authenticated zookeeper client connected to the in-process zookeeper server with a custom sessionTimeout.
protected  ZooKeeperClient BaseZooKeeperTest.createZkClient(Amount<Integer,Time> sessionTimeout)
          Returns a new unauthenticated zookeeper client connected to the in-process zookeeper server with a custom sessionTimeout.
protected  ZooKeeperClient BaseZooKeeperTest.createZkClient(Amount<Integer,Time> sessionTimeout, ZooKeeperClient.Credentials credentials)
          Returns a new authenticated zookeeper client connected to the in-process zookeeper server with a custom sessionTimeout.
 

Constructors in com.twitter.common.zookeeper.testing with parameters of type Amount
BaseZooKeeperTest(Amount<Integer,Time> defaultSessionTimeout)
          Creates a test case where the test server uses the given defaultSessionTimeout for clients created without an explicit session timeout.
ZooKeeperTestServer(int port, ShutdownRegistry shutdownRegistry, Amount<Integer,Time> defaultSessionTimeout)