diff options
author | 2018-06-21 12:12:30 +0200 | |
---|---|---|
committer | 2018-06-24 14:18:02 +0200 | |
commit | 943a47187dbb1393d720b2fdf0019d48270edb4d (patch) | |
tree | fef76ed7b3034597853ab9735f5052cab2f0d6d5 /src/main/java/org/onap/dcae/commonFunction/EventPublisherHash.java | |
parent | b4d5236a7164b166d49cf8c0a5c15bb848e04cd6 (diff) |
Remove dead code from VESCollector
Many things there are unused or have inproper modifiers,
spelling etc. I run static analysis tool (Intellij code inspect)
and clear those things up. It will be easier to maintain now.
No actual behavior changes were done.
Issue-ID: DCAEGEN2-526
Signed-off-by: PawelSzalapski <pawel.szalapski@nokia.com>
Change-Id: I1a4ad0c896bd32165cba654344ffc5245648c615
Diffstat (limited to 'src/main/java/org/onap/dcae/commonFunction/EventPublisherHash.java')
-rw-r--r-- | src/main/java/org/onap/dcae/commonFunction/EventPublisherHash.java | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/main/java/org/onap/dcae/commonFunction/EventPublisherHash.java b/src/main/java/org/onap/dcae/commonFunction/EventPublisherHash.java index 474424a7..f3907126 100644 --- a/src/main/java/org/onap/dcae/commonFunction/EventPublisherHash.java +++ b/src/main/java/org/onap/dcae/commonFunction/EventPublisherHash.java @@ -38,11 +38,6 @@ public class EventPublisherHash { private static volatile EventPublisherHash instance = new EventPublisherHash(DmaapPublishers.create()); private final DmaapPublishers dmaapPublishers; - /** - * Returns event publisher - * - * @return event publisher - */ public static EventPublisherHash getInstance() { return instance; } @@ -52,14 +47,14 @@ public class EventPublisherHash { this.dmaapPublishers = dmaapPublishers; } - public void sendEvent(JSONObject event, String streamid) { + void sendEvent(JSONObject event, String streamid) { log.debug("EventPublisher.sendEvent: instance for publish is ready"); clearVesUniqueId(event); try { sendEventUsingCachedPublisher(streamid, event); } catch (IOException | IllegalArgumentException e) { - log.error("Unable to publish event: {} streamid: {}. Exception: {}", event, streamid, e); + log.error("Unable to publish event: {} streamID: {}. Exception: {}", event, streamid, e); dmaapPublishers.closeByStreamId(streamid); } } @@ -76,19 +71,15 @@ public class EventPublisherHash { private void sendEventUsingCachedPublisher(String streamid, JSONObject event) throws IOException { int pendingMsgs = dmaapPublishers.getByStreamId(streamid).send("MyPartitionKey", event.toString()); - // this.wait(2000); - if (pendingMsgs > 100) { log.info("Pending Message Count=" + pendingMsgs); } - log.info("pub.send invoked - no error"); - //CommonStartup.oplog.info(String.format("URL:%sTOPIC:%sEvent Published:%s", ueburl, topic, event)); CommonStartup.oplog.info(String.format("StreamID:%s Event Published:%s ", streamid, event)); } @VisibleForTesting - public CambriaBatchingPublisher getDmaapPublisher(String streamId) { + CambriaBatchingPublisher getDmaapPublisher(String streamId) { return dmaapPublishers.getByStreamId(streamId); } } |