public class SamplesUtil extends Object
| Constructor and Description |
|---|
SamplesUtil() |
| Modifier and Type | Method and Description |
|---|---|
static CountersReader |
mapCounters()
Map an existing CnC file.
|
static CountersReader |
mapCounters(MutableInteger cncFileVersion)
Map an existing CnC file.
|
static MappedByteBuffer |
mapExistingFileReadOnly(File location)
Map an existing file as a read only buffer.
|
static FragmentHandler |
printAsciiMessage(int streamId)
Return a reusable, parametrised
FragmentHandler that prints to stdout. |
static void |
printAvailableImage(Image image)
Print the information for an available image to stdout.
|
static void |
printError(String channel,
int streamId,
int sessionId,
String message,
HeaderFlyweight cause)
Generic error handler that just prints message to stdout.
|
static void |
printRate(double messagesPerSec,
double bytesPerSec,
long totalMessages,
long totalBytes)
Print the rates to stdout.
|
static void |
printUnavailableImage(Image image)
Print the information for an unavailable image to stdout.
|
static FragmentHandler |
rateReporterHandler(RateReporter reporter)
Return a reusable, parametrised
FragmentHandler that calls into a
RateReporter. |
static Consumer<Subscription> |
subscriberLoop(FragmentHandler fragmentHandler,
int limit,
AtomicBoolean running)
Return a reusable, parametrised event loop that calls a default
IdleStrategy when no messages
are received. |
static Consumer<Subscription> |
subscriberLoop(FragmentHandler fragmentHandler,
int limit,
AtomicBoolean running,
IdleStrategy idleStrategy)
Return a reusable, parametrised event loop that calls and idler when no messages are received.
|
public static Consumer<Subscription> subscriberLoop(FragmentHandler fragmentHandler, int limit, AtomicBoolean running)
IdleStrategy when no messages
are received.fragmentHandler - to be called back for each message.limit - passed to Subscription.poll(FragmentHandler, int).running - indication for loop.public static Consumer<Subscription> subscriberLoop(FragmentHandler fragmentHandler, int limit, AtomicBoolean running, IdleStrategy idleStrategy)
fragmentHandler - to be called back for each message.limit - passed to Subscription.poll(FragmentHandler, int).running - indication for loop.idleStrategy - to use for loop.public static FragmentHandler printAsciiMessage(int streamId)
FragmentHandler that prints to stdout.streamId - to show when printing.public static FragmentHandler rateReporterHandler(RateReporter reporter)
FragmentHandler that calls into a
RateReporter.reporter - for the rate.FragmentHandler that records the rate information.public static void printError(String channel, int streamId, int sessionId, String message, HeaderFlyweight cause)
channel - for the error.streamId - for the error.sessionId - for the error, if it has a source.message - indicating what the error was.cause - of the error.public static void printRate(double messagesPerSec,
double bytesPerSec,
long totalMessages,
long totalBytes)
messagesPerSec - being reported.bytesPerSec - being reported.totalMessages - being reported.totalBytes - being reported.public static void printAvailableImage(Image image)
image - that has been created.public static void printUnavailableImage(Image image)
image - that has gone inactive.public static MappedByteBuffer mapExistingFileReadOnly(File location)
location - of file to map.public static CountersReader mapCounters()
CountersReader over the CnC file.public static CountersReader mapCounters(MutableInteger cncFileVersion)
cncFileVersion - to set as value of file.CountersReader over the CnC file.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.