diff options
author | Ram Koya <rk541m@att.com> | 2018-04-27 15:43:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-04-27 15:43:03 +0000 |
commit | 0ee32170163c467c88e35f2ec019df486b9f4c33 (patch) | |
tree | 2de01913f974050d9ebb12ae641edddaf3098cf5 | |
parent | fd43f0cffba3a74ad6962d931dda738eda16e99c (diff) | |
parent | e25f2025171ba6f9f2f3fddc76cee021bf86c9d1 (diff) |
Merge changes I624da3f9,I5e879cf1,I43199346,I124eefbc,If36c06fcv1.1.4
* changes:
Sonar critical issues
Sonar critical issues
Sonar critical issues
Sonar critical issues
Sonar critical issues
5 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/com/att/nsa/cambria/metrics/publisher/CambriaPublisherUtility.java b/src/main/java/com/att/nsa/cambria/metrics/publisher/CambriaPublisherUtility.java index 8e54ee5..511053e 100644 --- a/src/main/java/com/att/nsa/cambria/metrics/publisher/CambriaPublisherUtility.java +++ b/src/main/java/com/att/nsa/cambria/metrics/publisher/CambriaPublisherUtility.java @@ -53,7 +53,7 @@ public class CambriaPublisherUtility } catch ( UnsupportedEncodingException e ) { - throw new RuntimeException ( e ); + throw new AssertionError ( e ); } } /** diff --git a/src/main/java/com/att/nsa/cambria/resources/CambriaOutboundEventStream.java b/src/main/java/com/att/nsa/cambria/resources/CambriaOutboundEventStream.java index e519f71..7366dde 100644 --- a/src/main/java/com/att/nsa/cambria/resources/CambriaOutboundEventStream.java +++ b/src/main/java/com/att/nsa/cambria/resources/CambriaOutboundEventStream.java @@ -44,6 +44,8 @@ import com.att.nsa.cambria.metabroker.Topic; import com.att.nsa.cambria.utils.DMaaPResponseBuilder.StreamWriter; import com.att.nsa.cambria.utils.Utils; +import jline.internal.Log; + /** * class used to write the consumed messages @@ -327,7 +329,8 @@ public class CambriaOutboundEventStream implements StreamWriter { // FIXME: would be good to wait/signal Thread.sleep(100); } catch (InterruptedException e) { - // ignore + Log.error(e.toString()); + Thread.currentThread().interrupt(); } } }); diff --git a/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaJsonStreamReader.java b/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaJsonStreamReader.java index 54a9bc6..c8172a9 100644 --- a/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaJsonStreamReader.java +++ b/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaJsonStreamReader.java @@ -72,6 +72,7 @@ public class CambriaJsonStreamReader implements reader { throw new CambriaApiException(HttpServletResponse.SC_BAD_REQUEST, "Expecting an array or an object."); } } catch (JSONException e) { + Log.error(e); throw new CambriaApiException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); } } diff --git a/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java b/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java index 2b76a61..41b9275 100644 --- a/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java +++ b/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java @@ -25,6 +25,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.util.logging.Logger; import javax.servlet.http.HttpServletResponse; @@ -33,6 +34,8 @@ import com.att.nsa.cambria.backends.Publisher.message; import com.att.nsa.cambria.beans.LogDetails; import com.att.nsa.cambria.resources.CambriaEventSet.reader; +import jline.internal.Log; + /** * This stream reader just pulls single lines. It uses the default partition if provided. If * not, the key is the current time, which does not guarantee ordering. @@ -42,6 +45,7 @@ import com.att.nsa.cambria.resources.CambriaEventSet.reader; */ public class CambriaTextStreamReader implements reader { + private Logger log = Logger.getLogger(CambriaTextStreamReader.class.toString()); /** * This is the constructor for Cambria Text Reader format * @param is @@ -131,6 +135,7 @@ public class CambriaTextStreamReader implements reader } catch ( IOException e ) { + Log.error(e); throw new CambriaApiException ( HttpServletResponse.SC_BAD_REQUEST, e.getMessage () ); } } diff --git a/src/main/java/com/att/nsa/cambria/service/impl/MMServiceImpl.java b/src/main/java/com/att/nsa/cambria/service/impl/MMServiceImpl.java index da024f1..04cc51c 100644 --- a/src/main/java/com/att/nsa/cambria/service/impl/MMServiceImpl.java +++ b/src/main/java/com/att/nsa/cambria/service/impl/MMServiceImpl.java @@ -223,7 +223,7 @@ public class MMServiceImpl implements MMService { metricsSet.consumeTick(sent); } catch (UnavailableException excp) { - + LOG.error(excp.toString()); ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_SERVICE_UNAVAILABLE, DMaaPResponseCode.SERVER_UNAVAILABLE.getResponseCode(), errorMessages.getServerUnav() + excp.getMessage(), null, Utils.getFormattedDate(new Date()), topic, |