You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ha...@apache.org on 2016/12/08 12:47:42 UTC

[2/2] incubator-eagle git commit: [MINOR] Rename createTable.sql to metadata-ddl.sql

[MINOR] Rename createTable.sql to metadata-ddl.sql


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/cfd4d38f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/cfd4d38f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/cfd4d38f

Branch: refs/heads/master
Commit: cfd4d38fdbe9fa3922dcec566461f0ead810cf0c
Parents: c1dcfb1
Author: Hao Chen <ha...@apache.org>
Authored: Thu Dec 8 20:47:05 2016 +0800
Committer: Hao Chen <ha...@apache.org>
Committed: Thu Dec 8 20:47:05 2016 +0800

----------------------------------------------------------------------
 .../src/main/bin/createTables.sql               | 137 -------------------
 .../src/main/bin/metadata-ddl.sql               | 137 +++++++++++++++++++
 2 files changed, 137 insertions(+), 137 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/cfd4d38f/eagle-server-assembly/src/main/bin/createTables.sql
----------------------------------------------------------------------
diff --git a/eagle-server-assembly/src/main/bin/createTables.sql b/eagle-server-assembly/src/main/bin/createTables.sql
deleted file mode 100644
index f80a7ea..0000000
--- a/eagle-server-assembly/src/main/bin/createTables.sql
+++ /dev/null
@@ -1,137 +0,0 @@
--- /*
---  * Licensed to the Apache Software Foundation (ASF) under one or more
---  * contributor license agreements.  See the NOTICE file distributed with
---  * this work for additional information regarding copyright ownership.
---  * The ASF licenses this file to You under the Apache License, Version 2.0
---  * (the "License"); you may not use this file except in compliance with
---  * the License.  You may obtain a copy of the License at
---  *
---  *    http://www.apache.org/licenses/LICENSE-2.0
---  *
---  * Unless required by applicable law or agreed to in writing, software
---  * distributed under the License is distributed on an "AS IS" BASIS,
---  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---  * See the License for the specific language governing permissions and
---  * limitations under the License.
---  *
---  */
-
-
--- application framework metadata
-
-CREATE TABLE IF NOT EXISTS applications (
-  uuid varchar(50) PRIMARY KEY,
-  appid varchar(100) DEFAULT NULL,
-  siteid varchar(100) DEFAULT NULL,
-  apptype varchar(30) DEFAULT NULL,
-  appmode varchar(10) DEFAULT NULL,
-  jarpath varchar(255) DEFAULT NULL,
-  appstatus  varchar(20) DEFAULT NULL,
-  configuration mediumtext DEFAULT NULL,
-  context mediumtext DEFAULT NULL,
-  createdtime bigint(20) DEFAULT NULL,
-  modifiedtime  bigint(20) DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS sites (
-  uuid varchar(50) PRIMARY KEY,
-  siteid varchar(100) DEFAULT NULL,
-  sitename varchar(100) DEFAULT NULL,
-  description varchar(255) DEFAULT NULL,
-  createdtime bigint(20) DEFAULT NULL,
-  modifiedtime  bigint(20) DEFAULT NULL,
-  UNIQUE (siteid)
-);
-
--- eagle security module metadata
-
-CREATE TABLE IF NOT EXISTS hdfs_sensitivity_entity (
-  site varchar(20) DEFAULT NULL,
-  filedir varchar(100) DEFAULT NULL,
-  sensitivity_type varchar(20) DEFAULT NULL,
-  primary key (site, filedir)
-);
-
-CREATE TABLE IF NOT EXISTS ip_securityzone (
-  iphost varchar(100) DEFAULT NULL,
-  security_zone varchar(100) DEFAULT NULL,
-  primary key (iphost)
-);
-
-CREATE TABLE IF NOT EXISTS hbase_sensitivity_entity (
-  site varchar(20) DEFAULT NULL,
-  hbase_resource varchar(100) DEFAULT NULL,
-  sensitivity_type varchar(20) DEFAULT NULL,
-  primary key (site, hbase_resource)
-);
-
--- alert engine metadata
-
-CREATE TABLE IF NOT EXISTS stream_cluster (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS stream_definition (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS kafka_tuple_metadata (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS policy_definition (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS publishment (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS schedule_state (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS policy_assignment (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS topology (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS publishment_type (
-  id VARCHAR (50) PRIMARY KEY,
-  content longtext DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS policy_publishment (
-  policyId VARCHAR(50),
-  publishmentName VARCHAR(50),
-  PRIMARY KEY(policyId, publishmentName),
-  CONSTRAINT `policy_id_fk` FOREIGN KEY (`policyId`) REFERENCES `policy_definition` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
-  CONSTRAINT `publishment_id_fk` FOREIGN KEY (`publishmentName`) REFERENCES `publishment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-);
-
-CREATE TABLE IF NOT EXISTS alert_event (
-  alertId VARCHAR (50) PRIMARY KEY,
-  siteId VARCHAR (50) DEFAULT NULL,
-  appIds VARCHAR (255) DEFAULT NULL,
-  policyId VARCHAR (50) DEFAULT NULL,
-  alertTimestamp bigint(20) DEFAULT NULL,
-  policyValue mediumtext DEFAULT NULL,
-  alertData mediumtext DEFAULT NULL
-);
-
-INSERT INTO publishment_type(id, content) VALUES
-('Kafka', '{"name":"Kafka","type":"org.apache.eagle.alert.engine.publisher.impl.AlertKafkaPublisher","description":null,"fields":[{"name":"kafka_broker","value":"sandbox.hortonworks.com:6667"},{"name":"topic"}]}'),
-('Email', '{"name":"Email","type":"org.apache.eagle.alert.engine.publisher.impl.AlertEmailPublisher","description":null,"fields":[{"name":"subject"},{"name":"sender"}, {"name":"recipients"}]}'),
-('Slack', '{"name":"Slack","type":"org.apache.eagle.alert.engine.publisher.impl.AlertSlackPublisher","description":null,"fields":[{"name":"token"},{"name":"channels"}, {"name":"severitys"}, {"name":"urltemplate"}]}'),
-('Storage', '{"name":"Storage","type":"org.apache.eagle.alert.app.AlertEagleStorePlugin","description":null,"fields":[]}');

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/cfd4d38f/eagle-server-assembly/src/main/bin/metadata-ddl.sql
----------------------------------------------------------------------
diff --git a/eagle-server-assembly/src/main/bin/metadata-ddl.sql b/eagle-server-assembly/src/main/bin/metadata-ddl.sql
new file mode 100644
index 0000000..f80a7ea
--- /dev/null
+++ b/eagle-server-assembly/src/main/bin/metadata-ddl.sql
@@ -0,0 +1,137 @@
+-- /*
+--  * Licensed to the Apache Software Foundation (ASF) under one or more
+--  * contributor license agreements.  See the NOTICE file distributed with
+--  * this work for additional information regarding copyright ownership.
+--  * The ASF licenses this file to You under the Apache License, Version 2.0
+--  * (the "License"); you may not use this file except in compliance with
+--  * the License.  You may obtain a copy of the License at
+--  *
+--  *    http://www.apache.org/licenses/LICENSE-2.0
+--  *
+--  * Unless required by applicable law or agreed to in writing, software
+--  * distributed under the License is distributed on an "AS IS" BASIS,
+--  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+--  * See the License for the specific language governing permissions and
+--  * limitations under the License.
+--  *
+--  */
+
+
+-- application framework metadata
+
+CREATE TABLE IF NOT EXISTS applications (
+  uuid varchar(50) PRIMARY KEY,
+  appid varchar(100) DEFAULT NULL,
+  siteid varchar(100) DEFAULT NULL,
+  apptype varchar(30) DEFAULT NULL,
+  appmode varchar(10) DEFAULT NULL,
+  jarpath varchar(255) DEFAULT NULL,
+  appstatus  varchar(20) DEFAULT NULL,
+  configuration mediumtext DEFAULT NULL,
+  context mediumtext DEFAULT NULL,
+  createdtime bigint(20) DEFAULT NULL,
+  modifiedtime  bigint(20) DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS sites (
+  uuid varchar(50) PRIMARY KEY,
+  siteid varchar(100) DEFAULT NULL,
+  sitename varchar(100) DEFAULT NULL,
+  description varchar(255) DEFAULT NULL,
+  createdtime bigint(20) DEFAULT NULL,
+  modifiedtime  bigint(20) DEFAULT NULL,
+  UNIQUE (siteid)
+);
+
+-- eagle security module metadata
+
+CREATE TABLE IF NOT EXISTS hdfs_sensitivity_entity (
+  site varchar(20) DEFAULT NULL,
+  filedir varchar(100) DEFAULT NULL,
+  sensitivity_type varchar(20) DEFAULT NULL,
+  primary key (site, filedir)
+);
+
+CREATE TABLE IF NOT EXISTS ip_securityzone (
+  iphost varchar(100) DEFAULT NULL,
+  security_zone varchar(100) DEFAULT NULL,
+  primary key (iphost)
+);
+
+CREATE TABLE IF NOT EXISTS hbase_sensitivity_entity (
+  site varchar(20) DEFAULT NULL,
+  hbase_resource varchar(100) DEFAULT NULL,
+  sensitivity_type varchar(20) DEFAULT NULL,
+  primary key (site, hbase_resource)
+);
+
+-- alert engine metadata
+
+CREATE TABLE IF NOT EXISTS stream_cluster (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS stream_definition (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS kafka_tuple_metadata (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS policy_definition (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS publishment (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS schedule_state (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS policy_assignment (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS topology (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS publishment_type (
+  id VARCHAR (50) PRIMARY KEY,
+  content longtext DEFAULT NULL
+);
+
+CREATE TABLE IF NOT EXISTS policy_publishment (
+  policyId VARCHAR(50),
+  publishmentName VARCHAR(50),
+  PRIMARY KEY(policyId, publishmentName),
+  CONSTRAINT `policy_id_fk` FOREIGN KEY (`policyId`) REFERENCES `policy_definition` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `publishment_id_fk` FOREIGN KEY (`publishmentName`) REFERENCES `publishment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS alert_event (
+  alertId VARCHAR (50) PRIMARY KEY,
+  siteId VARCHAR (50) DEFAULT NULL,
+  appIds VARCHAR (255) DEFAULT NULL,
+  policyId VARCHAR (50) DEFAULT NULL,
+  alertTimestamp bigint(20) DEFAULT NULL,
+  policyValue mediumtext DEFAULT NULL,
+  alertData mediumtext DEFAULT NULL
+);
+
+INSERT INTO publishment_type(id, content) VALUES
+('Kafka', '{"name":"Kafka","type":"org.apache.eagle.alert.engine.publisher.impl.AlertKafkaPublisher","description":null,"fields":[{"name":"kafka_broker","value":"sandbox.hortonworks.com:6667"},{"name":"topic"}]}'),
+('Email', '{"name":"Email","type":"org.apache.eagle.alert.engine.publisher.impl.AlertEmailPublisher","description":null,"fields":[{"name":"subject"},{"name":"sender"}, {"name":"recipients"}]}'),
+('Slack', '{"name":"Slack","type":"org.apache.eagle.alert.engine.publisher.impl.AlertSlackPublisher","description":null,"fields":[{"name":"token"},{"name":"channels"}, {"name":"severitys"}, {"name":"urltemplate"}]}'),
+('Storage', '{"name":"Storage","type":"org.apache.eagle.alert.app.AlertEagleStorePlugin","description":null,"fields":[]}');