[addressing-devel] FuraSrc/Server/Plugins/ServerPlugin/brokerplugin/src/com/gridsystems/serverbroke
Brought to you by:
nodens2k
From: Gridsystems C. <gsc...@us...> - 2008-09-03 21:27:52
|
Update of /cvsroot/fura/FuraSrc/Server/Plugins/ServerPlugin/brokerplugin/src/com/gridsystems/serverbroker/internal/api In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv8372/FuraSrc/Server/Plugins/ServerPlugin/brokerplugin/src/com/gridsystems/serverbroker/internal/api Modified Files: ApiServerBrokerImpl.java ServerBrokerListener.java ServerExecutorStatusWatchDog.java ServerExecutorWatchDog.java Log Message: cvssync-20080903232636 Index: ServerExecutorStatusWatchDog.java =================================================================== RCS file: /cvsroot/fura/FuraSrc/Server/Plugins/ServerPlugin/brokerplugin/src/com/gridsystems/serverbroker/internal/api/ServerExecutorStatusWatchDog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ServerExecutorStatusWatchDog.java 16 Jul 2008 06:55:48 -0000 1.3 --- ServerExecutorStatusWatchDog.java 3 Sep 2008 21:27:22 -0000 1.4 *************** *** 31,35 **** import com.gridsystems.resource.api.Resource; import com.gridsystems.resource.api.ResourceProperties; - import com.gridsystems.resource.api.ResourceUsage; import com.gridsystems.serverexecutor.api.ApiServerExecutor; --- 31,34 ---- *************** *** 91,96 **** try { ! AssignmentStatus[] resAssign = checkServerExecutorLock(api, r, name, ! true); // Update Assignment Status synchronized (ApiServerBrokerImpl.TOKEN_TO_UPDATE_MICROTASK) { --- 90,105 ---- try { ! ApiServerExecutor apiServer = null; ! apiServer = ServerBrokerUtils.getRemoteApiServer(name, -1); ! ! // Update Information of Server Executor in Resource List. ! AssignmentStatus[] resAssign = apiServer.status(); ! if (resAssign == null) { ! log ! .warn("The call to ApiServerExecutor::status() has returned null ?????"); ! resAssign = new AssignmentStatus[0]; ! } ! ! // checkServerExecutorLock(api, r, name, true); // Update Assignment Status synchronized (ApiServerBrokerImpl.TOKEN_TO_UPDATE_MICROTASK) { *************** *** 121,194 **** /** - * @param api Instance of ApiResourceQuery - * @param r Resource - * @param name Resource Name - * @param repeatCheck If repeatCheck - * @return List of assignment status. - * @throws Exception If error - */ - private AssignmentStatus[] checkServerExecutorLock(ApiResourceQuery api, - Resource r, String name, boolean repeatCheck) throws Exception { - - ApiServerExecutor apiServer = null; - apiServer = ServerBrokerUtils.getRemoteApiServer(name, -1); - - // Update Information of Server Executor in Resource List. - AssignmentStatus[] resAssign = apiServer.status(); - if (resAssign == null) { - log - .warn("The call to ApiServerExecutor::status() has returned null ?????"); - resAssign = new AssignmentStatus[0]; - } - - // If executor is working, OK - ResourceUsage ru = r.getUsage(); - if (resAssign.length != 0) { - return resAssign; - } - // Must have consistency between Broker and Executor. - if ((ru.getAssignments().length == 0) && (ru.isMoreAssignmentsAccepted()) - && (resAssign.length == 0)) { - return resAssign; - } - - log.warn("Inconsistency between Broker and Executor -> (ExecAssign: " - + resAssign.length + " | ResAssign=" + ru.getAssignments().length - + " | ResAcceptMore: " + ru.isMoreAssignmentsAccepted()); - - // Exists inconsistency between Broker and Executor. - if (repeatCheck) { - // Refresh values and retry test to avoid inconsistent states - // between transitional states - final long fiveSeconds = 5000; - Thread.sleep(fiveSeconds); - - r = api.getResource(r.getId()); - - resAssign = checkServerExecutorLock(api, r, name, false); - - } else { - // Inconsistency is persistent, we must unlock this state - try { - boolean acceptMore = apiServer.runAssignment(null, false); - - if (acceptMore) { - ApiResourceManager apiMan; - apiMan = ApiServerFactory.newApi(ApiResourceManager.class); - apiMan.setMoreAssignmentsAccepted(r.getId(), true); - log.warn("The ServerExecutor " + name + " was marked as " - + "No_Accept_More_Assign by ServerBroker," - + " but really the ServerExecutor is free."); - } - } catch (Exception ex) { - log.error("Cannot update resource properties of Server Executor " - + name, ex); - } - } - - return resAssign; - } - - /** * @todo Documentar * --- 130,133 ---- Index: ApiServerBrokerImpl.java =================================================================== RCS file: /cvsroot/fura/FuraSrc/Server/Plugins/ServerPlugin/brokerplugin/src/com/gridsystems/serverbroker/internal/api/ApiServerBrokerImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ApiServerBrokerImpl.java 23 Jul 2008 09:58:29 -0000 1.4 --- ApiServerBrokerImpl.java 3 Sep 2008 21:27:22 -0000 1.5 *************** *** 43,46 **** --- 43,47 ---- import com.gridsystems.module.api.ApiModuleManager; import com.gridsystems.module.api.ApiPlatformManager; + import com.gridsystems.module.api.DownloadPolicy; import com.gridsystems.module.api.Platform; import com.gridsystems.resource.ResourcePlugin; *************** *** 472,475 **** --- 473,479 ---- resProp.setOnOverloadPolicy(ResourceProperties.ON_OVERLOAD_IGNORE); + // @todo Case 11073 + resProp.setSupportedResultFilterPolicies(new String[]{DownloadPolicy.POLICY_FINAL}); + return resProp; } Index: ServerExecutorWatchDog.java =================================================================== RCS file: /cvsroot/fura/FuraSrc/Server/Plugins/ServerPlugin/brokerplugin/src/com/gridsystems/serverbroker/internal/api/ServerExecutorWatchDog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ServerExecutorWatchDog.java 17 Jun 2008 17:18:58 -0000 1.2 --- ServerExecutorWatchDog.java 3 Sep 2008 21:27:22 -0000 1.3 *************** *** 330,334 **** computeIfAcceptMoreAssignments); computeIfAcceptMoreAssignments = false; ! ServerBrokerUtils.markServerExecutorAcceptMore(resId, acceptMoreAssignments); } catch (Exception e) { String task = amt.getTask().getId(); --- 330,337 ---- computeIfAcceptMoreAssignments); computeIfAcceptMoreAssignments = false; ! if (acceptMoreAssignments) { ! ServerBrokerUtils.markServerExecutorAcceptMore(resId, acceptMoreAssignments); ! } ! // If acceptMoreAssignments == false then it will exit of this iteration. } catch (Exception e) { String task = amt.getTask().getId(); Index: ServerBrokerListener.java =================================================================== RCS file: /cvsroot/fura/FuraSrc/Server/Plugins/ServerPlugin/brokerplugin/src/com/gridsystems/serverbroker/internal/api/ServerBrokerListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ServerBrokerListener.java 16 Jul 2008 06:55:48 -0000 1.2 --- ServerBrokerListener.java 3 Sep 2008 21:27:22 -0000 1.3 *************** *** 260,264 **** */ @Override ! public void afterAssignmentStart(ResourceEvent arg0) { } --- 260,285 ---- */ @Override ! public void afterAssignmentStart(ResourceEvent event) { ! ResourceId resId = event.getResource(); ! if (!ApiServerBroker.RESOURCE_TYPE.equals(resId.getResourceType())) { ! return; ! } ! // 1.- Checks ! String name = resId.getResourceName(); ! ServerExecutor se = ServerExecutorList.getInstance().get(name); ! if (se == null) { ! return; ! } ! // 2.- Mark this shell as occupied. ! try { ! if (log.isDebugEnabled()) { ! log.debug("ResourceAssignment " + event.getResourceAssignment() ! + " assigned to server resource " + resId ! + ": Setting acceptmoreAssignment to false."); ! } ! ServerBrokerUtils.markServerExecutorAcceptMore(resId, false); ! } catch (Exception e) { ! log.error("afterAssignmentStart() error", e); ! } } |