blob: cd87dde028e507d9002e4661e52521348c078110 [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,
4 NAME VARCHAR(255) NOT NULL,
5 VERSION VARCHAR(20) NOT NULL,
6 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,
17 CREATED_DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP
18);
19
20CREATE TABLE FEED_ENDPOINT_IDS (
21 FEEDID INT UNSIGNED NOT NULL,
22 USERID VARCHAR(20) NOT NULL,
23 PASSWORD VARCHAR(32) NOT NULL
24);
25
26CREATE TABLE FEED_ENDPOINT_ADDRS (
27 FEEDID INT UNSIGNED NOT NULL,
28 ADDR VARCHAR(44) NOT NULL
29);
30
31CREATE TABLE SUBSCRIPTIONS (
32 SUBID INT UNSIGNED NOT NULL PRIMARY KEY,
33 FEEDID INT UNSIGNED NOT NULL,
34 GROUPID INT(10) UNSIGNED NOT NULL DEFAULT 0,
35 DELIVERY_URL VARCHAR(256),
36 DELIVERY_USER VARCHAR(20),
37 DELIVERY_PASSWORD VARCHAR(32),
38 DELIVERY_USE100 BOOLEAN DEFAULT FALSE,
39 METADATA_ONLY BOOLEAN DEFAULT FALSE,
40 SUBSCRIBER VARCHAR(8) NOT NULL,
41 SELF_LINK VARCHAR(256),
42 LOG_LINK VARCHAR(256),
43 LAST_MOD TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
44 SUSPENDED BOOLEAN DEFAULT FALSE,
45 CREATED_DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP
46
47);
48
49CREATE TABLE PARAMETERS (
50 KEYNAME VARCHAR(32) NOT NULL PRIMARY KEY,
51 VALUE VARCHAR(4096) NOT NULL
52);
53
54CREATE TABLE LOG_RECORDS (
55 TYPE ENUM('pub', 'del', 'exp', 'pbf', 'dlx') NOT NULL,
56 EVENT_TIME BIGINT NOT NULL, /* time of the publish request */
57 PUBLISH_ID VARCHAR(64) NOT NULL, /* unique ID assigned to this publish attempt */
58 FEEDID INT UNSIGNED NOT NULL, /* pointer to feed in FEEDS */
59 REQURI VARCHAR(256) NOT NULL, /* request URI */
60 METHOD ENUM('DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'POST', 'TRACE') NOT NULL, /* HTTP method */
61 CONTENT_TYPE VARCHAR(256) NOT NULL, /* content type of published file */
62 CONTENT_LENGTH BIGINT NOT NULL, /* content length of published file */
63
64 FEED_FILEID VARCHAR(256), /* file ID of published file */
65 REMOTE_ADDR VARCHAR(40), /* IP address of publishing endpoint */
66 USER VARCHAR(50), /* user name of publishing endpoint */
67 STATUS SMALLINT, /* status code returned to delivering agent */
68
69 DELIVERY_SUBID INT UNSIGNED, /* pointer to subscription in SUBSCRIPTIONS */
70 DELIVERY_FILEID VARCHAR(256), /* file ID of file being delivered */
71 RESULT SMALLINT, /* result received from subscribing agent */
72
73 ATTEMPTS INT, /* deliveries attempted */
74 REASON ENUM('notRetryable', 'retriesExhausted', 'diskFull', 'other'),
75
76 RECORD_ID BIGINT UNSIGNED NOT NULL PRIMARY KEY, /* unique ID for this record */
77 CONTENT_LENGTH_2 BIGINT,
78
79 INDEX (FEEDID) USING BTREE,
80 INDEX (DELIVERY_SUBID) USING BTREE,
81 INDEX (RECORD_ID) USING BTREE
82) ENGINE = MyISAM;
83
84CREATE TABLE INGRESS_ROUTES (
85 SEQUENCE INT UNSIGNED NOT NULL,
86 FEEDID INT UNSIGNED NOT NULL,
87 USERID VARCHAR(20),
88 SUBNET VARCHAR(44),
89 NODESET INT UNSIGNED NOT NULL
90);
91
92CREATE TABLE EGRESS_ROUTES (
93 SUBID INT UNSIGNED NOT NULL PRIMARY KEY,
94 NODEID INT UNSIGNED NOT NULL
95);
96
97CREATE TABLE NETWORK_ROUTES (
98 FROMNODE INT UNSIGNED NOT NULL,
99 TONODE INT UNSIGNED NOT NULL,
100 VIANODE INT UNSIGNED NOT NULL
101);
102
103CREATE TABLE NODESETS (
104 SETID INT UNSIGNED NOT NULL,
105 NODEID INT UNSIGNED NOT NULL
106);
107
108CREATE TABLE NODES (
109 NODEID INT UNSIGNED NOT NULL PRIMARY KEY,
110 NAME VARCHAR(255) NOT NULL,
111 ACTIVE BOOLEAN DEFAULT TRUE
112);
113
114CREATE TABLE GROUPS (
115 GROUPID INT UNSIGNED NOT NULL PRIMARY KEY,
116 AUTHID VARCHAR(100) NOT NULL,
117 NAME VARCHAR(50) NOT NULL,
118 DESCRIPTION VARCHAR(255),
119 CLASSIFICATION VARCHAR(20) NOT NULL,
120 MEMBERS TINYTEXT,
121 LAST_MOD TIMESTAMP DEFAULT CURRENT_TIMESTAMP
122);
123
124INSERT INTO PARAMETERS VALUES
125 ('ACTIVE_POD', 'dmaap-dr-prov'),
126 ('PROV_ACTIVE_NAME', 'dmaap-dr-prov'),
127 ('STANDBY_POD', ''),
128 ('PROV_NAME', 'dmaap-dr-prov'),
129 ('NODES', 'dmaap-dr-node'),
130 ('PROV_DOMAIN', ''),
131 ('DELIVERY_INIT_RETRY_INTERVAL', '10'),
132 ('DELIVERY_MAX_AGE', '86400'),
133 ('DELIVERY_MAX_RETRY_INTERVAL', '3600'),
134 ('DELIVERY_RETRY_RATIO', '2'),
135 ('LOGROLL_INTERVAL', '300'),
136 ('PROV_AUTH_ADDRESSES', 'dmaap-dr-prov|dmaap-dr-node'),
137 ('PROV_AUTH_SUBJECTS', ''),
138 ('PROV_MAXFEED_COUNT', '10000'),
139 ('PROV_MAXSUB_COUNT', '100000'),
140 ('PROV_REQUIRE_CERT', 'false'),
econward3c00d22018-08-31 14:48:53 +0000141 ('PROV_REQUIRE_SECURE', 'true'),
econwar8ef486f2018-08-31 11:36:11 +0000142 ('_INT_VALUES', 'LOGROLL_INTERVAL|PROV_MAXFEED_COUNT|PROV_MAXSUB_COUNT|DELIVERY_INIT_RETRY_INTERVAL|DELIVERY_MAX_RETRY_INTERVAL|DELIVERY_RETRY_RATIO|DELIVERY_MAX_AGE')
143 ;
144
145INSERT INTO GROUPS(GROUPID, AUTHID, NAME, DESCRIPTION, CLASSIFICATION, MEMBERS)
146VALUES (1, 'Basic dXNlcjE6cGFzc3dvcmQx', 'Group1', 'First Group for testing', 'Class1', 'Member1');
esobmarc2d7dbe2018-09-03 14:58:01 +0100147
econwar7f93b3d2018-09-03 09:24:00 +0000148INSERT INTO SUBSCRIPTIONS(SUBID, FEEDID, DELIVERY_URL, DELIVERY_USER, DELIVERY_PASSWORD, DELIVERY_USE100, METADATA_ONLY, SUBSCRIBER, SUSPENDED, GROUPID)
149VALUES (1, 1, 'https://172.100.0.5:8080', 'user1', 'password1', true, false, 'user1', false, 1);
150
esobmarc2d7dbe2018-09-03 14:58:01 +0100151INSERT INTO SUBSCRIPTIONS(SUBID, FEEDID, DELIVERY_URL, DELIVERY_USER, DELIVERY_PASSWORD, SUBSCRIBER, SELF_LINK, LOG_LINK)
152VALUES (23, 1, 'http://delivery_url', 'user1', 'somepassword', 'sub123', 'selflink', 'loglink');
Emmett Cox096e9772018-09-03 11:43:13 +0100153
Emmett Cox5cbbe742018-09-05 10:33:05 +0100154INSERT INTO FEED_ENDPOINT_IDS(FEEDID, USERID, PASSWORD)
155VALUES (1, 'USER', 'PASSWORD');
156
Emmett Cox096e9772018-09-03 11:43:13 +0100157INSERT INTO FEEDS(FEEDID, GROUPID, NAME, VERSION, DESCRIPTION, BUSINESS_DESCRIPTION, AUTH_CLASS, PUBLISHER, SELF_LINK, PUBLISH_LINK, SUBSCRIBE_LINK, LOG_LINK)
158VALUES (1, 1,'Feed1','v0.1', 'First Feed for testing', 'First Feed for testing', 'auth_class', 'pub','self_link','publish_link','subscribe_link','log_link');
159
160insert into INGRESS_ROUTES(SEQUENCE, FEEDID , USERID, SUBNET, NODESET)
161VALUES (1,1,'user',null,2);
162
163insert into INGRESS_ROUTES(SEQUENCE, FEEDID , USERID, SUBNET, NODESET)
164VALUES (2,1,'user',null,2);
165
166insert into NODESETS(SETID, NODEID)
esobmar8f2e78c2018-09-07 16:39:17 +0100167VALUES (2,2);
Emmett Cox1d971022018-09-06 13:58:27 +0100168
169insert 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)
170VALUES(1,'pub',2536159564422,'ID',1,'URL','GET','application/vnd.att-dr.log-list; version=1.0',100,1,'172.0.0.8','user',204,1,1,204,0,'other');
171
172CREATE ALIAS IF NOT EXISTS `SUBSTRING_INDEX` AS $$
173 String Function(String one, String two, String three){
174 return "url";
175 }
esobmar8f2e78c2018-09-07 16:39:17 +0100176$$;
177
178insert into NETWORK_ROUTES(FROMNODE, TONODE, VIANODE)
179VALUES (1, 3, 2);
180
181insert into NODES(NODEID, NAME) values
182 (1, 'stub_from.'),
183 (2, 'stub_via.'),
184 (3, 'stub_to.'),
185 (4, 'node01.'),
186 (5, 'node02.'),
187 (6, 'node03.')
188;
189insert into EGRESS_ROUTES(SUBID, NODEID) values (1, 1);
190