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