Initial builds using bazel
Change-Id: I38123b396a2ffda5f36cdca43f3ad1fa67a7ab52
diff --git a/core/store/dist/BUILD b/core/store/dist/BUILD
new file mode 100644
index 0000000..0608650
--- /dev/null
+++ b/core/store/dist/BUILD
@@ -0,0 +1,28 @@
+COMPILE_DEPS = CORE_DEPS + NETTY + JACKSON + KRYO + [
+ '//core/common:onos-core-common',
+ '//utils/rest:onlab-rest',
+ '//core/store/serializers:onos-core-serializers',
+ '@netty_transport//jar',
+ '@netty_codec//jar',
+ '@netty_handler//jar',
+ '@netty_transport_native_epoll//jar',
+ '@netty_resolver//jar',
+ '@commons_math3//jar',
+ '//incubator/api:onos-incubator-api',
+]
+
+TEST_DEPS = TEST + [
+ '//core/api:onos-api-tests',
+ '//core/common:onos-core-common-tests',
+]
+
+osgi_jar_with_tests (
+ name = 'onos-core-dist',
+ deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
+ exclude_tests = [
+ 'org.onosproject.store.link.impl.ECLinkStoreTest',
+ 'org.onosproject.store.flow.impl.DistributedFlowRuleStoreTest',
+ ],
+ visibility = ["//visibility:public"],
+)
diff --git a/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/MessageDecoder.java b/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/MessageDecoder.java
index bdf5cdf..4b9ef6c 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/MessageDecoder.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/MessageDecoder.java
@@ -69,32 +69,41 @@
case READ_SENDER_IP_VERSION:
ipVersion = buffer.readByte() == 0x0 ? Version.INET : Version.INET6;
checkpoint(DecoderState.READ_SENDER_IP);
+ // FALLTHROUGH
case READ_SENDER_IP:
byte[] octets = new byte[IpAddress.byteLength(ipVersion)];
buffer.readBytes(octets);
senderIp = IpAddress.valueOf(ipVersion, octets);
checkpoint(DecoderState.READ_SENDER_PORT);
+ // FALLTHROUGH
case READ_SENDER_PORT:
senderPort = buffer.readInt();
checkpoint(DecoderState.READ_TYPE);
+ // FALLTHROUGH
case READ_TYPE:
type = InternalMessage.Type.forId(buffer.readByte());
checkpoint(DecoderState.READ_PREAMBLE);
+ // FALLTHROUGH
case READ_PREAMBLE:
preamble = buffer.readInt();
checkpoint(DecoderState.READ_LOGICAL_TIME);
+ // FALLTHROUGH
case READ_LOGICAL_TIME:
logicalTime = buffer.readLong();
checkpoint(DecoderState.READ_LOGICAL_COUNTER);
+ // FALLTHROUGH
case READ_LOGICAL_COUNTER:
logicalCounter = buffer.readLong();
checkpoint(DecoderState.READ_MESSAGE_ID);
+ // FALLTHROUGH
case READ_MESSAGE_ID:
messageId = buffer.readLong();
checkpoint(DecoderState.READ_CONTENT_LENGTH);
+ // FALLTHROUGH
case READ_CONTENT_LENGTH:
contentLength = buffer.readInt();
checkpoint(DecoderState.READ_CONTENT);
+ // FALLTHROUGH
case READ_CONTENT:
if (contentLength > 0) {
//TODO Perform a sanity check on the size before allocating
@@ -125,6 +134,7 @@
case READ_SUBJECT_LENGTH:
subjectLength = buffer.readShort();
checkpoint(DecoderState.READ_SUBJECT);
+ // FALLTHROUGH
case READ_SUBJECT:
byte[] messageTypeBytes = new byte[subjectLength];
buffer.readBytes(messageTypeBytes);