hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From y...@apache.org
Subject incubator-hawq git commit: HAWQ-451. Remove dead code in utilities of resource manager
Date Thu, 25 Feb 2016 02:06:35 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 51073e4d3 -> 2f5980b81


HAWQ-451. Remove dead code in utilities of resource manager


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

Branch: refs/heads/master
Commit: 2f5980b81ecc75fb74e060b2b21e136dc93afacc
Parents: 51073e4
Author: YI JIN <yjin@pivotal.io>
Authored: Thu Feb 25 13:06:16 2016 +1100
Committer: YI JIN <yjin@pivotal.io>
Committed: Thu Feb 25 13:06:16 2016 +1100

----------------------------------------------------------------------
 .../communication/rmcomm_QD2RM.c                |   1 -
 .../resourcemanager/include/utils/balancedbst.h |   8 +-
 .../include/utils/filesystem_utils.h            |  69 ------
 .../resourcemanager/include/utils/hashtable.h   |   5 +-
 .../include/utils/kvproperties.h                |  18 --
 .../resourcemanager/include/utils/linkedlist.h  |  57 -----
 .../include/utils/memutilities.h                |   7 -
 .../include/utils/network_utils.h               |   7 -
 .../include/utils/nullablebool.h                |  31 ---
 .../resourcemanager/include/utils/pair.h        |   6 -
 .../include/utils/simplestring.h                |  34 ---
 src/backend/resourcemanager/utils/Makefile      |   3 +-
 src/backend/resourcemanager/utils/balancedbst.c |  76 +-----
 .../resourcemanager/utils/filesystem_utils.c    |  78 ------
 src/backend/resourcemanager/utils/hashtable.c   |  14 +-
 .../resourcemanager/utils/kvproperties.c        | 113 ---------
 src/backend/resourcemanager/utils/linkedlist.c  | 237 -------------------
 .../resourcemanager/utils/memutilities.c        |  30 ---
 .../resourcemanager/utils/network_utils.c       |  69 ------
 .../resourcemanager/utils/simplestring.c        | 112 ---------
 20 files changed, 13 insertions(+), 962 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/communication/rmcomm_QD2RM.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/communication/rmcomm_QD2RM.c b/src/backend/resourcemanager/communication/rmcomm_QD2RM.c
index 7d1df87..65837a2 100644
--- a/src/backend/resourcemanager/communication/rmcomm_QD2RM.c
+++ b/src/backend/resourcemanager/communication/rmcomm_QD2RM.c
@@ -22,7 +22,6 @@
 #include "utils/memutilities.h"
 #include "utils/simplestring.h"
 #include "utils/linkedlist.h"
-#include "utils/nullablebool.h"
 #include "nodes/pg_list.h"
 #include "commands/defrem.h"
 #include "pgstat.h"

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/balancedbst.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/balancedbst.h b/src/backend/resourcemanager/include/utils/balancedbst.h
index 3fe5300..fe67ad8 100644
--- a/src/backend/resourcemanager/include/utils/balancedbst.h
+++ b/src/backend/resourcemanager/include/utils/balancedbst.h
@@ -88,7 +88,6 @@ int  	 getBalanceFactor(BBSTNode node);
 
 /* Node creation/free helper */
 BBSTNode createBBSTNode(BBST tree, void *data);
-void     freeBBSTNode(BBST tree, BBSTNode node);
 BBSTNode getBBSTNode(BBST tree, void *data);
 
 /* Insert / Remove one node identified by the node address node */
@@ -100,16 +99,15 @@ int		 reorderBBSTNodeData(BBST tree, void *data);
 /* Get count of node with no less value than specified criterion */
 int countBBSTNodeNoLessThan(BBST tree, void * critirion);
 
+/*
+void     freeBBSTNode(BBST tree, BBSTNode node);
 void     freeBBST(BBST tree);
 void     clearBBST(BBST tree);
-void	 freeBBSTFreeNodes(BBST tree);
+*/
 
 /* Get node */
-BBSTNode getRightMostNode(BBST tree);
 BBSTNode getLeftMostNode(BBST tree);
 
-int getMaxDepthofBBST(BBST tree);
-int traverseBBSTPreOrder(BBST tree, DQueue lines, int maxcount);
 int traverseBBSTMidOrder(BBST tree, DQueue lines);
 
 #endif //BALANCED_BINARY_SEARCH_TREE_H

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/filesystem_utils.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/filesystem_utils.h b/src/backend/resourcemanager/include/utils/filesystem_utils.h
deleted file mode 100644
index 3bb474f..0000000
--- a/src/backend/resourcemanager/include/utils/filesystem_utils.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef RESOURCE_MANAGER_FILE_UTILITIES_H
-#define RESOURCE_MANAGER_FILE_UTILITIES_H
-#include "envswitch.h"
-
-/**
- *         |<----------- 64 bits (8 bytes) ----------->|
- * 		   +---------------------+----+-----+----+-----+
- * 		   |    Instance Size	 | D  | E   | R  |  W  |
- * 		   +---------------------+----+-----+----+-----+
- * 		   |       Name Len      | Acc Mask | Reserved |
- * 		   +---------------------+----------+----------+
- *         |           Write Bytes per second          |
- *         +-------------------------------------------+
- *         |           Read  Bytes per second          |
- *         +-------------------------------------------+
- *		   |           Name string                     |
- *		   |                                           |
- *		   +-------------------------------------------+
- */
-
-enum UINT8_STAT_VALUES {
-	STAT_FALSE = 0,
-	STAT_TRUE  = 1,
-	STAT_UNSET = 0xFF
-};
-
-struct FileConfigurationData {
-	uint32_t	InstanceSize;
-	uint8_t		isDirectory;
-	uint8_t 	Exist;
-	uint8_t 	Readable;
-	uint8_t 	Writable;
-	uint32_t 	FileNameLength;
-	uint16_t	AccessMask;
-	uint16_t	Reserved;
-	double		WriteBytesPerSec;
-	double		ReadBytesPerSec;
-	char		FileName[1];
-};
-
-typedef struct FileConfigurationData  *FileConfiguration;
-typedef struct FileConfigurationData   FileConfigurationData;
-
-#define UTIL_FILESYSTEM_FAIL_GET_FILESTAT 1
-
-FileConfiguration createFileConfiguration(MCTYPE context, char *filename);
-
-int updateFileConfigurationAsLocalFile(FileConfiguration fileconfig, bool testio);
-
-#endif /* RESOURCE_MANAGER_FILE_UTILITIES_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/hashtable.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/hashtable.h b/src/backend/resourcemanager/include/utils/hashtable.h
index 269e4b8..dd29809 100644
--- a/src/backend/resourcemanager/include/utils/hashtable.h
+++ b/src/backend/resourcemanager/include/utils/hashtable.h
@@ -133,10 +133,9 @@ PAIR	  getHASHTABLENode	  ( HASHTABLE table, void *key );
 int	  	  removeHASHTABLENode ( HASHTABLE table, void *key );
 void	  clearHASHTABLE	  ( HASHTABLE table );
 void	  cleanHASHTABLE	  ( HASHTABLE table );
+/*
 void	  freeHASHTABLE		  ( HASHTABLE table );
-uint32_t  getHASHTABLESize    ( HASHTABLE table );
-uint32_t  getHASHTABLEVolume  ( HASHTABLE table );
-
+*/
 void	  extendHASHTABLESlotSize ( HASHTABLE table, int newsize );
 void	  getAllPAIRRefIntoList   ( HASHTABLE table, List **list );
 void 	  freePAIRRefList		  ( HASHTABLE table, List **list );

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/kvproperties.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/kvproperties.h b/src/backend/resourcemanager/include/utils/kvproperties.h
index 470cd30..e20d2ff 100644
--- a/src/backend/resourcemanager/include/utils/kvproperties.h
+++ b/src/backend/resourcemanager/include/utils/kvproperties.h
@@ -77,12 +77,6 @@ KVProperty createPropertyBool(MCTYPE  		context,
 							  int	 	   *index,
 							  Oid	  		value);
 
-KVProperty createPropertyText(MCTYPE  		context,
-							  const char   *tag1,
-							  const char   *tag2,
-							  int	 	   *index,
-							  text	  	   *value);
-
 KVProperty createPropertyString(MCTYPE  	  context,
 							    const char   *tag1,
 							    const char   *tag2,
@@ -100,16 +94,4 @@ void buildDottedPropertyNameString(SimpStringPtr 	 string,
 								   const char 		*tag2,
 								   int  			*index);
 
-int parseRangeTupleBracket(MCTYPE			  context,
-						   Datum 			  textdatum,
-						   bool 			  isNull,
-						   const char 		**p1,
-						   const char 		**p2);
-
-int parseRangeTextBracket (MCTYPE 	 	  	  context,
-						   char 			 *text,
-						   bool 		 	  isNull,
-						   const char 		**p1,
-						   const char 		**p2);
-
 #endif /* _KEY_VALUE_PROPERTIES_PROCESSOR_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/linkedlist.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/linkedlist.h b/src/backend/resourcemanager/include/utils/linkedlist.h
index b55e0f3..4d00aa5 100644
--- a/src/backend/resourcemanager/include/utils/linkedlist.h
+++ b/src/backend/resourcemanager/include/utils/linkedlist.h
@@ -66,10 +66,6 @@ struct DQueueData {
 /* Create one DQueue */
 DQueue  createDQueue(MCTYPE context);
 void    initializeDQueue(DQueue list, MCTYPE context);
-bool    isDQueueInitialized(DQueue list);
-/* Free one DQueue instance */
-void  freeDQueue(DQueue list);
-//void  freeDQueueWithFree(DQueue list, FreeObjectFuncType func);
 
 void cleanDQueue(DQueue list);
 
@@ -88,11 +84,6 @@ void *removeDQueueHeadNode(DQueue list);
 void *removeDQueueTailNode(DQueue list);
 void  removeAllDQueueNodes(DQueue list);
 
-//void  removeAllDQueueNodesWithFree(DQueue list, FreeObjectFuncType func);
-
-/* Generate string info of the whole list status. */
-void  buildDQueueReport	  (DQueue list, char *buffer, int bufferlen);
-
 /* Macro for building a loop for processing each data node */
 #define DQUEUE_LOOP_BEGIN(list, iter, valuetype, value) 					  \
 		for( DQueueNode (iter) = getDQueueContainerHead((list)) ; 			  \
@@ -103,52 +94,4 @@ void  buildDQueueReport	  (DQueue list, char *buffer, int bufferlen);
 #define DQUEUE_LOOP_END														  \
 		}
 
-void swapDQueues(DQueue list1, DQueue list2);
-
-DQueueNode getDQueueNodeByIndex(DQueue list, int index);
-/******************************************************************************
- * thread-safe linked-list.
- *****************************************************************************/
-struct DSafeQueueData {
-	DQueueData			Queue;
-	pthread_mutex_t		Lock;				/* lock for race condition.		  */
-	volatile int32_t	QueueLength;
-};
-
-typedef struct DSafeQueueData     *DSafeQueue;
-typedef struct DSafeQueueData     DSafeQueueData;
-
-/* Create one DQueue */
-DSafeQueue  createDSafeQueue(MCTYPE context);
-void    	initializeDSafeQueue(DSafeQueue list, MCTYPE context);
-
-/* Free one DQueue instance */
-void  freeDSafeQueue(DSafeQueue list);
-//void  freeDSafeQueueWithFree(DSafeQueue list, FreeObjectFuncType func);
-
-void  cleanDSafeQueue(DSafeQueue list);
-
-/* Get node data */
-void  moveDQueueNodeOut(DSafeQueue list, DQueue target, int max, bool fromhead);
-void  moveDQueueNodeIn(DSafeQueue list, DQueue source, bool tohead);
-
-/* Get DQueue length ( node count ) for logging etc. */
-#define getDSafeQueueLength(list) ((list)->QueueLength)
-
-/* Externally lock/unlock the list. */
-void lockDSafeQueue(DSafeQueue list);
-void unlockDSafeQueue(DSafeQueue list);
-DQueue getDSafeQueueQueue(DSafeQueue list);
-
-
-/* Insert / Remove one node at the head of DQueue. */
-void  insertDSafeQueueHeadNode(DSafeQueue list, void *data);
-void  insertDSafeQueueTailNode(DSafeQueue list, void *data);
-void *removeDSafeQueueNode	  (DSafeQueue list, DQueueNode node);
-void *removeDSafeQueueHeadNode(DSafeQueue list);
-void  removeAllDSafeQueueNodes(DSafeQueue list);
-
-/* Generate string info of the whole list status. */
-void  buildDSafeQueueReport	  (DSafeQueue list, char *buffer, int bufferlen);
-
 #endif //SINGLE_DIRECTION_LINKED_LIST_H

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/memutilities.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/memutilities.h b/src/backend/resourcemanager/include/utils/memutilities.h
index 0e765ae..d5f02d6 100644
--- a/src/backend/resourcemanager/include/utils/memutilities.h
+++ b/src/backend/resourcemanager/include/utils/memutilities.h
@@ -75,8 +75,6 @@ void *_rm_repalloc (MCTYPE context, void *ptr,
 void  _rm_pfree    (MCTYPE context, void *ptr,
 					const char *filename, int line, const char *function);
 
-uint64_t gettime_cost_microsec(void);
-
 /******************************************************************************
  *  Self-grow buffer.
  *
@@ -149,10 +147,5 @@ void deleteSelfMaintainBuffer(SelfMaintainBuffer buffer);
 
 void appendSelfMaintainBufferTill64bitAligned(SelfMaintainBuffer buffer);
 
-void swapSelfMaintainBuffer(SelfMaintainBuffer buffer1,
-							SelfMaintainBuffer buffer2);
-void copySelfMaintainBuffer(SelfMaintainBuffer buffer1,
-							SelfMaintainBuffer buffer2);
-
 void shiftLeftSelfMaintainBuffer(SelfMaintainBuffer buffer, int shift);
 #endif /* RESOURCE_MANAGER_UTIL_MEMORY_UTILITIES_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/network_utils.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/network_utils.h b/src/backend/resourcemanager/include/utils/network_utils.h
index eabab18..01a817a 100644
--- a/src/backend/resourcemanager/include/utils/network_utils.h
+++ b/src/backend/resourcemanager/include/utils/network_utils.h
@@ -30,11 +30,6 @@
 /******************************************************************************
  * miscs
  *****************************************************************************/
-int hostname_to_ipaddressstr(const char *hostname, char *ip );
-//int hostname_to_ipaddress4bytes(const char *hostname, uint8_t nums[4] );
-int ipaddressstr_to_4bytes(const char *ip, uint8_t nums[4]);
-int ipaddress4bytes_to_str(uint8_t nums[4], char *ip);
-
 #define SOCKADDR(addr) inet_ntoa(((struct sockaddr_in *)(addr))->sin_addr)
 #define SOCKPORT(addr) ((struct sockaddr_in *)(addr))->sin_port
 
@@ -91,7 +86,6 @@ typedef struct HostAddressData 		*HostAddress;
 #define HOST_ADDRESS_TYPE_IPV6			0X1
 #define HOST_ADDRESS_CONTENT_STRING		0X2
 
-HostAddress createHostAddressAsStringFromIPV4Address(MCTYPE context, uint32_t addr);
 HostAddress createHostAddressAsStringFromIPV4AddressStr(MCTYPE context, const char *addr);
 void freeHostAddress(MCTYPE context, HostAddress addr);
 /* In case we have only host name of a remote machine, we need this one to find
@@ -106,7 +100,6 @@ void freeHostIPV4AddressesAsString(MCTYPE context, List **addresses);
 int getLocalHostName(SimpStringPtr hostname);
 
 int getLocalHostAllIPAddressesAsStrings(DQueue addresslist);
-int getLocalHostAllIPAddresses(DQueue addresslist);
 
 bool AddressStringComp(AddressString addr1, AddressString addr2);
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/nullablebool.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/nullablebool.h b/src/backend/resourcemanager/include/utils/nullablebool.h
deleted file mode 100644
index fec8d0a..0000000
--- a/src/backend/resourcemanager/include/utils/nullablebool.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef RESOURCE_MANANGER_NULLABLE_BOOL_UTILITIES_H
-#define RESOURCE_MANANGER_NULLABLE_BOOL_UTILITIES_H
-
-enum NBOOL {
-	BUNSET = -1,
-	BFALSE = 0,
-	BTRUE = 1
-};
-
-typedef enum NBOOL NBOOL;
-
-#endif /* RESOURCE_MANANGER_NULLABLE_BOOL_UTILITIES_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/pair.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/pair.h b/src/backend/resourcemanager/include/utils/pair.h
index 666c65b..9bd4399 100644
--- a/src/backend/resourcemanager/include/utils/pair.h
+++ b/src/backend/resourcemanager/include/utils/pair.h
@@ -31,12 +31,6 @@ struct PAIRData {
 typedef struct PAIRData *PAIR;
 typedef struct PAIRData  PAIRData;
 
-//#define PAIR_KEYASUINT32(pair) 		((uint32_t)((pair)->Key))
-//#define PAIR_KEYASVOIDPT(pair) 		((void *)  ((pair)->Key))
-//#define PAIR_KEYASSTRING(pair) ((void *)  ((pair)->Key))
-
-//#define PAIR_VALUEASVOIDPT(pair) 	((void *)  ((pair)->Value))
-
 PAIR createPAIR(MCTYPE context, void *key, void *value);
 void freePAIR(PAIR pair);
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/include/utils/simplestring.h
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/include/utils/simplestring.h b/src/backend/resourcemanager/include/utils/simplestring.h
index 13d4252..d039de4 100644
--- a/src/backend/resourcemanager/include/utils/simplestring.h
+++ b/src/backend/resourcemanager/include/utils/simplestring.h
@@ -43,39 +43,24 @@ void initSimpleStringWithContent( SimpStringPtr str,
 					  	  	  	  MCTYPE 	    context,
 					  	  	  	  char 		   *content,
 					  	  	  	  int 		    length);
-
-void initSimpleStringFilled( SimpStringPtr str,
-							 MCTYPE 	   context,
-							 uint8_t 	   val,
-							 int 	 	   length);
-
 /* set string value. */
-
 void setSimpleStringWithContent( SimpStringPtr  str,
 					  	  	 	 char		   *content,
 					  	  	 	 int		    length);
 
-void setSimpleStringFilled( SimpStringPtr  str,
-							uint8_t        val,
-							int			   length);
-
 /* free simple string with allocated content. */
 void freeSimpleStringContent(SimpStringPtr str);
 
 /* Reference one existing buffer without memory allocation. */
 void setSimpleStringRef(SimpStringPtr str, char *content, int length);
-void clearSimpleStringRef(SimpStringPtr str);
 
 /* string operations. */
 int  SimpleStringFind(SimpStringPtr str, char *target);
 int  SimpleStringComp(SimpStringPtr str, char *target);
-int  SimpleStringCaseComp(SimpStringPtr str, char *target);
 void SimpleStringCopy(SimpStringPtr str, SimpString *source);
 void SimpleStringFill(SimpStringPtr str, int start, int length, uint8_t val);
 bool SimpleStringEmpty(SimpStringPtr str);
 int  SimpleStringLocateChar(SimpStringPtr str, char target, int *location);
-void SimpleStringReplaceChar(SimpStringPtr str, char oldchar, char newchar);
-void SimpleStringReplaceFirst(SimpStringPtr str, char *oldstr, char *newstr);
 /* string to the other number values. */
 int  SimpleStringToInt8(SimpStringPtr str, int8_t *value);
 int  SimpleStringToInt32(SimpStringPtr str, int32_t *value);
@@ -129,23 +114,6 @@ void freeSimpleStringTokens(SimpStringPtr   owner,
 #define setSimpleStringRefNoLen(str, content) \
 		setSimpleStringRef((str),(content),strlen((content)))
 
-/* Serialization and de-serialization */
-
-/*-----------------------------------------------------------------------------
- *
- *  Format: ( 8-byte aligned memory block. )
- *         ---------------------------------------------
- *         |   Length(int32)     | string              |
- *         +----------------------                     +
- * 		   |                                           |
- * 		   ---------------------------------------------
- *
- *---------------------------------------------------------------------------*/
-
-int  deserializeToSimpleString(SimpStringPtr str, char *content);
-int  serializeFromSimpleString(SimpStringPtr str, char *content);
-int  serializationSize(SimpStringPtr str);
-
 struct SimpArray
 {
 	MCTYPE				Context;
@@ -157,8 +125,6 @@ typedef struct SimpArray  SimpArray;
 typedef struct SimpArray *SimpArrayPtr;
 
 SimpArrayPtr createSimpleArray(MCTYPE context);
-/* initialize string. */
-void initSimpleArray(SimpArrayPtr array, MCTYPE context);
 
 /* set array value. */
 void setSimpleArrayWithContent( SimpArrayPtr  array,

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/Makefile
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/Makefile b/src/backend/resourcemanager/utils/Makefile
index 33fe10c..daf64d2 100644
--- a/src/backend/resourcemanager/utils/Makefile
+++ b/src/backend/resourcemanager/utils/Makefile
@@ -37,8 +37,7 @@ OBJS = balancedbst.o \
 	   simplestring.o \
 	   network_utils.o \
 	   memutilities.o \
-	   kvproperties.o \
-	   filesystem_utils.o
+	   kvproperties.o 
 
 include $(top_srcdir)/src/backend/common.mk
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/balancedbst.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/balancedbst.c b/src/backend/resourcemanager/utils/balancedbst.c
index b4f2c16..69a90f7 100644
--- a/src/backend/resourcemanager/utils/balancedbst.c
+++ b/src/backend/resourcemanager/utils/balancedbst.c
@@ -79,8 +79,6 @@ shiftupCalculateChildCountAndDepth(node)                                       \
 void rotateNodeBelowRight(BBSTNode nodea, BBSTNode *nodeptr);
 void rotateNodeBelowLeft(BBSTNode nodea, BBSTNode *nodeptr);
 void rebalanceBBST(BBST tree, BBSTNode node);
-int  getDepthOfBBST(BBSTNode ptr);
-
 
 /*
  * Get balance factor of one BBST node, if the factor is less than 0, the right
@@ -354,6 +352,8 @@ BBSTNode createBBSTNode(BBST tree, void *data)
 /*
  * Free one BBST node and save it in the free list of the BBST.
  */
+
+/*
 void freeBBSTNode(BBST tree, BBSTNode node)
 {
 
@@ -370,6 +370,7 @@ void freeBBSTNode(BBST tree, BBSTNode node)
     tree->Free = node->Right;
     
 }
+*/
 
 BBSTNode getBBSTNode(BBST tree, void *data)
 {
@@ -642,6 +643,7 @@ int getBBSTNodeCount(BBST tree)
 	return tree->Root == NULL ? 0 : tree->Root->NodeCount;
 }
 
+/*
 void freeBBST(BBST tree)
 {
 	clearBBST(tree);
@@ -660,62 +662,7 @@ void clearBBST(BBST tree)
 		freeBBSTNode(tree, node);
 	}
 }
-
-void freeBBSTFreeNodes(BBST tree)
-{
-	Assert( tree != NULL );
-	while( tree->Free != NULL ) {
-		BBSTNode tofree = tree->Free;
-		tree->Free = tofree->Right;
-		rm_pfree(tree->Context, tofree);
-	}
-}
-
-int getMaxDepthofBBST(BBST tree)
-{
-	return getDepthOfBBST(tree->Root);
-}
-
-int getDepthOfBBST(BBSTNode ptr)
-{
-	if( ptr == NULL ) {
-		return 0;
-	}
-	int leftdepth  = getDepthOfBBST(ptr->Left);
-	int rightdepth = getDepthOfBBST(ptr->Right);
-	return leftdepth > rightdepth ? leftdepth+1 : rightdepth+1;
-}
-
-/* This function generates a sequence of nodes by a depth-first traverse in
- * pre-order, this is for verifying if the BST is well balanced. */
-int traverseBBSTPreOrder(BBST tree, DQueue lines, int maxcount)
-{
-	BBSTNode 	p 		= tree->Root;
-	DQueueData 	stack;
-
-	initializeDQueue(&stack, tree->Context);
-
-	while( stack.NodeCount > 0 || p != NULL ) {
-		if ( p != NULL ) {
-			insertDQueueTailNode(lines, p);
-			insertDQueueHeadNode(&stack, p);
-			p = p->Left;
-
-			if ( maxcount > 0 && getDQueueLength(lines) == maxcount ) {
-				break;
-			}
-		}
-		else {
-				p = (BBSTNode)removeDQueueHeadNode(&stack);
-				p = p->Right;
-		}
-	}
-
-    removeAllDQueueNodes(&stack);
-	cleanDQueue(&stack);
-
-	return FUNC_RETURN_OK;
-}
+*/
 
 int traverseBBSTMidOrder(BBST tree, DQueue lines)
 {
@@ -755,16 +702,3 @@ BBSTNode getLeftMostNode(BBST tree)
 
 	return res;
 }
-
-BBSTNode getRightMostNode(BBST tree)
-{
-	BBSTNode res = tree->Root;
-	if ( res == NULL )
-		return res;
-
-	while( res->Right != NULL ) {
-		res = res->Right;
-	}
-
-	return res;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/filesystem_utils.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/filesystem_utils.c b/src/backend/resourcemanager/utils/filesystem_utils.c
deleted file mode 100644
index fd58603..0000000
--- a/src/backend/resourcemanager/utils/filesystem_utils.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.
- */
-
-#include "utils/filesystem_utils.h"
-#include <sys/stat.h>
-#include <unistd.h>
-
-FileConfiguration createFileConfiguration(MCTYPE context, char *filename)
-{
-	FileConfiguration result = NULL;
-
-	uint32_t filenamelen = strlen(filename);
-	result = rm_palloc0(context,
-						offsetof(FileConfigurationData, FileName) +
-						__SIZE_ALIGN64(filenamelen+1));
-
-	memcpy(result->FileName, filename, filenamelen+1);
-	result->FileNameLength 	= filenamelen;
-	result->InstanceSize	= offsetof(FileConfigurationData, FileName) +
-							  __SIZE_ALIGN64(filenamelen+1);
-	return result;
-}
-
-int updateFileConfigurationAsLocalFile(FileConfiguration fileconfig, bool testio)
-{
-	/* Check if the file exists*/
-	fileconfig->Exist    = access(fileconfig->FileName, F_OK) == 0 ?
-							      STAT_TRUE :
-							      STAT_FALSE;
-
-	fileconfig->Readable = access(fileconfig->FileName, R_OK) == 0 ?
-								  STAT_TRUE :
-								  STAT_FALSE;
-
-	fileconfig->Writable = access(fileconfig->FileName, W_OK) == 0 ?
-								  STAT_TRUE :
-								  STAT_FALSE;
-
-	/* Get file stat to have more details. */
-	struct stat filestat;
-	int statres = stat(fileconfig->FileName, &filestat);
-	if ( statres != 0 ) {
-		/* We dont think this directory can be accessed. */
-		fileconfig->AccessMask 		 = 0;
-		fileconfig->Exist	   		 = STAT_FALSE;
-		fileconfig->Readable   		 = STAT_UNSET;
-		fileconfig->Writable   		 = STAT_UNSET;
-		fileconfig->Reserved		 = 0;
-		fileconfig->isDirectory		 = STAT_UNSET;
-		fileconfig->ReadBytesPerSec  = -1.0;
-		fileconfig->WriteBytesPerSec = -1.0;
-		return UTIL_FILESYSTEM_FAIL_GET_FILESTAT;
-	}
-
-	fileconfig->isDirectory = S_ISDIR(filestat.st_mode) ?
-							  STAT_TRUE :
-							  STAT_FALSE;
-
-	fileconfig->AccessMask = filestat.st_mode;
-
-	return FUNC_RETURN_OK;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/hashtable.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/hashtable.c b/src/backend/resourcemanager/utils/hashtable.c
index 6c95347..eff486d 100644
--- a/src/backend/resourcemanager/utils/hashtable.c
+++ b/src/backend/resourcemanager/utils/hashtable.c
@@ -341,24 +341,14 @@ void cleanHASHTABLE( HASHTABLE table )
 	table->Slots = NULL;
 }
 
+/*
 void freeHASHTABLE( HASHTABLE table )
 {
 	Assert( table != NULL );
 	cleanHASHTABLE( table );
 	rm_pfree(table->Context, table);
 }
-
-uint32_t getHASHTABLESize( HASHTABLE table )
-{
-	Assert(table != NULL);
-	return table->NodeCount;
-}
-
-uint32_t getHASHTABLEVolume( HASHTABLE table )
-{
-	Assert(table != NULL);
-	return table->SlotVolume;
-}
+*/
 
 uint32_t HASHTABLE_Hash_UINT32 (void *data)
 {

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/kvproperties.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/kvproperties.c b/src/backend/resourcemanager/utils/kvproperties.c
index 660ed9e..c7233b4 100644
--- a/src/backend/resourcemanager/utils/kvproperties.c
+++ b/src/backend/resourcemanager/utils/kvproperties.c
@@ -505,18 +505,6 @@ KVProperty createPropertyBool(MCTYPE  		context,
 	return result;
 }
 
-KVProperty createPropertyText(MCTYPE  		context,
-							  const char   *tag1,
-							  const char   *tag2,
-							  int	 	   *index,
-							  text	  	   *value)
-{
-	KVProperty result = createPropertyEmpty(context);
-	buildDottedPropertyNameString(&(result->Key), tag1, tag2, index);
-	SimpleStringSetText(context, &(result->Val), value);
-	return result;
-}
-
 KVProperty createPropertyString(MCTYPE  	  context,
 							    const char   *tag1,
 							    const char   *tag2,
@@ -540,104 +528,3 @@ KVProperty createPropertyFloat(MCTYPE		 context,
 	SimpleStringSetFloat(&(result->Val), value);
 	return result;
 }
-int parseRangeTextBracket(MCTYPE 	 	  context,
-						  char 			 *text,
-						  bool 		 	  isNull,
-						  const char 	**p1,
-						  const char 	**p2)
-{
-	static char val1[128];
-	static char val2[128];
-
-	int res = FUNC_RETURN_OK;
-
-	*p1 = val1;
-	*p2 = val2;
-
-	if ( isNull ) {
-		val1[0] = '\0';
-		val2[0] = '\0';
-		return res;
-	}
-
-	SimpString tmpval;
-	initSimpleString(&tmpval, context);
-	setSimpleStringNoLen(&tmpval, text);
-
-	int leftbracket  = -1;
-	int rightbracket = -1;
-	int comma        = -1;
-
-	if ( tmpval.Str[0]            == '(' ) { leftbracket  = 0;            }
-	else goto exit;
-	if ( tmpval.Str[tmpval.Len-1] == ')' ) { rightbracket = tmpval.Len-1; }
-	else goto exit;
-
-	res = SimpleStringLocateChar(&tmpval, ',', &comma);
-	if ( res != FUNC_RETURN_OK )
-		goto exit;
-	if ( comma        - leftbracket > sizeof(val1) ) goto exit;
-	if ( rightbracket - comma       > sizeof(val2) ) goto exit;
-
-	/* Set values. */
-	memcpy(val1, &(tmpval.Str[leftbracket+1]), comma-leftbracket-1);
-	val1[comma-leftbracket-1] = '\0';
-	memcpy(val2, &(tmpval.Str[comma+1]), rightbracket-comma-1);
-	val2[rightbracket-comma-1] = '\0';
-
-exit:
-	freeSimpleStringContent(&tmpval);
-	return FUNC_RETURN_OK;
-}
-
-
-int parseRangeTupleBracket(MCTYPE			  context,
-						   Datum 			  textdatum,
-						   bool 			  isNull,
-						   const char 		**p1,
-						   const char 		**p2)
-{
-	static char val1[128];
-	static char val2[128];
-
-	int res = FUNC_RETURN_OK;
-
-	*p1 = val1;
-	*p2 = val2;
-
-	if ( isNull ) {
-		val1[0] = '\0';
-		val2[0] = '\0';
-		return res;
-	}
-
-	SimpString tmpval;
-	initSimpleString(&tmpval, context);
-	text *textvalue = DatumGetTextP(textdatum);
-	SimpleStringSetText(context, &tmpval, textvalue);
-
-	int leftbracket  = -1;
-	int rightbracket = -1;
-	int comma        = -1;
-
-	if ( tmpval.Str[0]            == '(' ) { leftbracket  = 0;            }
-	else goto exit;
-	if ( tmpval.Str[tmpval.Len-1] == ')' ) { rightbracket = tmpval.Len-1; }
-	else goto exit;
-
-	res = SimpleStringLocateChar(&tmpval, ',', &comma);
-	if ( res != FUNC_RETURN_OK )
-		goto exit;
-	if ( comma        - leftbracket > sizeof(val1) ) goto exit;
-	if ( rightbracket - comma       > sizeof(val2) ) goto exit;
-
-	/* Set values. */
-	memcpy(val1, &(tmpval.Str[leftbracket+1]), comma-leftbracket-1);
-	val1[comma-leftbracket-1] = '\0';
-	memcpy(val2, &(tmpval.Str[comma+1]), rightbracket-comma-1);
-	val2[rightbracket-comma-1] = '\0';
-
-exit:
-	freeSimpleStringContent(&tmpval);
-	return FUNC_RETURN_OK;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/linkedlist.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/linkedlist.c b/src/backend/resourcemanager/utils/linkedlist.c
index ad9267d..7f6db80 100644
--- a/src/backend/resourcemanager/utils/linkedlist.c
+++ b/src/backend/resourcemanager/utils/linkedlist.c
@@ -47,32 +47,6 @@ void initializeDQueue(DQueue list, MCTYPE context)
     list->NodeCount = 0;
 }
 
-bool isDQueueInitialized(DQueue list)
-{
-	return list->Context != NULL;
-}
-/*
- * Free DQueue instance which must has 0 nodes in it.
- */
-void freeDQueue(DQueue list) {
-    
-    DQueueNode tofree = NULL;
-    
-    Assert( list != NULL );
-    /* The caller must free the data one by one, to ensure the list is empty. */
-    Assert( list->NodeCount == 0 );
-    
-    /* Free all nodes in the free list. */
-    while ( list->Free != NULL ) {
-        tofree = list->Free;
-        list->Free = list->Free->Next;
-        rm_pfree(list->Context, tofree);
-    }
-
-    rm_pfree(list->Context, list);
-}
-
-
 void cleanDQueue(DQueue list)
 {
 	DQueueNode tofree = NULL;
@@ -109,16 +83,6 @@ void *getDQueueNodeDataByIndex(DQueue list, int index)
 	return p->Data;
 }
 
-DQueueNode getDQueueNodeByIndex(DQueue list, int index)
-{
-	Assert( list != NULL );
-	Assert( index >= 0 );
-	DQueueNode p = list->Head;
-	for ( int i = 0 ; i < index ; ++i )
-		p = p->Next;
-	return p;
-}
-
 /* Insert one node at the head of DQueue. */
 void insertDQueueHeadNode(DQueue list, void *data)
 {
@@ -273,207 +237,6 @@ void removeAllDQueueNodes(DQueue list)
     list->Tail = NULL;
 }
 
-/*
- * Generate string information of the whole list status.
- */
-void buildDQueueReport(DQueue list, char *buffer, int bufferlen)
-{
-    /* TODO: Check if the buffer length is enough for the report. */
-    if ( list == NULL )
-        sprintf( buffer, "DQueue[NULL]");
-    else {
-        sprintf( buffer,
-                 "DQueue[Len=%d,Head=%lu,Tail=%lu,Free=%lu]",
-                 list->NodeCount,
-                 (unsigned long)list->Head,
-                 (unsigned long)list->Tail,
-                 (unsigned long)list->Free );
-    }
-}
-
-/******************************************************************************
- * Implementation of DSafeQueue
- ******************************************************************************/
-DSafeQueue  createDSafeQueue(MCTYPE context)
-{
-    DSafeQueue res = NULL;
-    res = (DSafeQueue)
-    	  rm_palloc0(context, sizeof(DSafeQueueData));
-    initializeDSafeQueue(res, context);
-    return res;
-}
-
-void initializeDSafeQueue(DSafeQueue list, MCTYPE context)
-{
-	initializeDQueue(&(list->Queue), context);
-	pthread_mutex_init(&(list->Lock), NULL);
-	/* TODO: Check mutex initialization result. */
-}
-
-/* Free one DQueue instance */
-void  freeDSafeQueue(DSafeQueue list)
-{
-	pthread_mutex_lock(&(list->Lock));
-	freeDQueue(&(list->Queue));
-	pthread_mutex_unlock(&(list->Lock));
-}
-
-//void  freeDSafeQueueWithFree(DSafeQueue list, FreeObjectFuncType func)
-//{
-//	pthread_mutex_lock(&(list->Lock));
-//	freeDQueueWithFree(&(list->Queue), func);
-//	pthread_mutex_unlock(&(list->Lock));
-//}
-
-void  cleanDSafeQueue(DSafeQueue list)
-{
-	pthread_mutex_lock(&(list->Lock));
-	cleanDQueue(&(list->Queue));
-	pthread_mutex_unlock(&(list->Lock));
-}
-
-void  moveDQueueNodeOut(DSafeQueue list, DQueue target, int max, bool fromhead)
-{
-	DQueueNode node = NULL;
-	void *data		= NULL;
-
-	pthread_mutex_lock(&(list->Lock));
-	int count = 0;
-	while( count < max && list->Queue.NodeCount > 0 ) {
-		if ( fromhead ) {
-			/* Move node out from list head. */
-			data = removeDQueueNode(&(list->Queue), list->Queue.Head);
-
-			/* Move one free node from list to the target to reuse it. */
-			node = list->Queue.Free;
-			list->Queue.Free = node->Next;
-			node->Prev = NULL;
-			node->Data = NULL;
-			node->Next = target->Free;
-			target->Free = node;
-
-			/* Linked node in target as tail. */
-			insertDQueueTailNode(target, data);
-		}
-		else {
-			/* Move node out from list tail. */
-			data = removeDQueueNode(&(list->Queue), list->Queue.Tail);
-
-			/* Move one free node from list to the target to reuse it. */
-			node = list->Queue.Free;
-			list->Queue.Free = node->Next;
-			node->Prev = NULL;
-			node->Data = NULL;
-			node->Next = target->Free;
-			target->Free = node;
-
-			/* Linked node in target as head. */
-			insertDQueueHeadNode(target, data);
-		}
-		count++;
-	}
-
-	list->QueueLength = list->Queue.NodeCount;
-
-	pthread_mutex_unlock(&(list->Lock));
-}
-
-
-void  moveDQueueNodeIn(DSafeQueue list, DQueue source, bool tohead)
-{
-	if ( source->NodeCount == 0 )
-		return;
-
-	pthread_mutex_lock(&(list->Lock));
-
-	if ( tohead ) {
-		source->Tail->Next = list->Queue.Head;
-		list->Queue.Head = source->Head;
-	}
-	else if ( list->Queue.NodeCount == 0 ){
-		list->Queue.Head = source->Head;
-		list->Queue.Tail = source->Tail;
-	}
-	else {
-		list->Queue.Tail->Next = source->Head;
-		list->Queue.Tail = source->Tail;
-	}
-
-	list->Queue.NodeCount += source->NodeCount;
-
-	list->QueueLength = list->Queue.NodeCount;
-
-	pthread_mutex_unlock(&(list->Lock));
-}
-
-/* Get DQueue length ( node count ) */
-#define getDSafeQueueLength(list) ((list)->QueueLength)
-
-/* Insert / Remove one node at the head of DQueue. */
-void  insertDSafeQueueHeadNode(DSafeQueue list, void *data)
-{
-	pthread_mutex_lock(&(list->Lock));
-	insertDQueueHeadNode(&(list->Queue), data);
-	list->QueueLength = list->Queue.NodeCount;
-	pthread_mutex_unlock(&(list->Lock));
-}
-
-void  insertDSafeQueueTailNode(DSafeQueue list, void *data)
-{
-	pthread_mutex_lock(&(list->Lock));
-	insertDQueueTailNode(&(list->Queue), data);
-	list->QueueLength = list->Queue.NodeCount;
-	pthread_mutex_unlock(&(list->Lock));
-}
-
-void *removeDSafeQueueHeadNode(DSafeQueue list)
-{
-	pthread_mutex_lock(&(list->Lock));
-	void * res = removeDQueueHeadNode(&(list->Queue));
-	list->QueueLength = list->Queue.NodeCount;
-	pthread_mutex_unlock(&(list->Lock));
-	return res;
-}
-
-//void removeAllDSafeQueueNodes(DSafeQueue list)
-//{
-//	pthread_mutex_lock(&(list->Lock));
-//	removeAllDQueueNodes(&(list->Queue));
-//	list->QueueLength = list->Queue.NodeCount;
-//	pthread_mutex_unlock(&(list->Lock));
-//}
-
-/* Generate string info of the whole list status. */
-void  buildDSafeQueueReport	  (DSafeQueue list, char *buffer, int bufferlen)
-{
-	buildDQueueReport( &(list->Queue), buffer, bufferlen);
-}
-
-void lockDSafeQueue(DSafeQueue list)
-{
-	pthread_mutex_lock(&(list->Lock));
-}
-
-void unlockDSafeQueue(DSafeQueue list)
-{
-	pthread_mutex_unlock(&(list->Lock));
-}
-
-DQueue getDSafeQueueQueue(DSafeQueue list)
-{
-	return &(list->Queue);
-}
-
-void swapDQueues(DQueue list1, DQueue list2)
-{
-	DQueueData tmp;
-	tmp.Context = list1->Context; list1->Context = list2->Context ; list2->Context = tmp.Context;
-	tmp.Free = list1->Free; list1->Free = list2->Free; list2->Free = tmp.Free;
-	tmp.Head = list1->Head; list1->Head = list2->Head; list2->Head = tmp.Head;
-	tmp.Tail = list1->Tail; list1->Tail = list2->Tail; list2->Tail = tmp.Tail;
-	tmp.NodeCount = list1->NodeCount; list1->NodeCount = list2->NodeCount ; list2->NodeCount = tmp.NodeCount;
-
-}
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/memutilities.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/memutilities.c b/src/backend/resourcemanager/utils/memutilities.c
index abea3af..0e07b8d 100644
--- a/src/backend/resourcemanager/utils/memutilities.c
+++ b/src/backend/resourcemanager/utils/memutilities.c
@@ -241,36 +241,6 @@ void appendSelfMaintainBufferTill64bitAligned(SelfMaintainBuffer buffer)
 		appendSelfMaintainBuffer(buffer, ZEROPAD, padsize);
 }
 
-void swapSelfMaintainBuffer(SelfMaintainBuffer buffer1,
-							SelfMaintainBuffer buffer2)
-{
-	Assert( buffer1 != NULL && buffer2 != NULL );
-
-	char *tmpbuff = buffer1->Buffer ;
-	buffer1->Buffer = buffer2->Buffer ;
-	buffer2->Buffer = tmpbuff;
-
-	int32_t tmpcursor = buffer1->Cursor;
-	buffer1->Cursor = buffer2->Cursor;
-	buffer2->Cursor = tmpcursor;
-
-	int32_t tmpsize = buffer1->Size;
-	buffer1->Size = buffer2->Size;
-	buffer2->Size = tmpsize;
-
-	MCTYPE context = buffer1->Context;
-	buffer1->Context = buffer2->Context;
-	buffer2->Context = context;
-}
-
-void copySelfMaintainBuffer(SelfMaintainBuffer buffer1,
-							SelfMaintainBuffer buffer2)
-{
-	Assert( buffer1 != NULL && buffer2 != NULL );
-	resetSelfMaintainBuffer(buffer1);
-	appendSelfMaintainBuffer(buffer1, buffer2->Buffer, buffer2->Cursor+1);
-}
-
 void shiftLeftSelfMaintainBuffer(SelfMaintainBuffer buffer, int shift)
 {
 	Assert( buffer != NULL );

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/network_utils.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/network_utils.c b/src/backend/resourcemanager/utils/network_utils.c
index 8ffcb57..4cfc9df 100644
--- a/src/backend/resourcemanager/utils/network_utils.c
+++ b/src/backend/resourcemanager/utils/network_utils.c
@@ -30,44 +30,6 @@
 #include <unistd.h>
 #include <sys/types.h>
 
-int hostname_to_ipaddressstr(const char *hostname, char *ip )
-{
-	struct hostent *host;
-	struct in_addr **address_list;
-
-	host = gethostbyname(hostname);
-	if ( host == NULL ) {
-		return -1; /* Can not get host address from the name. */
-	}
-
-	address_list = (struct in_addr **)(host->h_addr_list);
-
-	if ( address_list[0] == NULL )
-		return -1; /* No usable address. */
-	strcpy(ip, inet_ntoa(*address_list[0]));
-
-	return 0;
-
-}
-
-int ipaddressstr_to_4bytes(const char *ip, uint8_t nums[4])
-{
-	int val[4];
-	sscanf(ip, "%d.%d.%d.%d", val, val+1, val+2, val+3);
-	nums[0] = val[0] & 0xFF;
-	nums[1] = val[1] & 0xFF;
-	nums[2] = val[2] & 0xFF;
-	nums[3] = val[3] & 0xFF;
-
-	return 0;
-}
-
-int ipaddress4bytes_to_str(uint8_t nums[4], char *ip)
-{
-	sprintf(ip, "%d.%d.%d.%d", nums[0], nums[1], nums[2], nums[3]);
-	return 0;
-}
-
 uint64_t gettime_microsec(void)
 {
     static struct timeval t;
@@ -195,12 +157,6 @@ int getLocalHostName(SimpStringPtr hostname)
 	return res;
 }
 
-int getLocalHostAllIPAddresses(DQueue addresslist)
-{
-	Assert(false);
-	return FUNC_RETURN_OK;
-}
-
 int getLocalHostAllIPAddressesAsStrings(DQueue addresslist)
 {
 	int		 res	   = FUNC_RETURN_OK;
@@ -252,31 +208,6 @@ int getLocalHostAllIPAddressesAsStrings(DQueue addresslist)
 	return res;
 }
 
-HostAddress createHostAddressAsStringFromIPV4Address(MCTYPE context, uint32_t addr)
-{
-	static char 	tmpaddrstr[16];
-	static uint32_t tmpaddrlen = 0;
-	HostAddress 	result = NULL;
-	int				resultsize = 0;
-
-	result = rm_palloc0(context, sizeof(HostAddressData));
-	result->Attribute.Offset  = 0;
-	result->Attribute.Mark   |= HOST_ADDRESS_CONTENT_STRING;
-
-	ipaddress4bytes_to_str((uint8_t *)&addr, tmpaddrstr);
-	tmpaddrlen = strlen(tmpaddrstr);
-	resultsize = __SIZE_ALIGN64(offsetof(AddressStringData, Address) +
-								tmpaddrlen + 1 );
-	AddressString straddr = rm_palloc0(context, resultsize);
-
-	straddr->Length = tmpaddrlen;
-	strcpy(straddr->Address, tmpaddrstr);
-	result->Address = (char *)straddr;
-	result->AddressSize = resultsize;
-
-	return result;
-}
-
 HostAddress createHostAddressAsStringFromIPV4AddressStr(MCTYPE context, const char *addr)
 {
 	static uint32_t addrlen = 0;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2f5980b8/src/backend/resourcemanager/utils/simplestring.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/utils/simplestring.c b/src/backend/resourcemanager/utils/simplestring.c
index fcbb538..2c4edd6 100644
--- a/src/backend/resourcemanager/utils/simplestring.c
+++ b/src/backend/resourcemanager/utils/simplestring.c
@@ -50,16 +50,6 @@ void initSimpleStringWithContent( SimpStringPtr str,
 	setSimpleStringWithContent( str, content, length);
 }
 
-void initSimpleStringFilled( SimpStringPtr str,
-							 MCTYPE 	   context,
-							 uint8_t 	   val,
-							 int 	 	   length)
-{
-	Assert( str != NULL );
-	str->Context = context;
-	setSimpleStringFilled( str, val, length);
-}
-
 void setSimpleStringWithContent( SimpStringPtr str,
 					  	  	     char		  *content,
 					  	  	     int		   length)
@@ -82,16 +72,6 @@ void setSimpleStringWithContent( SimpStringPtr str,
 	str->Len = length;
 }
 
-void setSimpleStringFilled( SimpStringPtr  str,
-							uint8_t 	   val,
-							int 		   length)
-{
-	Assert( str != NULL );
-	str->Str = (char *)rm_palloc0(str->Context, length+1);
-	memset(str->Str, val, length);
-	str->Len = length;
-}
-
 void freeSimpleStringContent(SimpStringPtr  str)
 {
 	Assert( str != NULL );
@@ -100,7 +80,6 @@ void freeSimpleStringContent(SimpStringPtr  str)
 	}
 	str->Str = NULL;
 	str->Len = -1;
-	//str->Context = NULL;
 }
 
 void setSimpleStringRef(SimpStringPtr str, char *content, int length)
@@ -111,14 +90,6 @@ void setSimpleStringRef(SimpStringPtr str, char *content, int length)
 	str->Context = NULL;
 }
 
-void clearSimpleStringRef(SimpStringPtr str)
-{
-	Assert( str != NULL );
-	str->Str = NULL;
-	str->Len = -1;
-	str->Context = NULL;
-}
-
 int  SimpleStringFind(SimpStringPtr str, char *target)
 {
 	Assert( str != NULL );
@@ -136,12 +107,6 @@ int  SimpleStringComp(SimpStringPtr str, char *target)
 	return strcmp(str->Str, target);
 }
 
-int  SimpleStringCaseComp(SimpStringPtr str, char *target)
-{
-	Assert( str != NULL );
-	return strcasecmp(str->Str, target);
-}
-
 void SimpleStringCopy(SimpStringPtr str, SimpStringPtr source)
 {
 	Assert( source != NULL );
@@ -176,27 +141,6 @@ int SimpleStringSubstring( SimpStringPtr str,
 	return newlen;
 }
 
-int deserializeToSimpleString(SimpStringPtr str, char *content)
-{
-	Assert(str != NULL);
-	str->Len = *((int32_t *)content);
-	str->Str = (char *)rm_palloc0(str->Context, (str->Len+1));
-	memcpy(str->Str, content+4, str->Len);
-	return __SIZE_ALIGN64(str->Len + sizeof(int32_t));
-}
-
-int serializeFromSimpleString(SimpStringPtr str, char *content)
-{
-	*((int32_t *)content) = str->Len;
-	memcpy(content+4, str->Str, str->Len);
-	return __SIZE_ALIGN64(str->Len + sizeof(int32_t));
-}
-
-int serializationSize(SimpStringPtr str)
-{
-	return __SIZE_ALIGN64(str->Len + sizeof(int32_t));
-}
-
 bool SimpleStringIsPercentage(SimpStringPtr str)
 {
 	if ( str->Len <= 1 )
@@ -361,34 +305,6 @@ int  SimpleStringLocateChar(SimpStringPtr str, char target, int *location)
 	return FUNC_RETURN_FAIL;
 }
 
-void SimpleStringReplaceChar(SimpStringPtr str, char oldchar, char newchar)
-{
-	for ( int i = 0 ; i < str->Len ; ++i ) {
-		str->Str[i] = str->Str[i] == oldchar ? newchar : str->Str[i];
-	}
-}
-
-void SimpleStringReplaceFirst(SimpStringPtr str, char *oldstr, char *newstr)
-{
-	char *pos = strstr(str->Str, oldstr);
-	/* If the old string does not exist, no need to do any update. */
-	if ( pos == NULL )
-		return;
-
-	SelfMaintainBufferData smb;
-	initializeSelfMaintainBuffer(&smb, str->Context);
-	if ( str->Str != pos ) {
-		appendSelfMaintainBuffer(&smb, str->Str, pos - str->Str);
-	}
-	int oldstrlen = strlen(oldstr);
-	appendSelfMaintainBuffer(&smb, newstr, strlen(newstr));
-	if ( oldstrlen + (pos - str->Str) < str->Len ) {
-		appendSMBStr(&smb, pos + oldstrlen);
-	}
-	setSimpleStringWithContent(str, smb.Buffer, getSMBContentSize(&smb));
-	destroySelfMaintainBuffer(&smb);
-}
-
 int SimpleArrayComp(SimpArrayPtr array1, SimpArrayPtr array2)
 {
 	int val = 0;
@@ -410,15 +326,6 @@ SimpArrayPtr createSimpleArray(MCTYPE context)
 	return res;
 }
 
-/* initialize string. */
-void initSimpleArray(SimpArrayPtr array, MCTYPE context)
-{
-	Assert( array != NULL );
-	array->Array   = NULL;
-	array->Len 	   = -1;
-	array->Context = context;
-}
-
 /* set array value. */
 void setSimpleArrayWithContent( SimpArrayPtr  array,
 					  	  	 	char		 *content,
@@ -507,25 +414,6 @@ int SimpleStringSetFloat(SimpStringPtr str, float value)
 	setSimpleStringNoLen(str, valuestr);
 	return FUNC_RETURN_OK;
 }
-int SimpleStringSetText(MCTYPE context, SimpStringPtr str, text *value)
-{
-	Assert(str != NULL);
-
-	if ( value != NULL ) {
-		char *tmpvalue = NULL;
-		MEMORY_CONTEXT_SWITCH_TO(context)
-		tmpvalue = DatumGetCString(DirectFunctionCall1(textout,
-													   PointerGetDatum(value)));
-		setSimpleStringNoLen(str, tmpvalue);
-		pfree(tmpvalue);
-		MEMORY_CONTEXT_SWITCH_BACK
-	}
-	else {
-		setSimpleStringNoLen(str, "");
-	}
-
-	return FUNC_RETURN_OK;
-}
 
 int SimpleStringToOid(SimpStringPtr str, Oid *value)
 {


Mime
View raw message