Skip to content

Commit 3fe7348

Browse files
Merge pull request #123 from PanDAWMS/v0.1.1
V0.1.1
2 parents eb7b807 + 7259c4a commit 3fe7348

5 files changed

Lines changed: 114 additions & 9 deletions

File tree

schema/oracle/ATLAS_PANDA.sql

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
-- IMPORTANT: Please always update to up2date version
3535
--------------------------------------------------------
3636

37-
INSERT INTO "ATLAS_PANDA"."PANDADB_VERSION" VALUES ('PanDA', 0, 1, 0);
37+
INSERT INTO "ATLAS_PANDA"."PANDADB_VERSION" VALUES ('PanDA', 0, 1, 1);
3838
--------------------------------------------------------
3939
-- DDL for Sequence FILESTABLE4_ROW_ID_SEQ
4040
--------------------------------------------------------
@@ -2300,7 +2300,8 @@ COMMENT ON TABLE "ATLAS_PANDA"."JOB_STATS_HP" IS 'highest priority job statisti
23002300
"NUM_OF_JOBS" NUMBER,
23012301
"NUM_OF_CORES" NUMBER,
23022302
"VO" VARCHAR2(16 BYTE),
2303-
"WORKQUEUE_ID" NUMBER(5,0)
2303+
"WORKQUEUE_ID" NUMBER(5,0),
2304+
"RESOURCE_TYPE" VARCHAR2(56 BYTE)
23042305
) ;
23052306

23062307
COMMENT ON COLUMN "ATLAS_PANDA"."MV_JOBSACTIVE4_STATS"."CUR_DATE" IS 'The timestamp of the Materialized view refresh ';
@@ -2315,6 +2316,9 @@ COMMENT ON TABLE "ATLAS_PANDA"."JOB_STATS_HP" IS 'highest priority job statisti
23152316
COMMENT ON COLUMN "ATLAS_PANDA"."MV_JOBSACTIVE4_STATS"."CURRENTPRIORITY" IS 'actual priority value which is usually the same as assignedPriority, can be modified by Panda server';
23162317
COMMENT ON COLUMN "ATLAS_PANDA"."MV_JOBSACTIVE4_STATS"."NUM_OF_JOBS" IS 'Number of jobs computed by grouping all set of attributes(columns) listed in that column, ';
23172318
COMMENT ON COLUMN "ATLAS_PANDA"."MV_JOBSACTIVE4_STATS"."NUM_OF_CORES" IS 'Number of cores computed by grouping all set of attributes(columns) listed in that column, ';
2319+
COMMENT ON COLUMN "ATLAS_PANDA"."MV_JOBSACTIVE4_STATS"."VO" IS 'Virtual organization ';
2320+
COMMENT ON COLUMN "ATLAS_PANDA"."MV_JOBSACTIVE4_STATS"."WORKQUEUE_ID" IS 'Work queue identifier';
2321+
COMMENT ON COLUMN "ATLAS_PANDA"."MV_JOBSACTIVE4_STATS"."RESOURCE_TYPE" IS 'Resource type (SCORE, MCORE...)';
23182322
COMMENT ON TABLE "ATLAS_PANDA"."MV_JOBSACTIVE4_STATS" IS 'Table (was from Materialized view before, but was not reliable) which collects aggregated data on set of attributes(columns). The data is read from the JOBSACTIVE4 table by an Oracle scheduler job. The refresh interval is 2 min';
23192323

23202324

@@ -5734,6 +5738,7 @@ set define off;
57345738
AS
57355739
BEGIN
57365740

5741+
-- 2026 02 23, ver 1.4 , added RESOURCE_TYPE column
57375742
-- ver 1.3 , last modified on 2nd September 2024
57385743
-- added NUM_OF_CORES columns
57395744
-- ver 1.2 , last modified on 2th July 2013
@@ -5760,7 +5765,8 @@ INSERT INTO mv_jobsactive4_stats
57605765
VO,
57615766
WORKQUEUE_ID,
57625767
NUM_OF_JOBS,
5763-
NUM_OF_CORES
5768+
NUM_OF_CORES,
5769+
RESOURCE_TYPE
57645770
)
57655771
SELECT
57665772
sysdate,
@@ -5776,7 +5782,8 @@ INSERT INTO mv_jobsactive4_stats
57765782
VO,
57775783
WORKQUEUE_ID,
57785784
COUNT(*) AS num_of_jobs,
5779-
SUM(COALESCE(actualcorecount, corecount)) AS num_of_cores
5785+
SUM(COALESCE(actualcorecount, corecount)) AS num_of_cores,
5786+
RESOURCE_TYPE
57805787
FROM jobsActive4
57815788
GROUP BY
57825789
sysdate,
@@ -5790,7 +5797,8 @@ INSERT INTO mv_jobsactive4_stats
57905797
prodSourceLabel,
57915798
TRUNC(currentPriority, -1),
57925799
VO,
5793-
WORKQUEUE_ID;
5800+
WORKQUEUE_ID,
5801+
RESOURCE_TYPE;
57945802
commit;
57955803

57965804
DBMS_APPLICATION_INFO.SET_MODULE( module_name => null, action_name => null);
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
-- patch to be used to upgrade from version 0.1.0
2+
3+
ALTER TABLE doma_panda.mv_jobsactive4_stats
4+
ADD COLUMN resource_type varchar(56);
5+
6+
COMMENT ON COLUMN doma_panda.mv_jobsactive4_stats.vo IS E'Virtual organization ';
7+
COMMENT ON COLUMN doma_panda.mv_jobsactive4_stats.workqueue_id IS E'Work queue identifier';
8+
COMMENT ON COLUMN doma_panda.mv_jobsactive4_stats.resource_type IS E'Resource type (SCORE, MCORE...)';
9+
10+
CREATE OR REPLACE PROCEDURE doma_panda.update_jobsactive_stats () AS $body$
11+
BEGIN
12+
13+
-- 2026 02 23, ver 1.4 , added RESOURCE_TYPE column
14+
-- ver 1.3 , last modified on 2nd September 2024
15+
-- added NUM_OF_CORES columns
16+
-- ver 1.2 , last modified on 2th July 2013
17+
-- added VO and WORKQUEUE_ID columns
18+
-- to easy identify the session and better view on resource usage by setting a dedicated module for the PanDA jobs
19+
--DBMS_APPLICATION_INFO.SET_MODULE( module_name => 'PanDA scheduler job', action_name => 'Aggregates data for the active jobs!');
20+
--DBMS_APPLICATION_INFO.SET_CLIENT_INFO( client_info => sys_context('userenv', 'host') || ' ( ' || sys_context('userenv', 'ip_address') || ' )' );
21+
22+
23+
DELETE from doma_panda.mv_jobsactive4_stats;
24+
25+
INSERT INTO doma_panda.mv_jobsactive4_stats(CUR_DATE,
26+
CLOUD,
27+
COMPUTINGSITE,
28+
COUNTRYGROUP,
29+
WORKINGGROUP,
30+
RELOCATIONFLAG,
31+
JOBSTATUS,
32+
PROCESSINGTYPE,
33+
PRODSOURCELABEL,
34+
CURRENTPRIORITY,
35+
VO,
36+
WORKQUEUE_ID,
37+
NUM_OF_JOBS,
38+
NUM_OF_CORES,
39+
RESOURCE_TYPE
40+
)
41+
SELECT
42+
clock_timestamp(),
43+
cloud,
44+
computingSite,
45+
countrygroup,
46+
workinggroup,
47+
relocationflag,
48+
jobStatus,
49+
processingType,
50+
prodSourceLabel,
51+
TRUNC(currentPriority, -1) AS currentPriority,
52+
VO,
53+
WORKQUEUE_ID,
54+
COUNT(*) AS num_of_jobs,
55+
SUM(COALESCE(actualcorecount, corecount)) AS num_of_cores
56+
FROM jobsActive4
57+
GROUP BY
58+
clock_timestamp(),
59+
cloud,
60+
computingSite,
61+
countrygroup,
62+
workinggroup,
63+
relocationflag,
64+
jobStatus,
65+
processingType,
66+
prodSourceLabel,
67+
TRUNC(currentPriority, -1),
68+
VO,
69+
WORKQUEUE_ID,
70+
RESOURCE_TYPE;
71+
--COMMIT;
72+
73+
--DBMS_APPLICATION_INFO.SET_MODULE( module_name => null, action_name => null);
74+
--DBMS_APPLICATION_INFO.SET_CLIENT_INFO( client_info => null);
75+
76+
end;
77+
$body$
78+
LANGUAGE PLPGSQL
79+
SECURITY DEFINER
80+
;
81+
ALTER PROCEDURE doma_panda.update_jobsactive_stats () OWNER TO panda;
82+
-- REVOKE ALL ON PROCEDURE doma_panda.update_jobsactive_stats () FROM PUBLIC;
83+
84+
-- =========================
85+
-- Version bump
86+
-- =========================
87+
UPDATE doma_panda.pandadb_version
88+
SET major = 0, minor = 1, patch = 1
89+
WHERE component = 'PanDA';
90+

schema/postgres/sqls/pg_PANDA_SCHEDULER_JOBS.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,7 @@ ALTER PROCEDURE doma_panda.tasks_statuslog_sl_window (DAYS_OFFSET bigint) owner
12211221
CREATE OR REPLACE PROCEDURE doma_panda.update_jobsactive_stats () AS $body$
12221222
BEGIN
12231223

1224+
-- 2026 02 23, ver 1.4 , added RESOURCE_TYPE column
12241225
-- ver 1.3 , last modified on 2nd September 2024
12251226
-- added NUM_OF_CORES columns
12261227
-- ver 1.2 , last modified on 2th July 2013
@@ -1245,7 +1246,8 @@ INSERT INTO doma_panda.mv_jobsactive4_stats(CUR_DATE,
12451246
VO,
12461247
WORKQUEUE_ID,
12471248
NUM_OF_JOBS,
1248-
NUM_OF_CORES
1249+
NUM_OF_CORES,
1250+
RESOURCE_TYPE
12491251
)
12501252
SELECT
12511253
clock_timestamp(),
@@ -1275,7 +1277,8 @@ INSERT INTO doma_panda.mv_jobsactive4_stats(CUR_DATE,
12751277
prodSourceLabel,
12761278
TRUNC(currentPriority, -1),
12771279
VO,
1278-
WORKQUEUE_ID;
1280+
WORKQUEUE_ID,
1281+
RESOURCE_TYPE;
12791282
--COMMIT;
12801283

12811284
--DBMS_APPLICATION_INFO.SET_MODULE( module_name => null, action_name => null);

schema/postgres/sqls/pg_PANDA_TABLE.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,8 @@ CREATE TABLE mv_jobsactive4_stats (
23742374
num_of_jobs bigint,
23752375
vo varchar(32),
23762376
workqueue_id integer,
2377-
num_of_cores bigint
2377+
num_of_cores bigint,
2378+
resource_type varchar(56)
23782379
) ;
23792380
COMMENT ON TABLE mv_jobsactive4_stats IS E'Table (was from Materialized view before, but was not reliable) which collects aggregated data on set of attributes(columns). The data is read from the JOBSACTIVE4 table by an Oracle scheduler job. The refresh interval is 2 min';
23802381
COMMENT ON COLUMN mv_jobsactive4_stats.cloud IS E'cloud (associated with Tier 1) where the job is submitted to';
@@ -2389,6 +2390,9 @@ COMMENT ON COLUMN mv_jobsactive4_stats.prodsourcelabel IS E'activity name of the
23892390
COMMENT ON COLUMN mv_jobsactive4_stats.relocationflag IS E'flag for submitting jobs to a single site. I.e. the brokerage is bypassed';
23902391
COMMENT ON COLUMN mv_jobsactive4_stats.workinggroup IS E'working group name';
23912392
COMMENT ON COLUMN mv_jobsactive4_stats.num_of_cores IS E'Number of cores computed by grouping all set of attributes(columns) listed in that column';
2393+
COMMENT ON COLUMN mv_jobsactive4_stats.vo IS E'Virtual organization ';
2394+
COMMENT ON COLUMN mv_jobsactive4_stats.workqueue_id IS E'Work queue identifier';
2395+
COMMENT ON COLUMN mv_jobsactive4_stats.resource_type IS E'Resource type (SCORE, MCORE...)';
23922396
ALTER TABLE mv_jobsactive4_stats OWNER TO panda;
23932397
ALTER TABLE mv_jobsactive4_stats ALTER COLUMN JOBSTATUS SET NOT NULL;
23942398

schema/postgres/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
0.1.1

0 commit comments

Comments
 (0)