Skip to content
Permalink
Browse files
Merge pull request #3 from tmaret/in-memory-implementation
Cleanup code
  • Loading branch information
cschneider committed Jan 3, 2019
2 parents 400aea5 + cb9ffda commit ad3b813547855293a0bf4cac86e4403eb6f00e84
Showing 3 changed files with 3 additions and 7 deletions.
@@ -54,12 +54,12 @@ public Message newMessage(byte[] payload, Map<String, String> props) {

@Override
public Position positionFromString(String position) {
long offset = new Long(position).longValue();
long offset = Long.parseLong(position);
return new MemoryPosition(offset);
}

private Topic getOrCreate(String topicName) {
return topics.computeIfAbsent(topicName, topicName2 -> new Topic(topicName2));
return topics.computeIfAbsent(topicName, Topic::new);
}

}
@@ -33,6 +33,6 @@ public long getOffset() {

@Override
public String toString() {
return new Long(offset).toString();
return Long.toString(offset);
}
}
@@ -17,9 +17,7 @@
*/
package org.apache.aries.events.memory;

import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@@ -38,7 +36,6 @@ public class Topic {

private String topicName;
private Journal<Message> journal;
private Set<Subscription> subscriptions = new HashSet<>();

public Topic(String topicName) {
this.topicName = topicName;
@@ -116,7 +113,6 @@ public void close() {
} catch (InterruptedException e) {
// Ignore
}
subscriptions.remove(this);
}

}

0 comments on commit ad3b813

Please sign in to comment.