Class ChronicleLogManager
- java.lang.Object
-
- org.nuxeo.lib.stream.log.internals.AbstractLogManager
-
- org.nuxeo.lib.stream.log.chronicle.ChronicleLogManager
-
- All Implemented Interfaces:
AutoCloseable
,LogManager
public class ChronicleLogManager extends AbstractLogManager
- Since:
- 9.3
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ChronicleLogConfig>
configs
protected ChronicleLogConfig
defaultConfig
static boolean
IS_WIN
protected static String
OS
-
Fields inherited from class org.nuxeo.lib.stream.log.internals.AbstractLogManager
ADMIN_GROUP, appenders, tailers, tailersAssignments
-
-
Constructor Summary
Constructors Constructor Description ChronicleLogManager(Path basePath)
ChronicleLogManager(Path basePath, String retentionDuration)
ConstructorChronicleLogManager(List<ChronicleLogConfig> configs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
create(Name name, int size)
<M extends Externalizable>
CloseableLogAppender<M>createAppender(Name name, Codec<M> codec)
boolean
delete(Name name)
Tries to delete a Log.protected static void
deleteQueueBasePath(Path basePath)
protected <M extends Externalizable>
LogTailer<M>doCreateTailer(Collection<LogPartition> partitions, Name group, Codec<M> codec)
protected <M extends Externalizable>
LogTailer<M>doSubscribe(Name group, Collection<Name> names, RebalanceListener listener, Codec<M> codec)
boolean
exists(Name name)
Returnstrue
if a Log with thisname
exists.protected ChronicleLogConfig
findDefaultConfig()
String
getBasePath()
protected ChronicleLogConfig
getConfig(Name name)
protected ChronicleLogConfig
getConfig(Name name, Name group)
protected LogLag
getLagForPartition(Name name, int partition, Name group)
List<LogLag>
getLagPerPartition(Name name, Name group)
Returns the lag between consumergroup
and the producers for each partition.protected int
getSize(Name name)
protected static boolean
isChronicleLogFile(Path path)
List<Name>
listAllNames()
Returns all the Log names.List<Name>
listConsumerGroups(Name name)
List the consumer groups for a Log.String
toString()
-
Methods inherited from class org.nuxeo.lib.stream.log.internals.AbstractLogManager
checkInvalidAssignment, checkInvalidCodec, cleanTailers, close, createIfNotExists, createTailer, getAppender, getLatencyPerPartition, guessCodec, sameCodec, size, subscribe, supportSubscribe, supportSubscribe
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.lib.stream.log.LogManager
createIfNotExists, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, delete, deleteConsumers, deleteRecords, exists, getAppender, getAppender, getAppender, getLag, getLag, getLagPerPartition, getLatency, getLatency, getLatencyPerPartition, listAll, listConsumerGroups, size, subscribe, subscribe, subscribe
-
-
-
-
Field Detail
-
configs
protected final List<ChronicleLogConfig> configs
-
defaultConfig
protected final ChronicleLogConfig defaultConfig
-
OS
protected static final String OS
-
IS_WIN
public static final boolean IS_WIN
-
-
Constructor Detail
-
ChronicleLogManager
public ChronicleLogManager(Path basePath)
-
ChronicleLogManager
public ChronicleLogManager(Path basePath, String retentionDuration)
Constructor- Parameters:
basePath
- the base path.retentionDuration
- the retention duration. It is the time period the queue files will be retained. Once the retention duration expires, the older files are candidates for being purged. The property can be expressed as: 15s, 30m, 1h, 4d ... (where 's' is expressing a duration in seconds, 'm' in minutes,'h' in hours and 'd' in days)
-
ChronicleLogManager
public ChronicleLogManager(List<ChronicleLogConfig> configs)
-
-
Method Detail
-
findDefaultConfig
protected ChronicleLogConfig findDefaultConfig()
-
getConfig
protected ChronicleLogConfig getConfig(Name name)
-
getConfig
protected ChronicleLogConfig getConfig(Name name, Name group)
-
deleteQueueBasePath
protected static void deleteQueueBasePath(Path basePath)
-
isChronicleLogFile
protected static boolean isChronicleLogFile(Path path)
-
getBasePath
public String getBasePath()
-
exists
public boolean exists(Name name)
Description copied from interface:LogManager
Returnstrue
if a Log with thisname
exists.
-
create
public void create(Name name, int size)
- Specified by:
create
in classAbstractLogManager
-
getSize
protected int getSize(Name name)
- Specified by:
getSize
in classAbstractLogManager
-
delete
public boolean delete(Name name)
Description copied from interface:LogManager
Tries to delete a Log. Returns true if successfully deleted, might not be possible depending on the implementation.- Specified by:
delete
in interfaceLogManager
- Overrides:
delete
in classAbstractLogManager
-
getLagPerPartition
public List<LogLag> getLagPerPartition(Name name, Name group)
Description copied from interface:LogManager
Returns the lag between consumergroup
and the producers for each partition. The result list is ordered, for instance index 0 is lag for partition 0.- Specified by:
getLagPerPartition
in interfaceLogManager
- Specified by:
getLagPerPartition
in classAbstractLogManager
-
listAllNames
public List<Name> listAllNames()
Description copied from interface:LogManager
Returns all the Log names.
-
listConsumerGroups
public List<Name> listConsumerGroups(Name name)
Description copied from interface:LogManager
List the consumer groups for a Log.
-
createAppender
public <M extends Externalizable> CloseableLogAppender<M> createAppender(Name name, Codec<M> codec)
- Specified by:
createAppender
in classAbstractLogManager
-
doCreateTailer
protected <M extends Externalizable> LogTailer<M> doCreateTailer(Collection<LogPartition> partitions, Name group, Codec<M> codec)
- Specified by:
doCreateTailer
in classAbstractLogManager
-
doSubscribe
protected <M extends Externalizable> LogTailer<M> doSubscribe(Name group, Collection<Name> names, RebalanceListener listener, Codec<M> codec)
- Specified by:
doSubscribe
in classAbstractLogManager
-
-