summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts2
-rw-r--r--components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html2
-rw-r--r--components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts2
-rw-r--r--components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html2
-rw-r--r--components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts2
-rw-r--r--components/datalake-handler/admin/src/src/assets/i18n/en-us.json6
-rw-r--r--components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json8
-rw-r--r--components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json8
-rw-r--r--components/datalake-handler/feeder/src/assembly/scripts/init_db.sql22
-rw-r--r--components/datalake-handler/feeder/src/assembly/scripts/init_db_data.sql35
-rw-r--r--components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java8
-rw-r--r--components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Db.java4
-rw-r--r--components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/db/MongodbService.java4
-rw-r--r--components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/DbTest.java2
14 files changed, 73 insertions, 34 deletions
diff --git a/components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts b/components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts
index aa34b517..8ccbcc91 100644
--- a/components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts
+++ b/components/datalake-handler/admin/src/src/app/core/services/rest-api.service.ts
@@ -166,7 +166,7 @@ export class RestApiService {
Database
*/
getDbEncryptList(flag): Observable<any> {
- return this.http.get(prefix + "dbs/list?tool="+flag).pipe(
+ return this.http.get(prefix + "dbs/list?isDb="+flag).pipe(
retry(1),
map(this.extractData),
catchError(this.handleError)
diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html
index 304879ee..440485c5 100644
--- a/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html
+++ b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.html
@@ -24,7 +24,7 @@ limitations under the License.
</div>
<!-- Only for feeder page -->
- <div class="pt-3 pl-2 align-self-center" *ngIf="this.title == 'SIDEBAR.FEDDFER'">
+ <div class="pt-3 pl-2 align-self-center" *ngIf="this.title == 'SIDEBAR.FEEDER'">
<label class="dl-switch">
<input id="switch" type="checkbox" [(ngModel)]="this.feeder.running"
(ngModelChange)="this.changeFeederStatus()" />
diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts
index 8c39ec18..2d479ea6 100644
--- a/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts
+++ b/components/datalake-handler/admin/src/src/app/shared/layout/header/header.component.ts
@@ -64,7 +64,7 @@ export class HeaderComponent {
});
this.selectedLang = this.translateService.defaultLang;
- if ((this.title = "SIDEBAR.FEDDFER")) {
+ if ((this.title = "SIDEBAR.FEEDER")) {
this.restApiService.getFeederstatus().subscribe((data: {}) => {
this.feeder = new Feeder();
this.feeder = data;
diff --git a/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html
index 2e463883..a0ed00c4 100644
--- a/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html
+++ b/components/datalake-handler/admin/src/src/app/shared/layout/sidebar/sidebar.component.html
@@ -30,7 +30,7 @@ limitations under the License.
<a class="nav-link" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}"
routerLink="/feeder">
<i class="fas fa-tachometer-alt">&nbsp;</i>
- {{"SIDEBAR.FEDDFER" | translate}}
+ {{"SIDEBAR.FEEDER" | translate}}
</a>
</li>
diff --git a/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts
index 921910b8..ceb9e59f 100644
--- a/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts
+++ b/components/datalake-handler/admin/src/src/app/views/feeder/feeder.component.ts
@@ -49,7 +49,7 @@ export class FeederComponent implements OnInit {
private notificationService: ToastrNotificationService,
private spinner: NgxSpinnerService
) {
- this.adminService.setTitle("SIDEBAR.FEDDFER");
+ this.adminService.setTitle("SIDEBAR.FEEDER");
this.restApiService.getTopicsFromFeeder().subscribe(
res => {
this.topicContent = res.length.toString();
diff --git a/components/datalake-handler/admin/src/src/assets/i18n/en-us.json b/components/datalake-handler/admin/src/src/assets/i18n/en-us.json
index 233f1377..f0217a8f 100644
--- a/components/datalake-handler/admin/src/src/assets/i18n/en-us.json
+++ b/components/datalake-handler/admin/src/src/assets/i18n/en-us.json
@@ -1,6 +1,6 @@
{
"SIDEBAR": {
- "FEDDFER": "DataLake Feeder",
+ "FEEDER": "DataLake Feeder",
"KAFKA": "Kafka",
"TOPICS": "Topics",
"DATABASE": "Database",
@@ -11,7 +11,7 @@
},
"NAME": "Name",
"STATUS": "Status",
- "SINK": "Sink",
+ "SINK": "Target",
"AUTHENTICATION": "Authentication",
"DATA_FORMAT": "Data format",
"TTL": "TTL",
@@ -56,7 +56,7 @@
"NODATA": "No Data",
"NEW_TEMPLATE": "New design",
"TEMPLATE_BODY": "Body",
- "FIELUPLOAD": "Import",
+ "FIELUPLOAD": "Select File ...",
"SUCCESSFULLY_CREARED": "Successfully created.",
"FAILED_CREARED": "Failed updated.",
"SUCCESSFULLY_UPDATED": "Successfully updated.",
diff --git a/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json b/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json
index 22bfe424..0ba8503f 100644
--- a/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json
+++ b/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json
@@ -1,11 +1,11 @@
{
"SIDEBAR": {
- "FEDDFER": "DataLake Feeder",
+ "FEEDER": "DataLake Feeder",
"TOPICS": "Topics",
- "KAFKA":"卡夫卡",
+ "KAFKA":"Kafka",
"DATABASE": "Database",
- "DASHBOARD": "仪表板设置",
- "DASHBOARDLIST": "仪表板",
+ "DASHBOARD": "工具设置",
+ "DASHBOARDLIST": "工具",
"TEMPLATE": "模板",
"ABOUT": "About"
},
diff --git a/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json b/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json
index 83e1be99..a3649be0 100644
--- a/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json
+++ b/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json
@@ -1,11 +1,11 @@
{
"SIDEBAR": {
- "FEDDFER": "DataLake Feeder",
- "KAFKA":"卡夫卡",
+ "FEEDER": "DataLake Feeder",
+ "KAFKA":"Kafka",
"TOPICS": "Topics",
"DATABASE": "Database",
- "DASHBOARD": "儀表板設置",
- "DASHBOARDLIST": "儀表板",
+ "DASHBOARD": "工具設置",
+ "DASHBOARDLIST": "工具",
"TEMPLATE": "模板",
"ABOUT": "About"
},
diff --git a/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql b/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql
index 72892a27..8a914270 100644
--- a/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql
+++ b/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql
@@ -1,3 +1,23 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : DATALAKE
+* ================================================================================
+* Copyright 2019 China Mobile
+*=================================================================================
+* Licensed 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.
+* ============LICENSE_END=========================================================
+*/
+
drop DATABASE datalake;
create database datalake;
use datalake;
@@ -46,7 +66,7 @@ CREATE TABLE `design_type` (
CREATE TABLE `design` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `body` varchar(255) DEFAULT NULL,
+ `body` text DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`note` varchar(255) DEFAULT NULL,
`submitted` bit(1) DEFAULT NULL,
diff --git a/components/datalake-handler/feeder/src/assembly/scripts/init_db_data.sql b/components/datalake-handler/feeder/src/assembly/scripts/init_db_data.sql
index 770c68bf..1328279a 100644
--- a/components/datalake-handler/feeder/src/assembly/scripts/init_db_data.sql
+++ b/components/datalake-handler/feeder/src/assembly/scripts/init_db_data.sql
@@ -1,3 +1,23 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : DATALAKE
+* ================================================================================
+* Copyright 2019 China Mobile
+*=================================================================================
+* Licensed 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.
+* ============LICENSE_END=========================================================
+*/
+
INSERT INTO datalake.kafka(
id
,name
@@ -36,14 +56,13 @@ insert into db_type (`id`, `name`, tool) values ('HDFS', 'HDFS', false);
insert into db_type (`id`, `name`, tool) values ('KIBANA', 'Kibana', true);
insert into db_type (`id`, `name`, tool) values ('SUPERSET', 'Apache Superset', true);
-insert into db (id, db_type_id, enabled, `name`,`host`,`login`,`pass`,`database_name`) values (1, 'CB', true, 'Couchbase 1','dl-couchbase','dl','dl1234','datalake');
-insert into db (id, db_type_id, enabled, `name`,`host`) values (2, 'ES', true, 'Elasticsearch','dl-es');
-insert into db (id, db_type_id, enabled, `name`,`host`,`port`,`database_name`) values (3, 'MONGO', true, 'MongoDB 1','dl-mongodb',27017,'datalake');
-insert into db (id, db_type_id, enabled, `name`,`host`) values (4, 'DRUID', true, 'Druid','dl-druid');
-insert into db (id, db_type_id, enabled, `name`,`host`,`login`) values (5, 'HDFS', true, 'Hadoop Cluster','dl-hdfs','dl');
-insert into db (id, db_type_id, enabled, `name`,`host`) values (6, 'KIBANA', true, 'Kibana demo','dl-es');
-insert into db (id, db_type_id, enabled, `name`,`host`) values (7, 'SUPERSET', true, 'Superset demo','dl-druid');
-
+insert into db (id, db_type_id, enabled, encrypt, `name`,`host`,`login`,`pass`,`database_name`) values (1, 'CB', true, true, 'Couchbase 1','dl-couchbase','dl','dl1234','datalake');
+insert into db (id, db_type_id, enabled, encrypt, `name`,`host`) values (2, 'ES', true, true, 'Elasticsearch','dl-es');
+insert into db (id, db_type_id, enabled, encrypt, `name`,`host`,`port`,`database_name`) values (3, 'MONGO', true, true, 'MongoDB 1','dl-mongodb',27017,'datalake');
+insert into db (id, db_type_id, enabled, encrypt, `name`,`host`) values (4, 'DRUID', true, true, 'Druid','dl-druid');
+insert into db (id, db_type_id, enabled, encrypt, `name`,`host`,`login`) values (5, 'HDFS', true, true, 'Hadoop Cluster','dl-hdfs','dl');
+insert into db (id, db_type_id, enabled, encrypt, `name`,`host`) values (6, 'KIBANA', true, false, 'Kibana demo','dl-es');
+insert into db (id, db_type_id, enabled, encrypt, `name`,`host`) values (7, 'SUPERSET', true, false, 'Superset demo','dl-druid');
insert into topic_name (id) values ('_DL_DEFAULT_');
insert into topic_name (id) values ('unauthenticated.SEC_FAULT_OUTPUT');
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java
index 6d43300d..54f46e6f 100644
--- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java
+++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java
@@ -86,10 +86,10 @@ public class DbController {
@GetMapping("/list")
@ResponseBody
- @ApiOperation(value="Get all dbs by tool")
- public List<DbConfig> dblistByTool(@RequestParam boolean tool) {
+ @ApiOperation(value="Get all tools or dbs")
+ public List<DbConfig> dblistByTool(@RequestParam boolean isDb) {
log.info("Search dbs by tool start......");
- Iterable<DbType> dbType = dbTypeRepository.findByTool(tool);
+ Iterable<DbType> dbType = dbTypeRepository.findByTool(!isDb);
List<DbConfig> retDbConfig = new ArrayList<>();
for (DbType item : dbType) {
for (Db d : item.getDbs()) {
@@ -148,7 +148,7 @@ public class DbController {
if(!dbConfig.getName().equals("Elecsticsearch") || dbConfig.getName().equals("Druid"))
{
- newdb.setDatabase(new String(dbConfig.getDatabase()));
+ newdb.setDatabase(dbConfig.getDatabase());
}
dbRepository.save(newdb);
log.info("Db save ....... name: " + dbConfig.getName());
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Db.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Db.java
index ff2b87ad..2c235990 100644
--- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Db.java
+++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/Db.java
@@ -79,7 +79,7 @@ public class Db {
private String database;
@Column(name="`encrypt`")
- private Boolean encrypt;
+ private boolean encrypt;
@Column(name="`property1`")
private String property1;
@@ -162,7 +162,7 @@ public class Db {
dbConfig.setPort(getPort());
dbConfig.setPass(getPass());
dbConfig.setLogin(getLogin());
- dbConfig.setEncrypt(getEncrypt());
+ dbConfig.setEncrypt(isEncrypt());
dbConfig.setEnabled(isEnabled());
dbConfig.setDatabase(getDatabase());
dbConfig.setDbTypeId(getDbType().getId());
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/db/MongodbService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/db/MongodbService.java
index eb8a3a16..689f83cf 100644
--- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/db/MongodbService.java
+++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/db/MongodbService.java
@@ -106,7 +106,7 @@ public class MongodbService implements DbStoreService {
//http://mongodb.github.io/mongo-java-driver/3.0/driver/reference/connecting/ssl/
if (config.isEnableSSL()) {
- builder.sslEnabled(Boolean.TRUE.equals(mongodb.getEncrypt()));// getEncrypt() can be null
+ builder.sslEnabled(Boolean.TRUE.equals(mongodb.isEncrypt()));// getEncrypt() can be null
}
MongoClientOptions options = builder.build();
List<ServerAddress> addrs = new ArrayList<>();
@@ -162,7 +162,7 @@ public class MongodbService implements DbStoreService {
documents.add(doc);
}
- String collectionName = effectiveTopic.getName().replaceAll("[^a-zA-Z0-9]", "");//remove - _ .
+ String collectionName = effectiveTopic.getName().replaceAll("[^a-zA-Z0-9]", "").toLowerCase();//remove - _ .
MongoCollection<Document> collection = mongoCollectionMap.computeIfAbsent(collectionName, k -> database.getCollection(k));
try {
diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/DbTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/DbTest.java
index 0accf5a8..e1972c52 100644
--- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/DbTest.java
+++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/DbTest.java
@@ -84,7 +84,7 @@ public class DbTest {
assertTrue("root".equals(mongoDB2.getLogin()));
assertTrue("root123".equals(mongoDB2.getPass()));
assertTrue("mongoDB2".equals(mongoDB2.getDatabase()));
- assertFalse("true".equals(mongoDB2.getEncrypt()));
+ assertFalse("true".equals(mongoDB2.isEncrypt()));
assertTrue("property1".equals(mongoDB2.getProperty1()));
assertTrue("property2".equals(mongoDB2.getProperty2()));
assertTrue("property3".equals(mongoDB2.getProperty3()));