Top Description Fields Constructors Methods
org.HdrHistogram.packedarray

public Class ConcurrentPackedLongArray

extends PackedLongArray
Class Inheritance
Known Direct Subclasses
org.HdrHistogram.packedarray.PackedArrayRecorder.InternalConcurrentPackedLongArray
Imports
org.HdrHistogram.WriterReaderPhaser, java.io.IOException, .ObjectInputStream

A Packed array of signed 64 bit values that supports get(), set(), add() and increment() operations the logical contents of the array.

ConcurrentPackedLongArray supports concurrent accumulation, with the add() and increment() methods providing lossless atomic accumulation in the presence of multiple writers. However, it is impotant to note that add() and increment() are the *only* safe concurrent operations, and that all other operations, including get(), set() and clear() may produce "suprising" results if used on an array that is not at rest. While the add() and increment() methods are not quite wait-free, they come "close" that behvaior in the sense that a given thread will incur a total of no more than a capped fixed number (e.g. 74 in a current implementation) of non-wait-free add or increment operations during the lifetime of an array, regradless of the number of operations done.

Field Summary

Modifier and TypeField and Description
pack-priv transient WriterReaderPhaser

Constructor Summary

AccessConstructor and Description
public
ConcurrentPackedLongArray(final int virtualLength)

public
ConcurrentPackedLongArray(final int virtualLength, final int initialPhysicalLength)

Method Summary

Modifier and TypeMethod and Description
public void
pack-priv void
public ConcurrentPackedLongArray
copy()

Overrides org.HdrHistogram.packedarray.PackedLongArray.copy.

Create a copy of this array, complete with data and everything.
pack-priv long
pack-priv void
private void
pack-priv void
public void
setVirtualLength(final int
the
newVirtualArrayLength
)

Overrides org.HdrHistogram.packedarray.PackedLongArray.setVirtualLength.

Set a new virtual length for the array.
public String
toString()

Overrides org.HdrHistogram.packedarray.AbstractPackedLongArray.toString.

Returns a string representation of the object.

Field Detail

wrpback to summary
pack-priv transient WriterReaderPhaser wrp

Constructor Detail

ConcurrentPackedLongArrayback to summary
public ConcurrentPackedLongArray(final int virtualLength)
ConcurrentPackedLongArrayback to summary
public ConcurrentPackedLongArray(final int virtualLength, final int initialPhysicalLength)

Method Detail

clearback to summary
public void clear()

Overrides org.HdrHistogram.packedarray.AbstractPackedLongArray.clear.

Doc from org.HdrHistogram.packedarray.AbstractPackedLongArray.clear.

Clear the array contents

Annotations
@Override
clearContentsback to summary
pack-priv void clearContents()

Overrides org.HdrHistogram.packedarray.PackedLongArray.clearContents.

Annotations
@Override
copyback to summary
public ConcurrentPackedLongArray copy()

Overrides org.HdrHistogram.packedarray.PackedLongArray.copy.

Doc from org.HdrHistogram.packedarray.AbstractPackedLongArray.copy.

Create a copy of this array, complete with data and everything.

Returns:ConcurrentPackedLongArray

A distinct copy of this array.

Annotations
@Override
criticalSectionEnterback to summary
pack-priv long criticalSectionEnter()

Overrides org.HdrHistogram.packedarray.PackedLongArray.criticalSectionEnter.

Annotations
@Override
criticalSectionExitback to summary
pack-priv void criticalSectionExit(long criticalValueAtEnter)

Overrides org.HdrHistogram.packedarray.PackedLongArray.criticalSectionExit.

Annotations
@Override
readObjectback to summary
private void readObject(final ObjectInputStream o) throws IOException, ClassNotFoundException
resizeStorageArrayback to summary
pack-priv void resizeStorageArray(final int newPhysicalLengthInLongs)

Overrides org.HdrHistogram.packedarray.PackedLongArray.resizeStorageArray.

Annotations
@Override
setVirtualLengthback to summary
public void setVirtualLength(final int newVirtualArrayLength)

Overrides org.HdrHistogram.packedarray.PackedLongArray.setVirtualLength.

Doc from org.HdrHistogram.packedarray.AbstractPackedLongArray.setVirtualLength.

Set a new virtual length for the array.

Parameters
newVirtualArrayLength:int

the

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.HdrHistogram.packedarray.AbstractPackedLongArray.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override