GOSSIP-31 Changes to readme (Rishabh Patel via EGC)
diff --git a/pom.xml b/pom.xml
index 581c8b1..ad78c91 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
- <!--
+<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
@@ -16,8 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -29,17 +28,17 @@
<groupId>org.apache.gossip</groupId>
<artifactId>gossip</artifactId>
<name>gossip</name>
- <version>0.1.0-incubating</version>
+ <version>0.1.2-incubating-SNAPSHOT</version>
<packaging>jar</packaging>
<description>A peer to peer cluster discovery service</description>
<url>http://gossip.incubator.apache.org/</url>
-
+
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<!-- dependecy versions -->
- <jackson-datatype-json-org.version>1.8.0</jackson-datatype-json-org.version>
+ <jackson.version>2.8.5</jackson.version>
<junit.jupiter.version>5.0.0-M2</junit.jupiter.version>
<junit.platform.version>1.0.0-M2</junit.platform.version>
<junit.vintage.version>4.12.0-M2</junit.vintage.version>
@@ -66,8 +65,8 @@
<connection>scm:git:git@github.com:apache/incubator-gossip.git</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-gossip.git</developerConnection>
<url>scm:git:git@github.com:apache/incubator-gossip.git</url>
- <tag>HEAD</tag>
- </scm>
+ <tag>HEAD</tag>
+ </scm>
<issueManagement>
<system>JIRA</system>
@@ -76,9 +75,14 @@
<dependencies>
<dependency>
- <groupId>com.fasterxml.jackson</groupId>
- <artifactId>jackson-datatype-json-org</artifactId>
- <version>${jackson-datatype-json-org.version}</version>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
@@ -136,6 +140,20 @@
<build>
<pluginManagement>
<plugins>
+ <!-- we need to tweak the maven-release-plugin for GIT -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <pushChanges>false</pushChanges>
+ <localCheckout>true</localCheckout>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+
+ <releaseProfiles>distribution</releaseProfiles>
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@@ -187,6 +205,24 @@
</dependency>
</dependencies>
</plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>README.md</exclude>
+ <exclude>eclipse_template.xml</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
diff --git a/src/main/java/org/apache/gossip/GossipMember.java b/src/main/java/org/apache/gossip/GossipMember.java
index 58b1e91..7ae4d81 100644
--- a/src/main/java/org/apache/gossip/GossipMember.java
+++ b/src/main/java/org/apache/gossip/GossipMember.java
@@ -23,7 +23,6 @@
/**
* A abstract class representing a gossip member.
*
- * @author joshclemm, harmenw
*/
public abstract class GossipMember implements Comparable<GossipMember> {
@@ -44,6 +43,8 @@
/**
* Constructor.
*
+ * @param clusterName
+ * The name of the cluster
* @param uri
* A URI object containing IP/hostname and port
* @param heartbeat
@@ -69,7 +70,7 @@
/**
- * The member address in the form IP/host:port Similar to the toString in
+ * @return The member address in the form IP/host:port Similar to the toString in
* {@link InetSocketAddress}
*/
public String getAddress() {
diff --git a/src/main/java/org/apache/gossip/GossipRunner.java b/src/main/java/org/apache/gossip/GossipRunner.java
index c765ed6..1ae609c 100644
--- a/src/main/java/org/apache/gossip/GossipRunner.java
+++ b/src/main/java/org/apache/gossip/GossipRunner.java
@@ -22,7 +22,7 @@
import java.io.IOException;
import java.net.URISyntaxException;
-import org.json.JSONException;
+
public class GossipRunner {
@@ -46,8 +46,6 @@
gossipService.start();
} catch (FileNotFoundException e) {
System.err.println("The given file is not found!");
- } catch (JSONException e) {
- System.err.println("The given file is not in the correct JSON format!");
} catch (IOException e) {
System.err.println("Could not read the configuration file: " + e.getMessage());
} catch (InterruptedException e) {
diff --git a/src/main/java/org/apache/gossip/GossipService.java b/src/main/java/org/apache/gossip/GossipService.java
index e50f260..80c01ca 100644
--- a/src/main/java/org/apache/gossip/GossipService.java
+++ b/src/main/java/org/apache/gossip/GossipService.java
@@ -84,8 +84,9 @@
}
/**
- * Gossip data in a namespace that is per-node { node-id { key->value } }
+ * Gossip data in a namespace that is per-node { node-id { key, value } }
* @param message
+ * message to be gossip'ed across the cluster
*/
public void gossipPerNodeData(GossipDataMessage message){
gossipManager.gossipPerNodeData(message);
@@ -93,17 +94,21 @@
/**
* Retrieve per-node gossip data by key
+ *
* @param nodeId
+ * the id of the node that owns the data
* @param key
- * @return return the value if found or null if not found or expired
+ * the key in the per-node map to find the data
+ * @return the value if found or null if not found or expired
*/
public GossipDataMessage findPerNodeData(String nodeId, String key){
return getGossipManager().findPerNodeGossipData(nodeId, key);
}
/**
- * Gossip shared data
+ *
* @param message
+ * Shared data to gossip around the cluster
*/
public void gossipSharedData(SharedGossipDataMessage message){
gossipManager.gossipSharedData(message);
@@ -111,8 +116,9 @@
/**
*
- * @param key the key to search for
- * @return
+ * @param key
+ * the key to search for
+ * @return the value associated with given key
*/
public SharedGossipDataMessage findSharedData(String key){
return getGossipManager().findSharedGossipData(key);
diff --git a/src/main/java/org/apache/gossip/LocalGossipMember.java b/src/main/java/org/apache/gossip/LocalGossipMember.java
index d7e9f4e..97f4ab6 100644
--- a/src/main/java/org/apache/gossip/LocalGossipMember.java
+++ b/src/main/java/org/apache/gossip/LocalGossipMember.java
@@ -37,6 +37,7 @@
* @param uri
* The uri of the member
* @param id
+ * id of the node
* @param heartbeat
* The current heartbeat.
* @param notificationListener
diff --git a/src/main/java/org/apache/gossip/StartupSettings.java b/src/main/java/org/apache/gossip/StartupSettings.java
index 93757bd..08f7975 100644
--- a/src/main/java/org/apache/gossip/StartupSettings.java
+++ b/src/main/java/org/apache/gossip/StartupSettings.java
@@ -25,17 +25,18 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.apache.log4j.Logger;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
/**
* This object represents the settings used when starting the gossip service.
*
- * @author harmenw
*/
public class StartupSettings {
private static final Logger log = Logger.getLogger(StartupSettings.class);
@@ -152,15 +153,13 @@
* @param jsonFile
* The file object which refers to the JSON config file.
* @return The StartupSettings object with the settings from the config file.
- * @throws JSONException
- * Thrown when the file is not well-formed JSON.
* @throws FileNotFoundException
* Thrown when the file cannot be found.
* @throws IOException
* Thrown when reading the file gives problems.
* @throws URISyntaxException
*/
- public static StartupSettings fromJSONFile(File jsonFile) throws JSONException,
+ public static StartupSettings fromJSONFile(File jsonFile) throws
FileNotFoundException, IOException, URISyntaxException {
// Read the file to a String.
StringBuffer buffer = new StringBuffer();
@@ -170,32 +169,31 @@
buffer.append(line.trim());
}
}
-
- JSONObject jsonObject = new JSONArray(buffer.toString()).getJSONObject(0);
- String uri = jsonObject.getString("uri");
- String id = jsonObject.getString("id");
- int gossipInterval = jsonObject.getInt("gossip_interval");
- int cleanupInterval = jsonObject.getInt("cleanup_interval");
- String cluster = jsonObject.getString("cluster");
+ ObjectMapper om = new ObjectMapper();
+ JsonNode root = om.readTree(jsonFile);
+ JsonNode jsonObject = root.get(0);
+ String uri = jsonObject.get("uri").textValue();
+ String id = jsonObject.get("id").textValue();
+ int gossipInterval = jsonObject.get("gossip_interval").intValue();
+ int cleanupInterval = jsonObject.get("cleanup_interval").intValue();
+ String cluster = jsonObject.get("cluster").textValue();
if (cluster == null){
throw new IllegalArgumentException("cluster was null. It is required");
}
URI uri2 = new URI(uri);
StartupSettings settings = new StartupSettings(id, uri2, new GossipSettings(gossipInterval,
cleanupInterval), cluster);
-
- // Now iterate over the members from the config file and add them to the settings.
String configMembersDetails = "Config-members [";
- JSONArray membersJSON = jsonObject.getJSONArray("members");
- for (int i = 0; i < membersJSON.length(); i++) {
- JSONObject memberJSON = membersJSON.getJSONObject(i);
- URI uri3 = new URI(memberJSON.getString("uri"));
- RemoteGossipMember member = new RemoteGossipMember(memberJSON.getString("cluster"),
+ JsonNode membersJSON = jsonObject.get("members");
+ Iterator<JsonNode> it = membersJSON.iterator();
+ while (it.hasNext()){
+ JsonNode child = it.next();
+ URI uri3 = new URI(child.get("uri").textValue());
+ RemoteGossipMember member = new RemoteGossipMember(child.get("cluster").asText(),
uri3, "", 0);
settings.addGossipMember(member);
configMembersDetails += member.getAddress();
- if (i < (membersJSON.length() - 1))
- configMembersDetails += ", ";
+ configMembersDetails += ", ";
}
log.info(configMembersDetails + "]");
diff --git a/src/main/java/org/apache/gossip/manager/ActiveGossipThread.java b/src/main/java/org/apache/gossip/manager/ActiveGossipThread.java
index 064df59..29f4688 100644
--- a/src/main/java/org/apache/gossip/manager/ActiveGossipThread.java
+++ b/src/main/java/org/apache/gossip/manager/ActiveGossipThread.java
@@ -39,7 +39,9 @@
import org.apache.gossip.udp.UdpGossipDataMessage;
import org.apache.gossip.udp.UdpSharedGossipDataMessage;
import org.apache.log4j.Logger;
-import org.codehaus.jackson.map.ObjectMapper;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
/**
* [The active thread: periodically send gossip request.] The class handles gossiping the membership
diff --git a/src/main/java/org/apache/gossip/manager/Clock.java b/src/main/java/org/apache/gossip/manager/Clock.java
index 0e828f7..6629c62 100644
--- a/src/main/java/org/apache/gossip/manager/Clock.java
+++ b/src/main/java/org/apache/gossip/manager/Clock.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.gossip.manager;
public interface Clock {
diff --git a/src/main/java/org/apache/gossip/manager/DataReaper.java b/src/main/java/org/apache/gossip/manager/DataReaper.java
index 4f4616b..6760685 100644
--- a/src/main/java/org/apache/gossip/manager/DataReaper.java
+++ b/src/main/java/org/apache/gossip/manager/DataReaper.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.gossip.manager;
import java.util.Map.Entry;
diff --git a/src/main/java/org/apache/gossip/manager/GossipCore.java b/src/main/java/org/apache/gossip/manager/GossipCore.java
index 1871751..0ab56a0 100644
--- a/src/main/java/org/apache/gossip/manager/GossipCore.java
+++ b/src/main/java/org/apache/gossip/manager/GossipCore.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.gossip.manager;
import java.io.IOException;
@@ -14,7 +31,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor.DiscardPolicy;
@@ -35,7 +51,9 @@
import org.apache.gossip.udp.UdpNotAMemberFault;
import org.apache.gossip.udp.UdpSharedGossipDataMessage;
import org.apache.log4j.Logger;
-import org.codehaus.jackson.map.ObjectMapper;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
public class GossipCore {
@@ -257,7 +275,7 @@
List<GossipMember> remoteList) {
// if the person sending to us is in the dead list consider them up
- for (LocalGossipMember i : gossipManager.getDeadList()) {
+ for (LocalGossipMember i : gossipManager.getDeadMembers()) {
if (i.getId().equals(senderMember.getId())) {
LOGGER.info(gossipManager.getMyself() + " contacted by dead member " + senderMember.getUri());
LocalGossipMember newLocalMember = new LocalGossipMember(senderMember.getClusterName(),
@@ -280,7 +298,7 @@
localMember.resetTimeoutTimer();
}
} else if (!gossipManager.getLiveMembers().contains(remoteMember)
- && !gossipManager.getDeadList().contains(remoteMember)) {
+ && !gossipManager.getDeadMembers().contains(remoteMember)) {
LocalGossipMember newLocalMember = new LocalGossipMember(remoteMember.getClusterName(),
remoteMember.getUri(), remoteMember.getId(),
remoteMember.getHeartbeat(), gossipManager, gossipManager.getSettings()
@@ -288,9 +306,9 @@
gossipManager.createOrReviveMember(newLocalMember);
newLocalMember.startTimeoutTimer();
} else {
- if (gossipManager.getDeadList().contains(remoteMember)) {
- LocalGossipMember localDeadMember = gossipManager.getDeadList().get(
- gossipManager.getDeadList().indexOf(remoteMember));
+ if (gossipManager.getDeadMembers().contains(remoteMember)) {
+ LocalGossipMember localDeadMember = gossipManager.getDeadMembers().get(
+ gossipManager.getDeadMembers().indexOf(remoteMember));
if (remoteMember.getHeartbeat() > localDeadMember.getHeartbeat()) {
LocalGossipMember newLocalMember = new LocalGossipMember(remoteMember.getClusterName(),
remoteMember.getUri(), remoteMember.getId(),
@@ -305,14 +323,14 @@
LOGGER.debug("sender " + senderMember);
LOGGER.debug("remote " + remoteList);
LOGGER.debug("live " + gossipManager.getLiveMembers());
- LOGGER.debug("dead " + gossipManager.getDeadList());
+ LOGGER.debug("dead " + gossipManager.getDeadMembers());
}
} else {
LOGGER.debug("me " + gossipManager.getMyself());
LOGGER.debug("sender " + senderMember);
LOGGER.debug("remote " + remoteList);
LOGGER.debug("live " + gossipManager.getLiveMembers());
- LOGGER.debug("dead " + gossipManager.getDeadList());
+ LOGGER.debug("dead " + gossipManager.getDeadMembers());
// throw new IllegalArgumentException("wtf");
}
}
diff --git a/src/main/java/org/apache/gossip/manager/GossipManager.java b/src/main/java/org/apache/gossip/manager/GossipManager.java
index 9f75fe3..cd6e0a9 100644
--- a/src/main/java/org/apache/gossip/manager/GossipManager.java
+++ b/src/main/java/org/apache/gossip/manager/GossipManager.java
@@ -176,16 +176,6 @@
return me;
}
- public List<LocalGossipMember> getDeadList() {
- List<LocalGossipMember> up = new ArrayList<>();
- for (Entry<LocalGossipMember, GossipState> entry : members.entrySet()) {
- if (GossipState.DOWN.equals(entry.getValue())) {
- up.add(entry.getKey());
- }
- }
- return Collections.unmodifiableList(up);
- }
-
/**
* Starts the client. Specifically, start the various cycles for this protocol. Start the gossip
* thread and start the receiver thread.
diff --git a/src/main/java/org/apache/gossip/manager/PassiveGossipThread.java b/src/main/java/org/apache/gossip/manager/PassiveGossipThread.java
index 2e1fd81..b54a963 100644
--- a/src/main/java/org/apache/gossip/manager/PassiveGossipThread.java
+++ b/src/main/java/org/apache/gossip/manager/PassiveGossipThread.java
@@ -27,7 +27,8 @@
import org.apache.gossip.model.Base;
import org.apache.log4j.Logger;
-import org.codehaus.jackson.map.ObjectMapper;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
/**
* [The passive thread: reply to incoming gossip request.] This class handles the passive cycle,
diff --git a/src/main/java/org/apache/gossip/manager/SystemClock.java b/src/main/java/org/apache/gossip/manager/SystemClock.java
index 6d113b7..04a7080 100644
--- a/src/main/java/org/apache/gossip/manager/SystemClock.java
+++ b/src/main/java/org/apache/gossip/manager/SystemClock.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.gossip.manager;
public class SystemClock implements Clock {
diff --git a/src/main/java/org/apache/gossip/manager/Transport.java b/src/main/java/org/apache/gossip/manager/Transport.java
index 72b90df..d473e60 100644
--- a/src/main/java/org/apache/gossip/manager/Transport.java
+++ b/src/main/java/org/apache/gossip/manager/Transport.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.gossip.manager;
public class Transport {
diff --git a/src/main/java/org/apache/gossip/manager/UdpUtil.java b/src/main/java/org/apache/gossip/manager/UdpUtil.java
index a6a0174..c61769f 100644
--- a/src/main/java/org/apache/gossip/manager/UdpUtil.java
+++ b/src/main/java/org/apache/gossip/manager/UdpUtil.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.gossip.manager;
import java.nio.ByteBuffer;
diff --git a/src/main/java/org/apache/gossip/manager/random/RandomGossipManager.java b/src/main/java/org/apache/gossip/manager/random/RandomGossipManager.java
index e7e19da..26541ca 100644
--- a/src/main/java/org/apache/gossip/manager/random/RandomGossipManager.java
+++ b/src/main/java/org/apache/gossip/manager/random/RandomGossipManager.java
@@ -21,7 +21,6 @@
import org.apache.gossip.GossipSettings;
import org.apache.gossip.event.GossipListener;
import org.apache.gossip.manager.GossipManager;
-import org.apache.gossip.manager.impl.OnlyProcessReceivedPassiveGossipThread;
import java.net.URI;
import java.util.List;
diff --git a/src/main/java/org/apache/gossip/model/ActiveGossipOk.java b/src/main/java/org/apache/gossip/model/ActiveGossipOk.java
index 256ccd6..b54bf9a 100644
--- a/src/main/java/org/apache/gossip/model/ActiveGossipOk.java
+++ b/src/main/java/org/apache/gossip/model/ActiveGossipOk.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.gossip.model;
public class ActiveGossipOk extends Response {
diff --git a/src/main/java/org/apache/gossip/model/Base.java b/src/main/java/org/apache/gossip/model/Base.java
index 92b38cd..4551f2a 100644
--- a/src/main/java/org/apache/gossip/model/Base.java
+++ b/src/main/java/org/apache/gossip/model/Base.java
@@ -22,9 +22,11 @@
import org.apache.gossip.udp.UdpGossipDataMessage;
import org.apache.gossip.udp.UdpNotAMemberFault;
import org.apache.gossip.udp.UdpSharedGossipDataMessage;
-import org.codehaus.jackson.annotate.JsonSubTypes;
-import org.codehaus.jackson.annotate.JsonSubTypes.Type;
-import org.codehaus.jackson.annotate.JsonTypeInfo;
+
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
+
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
diff --git a/src/main/java/org/apache/gossip/model/Fault.java b/src/main/java/org/apache/gossip/model/Fault.java
index ea00ea0..3ba2508 100644
--- a/src/main/java/org/apache/gossip/model/Fault.java
+++ b/src/main/java/org/apache/gossip/model/Fault.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.gossip.model;
public abstract class Fault extends Response {
diff --git a/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java b/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java
index 383657d..49eac46 100644
--- a/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java
+++ b/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java
@@ -82,7 +82,7 @@
}
return total;
}
- }).afterWaitingAtMost(20, TimeUnit.SECONDS).isEqualTo(20);
+ }).afterWaitingAtMost(40, TimeUnit.SECONDS).isEqualTo(20);
// shutdown one client and verify that one client is lost.
Random r = new Random();
@@ -107,7 +107,7 @@
public Integer call() throws Exception {
int total = 0;
for (int i = 0; i < clusterMembers - 1; ++i) {
- total += clients.get(i).getGossipManager().getDeadList().size();
+ total += clients.get(i).getGossipManager().getDeadMembers().size();
}
return total;
}
diff --git a/src/test/java/org/apache/gossip/StartupSettingsTest.java b/src/test/java/org/apache/gossip/StartupSettingsTest.java
index 55c297b..1c0826b 100644
--- a/src/test/java/org/apache/gossip/StartupSettingsTest.java
+++ b/src/test/java/org/apache/gossip/StartupSettingsTest.java
@@ -18,7 +18,6 @@
package org.apache.gossip;
import org.apache.log4j.Logger;
-import org.json.JSONException;
import io.teknek.tunit.TUnit;
@@ -47,7 +46,7 @@
@Test
- public void testUsingSettingsFile() throws IOException, InterruptedException, JSONException, URISyntaxException {
+ public void testUsingSettingsFile() throws IOException, InterruptedException, URISyntaxException {
File settingsFile = File.createTempFile("gossipTest",".json");
log.debug( "Using settings file: " + settingsFile.getAbsolutePath() );
settingsFile.deleteOnExit();