econwar | 8ef486f | 2018-08-31 11:36:11 +0000 | [diff] [blame] | 1 | CREATE 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 | |
| 20 | CREATE TABLE FEED_ENDPOINT_IDS ( |
| 21 | FEEDID INT UNSIGNED NOT NULL, |
| 22 | USERID VARCHAR(20) NOT NULL, |
| 23 | PASSWORD VARCHAR(32) NOT NULL |
| 24 | ); |
| 25 | |
| 26 | CREATE TABLE FEED_ENDPOINT_ADDRS ( |
| 27 | FEEDID INT UNSIGNED NOT NULL, |
| 28 | ADDR VARCHAR(44) NOT NULL |
| 29 | ); |
| 30 | |
| 31 | CREATE 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 | |
| 49 | CREATE TABLE PARAMETERS ( |
| 50 | KEYNAME VARCHAR(32) NOT NULL PRIMARY KEY, |
| 51 | VALUE VARCHAR(4096) NOT NULL |
| 52 | ); |
| 53 | |
| 54 | CREATE 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 | |
| 84 | CREATE 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 | |
| 92 | CREATE TABLE EGRESS_ROUTES ( |
| 93 | SUBID INT UNSIGNED NOT NULL PRIMARY KEY, |
| 94 | NODEID INT UNSIGNED NOT NULL |
| 95 | ); |
| 96 | |
| 97 | CREATE TABLE NETWORK_ROUTES ( |
| 98 | FROMNODE INT UNSIGNED NOT NULL, |
| 99 | TONODE INT UNSIGNED NOT NULL, |
| 100 | VIANODE INT UNSIGNED NOT NULL |
| 101 | ); |
| 102 | |
| 103 | CREATE TABLE NODESETS ( |
| 104 | SETID INT UNSIGNED NOT NULL, |
| 105 | NODEID INT UNSIGNED NOT NULL |
| 106 | ); |
| 107 | |
| 108 | CREATE TABLE NODES ( |
| 109 | NODEID INT UNSIGNED NOT NULL PRIMARY KEY, |
| 110 | NAME VARCHAR(255) NOT NULL, |
| 111 | ACTIVE BOOLEAN DEFAULT TRUE |
| 112 | ); |
| 113 | |
| 114 | CREATE 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 | |
| 124 | INSERT 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'), |
econwar | d3c00d2 | 2018-08-31 14:48:53 +0000 | [diff] [blame] | 141 | ('PROV_REQUIRE_SECURE', 'true'), |
econwar | 8ef486f | 2018-08-31 11:36:11 +0000 | [diff] [blame] | 142 | ('_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 | |
| 145 | INSERT INTO GROUPS(GROUPID, AUTHID, NAME, DESCRIPTION, CLASSIFICATION, MEMBERS) |
| 146 | VALUES (1, 'Basic dXNlcjE6cGFzc3dvcmQx', 'Group1', 'First Group for testing', 'Class1', 'Member1'); |
esobmar | c2d7dbe | 2018-09-03 14:58:01 +0100 | [diff] [blame] | 147 | |
econwar | 7f93b3d | 2018-09-03 09:24:00 +0000 | [diff] [blame^] | 148 | INSERT INTO SUBSCRIPTIONS(SUBID, FEEDID, DELIVERY_URL, DELIVERY_USER, DELIVERY_PASSWORD, DELIVERY_USE100, METADATA_ONLY, SUBSCRIBER, SUSPENDED, GROUPID) |
| 149 | VALUES (1, 1, 'https://172.100.0.5:8080', 'user1', 'password1', true, false, 'user1', false, 1); |
| 150 | |
esobmar | c2d7dbe | 2018-09-03 14:58:01 +0100 | [diff] [blame] | 151 | INSERT INTO SUBSCRIPTIONS(SUBID, FEEDID, DELIVERY_URL, DELIVERY_USER, DELIVERY_PASSWORD, SUBSCRIBER, SELF_LINK, LOG_LINK) |
| 152 | VALUES (23, 1, 'http://delivery_url', 'user1', 'somepassword', 'sub123', 'selflink', 'loglink'); |
Emmett Cox | 096e977 | 2018-09-03 11:43:13 +0100 | [diff] [blame] | 153 | |
| 154 | INSERT INTO FEEDS(FEEDID, GROUPID, NAME, VERSION, DESCRIPTION, BUSINESS_DESCRIPTION, AUTH_CLASS, PUBLISHER, SELF_LINK, PUBLISH_LINK, SUBSCRIBE_LINK, LOG_LINK) |
| 155 | VALUES (1, 1,'Feed1','v0.1', 'First Feed for testing', 'First Feed for testing', 'auth_class', 'pub','self_link','publish_link','subscribe_link','log_link'); |
| 156 | |
| 157 | insert into INGRESS_ROUTES(SEQUENCE, FEEDID , USERID, SUBNET, NODESET) |
| 158 | VALUES (1,1,'user',null,2); |
| 159 | |
| 160 | insert into INGRESS_ROUTES(SEQUENCE, FEEDID , USERID, SUBNET, NODESET) |
| 161 | VALUES (2,1,'user',null,2); |
| 162 | |
| 163 | insert into NODESETS(SETID, NODEID) |
| 164 | VALUES (2,0); |