From 943a47187dbb1393d720b2fdf0019d48270edb4d Mon Sep 17 00:00:00 2001 From: PawelSzalapski Date: Thu, 21 Jun 2018 12:12:30 +0200 Subject: 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 Change-Id: I1a4ad0c896bd32165cba654344ffc5245648c615 --- .../org/onap/dcae/commonFunction/EventPublisherHash.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/main/java/org/onap/dcae/commonFunction/EventPublisherHash.java') 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); } } -- cgit 1.2.3-korg