@@ -46,22 +46,21 @@ typedef struct
46
46
do { \
47
47
Assert(CurrentMemoryContext != TopMemoryContext); \
48
48
Assert(CurrentMemoryContext != TopPathmanContext); \
49
- Assert(CurrentMemoryContext != PathmanRelationCacheContext ); \
50
- Assert(CurrentMemoryContext != PathmanParentCacheContext ); \
51
- Assert(CurrentMemoryContext != PathmanBoundCacheContext ); \
49
+ Assert(CurrentMemoryContext != PathmanParentsCacheContext ); \
50
+ Assert(CurrentMemoryContext != PathmanStatusCacheContext ); \
51
+ Assert(CurrentMemoryContext != PathmanBoundsCacheContext ); \
52
52
} while (0)
53
53
54
54
55
55
#define PATHMAN_MCXT_COUNT 4
56
56
extern MemoryContext TopPathmanContext ;
57
- extern MemoryContext PathmanInvalJobsContext ;
58
- extern MemoryContext PathmanRelationCacheContext ;
59
- extern MemoryContext PathmanParentCacheContext ;
60
- extern MemoryContext PathmanBoundCacheContext ;
57
+ extern MemoryContext PathmanParentsCacheContext ;
58
+ extern MemoryContext PathmanStatusCacheContext ;
59
+ extern MemoryContext PathmanBoundsCacheContext ;
61
60
62
- extern HTAB * partitioned_rels ;
63
- extern HTAB * parent_cache ;
64
- extern HTAB * bound_cache ;
61
+ extern HTAB * parents_cache ;
62
+ extern HTAB * status_cache ;
63
+ extern HTAB * bounds_cache ;
65
64
66
65
/* pg_pathman's initialization state */
67
66
extern PathmanInitState pathman_init_state ;
@@ -70,28 +69,29 @@ extern PathmanInitState pathman_init_state;
70
69
extern bool pathman_hooks_enabled ;
71
70
72
71
72
+ #define PATHMAN_TOP_CONTEXT "maintenance"
73
+ #define PATHMAN_PARENTS_CACHE "partition parents cache"
74
+ #define PATHMAN_STATUS_CACHE "partition status cache"
75
+ #define PATHMAN_BOUNDS_CACHE "partition bounds cache"
76
+
77
+
73
78
/* Transform pg_pathman's memory context into simple name */
74
79
static inline const char *
75
- simpify_mcxt_name (MemoryContext mcxt )
80
+ simplify_mcxt_name (MemoryContext mcxt )
76
81
{
77
- static const char * top_mcxt = "maintenance" ,
78
- * rel_mcxt = "partition dispatch cache" ,
79
- * parent_mcxt = "partition parents cache" ,
80
- * bound_mcxt = "partition bounds cache" ;
81
-
82
82
if (mcxt == TopPathmanContext )
83
- return top_mcxt ;
83
+ return PATHMAN_TOP_CONTEXT ;
84
84
85
- else if (mcxt == PathmanRelationCacheContext )
86
- return rel_mcxt ;
85
+ else if (mcxt == PathmanParentsCacheContext )
86
+ return PATHMAN_PARENTS_CACHE ;
87
87
88
- else if (mcxt == PathmanParentCacheContext )
89
- return parent_mcxt ;
88
+ else if (mcxt == PathmanStatusCacheContext )
89
+ return PATHMAN_STATUS_CACHE ;
90
90
91
- else if (mcxt == PathmanBoundCacheContext )
92
- return bound_mcxt ;
91
+ else if (mcxt == PathmanBoundsCacheContext )
92
+ return PATHMAN_BOUNDS_CACHE ;
93
93
94
- else elog (ERROR , "error in function " CppAsString ( simpify_mcxt_name ) );
94
+ else elog (ERROR , "unknown memory context" );
95
95
}
96
96
97
97
0 commit comments