This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit f90a5a51fe81378ce2905341b8398df67b1fe737
Author: Yini Li <[email protected]>
AuthorDate: Tue Aug 9 09:10:50 2022 +0800

    Declare BackoffPriorityIntToValue and ResourceQueueGetPriorityWeight as 
extern functions. (#13908)
    
    GPCC's metrics collector needs these two functions to find the priority of 
the queue of a query.
---
 src/backend/postmaster/backoff.c | 6 ++----
 src/include/postmaster/backoff.h | 5 +++++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/backend/postmaster/backoff.c b/src/backend/postmaster/backoff.c
index dbaea8654b..e11384b3d5 100644
--- a/src/backend/postmaster/backoff.c
+++ b/src/backend/postmaster/backoff.c
@@ -201,12 +201,10 @@ static volatile bool isSweeperProcess = false;
 
 /* Resource queue related routines */
 static int     BackoffPriorityValueToInt(const char *priorityVal);
-static char *BackoffPriorityIntToValue(int weight);
 extern List *GetResqueueCapabilityEntry(Oid queueid);
 
 static int BackoffDefaultWeight(void);
 static int BackoffSuperuserStatementWeight(void);
-static int ResourceQueueGetPriorityWeight(Oid queueId);
 
 /*
  * Helper method that verifies setting of default priority guc.
@@ -1392,7 +1390,7 @@ BackoffDefaultWeight(void)
  * GetResqueueCapabilityEntry will always  do a catalog lookup. In such cases
  * use the default weight.
  */
-static int
+int
 ResourceQueueGetPriorityWeight(Oid queueId)
 {
        List       *capabilitiesList = NULL;
@@ -1486,7 +1484,7 @@ BackoffPriorityValueToInt(const char *priorityVal)
  * method maps it to a text value corresponding to this weight. Caller is
  * responsible for deallocating the return pointer.
  */
-static char *
+char *
 BackoffPriorityIntToValue(int weight)
 {
        const PriorityMapping *p = priority_map;
diff --git a/src/include/postmaster/backoff.h b/src/include/postmaster/backoff.h
index 2f23c9825f..b84eded09c 100644
--- a/src/include/postmaster/backoff.h
+++ b/src/include/postmaster/backoff.h
@@ -29,5 +29,10 @@ extern Datum gp_list_backend_priorities(PG_FUNCTION_ARGS);
 extern void BackoffSweeperMain(Datum main_arg);
 extern bool BackoffSweeperStartRule(Datum main_arg);
 
+/* needed by metrics_collector */
+extern char *BackoffPriorityIntToValue(int weight);
+/* needed by metrics_collector */
+extern int ResourceQueueGetPriorityWeight(Oid queueId);
+
 
 #endif /* BACKOFF_H_ */


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to