hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject [09/38] incubator-hawq git commit: HAWQ-507. Remove useless code for cdbpersistentrelfile.c
Date Thu, 31 Mar 2016 00:24:02 GMT
HAWQ-507. Remove useless code for cdbpersistentrelfile.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/05e9ffdf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/05e9ffdf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/05e9ffdf

Branch: refs/heads/HAWQ-546
Commit: 05e9ffdf66a1857bca9b839edb235bde7508cf02
Parents: 6622e9c
Author: doli <doli@pivotal.io>
Authored: Thu Mar 10 13:56:13 2016 +0800
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Wed Mar 30 17:23:27 2016 -0700

----------------------------------------------------------------------
 src/backend/cdb/cdbpersistentrelfile.c | 152 ----------------------------
 src/include/cdb/cdbpersistentrelfile.h |  19 ----
 2 files changed, 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/05e9ffdf/src/backend/cdb/cdbpersistentrelfile.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbpersistentrelfile.c b/src/backend/cdb/cdbpersistentrelfile.c
index 2b8e3e8..fa4e023 100644
--- a/src/backend/cdb/cdbpersistentrelfile.c
+++ b/src/backend/cdb/cdbpersistentrelfile.c
@@ -105,16 +105,6 @@ static void PersistentRelfile_VerifyInitScan(void)
 // Helpers 
 // -----------------------------------------------------------------------------
 
-inline static void XLogRecPtr_Zero(XLogRecPtr *xlogLoc)
-{
-	MemSet(xlogLoc, 0, sizeof(XLogRecPtr));
-}
-
-void PersistentRelfile_FlushXLog(void)
-{
-	PersistentFileSysObj_FlushXLog();
-}
-
 extern void PersistentRelfile_Reset(void)
 {
 	// Currently, nothing to do.
@@ -145,75 +135,7 @@ int64 PersistentRelfile_CurrentMaxSerialNum(void)
 	return value;
 }
 
-static Oid persistentRelfileCheckTablespace;
-static int32 persistentRelfileCheckTablespaceUseCount;
-static RelFileNode persistentRelfileCheckTablespaceRelFileNode;
-
-static bool PersistentRelfile_CheckTablespaceScanTupleCallback(
-	ItemPointer 			persistentTid,
-	int64					persistentSerialNum,
-	Datum					*values)
-{
-	RelFileNode		relFileNode;
-	int32			segmentFileNum;
-
-	PersistentFileSysRelStorageMgr relationStorageManager;
-
-	PersistentFileSysState	state;
-
-	PersistentFileSysRelBufpoolKind relBufpoolKind;
-
-	TransactionId			parentXid;
-	int64					serialNum;
-	ItemPointerData			previousFreeTid;
-	bool					sharedStorage;
-
-	GpPersistentRelfileNode_GetValues(
-									values,
-									&relFileNode.spcNode,
-									&relFileNode.dbNode,
-									&relFileNode.relNode,
-									&segmentFileNum,
-									&relationStorageManager,
-									&state,
-									&relBufpoolKind,
-									&parentXid,
-									&serialNum,
-									&previousFreeTid,
-									&sharedStorage);
-
-	if (state == PersistentFileSysState_Created &&
-		relFileNode.spcNode == persistentRelfileCheckTablespace)
-	{
-		persistentRelfileCheckTablespaceUseCount++;
-		if (persistentRelfileCheckTablespaceUseCount == 1)
-		{
-			memcpy(&persistentRelfileCheckTablespaceRelFileNode, &relFileNode, sizeof(RelFileNode));
-		}
-	}
-
-	return true;	// Continue.
-}
-
-void PersistentRelfile_CheckTablespace(
-	Oid				tablespace,
-
-	int32			*useCount,
-
-	RelFileNode		*exampleRelFileNode)
-{
-	persistentRelfileCheckTablespace = tablespace;
-	persistentRelfileCheckTablespaceUseCount = 0;
-
-	MemSet(&persistentRelfileCheckTablespaceRelFileNode, 0, sizeof(RelFileNode));
 
-	PersistentFileSysObj_Scan(
-		PersistentFsObjType_RelationFile,
-		PersistentRelfile_CheckTablespaceScanTupleCallback);
-
-	*useCount = persistentRelfileCheckTablespaceUseCount;
-	memcpy(exampleRelFileNode, &persistentRelfileCheckTablespaceRelFileNode, sizeof(RelFileNode));
-}
 
 // -----------------------------------------------------------------------------
 // State Change 
@@ -453,80 +375,6 @@ void PersistentRelfile_AddCreated(
 /*
  * Indicate the transaction commited and the relation is officially created.
  */
-void PersistentRelfile_FinishBufferPoolBulkLoad(
-	RelFileNode 		*relFileNode,
-				/* The tablespace, database, and relation OIDs for the created relation. */
-
-	ItemPointer			persistentTid,
-				/* TID of the gp_persistent_rel_files tuple for the relation. */
-
-	int64				persistentSerialNum)
-				/* Serial number for the relation.  Distinquishes the uses of the tuple. */
-
-{
-	WRITE_PERSISTENT_STATE_ORDERED_LOCK_DECLARE;
-
-	PersistentFileSysObjName fsObjName;
-
-	PersistentFileSysObjStateChangeResult stateChangeResult;
-	
-	if(RelFileNode_IsEmpty(relFileNode))
-		elog(ERROR, "Invalid RelFileNode (0,0,0)");
-
-	if (Persistent_BeforePersistenceWork())
-	{	
-		if (Debug_persistent_print)
-			elog(Persistent_DebugPrintLevel(), 
-			     "Skipping persistent relation '%s' because we are before persistence work",
-				 relpath(*relFileNode));
-
-		return;	// The initdb process will load the persistent table once we out of bootstrap mode.
-	}
-
-	PersistentRelfile_VerifyInitScan();
-
-	PersistentFileSysObjName_SetRelationFile(
-										&fsObjName, 
-										relFileNode,
-										/* segmentFileNum */ 0,
-										is_tablespace_shared);
-
-	// Do this check after skipping out if in bootstrap mode.
-	if (PersistentStore_IsZeroTid(persistentTid))
-		elog(ERROR, "TID for persistent '%s' tuple for 'Created' is invalid (0,0)",
-			 PersistentFileSysObjName_TypeAndObjectName(&fsObjName));
-
-	if (persistentSerialNum == 0)
-		elog(ERROR, "Persistent '%s' serial number for 'Created' is invalid (0)",
-			 PersistentFileSysObjName_TypeAndObjectName(&fsObjName));
-
-	WRITE_PERSISTENT_STATE_ORDERED_LOCK;
-
-	stateChangeResult =
-		PersistentFileSysObj_StateChange(
-								&fsObjName,
-								persistentTid,
-								persistentSerialNum,
-								PersistentFileSysState_CreatePending,
-								/* retryPossible */ false,
-								/* flushToXlog */ false,
-								/* oldState */ NULL,
-								/* verifiedActionCallback */ NULL);
-
-	WRITE_PERSISTENT_STATE_ORDERED_UNLOCK;
-
-	if (Debug_persistent_print)
-		elog(Persistent_DebugPrintLevel(), 
-		     "Persistent relation: '%s' changed state from 'Bulk Load Create Pending' to 'Create
Pending', serial number " INT64_FORMAT " at TID %s (State-Change result '%s')",
-			 PersistentFileSysObjName_ObjectName(&fsObjName),
-			 persistentSerialNum,
-			 ItemPointerToString(persistentTid),
-			 PersistentFileSysObjStateChangeResult_Name(stateChangeResult));
-}
-
-/*
- * Indicate the transaction commited and the relation is officially created.
- */
 void PersistentRelfile_Created(
 	PersistentFileSysObjName *fsObjName,
 				/* The tablespace, database, and relation OIDs for the created relation. */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/05e9ffdf/src/include/cdb/cdbpersistentrelfile.h
----------------------------------------------------------------------
diff --git a/src/include/cdb/cdbpersistentrelfile.h b/src/include/cdb/cdbpersistentrelfile.h
index c89412b..657e939 100644
--- a/src/include/cdb/cdbpersistentrelfile.h
+++ b/src/include/cdb/cdbpersistentrelfile.h
@@ -44,15 +44,6 @@
 extern int64 PersistentRelfile_MyHighestSerialNum(void);
 extern int64 PersistentRelfile_CurrentMaxSerialNum(void);
 
-extern void PersistentRelfile_CheckTablespace(
-	Oid 			tablespace,
-
-	int32			*useCount,
-
-	RelFileNode 	*exampleRelFileNode);
-
-extern void PersistentRelfile_FlushXLog(void);
-
 extern void PersistentRelfile_Reset(void);
 
 /*
@@ -115,16 +106,6 @@ extern void PersistentRelfile_AddCreated(
 // Transaction End	
 // -----------------------------------------------------------------------------
 
-void PersistentRelfile_FinishBufferPoolBulkLoad(
-	RelFileNode 		*relFileNode,
-				/* The tablespace, database, and relation OIDs for the created relation. */
-
-	ItemPointer 		persistentTid,
-				/* TID of the gp_persistent_rel_files tuple for the relation. */
-
-	int64				persistentSerialNum);
-				/* Serial number for the relation.	Distinquishes the uses of the tuple. */
-
 /*
  * Indicate the transaction commited and the relation is officially created.
  */


Mime
View raw message