summaryrefslogtreecommitdiffstats
path: root/messagebus
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-08 12:11:56 +0200
committerGitHub <noreply@github.com>2020-10-08 12:11:56 +0200
commitb5565f865b9cc4c8f342b90040e00f947ce7cb78 (patch)
tree0057b770489326cb7eba3ea819782d1ab2ad7b63 /messagebus
parent5118810ba0ef660a9979a9dad8b8d30e06aae2df (diff)
parent5762dd1702e10d1c68fd920665e822b25568cd9c (diff)
Merge pull request #14778 from vespa-engine/bratseth/improve-error-logging
Log warning with exception instead of doing printStackTrace
Diffstat (limited to 'messagebus')
-rw-r--r--messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java4
-rw-r--r--messagebus/src/main/java/com/yahoo/messagebus/Protocol.java33
2 files changed, 17 insertions, 20 deletions
diff --git a/messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java b/messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java
index 460783457af..9bde5e32fd7 100644
--- a/messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java
+++ b/messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java
@@ -59,10 +59,10 @@ public final class ErrorCode {
/** The protocol specified for the message is unknown. */
public static final int UNKNOWN_PROTOCOL = FATAL_ERROR + 7;
- /** An error occured while decoding the message. */
+ /** An error occurred while decoding the message. */
public static final int DECODE_ERROR = FATAL_ERROR + 8;
- /** A timeout occured while sending. */
+ /** A timeout occurred while sending. */
public static final int TIMEOUT = FATAL_ERROR + 9;
/** The target is running an incompatible version. */
diff --git a/messagebus/src/main/java/com/yahoo/messagebus/Protocol.java b/messagebus/src/main/java/com/yahoo/messagebus/Protocol.java
index 3801308d38f..d1c19cda88c 100644
--- a/messagebus/src/main/java/com/yahoo/messagebus/Protocol.java
+++ b/messagebus/src/main/java/com/yahoo/messagebus/Protocol.java
@@ -12,37 +12,34 @@ import com.yahoo.messagebus.routing.RoutingPolicy;
*/
public interface Protocol {
- /**
- * Returns a global unique name for this protocol.
- *
- * @return The name.
- */
- public String getName();
+ /** Returns a global unique name for this protocol. */
+ String getName();
/**
* Encodes the protocol specific data of a routable into a byte array.
*
- * @param version The version to encode for.
- * @param routable The routable to encode.
- * @return The encoded data.
+ * @param version the version to encode for
+ * @param routable the routable to encode
+ * @return the encoded data
*/
- public byte[] encode(Version version, Routable routable);
+ byte[] encode(Version version, Routable routable);
/**
* Decodes the protocol specific data into a routable of the correct type.
*
- * @param version The version of the serialized routable.
- * @param payload The payload to decode from.
- * @return The decoded routable.
+ * @param version the version of the serialized routable
+ * @param payload the payload to decode from
+ * @return the decoded routable, or null if it could not be decoded
*/
- public Routable decode(Version version, byte[] payload);
+ Routable decode(Version version, byte[] payload);
/**
* Create a policy of the named type with the named param passed to the constructor of that policy.
*
- * @param name The name of the policy to create.
- * @param param The parameter to that policy's constructor.
- * @return The created policy.
+ * @param name the name of the policy to create
+ * @param param the parameter to that policy's constructor
+ * @return the created policy
*/
- public RoutingPolicy createPolicy(String name, String param);
+ RoutingPolicy createPolicy(String name, String param);
+
}