hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhuvnesh2...@apache.org
Subject [47/48] incubator-hawq git commit: HAWQ-620. remove useless codes in resourcebroker_NONE.c
Date Mon, 04 Apr 2016 05:09:51 GMT
HAWQ-620. remove useless codes in resourcebroker_NONE.c


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

Branch: refs/heads/HAWQ-617
Commit: e8fcfb0c0b350ec83d9cb30a2510993b68e00fc7
Parents: bc0904a
Author: Wen Lin <wlin@pivotal.io>
Authored: Fri Apr 1 20:36:21 2016 +0800
Committer: Wen Lin <wlin@pivotal.io>
Committed: Fri Apr 1 20:36:21 2016 +0800

----------------------------------------------------------------------
 .../resourcebroker/resourcebroker_NONE.c        | 70 --------------------
 1 file changed, 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e8fcfb0c/src/backend/resourcemanager/resourcebroker/resourcebroker_NONE.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcebroker/resourcebroker_NONE.c b/src/backend/resourcemanager/resourcebroker/resourcebroker_NONE.c
index 97e8d37..627356e 100644
--- a/src/backend/resourcemanager/resourcebroker/resourcebroker_NONE.c
+++ b/src/backend/resourcemanager/resourcebroker/resourcebroker_NONE.c
@@ -137,76 +137,6 @@ int RB_NONE_acquireResource(uint32_t memorymb, uint32_t core, List *preferred)
 		}
 	}
 
-	/*
-	 * Then if we need more containers, round-robin strategy is implemented.
-	 */
-	while( contactcount < contcount )
-	{
-
-		hasallocated = false;
-		for (int i = 0 ; i < hostcount ; ++i)
-		{
-
-		     RoundRobinIndex = RoundRobinIndex >= hostcount-1 ?
-		    		 	       0 :
-							   RoundRobinIndex + 1;
-
-			/* Get the host currently indexed. */
-			SegResource segres = getSegResource(RoundRobinIndex);
-			if ( segres == NULL )
-			{
-				continue;
-			}
-
-			char *hostname = GET_SEGRESOURCE_HOSTNAME(segres);
-
-			elog(DEBUG5, "NONE mode resource broker tries host %s.", hostname);
-
-			/* The host must be HAWQ available and not RUAlive pending. */
-			if ( !IS_SEGRESOURCE_USABLE(segres))
-			{
-				continue;
-			}
-
-			/* Check the pending resource quota to avoid allocating too much. */
-			if ( segres->Stat->FTSTotalMemoryMB -
-				 segres->Allocated.MemoryMB -
-				 segres->IncPending.MemoryMB >= contmemorymb &&
-				 segres->Stat->FTSTotalCore -
-				 segres->Allocated.Core -
-				 segres->IncPending.Core >= 1 )
-			{
-				hasallocated = true;
-
-				elog(DEBUG3, "NONE mode resource broker chooses host %s to allocate "
-							 "resource (%d MB, 1 CORE).",
-							 hostname,
-							 contmemorymb);
-
-				newcontainer = createGRMContainer(ContainerIDCounter,
-												  contmemorymb,
-												  1,
-												  hostname,
-											      segres);
-				contactcount++;
-				ContainerIDCounter++;
-				break;
-			}
-		}
-
-		if ( !hasallocated ) {
-			break; /* May be not fully satisfied. */
-		}
-
-		/*
-		 * Add the new container into resource pool. In NONE mode, we expect
-		 * HAWQ RM always can successfully add the container into its resource
-		 * pool.
-		 */
-		Assert(newcontainer != NULL);
-		addGRMContainerToToBeAccepted(newcontainer);
-	}
-
 	elog(LOG, "NONE mode resource broker allocated containers "
 			  "(%d MB, %d CORE) x %d. Expected %d containers.",
 				contmemorymb,


Mime
View raw message