blob: 7c10672358bd9149d4491d38ec98c3bf99498223 [file] [log] [blame]
econwar8ef486f2018-08-31 11:36:11 +00001CREATE TABLE FEEDS (
2 FEEDID INT UNSIGNED NOT NULL PRIMARY KEY,
3 GROUPID INT(10) UNSIGNED NOT NULL DEFAULT 0,
efiacor0fa01982019-04-08 14:52:08 +00004 NAME VARCHAR(256) NOT NULL,
efiacor5775de72019-03-26 14:29:01 +00005 VERSION VARCHAR(20) NULL,
econwar8ef486f2018-08-31 11:36:11 +00006 DESCRIPTION VARCHAR(1000),
7 BUSINESS_DESCRIPTION VARCHAR(1000) DEFAULT NULL,
8 AUTH_CLASS VARCHAR(32) NOT NULL,
9 PUBLISHER VARCHAR(8) NOT NULL,
10 SELF_LINK VARCHAR(256),
11 PUBLISH_LINK VARCHAR(256),
12 SUBSCRIBE_LINK VARCHAR(256),
13 LOG_LINK VARCHAR(256),
14 DELETED BOOLEAN DEFAULT FALSE,
15 LAST_MOD TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
16 SUSPENDED BOOLEAN DEFAULT FALSE,
efiacor5775de72019-03-26 14:29:01 +000017 CREATED_DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
18 AAF_INSTANCE VARCHAR(256)
econwar8ef486f2018-08-31 11:36:11 +000019);
20
21CREATE TABLE FEED_ENDPOINT_IDS (
22 FEEDID INT UNSIGNED NOT NULL,
efiacor5775de72019-03-26 14:29:01 +000023 USERID VARCHAR(60) NOT NULL,
24 PASSWORD VARCHAR(100) NOT NULL
econwar8ef486f2018-08-31 11:36:11 +000025);
26
27CREATE TABLE FEED_ENDPOINT_ADDRS (
28 FEEDID INT UNSIGNED NOT NULL,
29 ADDR VARCHAR(44) NOT NULL
30);
31
32CREATE TABLE SUBSCRIPTIONS (
econwarc5037472019-02-14 09:37:44 +000033 SUBID INT UNSIGNED NOT NULL PRIMARY KEY,
34 FEEDID INT UNSIGNED NOT NULL,
35 GROUPID INT(10) UNSIGNED NOT NULL DEFAULT 0,
36 DELIVERY_URL VARCHAR(256),
efiacor5775de72019-03-26 14:29:01 +000037 FOLLOW_REDIRECTS TINYINT(1) NOT NULL DEFAULT 0,
38 DELIVERY_USER VARCHAR(60),
39 DELIVERY_PASSWORD VARCHAR(100),
econwarc5037472019-02-14 09:37:44 +000040 DELIVERY_USE100 BOOLEAN DEFAULT FALSE,
41 METADATA_ONLY BOOLEAN DEFAULT FALSE,
42 SUBSCRIBER VARCHAR(8) NOT NULL,
43 SELF_LINK VARCHAR(256),
44 LOG_LINK VARCHAR(256),
45 LAST_MOD TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
46 SUSPENDED BOOLEAN DEFAULT FALSE,
47 PRIVILEGED_SUBSCRIBER BOOLEAN DEFAULT FALSE,
efiacor5775de72019-03-26 14:29:01 +000048 CREATED_DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
edepaul58553dd2019-03-13 11:54:41 +000049 DECOMPRESS BOOLEAN DEFAULT FALSE,
efiacor5775de72019-03-26 14:29:01 +000050 AAF_INSTANCE VARCHAR(256)
econwar8ef486f2018-08-31 11:36:11 +000051
52);
53
54CREATE TABLE PARAMETERS (
55 KEYNAME VARCHAR(32) NOT NULL PRIMARY KEY,
56 VALUE VARCHAR(4096) NOT NULL
57);
58
59CREATE TABLE LOG_RECORDS (
60 TYPE ENUM('pub', 'del', 'exp', 'pbf', 'dlx') NOT NULL,
61 EVENT_TIME BIGINT NOT NULL, /* time of the publish request */
62 PUBLISH_ID VARCHAR(64) NOT NULL, /* unique ID assigned to this publish attempt */
63 FEEDID INT UNSIGNED NOT NULL, /* pointer to feed in FEEDS */
64 REQURI VARCHAR(256) NOT NULL, /* request URI */
65 METHOD ENUM('DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'POST', 'TRACE') NOT NULL, /* HTTP method */
66 CONTENT_TYPE VARCHAR(256) NOT NULL, /* content type of published file */
67 CONTENT_LENGTH BIGINT NOT NULL, /* content length of published file */
68
69 FEED_FILEID VARCHAR(256), /* file ID of published file */
70 REMOTE_ADDR VARCHAR(40), /* IP address of publishing endpoint */
71 USER VARCHAR(50), /* user name of publishing endpoint */
72 STATUS SMALLINT, /* status code returned to delivering agent */
73
74 DELIVERY_SUBID INT UNSIGNED, /* pointer to subscription in SUBSCRIPTIONS */
75 DELIVERY_FILEID VARCHAR(256), /* file ID of file being delivered */
76 RESULT SMALLINT, /* result received from subscribing agent */
77
78 ATTEMPTS INT, /* deliveries attempted */
79 REASON ENUM('notRetryable', 'retriesExhausted', 'diskFull', 'other'),
80
81 RECORD_ID BIGINT UNSIGNED NOT NULL PRIMARY KEY, /* unique ID for this record */
82 CONTENT_LENGTH_2 BIGINT,
EmmettCox5da50e92019-02-05 16:16:40 +000083 FILENAME VARCHAR(256), /* Name of the file being published on DR */
econwar8ef486f2018-08-31 11:36:11 +000084
85 INDEX (FEEDID) USING BTREE,
86 INDEX (DELIVERY_SUBID) USING BTREE,
87 INDEX (RECORD_ID) USING BTREE
88) ENGINE = MyISAM;
89
90CREATE TABLE INGRESS_ROUTES (
91 SEQUENCE INT UNSIGNED NOT NULL,
92 FEEDID INT UNSIGNED NOT NULL,
efiacor5775de72019-03-26 14:29:01 +000093 USERID VARCHAR(50),
econwar8ef486f2018-08-31 11:36:11 +000094 SUBNET VARCHAR(44),
95 NODESET INT UNSIGNED NOT NULL
96);
97
98CREATE TABLE EGRESS_ROUTES (
99 SUBID INT UNSIGNED NOT NULL PRIMARY KEY,
100 NODEID INT UNSIGNED NOT NULL
101);
102
103CREATE TABLE NETWORK_ROUTES (
104 FROMNODE INT UNSIGNED NOT NULL,
105 TONODE INT UNSIGNED NOT NULL,
106 VIANODE INT UNSIGNED NOT NULL
107);
108
109CREATE TABLE NODESETS (
110 SETID INT UNSIGNED NOT NULL,
111 NODEID INT UNSIGNED NOT NULL
112);
113
114CREATE TABLE NODES (
115 NODEID INT UNSIGNED NOT NULL PRIMARY KEY,
116 NAME VARCHAR(255) NOT NULL,
117 ACTIVE BOOLEAN DEFAULT TRUE
118);
119
120CREATE TABLE GROUPS (
121 GROUPID INT UNSIGNED NOT NULL PRIMARY KEY,
122 AUTHID VARCHAR(100) NOT NULL,
123 NAME VARCHAR(50) NOT NULL,
124 DESCRIPTION VARCHAR(255),
125 CLASSIFICATION VARCHAR(20) NOT NULL,
126 MEMBERS TINYTEXT,
127 LAST_MOD TIMESTAMP DEFAULT CURRENT_TIMESTAMP
128);
129
130INSERT INTO PARAMETERS VALUES
131 ('ACTIVE_POD', 'dmaap-dr-prov'),
132 ('PROV_ACTIVE_NAME', 'dmaap-dr-prov'),
133 ('STANDBY_POD', ''),
134 ('PROV_NAME', 'dmaap-dr-prov'),
135 ('NODES', 'dmaap-dr-node'),
136 ('PROV_DOMAIN', ''),
137 ('DELIVERY_INIT_RETRY_INTERVAL', '10'),
138 ('DELIVERY_MAX_AGE', '86400'),
139 ('DELIVERY_MAX_RETRY_INTERVAL', '3600'),
econwarc5037472019-02-14 09:37:44 +0000140 ('DELIVERY_FILE_PROCESS_INTERVAL', '600'),
econwar8ef486f2018-08-31 11:36:11 +0000141 ('DELIVERY_RETRY_RATIO', '2'),
efiacor5775de72019-03-26 14:29:01 +0000142 ('LOGROLL_INTERVAL', '30'),
econwar8ef486f2018-08-31 11:36:11 +0000143 ('PROV_AUTH_ADDRESSES', 'dmaap-dr-prov|dmaap-dr-node'),
144 ('PROV_AUTH_SUBJECTS', ''),
145 ('PROV_MAXFEED_COUNT', '10000'),
146 ('PROV_MAXSUB_COUNT', '100000'),
147 ('PROV_REQUIRE_CERT', 'false'),
econward3c00d22018-08-31 14:48:53 +0000148 ('PROV_REQUIRE_SECURE', 'true'),
econwarc5037472019-02-14 09:37:44 +0000149 ('_INT_VALUES', 'LOGROLL_INTERVAL|PROV_MAXFEED_COUNT|PROV_MAXSUB_COUNT|DELIVERY_INIT_RETRY_INTERVAL|DELIVERY_MAX_RETRY_INTERVAL|DELIVERY_RETRY_RATIO|DELIVERY_MAX_AGE|DELIVERY_FILE_PROCESS_INTERVAL')
econwar8ef486f2018-08-31 11:36:11 +0000150 ;
151
152INSERT INTO GROUPS(GROUPID, AUTHID, NAME, DESCRIPTION, CLASSIFICATION, MEMBERS)
153VALUES (1, 'Basic dXNlcjE6cGFzc3dvcmQx', 'Group1', 'First Group for testing', 'Class1', 'Member1');
esobmarc2d7dbe2018-09-03 14:58:01 +0100154
efiacor5775de72019-03-26 14:29:01 +0000155INSERT INTO SUBSCRIPTIONS(SUBID, FEEDID, DELIVERY_URL, FOLLOW_REDIRECTS, DELIVERY_USER, DELIVERY_PASSWORD, DELIVERY_USE100, METADATA_ONLY, SUBSCRIBER, SUSPENDED, GROUPID, PRIVILEGED_SUBSCRIBER, AAF_INSTANCE, DECOMPRESS)
156VALUES (1, 1, 'https://172.100.0.5:8080', 0, 'user1', 'password1', true, false, 'user1', false, 1, false, 'legacy', false);
econwar7f93b3d2018-09-03 09:24:00 +0000157
efiacor5775de72019-03-26 14:29:01 +0000158INSERT INTO SUBSCRIPTIONS(SUBID, FEEDID, DELIVERY_URL, FOLLOW_REDIRECTS, DELIVERY_USER, DELIVERY_PASSWORD, DELIVERY_USE100, METADATA_ONLY, SUBSCRIBER, SUSPENDED, GROUPID, AAF_INSTANCE)
159VALUES (2, 1, 'https://172.100.0.5:8080', 0, 'user2', 'password2', true, true, 'subsc2', false, 1, '*');
160
161INSERT INTO SUBSCRIPTIONS(SUBID, FEEDID, DELIVERY_URL, FOLLOW_REDIRECTS, DELIVERY_USER, DELIVERY_PASSWORD, DELIVERY_USE100, METADATA_ONLY, SUBSCRIBER, SUSPENDED, GROUPID, AAF_INSTANCE)
162VALUES (3, 1, 'https://172.100.0.5:8080', 0, 'user3', 'password3', true, true, 'subsc3', false, 1, '*');
163
164INSERT INTO SUBSCRIPTIONS(SUBID, FEEDID, DELIVERY_URL, DELIVERY_USER, DELIVERY_PASSWORD, SUBSCRIBER, SELF_LINK, LOG_LINK, AAF_INSTANCE)
165VALUES (23, 1, 'http://delivery_url', 'user1', 'somepassword', 'sub123', 'selflink', 'loglink', 'legacy');
Emmett Cox096e9772018-09-03 11:43:13 +0100166
Emmett Cox5cbbe742018-09-05 10:33:05 +0100167INSERT INTO FEED_ENDPOINT_IDS(FEEDID, USERID, PASSWORD)
168VALUES (1, 'USER', 'PASSWORD');
169
EmmettCox51f0b1c2019-03-22 17:19:56 +0000170INSERT INTO FEED_ENDPOINT_ADDRS(FEEDID, ADDR)
171VALUES (1, '172.0.0.1');
172
Emmett Cox096e9772018-09-03 11:43:13 +0100173INSERT INTO FEEDS(FEEDID, GROUPID, NAME, VERSION, DESCRIPTION, BUSINESS_DESCRIPTION, AUTH_CLASS, PUBLISHER, SELF_LINK, PUBLISH_LINK, SUBSCRIBE_LINK, LOG_LINK)
174VALUES (1, 1,'Feed1','v0.1', 'First Feed for testing', 'First Feed for testing', 'auth_class', 'pub','self_link','publish_link','subscribe_link','log_link');
175
efiacor5775de72019-03-26 14:29:01 +0000176INSERT INTO FEEDS(FEEDID, GROUPID, NAME, VERSION, DESCRIPTION, BUSINESS_DESCRIPTION, AUTH_CLASS, PUBLISHER, SELF_LINK, PUBLISH_LINK, SUBSCRIBE_LINK, LOG_LINK, AAF_INSTANCE)
177VALUES (2, 1,'AafFeed','v0.1', 'AAF Feed for testing', 'AAF Feed for testing', 'auth_class', 'pub','self_link','publish_link','subscribe_link','log_link','*');
178
179INSERT INTO FEEDS(FEEDID, GROUPID, NAME, VERSION, DESCRIPTION, BUSINESS_DESCRIPTION, AUTH_CLASS, PUBLISHER, SELF_LINK, PUBLISH_LINK, SUBSCRIBE_LINK, LOG_LINK, AAF_INSTANCE)
180VALUES (3, 1,'DeleteableAafFeed','v0.1', 'AAF Feed3 for testing', 'AAF Feed3 for testing', 'auth_class', 'pub','self_link','publish_link','subscribe_link','log_link','*');
181
Emmett Cox096e9772018-09-03 11:43:13 +0100182insert into INGRESS_ROUTES(SEQUENCE, FEEDID , USERID, SUBNET, NODESET)
183VALUES (1,1,'user',null,2);
184
185insert into INGRESS_ROUTES(SEQUENCE, FEEDID , USERID, SUBNET, NODESET)
186VALUES (2,1,'user',null,2);
187
188insert into NODESETS(SETID, NODEID)
esobmar8f2e78c2018-09-07 16:39:17 +0100189VALUES (2,2);
Emmett Cox1d971022018-09-06 13:58:27 +0100190
EmmettCoxefa3dec2019-02-18 12:24:01 +0000191insert into LOG_RECORDS(RECORD_ID,TYPE,EVENT_TIME,PUBLISH_ID,FEEDID,REQURI,METHOD,CONTENT_TYPE,CONTENT_LENGTH,FEED_FILEID,REMOTE_ADDR,USER,STATUS,DELIVERY_SUBID,DELIVERY_FILEID,RESULT,ATTEMPTS,REASON,FILENAME)
192VALUES(1,'pub',2536159564422,'ID',1,'URL/file123','PUT','application/vnd.dmaap-dr.log-list; version=1.0',100,1,'172.0.0.8','user',204,1,1,204,0,'other','file123');
Emmett Cox1d971022018-09-06 13:58:27 +0100193
194CREATE ALIAS IF NOT EXISTS `SUBSTRING_INDEX` AS $$
195 String Function(String one, String two, String three){
196 return "url";
197 }
esobmar8f2e78c2018-09-07 16:39:17 +0100198$$;
199
200insert into NETWORK_ROUTES(FROMNODE, TONODE, VIANODE)
201VALUES (1, 3, 2);
202
203insert into NODES(NODEID, NAME) values
204 (1, 'stub_from.'),
205 (2, 'stub_via.'),
206 (3, 'stub_to.'),
207 (4, 'node01.'),
208 (5, 'node02.'),
209 (6, 'node03.')
210;
211insert into EGRESS_ROUTES(SUBID, NODEID) values (1, 1);
212