trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arvi...@apache.org
Subject [1/2] incubator-trafodion git commit: TRAFODION-1736 REST server reports duplicate DCS connections
Date Wed, 06 Jan 2016 21:42:48 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 27dbcce2d -> 37849041f


TRAFODION-1736 REST server reports duplicate DCS connections


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a2041665
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a2041665
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a2041665

Branch: refs/heads/master
Commit: a204166570f235be8913c93b7a359d3fc0f004b1
Parents: fc9651f
Author: venkat1m <venkat.muthuswamy@esgyn.com>
Authored: Tue Jan 5 18:21:23 2016 +0000
Committer: venkat1m <venkat.muthuswamy@esgyn.com>
Committed: Tue Jan 5 18:21:23 2016 +0000

----------------------------------------------------------------------
 .../src/main/java/org/trafodion/rest/GetStatusResponse.java   | 2 +-
 core/rest/src/main/java/org/trafodion/rest/RESTServlet.java   | 7 +++++++
 .../java/org/trafodion/rest/provider/JAXBContextResolver.java | 1 -
 .../rest/provider/producer/PlainTextMessageBodyProducer.java  | 3 ---
 core/rest/src/main/java/org/trafodion/rest/util/ConfTool.java | 2 +-
 .../src/main/java/org/trafodion/rest/zookeeper/ZkClient.java  | 1 -
 6 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a2041665/core/rest/src/main/java/org/trafodion/rest/GetStatusResponse.java
----------------------------------------------------------------------
diff --git a/core/rest/src/main/java/org/trafodion/rest/GetStatusResponse.java b/core/rest/src/main/java/org/trafodion/rest/GetStatusResponse.java
index 4386922..eb2b96e 100644
--- a/core/rest/src/main/java/org/trafodion/rest/GetStatusResponse.java
+++ b/core/rest/src/main/java/org/trafodion/rest/GetStatusResponse.java
@@ -20,7 +20,7 @@
 *
 * @@@ END COPYRIGHT @@@                                                          */
 
-package org.trafodion.dcs.rest;
+package org.trafodion.rest;
 
 import java.io.IOException;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a2041665/core/rest/src/main/java/org/trafodion/rest/RESTServlet.java
----------------------------------------------------------------------
diff --git a/core/rest/src/main/java/org/trafodion/rest/RESTServlet.java b/core/rest/src/main/java/org/trafodion/rest/RESTServlet.java
index 5b53f21..6ae343a 100644
--- a/core/rest/src/main/java/org/trafodion/rest/RESTServlet.java
+++ b/core/rest/src/main/java/org/trafodion/rest/RESTServlet.java
@@ -165,6 +165,13 @@ public class RESTServlet implements RestConstants {
 
 	    if( ! children.isEmpty()) {
 	        for(String child : children) {
+	        	
+	        	//If dcsstop.sh is executed and rest server is not restarted, the nodes get appended
to the
+	        	//existing list and we end with duplicate entries for the same servers with different
timestamps
+	        	//Since the runningServers are only for the DcsServers, it is ok and not expensive
to reconstruct 
+	        	//the list every time
+	        	runningServers.clear();
+	        	
 	            //If stop-dcs.sh is executed and DCS_MANAGES_ZK then zookeeper is stopped abruptly.
 	            //Second scenario is when ZooKeeper fails for some reason regardless of whether
DCS
 	            //manages it. When either happens the DcsServer running znodes still exist in
ZooKeeper

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a2041665/core/rest/src/main/java/org/trafodion/rest/provider/JAXBContextResolver.java
----------------------------------------------------------------------
diff --git a/core/rest/src/main/java/org/trafodion/rest/provider/JAXBContextResolver.java
b/core/rest/src/main/java/org/trafodion/rest/provider/JAXBContextResolver.java
index 5f1d27d..36ecb5d 100644
--- a/core/rest/src/main/java/org/trafodion/rest/provider/JAXBContextResolver.java
+++ b/core/rest/src/main/java/org/trafodion/rest/provider/JAXBContextResolver.java
@@ -76,7 +76,6 @@ public class JAXBContextResolver implements ContextResolver<JAXBContext>
{
 		  cTypes);
 	}
 
-	@Override
 	public JAXBContext getContext(Class<?> objectType) {
 		return (types.contains(objectType)) ? context : null;
   }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a2041665/core/rest/src/main/java/org/trafodion/rest/provider/producer/PlainTextMessageBodyProducer.java
----------------------------------------------------------------------
diff --git a/core/rest/src/main/java/org/trafodion/rest/provider/producer/PlainTextMessageBodyProducer.java
b/core/rest/src/main/java/org/trafodion/rest/provider/producer/PlainTextMessageBodyProducer.java
index 1646ddd..3a7191e 100644
--- a/core/rest/src/main/java/org/trafodion/rest/provider/producer/PlainTextMessageBodyProducer.java
+++ b/core/rest/src/main/java/org/trafodion/rest/provider/producer/PlainTextMessageBodyProducer.java
@@ -66,13 +66,11 @@ public class PlainTextMessageBodyProducer
 
   private ThreadLocal<byte[]> buffer = new ThreadLocal<byte[]>();
 
-  @Override
   public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2,
       MediaType arg3) {
     return true;
   }
 
-	@Override
 	public long getSize(Object object, Class<?> type, Type genericType,
 			Annotation[] annotations, MediaType mediaType) {
     byte[] bytes = object.toString().getBytes(); 
@@ -80,7 +78,6 @@ public class PlainTextMessageBodyProducer
     return bytes.length;
 	}
 
-	@Override
 	public void writeTo(Object object, Class<?> type, Type genericType,
 			Annotation[] annotations, MediaType mediaType,
 			MultivaluedMap<String, Object> httpHeaders, OutputStream outStream)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a2041665/core/rest/src/main/java/org/trafodion/rest/util/ConfTool.java
----------------------------------------------------------------------
diff --git a/core/rest/src/main/java/org/trafodion/rest/util/ConfTool.java b/core/rest/src/main/java/org/trafodion/rest/util/ConfTool.java
index 124b8ed..3b837dc 100644
--- a/core/rest/src/main/java/org/trafodion/rest/util/ConfTool.java
+++ b/core/rest/src/main/java/org/trafodion/rest/util/ConfTool.java
@@ -21,7 +21,7 @@ under the License.
 * @@@ END COPYRIGHT @@@
  */
 
-package org.trafodion.dcs.util;
+package org.trafodion.rest.util;
 
 import org.apache.hadoop.conf.Configuration;
 import org.trafodion.rest.util.RestConfiguration;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a2041665/core/rest/src/main/java/org/trafodion/rest/zookeeper/ZkClient.java
----------------------------------------------------------------------
diff --git a/core/rest/src/main/java/org/trafodion/rest/zookeeper/ZkClient.java b/core/rest/src/main/java/org/trafodion/rest/zookeeper/ZkClient.java
index ef78d8e..dfd391b 100644
--- a/core/rest/src/main/java/org/trafodion/rest/zookeeper/ZkClient.java
+++ b/core/rest/src/main/java/org/trafodion/rest/zookeeper/ZkClient.java
@@ -173,7 +173,6 @@ public class ZkClient implements Watcher {
 		return zk;
 	}
 	
-	@Override
 	public void process(WatchedEvent event) {
 		if(event.getState() == Watcher.Event.KeeperState.SyncConnected) {
 			connectedSignal.countDown();


Mime
View raw message