queue manager name
This commit is contained in:
parent
67402c3ef6
commit
fd5764d30d
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<groupId>it.cavallium</groupId>
|
||||
<artifactId>filequeue</artifactId>
|
||||
<name>file queue project</name>
|
||||
<version>3.1.9</version>
|
||||
<version>3.1.10</version>
|
||||
<packaging>jar</packaging>
|
||||
<description>Light weight, high performance, simple, reliable and persistent queue</description>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -17,7 +17,12 @@ public final class LMDBQueueToConsumer<T> implements IQueueToConsumer<T> {
|
||||
QueueConsumer<T> consumer) {
|
||||
this.env = LMDBEnvManager.ofPath(file);
|
||||
this.queueLMDB = new SimpleQueueLMDB<>(env, dbName, serializer, deserializer);
|
||||
this.queue = new QueueToConsumer<>(queueLMDB, consumer);
|
||||
this.queue = new QueueToConsumer<>(queueLMDB, consumer) {
|
||||
@Override
|
||||
protected String getQueueManagerName() {
|
||||
return super.getQueueManagerName() + "-" + dbName;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,7 +27,12 @@ public final class MemorySegmentQueueToConsumer<T> implements IQueueToConsumer<T
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
this.queue = new QueueToConsumer<>(queueMemorySegment, consumer);
|
||||
this.queue = new QueueToConsumer<>(queueMemorySegment, consumer) {
|
||||
@Override
|
||||
protected String getQueueManagerName() {
|
||||
return super.getQueueManagerName() + "-" + dbName;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -24,10 +24,14 @@ class QueueToConsumer<T> implements IQueueToConsumer<T> {
|
||||
this.afterAddQueued = new AtomicLong(queue.size());
|
||||
}
|
||||
|
||||
protected String getQueueManagerName() {
|
||||
return "queue-manager";
|
||||
}
|
||||
|
||||
public synchronized void startQueue() {
|
||||
if (manager == null) {
|
||||
this.manager = new Manager();
|
||||
manager.setName("queue-manager");
|
||||
manager.setName(getQueueManagerName());
|
||||
manager.start();
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ public class SimpleQueueMemorySegment<T> implements SimpleQueue<T>, Closeable {
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return 0;
|
||||
return this.queueSegments.stream().mapToInt(SimpleQueueMemorySegmentFixedSize::size).sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user