You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2016/06/26 11:18:28 UTC

svn commit: r1750244 - in /uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator: OrchestratorCommonArea.java jd/scheduler/JdScheduler.java

Author: degenaro
Date: Sun Jun 26 11:18:28 2016
New Revision: 1750244

URL: http://svn.apache.org/viewvc?rev=1750244&view=rev
Log:
UIMA-4989 Fix problems found by FindBugs

Modified:
    uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/OrchestratorCommonArea.java
    uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/jd/scheduler/JdScheduler.java

Modified: uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/OrchestratorCommonArea.java
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/OrchestratorCommonArea.java?rev=1750244&r1=1750243&r2=1750244&view=diff
==============================================================================
--- uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/OrchestratorCommonArea.java (original)
+++ uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/OrchestratorCommonArea.java Sun Jun 26 11:18:28 2016
@@ -189,7 +189,7 @@ public class OrchestratorCommonArea {
 		DuccWorkMap ckptWorkMap;
 		ConcurrentHashMap<DuccId,DuccId> ckptProcessToJobMap;
 		TrackSync ts = TrackSync.await(workMap, this.getClass(), methodName);
-		synchronized(workMap) {
+		synchronized(this) {
 			ts.using();
 			ckptWorkMap = (DuccWorkMap)SerializationUtils.clone(workMap);
 			ckptProcessToJobMap = (ConcurrentHashMap<DuccId,DuccId>)SerializationUtils.clone(processAccounting.getProcessToJobMap());
@@ -201,7 +201,7 @@ public class OrchestratorCommonArea {
 	public void setCheckpointable(Checkpointable checkpointable) {
 		String methodName = "setCheckpointable";
 		TrackSync ts = TrackSync.await(workMap, this.getClass(), methodName);
-		synchronized(workMap) {
+		synchronized(this) {
 			ts.using();
 			workMap = checkpointable.getWorkMap();
 			processAccounting = new ProcessAccounting(checkpointable.getProcessToJobMap());

Modified: uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/jd/scheduler/JdScheduler.java
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/jd/scheduler/JdScheduler.java?rev=1750244&r1=1750243&r2=1750244&view=diff
==============================================================================
--- uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/jd/scheduler/JdScheduler.java (original)
+++ uima/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/jd/scheduler/JdScheduler.java Sun Jun 26 11:18:28 2016
@@ -253,7 +253,7 @@ public class JdScheduler {
 		long slicesReserveDesired = getSlicesReserveDesired(jdHostProperties);
 		long slicesReserveActual = getSlicesReserveActual();
 		if(map.size() > 1) {
-			synchronized(map) {
+			synchronized(this) {
 				for(Entry<DuccId, JdReservation> entry : map.entrySet()) {
 					JdReservation jdReservation = entry.getValue();
 					if(jdReservation.isEmpty()) {
@@ -356,7 +356,7 @@ public class JdScheduler {
 	private void reservationDivest(IDuccWorkMap dwm, JdHostProperties jdHostProperties) {
 		String location = "reservationDivest";
 		DuccId jdReservationDuccId = null;
-		synchronized(map) {
+		synchronized(this) {
 			for(Entry<DuccId, JdReservation> entry : map.entrySet()) {
 				JdReservation jdReservation = entry.getValue();
 				if(jdReservation.isEmpty()) {
@@ -450,7 +450,7 @@ public class JdScheduler {
 		JdReservation jdReservation = null;
 		SizeBytes reservationSize = JdHelper.getReservationSize(dwr);
 		SizeBytes sliceSize = JdHelper.getSliceSize(jdHostProperties);
-		synchronized(map) {
+		synchronized(this) {
 			jdReservation = map.get(jdReservationDuccId);
 			if(jdReservation == null) {
 				jdReservation = new JdReservation(dwr, reservationSize, sliceSize);
@@ -477,7 +477,7 @@ public class JdScheduler {
 		DuccId jdReservationDuccId = (DuccId) duccId;
 		JdReservation jdReservation = null;
 		List<JdReservation> list = new ArrayList<JdReservation>();
-		synchronized(map) {
+		synchronized(this) {
 			jdReservation = map.get(jdReservationDuccId);
 			if(jdReservation != null) {
 				map.remove(jdReservationDuccId);
@@ -499,7 +499,7 @@ public class JdScheduler {
 		JdReservation jdReservation = null;
 		SizeBytes reservationSize = JdHelper.getReservationSize(dwr);
 		SizeBytes sliceSize = JdHelper.getSliceSize(jdHostProperties);
-		synchronized(map) {
+		synchronized(this) {
 			jdReservation = map.get(jdReservationDuccId);
 			if(jdReservation == null) {
 				jdReservation = new JdReservation(dwr, reservationSize, sliceSize);
@@ -514,7 +514,7 @@ public class JdScheduler {
 	private void reservationVanished(DuccId jdReservationDuccId) {
 		String location = "reservationVanished";
 		List<JdReservation> list = new ArrayList<JdReservation>();
-		synchronized(map) {
+		synchronized(this) {
 			JdReservation jdReservation = map.get(jdReservationDuccId);
 			if(jdReservation != null) {
 				jdReservation = map.remove(jdReservationDuccId);
@@ -559,7 +559,7 @@ public class JdScheduler {
 		NodeIdentity nodeIdentity = null;
 		if(jdId != null) {
 			String host = null;
-			synchronized(map) {
+			synchronized(this) {
 				for(Entry<DuccId, JdReservation> entry : map.entrySet()) {
 					JdReservation jdReservation = entry.getValue();
 					nodeIdentity = jdReservation.allocate(jdId, jobId);
@@ -585,7 +585,7 @@ public class JdScheduler {
 		if(jdId != null) {
 			String host = null;
 			logger.debug(location, jobId, "map size: "+map.size());
-			synchronized(map) {
+			synchronized(this) {
 				for(Entry<DuccId, JdReservation> entry : map.entrySet()) {
 					JdReservation jdReservation = entry.getValue();
 					logger.debug(location, jobId, "get host: "+jdReservation.getHost());