Top Description Fields Constructors Methods
org.terracotta.statistics.extended

public Class CompoundOperationImpl<T extends java.lang.Enum<T>>

extends Object
implements CompoundOperation<T extends Enum<T>>
Class Inheritance
All Implemented Interfaces
org.terracotta.statistics.extended.CompoundOperation, org.terracotta.statistics.extended.SamplingSupport
Type Parameters
<T>
the generic type
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, org.terracotta.statistics.OperationStatistic, java.util.Arrays, .EnumMap, .EnumSet, .List, .Map, .Set, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, .ScheduledExecutorService, .TimeUnit

The Class CompoundOperationImpl.
Author
cdennis

Field Summary

Modifier and TypeField and Description
private volatile boolean
private volatile long
private volatile TimeUnit
private final ConcurrentMap<Set<T>, ResultImpl<T>>
private final ScheduledExecutorService
private volatile long
private volatile int
private volatile TimeUnit
private final Map<T, ResultImpl<T>>
private final ConcurrentMap<List<Set<T>>, ExpiringSampledStatistic<Double>>
private final OperationStatistic<T>
private final Class<T>

Constructor Summary

AccessConstructor and Description
public
CompoundOperationImpl(OperationStatistic<T>
the source
source
,
Class<T>
the type
type
,
long
the average period
averagePeriod
,
TimeUnit
the average unit
averageTimeUnit
,
ScheduledExecutorService
the executor
executor
,
int
the history size
historySize
,
long
the history period
historyPeriod
,
TimeUnit
the history unit
historyTimeUnit
)

Instantiates a new compound operation impl.

Method Summary

Modifier and TypeMethod and Description
public CountOperation<T>
public Result
public Result
public boolean

Returns:

true, if successful
expire
(long
the expiry time
expiryTime
)

Implements org.terracotta.statistics.extended.SamplingSupport.expire.

Expire.
public int
public long
public long
public boolean
public SampledStatistic<Double>
ratioOf(EnumSet<T>
the numerator
numerator
,
EnumSet<T>
the denomiator
denominator
)

Implements org.terracotta.statistics.extended.CompoundOperation.ratioOf.

Ratio of.
public void
setAlwaysOn(boolean
the new always on
enable
)

Implements org.terracotta.statistics.extended.CompoundOperation.setAlwaysOn.

Sets the always on.
public void
setHistory(int
the samples
samples
,
long
the time
time
,
TimeUnit
the unit
unit
)

Implements org.terracotta.statistics.extended.CompoundOperation.setHistory.

Sets the history.
public void
setWindow(long
the time
time
,
TimeUnit
the unit
unit
)

Implements org.terracotta.statistics.extended.CompoundOperation.setWindow.

Sets the window.
public Class<T>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alwaysOnback to summary
private volatile boolean alwaysOn
averagePeriodback to summary
private volatile long averagePeriod
averageTimeUnitback to summary
private volatile TimeUnit averageTimeUnit
compoundsback to summary
private final ConcurrentMap<Set<T>, ResultImpl<T>> compounds
executorback to summary
private final ScheduledExecutorService executor
historyPeriodback to summary
private volatile long historyPeriod
historySizeback to summary
private volatile int historySize
historyTimeUnitback to summary
private volatile TimeUnit historyTimeUnit
operationsback to summary
private final Map<T, ResultImpl<T>> operations
ratiosback to summary
private final ConcurrentMap<List<Set<T>>, ExpiringSampledStatistic<Double>> ratios
sourceback to summary
private final OperationStatistic<T> source
typeback to summary
private final Class<T> type

Constructor Detail

CompoundOperationImplback to summary
public CompoundOperationImpl(OperationStatistic<T> source, Class<T> type, long averagePeriod, TimeUnit averageTimeUnit, ScheduledExecutorService executor, int historySize, long historyPeriod, TimeUnit historyTimeUnit)

Instantiates a new compound operation impl.

Parameters
source:OperationStatistic<T>

the source

type:Class<T>

the type

averagePeriod:long

the average period

averageTimeUnit:TimeUnit

the average unit

executor:ScheduledExecutorService

the executor

historySize:int

the history size

historyPeriod:long

the history period

historyTimeUnit:TimeUnit

the history unit

Method Detail

asCountOperationback to summary
public CountOperation<T> asCountOperation()

Implements org.terracotta.statistics.extended.CompoundOperation.asCountOperation.

Doc from org.terracotta.statistics.extended.CompoundOperation.asCountOperation.

Count operation.

Returns:CountOperation<T>

the count operation

Annotations
@Override
componentback to summary
public Result component(T result)

Implements org.terracotta.statistics.extended.CompoundOperation.component.

Doc from org.terracotta.statistics.extended.CompoundOperation.component.

Component.

Parameters
result:T

the result

Returns:Result

the result

Annotations
@Override
compoundback to summary
public Result compound(EnumSet<T> results)

Implements org.terracotta.statistics.extended.CompoundOperation.compound.

Doc from org.terracotta.statistics.extended.CompoundOperation.compound.

Compound.

Parameters
results:EnumSet<T>

the results

Returns:Result

the result

Annotations
@Override
expireback to summary
public boolean expire(long expiryTime)

Implements org.terracotta.statistics.extended.SamplingSupport.expire.

Expire.

Parameters
expiryTime:long

the expiry time

Returns:boolean

true, if successful

Annotations
@Override
@SuppressFBWarnings:NS_DANGEROUS_NON_SHORT_CIRCUIT
getHistorySampleSizeback to summary
public int getHistorySampleSize()

Implements org.terracotta.statistics.extended.CompoundOperation.getHistorySampleSize.

Get the history sample size.

Returns:int

Doc from org.terracotta.statistics.extended.CompoundOperation.getHistorySampleSize.

the history sample size

Annotations
@Override
getHistorySampleTimeback to summary
public long getHistorySampleTime(TimeUnit unit)

Implements org.terracotta.statistics.extended.CompoundOperation.getHistorySampleTime.

Get the history sample time.

Parameters
unit:TimeUnit

Doc from org.terracotta.statistics.extended.CompoundOperation.getHistorySampleTime.

the unit

Returns:long

Doc from org.terracotta.statistics.extended.CompoundOperation.getHistorySampleTime.

the history sample time

Annotations
@Override
getWindowSizeback to summary
public long getWindowSize(TimeUnit unit)

Implements org.terracotta.statistics.extended.CompoundOperation.getWindowSize.

Doc from org.terracotta.statistics.extended.CompoundOperation.getWindowSize.

Gets the window size.

Parameters
unit:TimeUnit

the unit

Returns:long

the window size

Annotations
@Override
isAlwaysOnback to summary
public boolean isAlwaysOn()

Implements org.terracotta.statistics.extended.CompoundOperation.isAlwaysOn.

Doc from org.terracotta.statistics.extended.CompoundOperation.isAlwaysOn.

Checks if is always on.

Returns:boolean

true, if is always on

Annotations
@Override
ratioOfback to summary
public SampledStatistic<Double> ratioOf(EnumSet<T> numerator, EnumSet<T> denominator)

Implements org.terracotta.statistics.extended.CompoundOperation.ratioOf.

Doc from org.terracotta.statistics.extended.CompoundOperation.ratioOf.

Ratio of.

Parameters
numerator:EnumSet<T>

the numerator

denominator:EnumSet<T>

the denomiator

Returns:SampledStatistic<Double>

the statistic

Annotations
@Override
setAlwaysOnback to summary
public void setAlwaysOn(boolean enable)

Implements org.terracotta.statistics.extended.CompoundOperation.setAlwaysOn.

Doc from org.terracotta.statistics.extended.CompoundOperation.setAlwaysOn.

Sets the always on.

Parameters
enable:boolean

the new always on

Annotations
@Override
setHistoryback to summary
public void setHistory(int samples, long time, TimeUnit unit)

Implements org.terracotta.statistics.extended.CompoundOperation.setHistory.

Doc from org.terracotta.statistics.extended.CompoundOperation.setHistory.

Sets the history.

Parameters
samples:int

the samples

time:long

the time

unit:TimeUnit

the unit

Annotations
@Override
setWindowback to summary
public void setWindow(long time, TimeUnit unit)

Implements org.terracotta.statistics.extended.CompoundOperation.setWindow.

Doc from org.terracotta.statistics.extended.CompoundOperation.setWindow.

Sets the window.

Parameters
time:long

the time

unit:TimeUnit

the unit

Annotations
@Override
typeback to summary
public Class<T> type()

Implements org.terracotta.statistics.extended.CompoundOperation.type.

Doc from org.terracotta.statistics.extended.CompoundOperation.type.

Type.

Returns:Class<T>

the class

Annotations
@Override