Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Hubble graph connect error #378

Merged
merged 5 commits into from
Nov 23, 2022
Merged

Fix Hubble graph connect error #378

merged 5 commits into from
Nov 23, 2022

Conversation

coderzc
Copy link
Member

@coderzc coderzc commented Nov 22, 2022

Fixed: #377

  • Fix Hubble graph connect error
  • Add API unit-test
  • Remove redundant @Bean
  • Print the exception stack

@coderzc coderzc self-assigned this Nov 22, 2022
@coderzc coderzc added the hubble hugegraph-hubble label Nov 22, 2022
@coderzc coderzc added this to the 1.0.0 milestone Nov 22, 2022
@coderzc coderzc added the bug Something isn't working label Nov 22, 2022
Comment on lines +49 to +119
CREATE INDEX IF NOT EXISTS `gremlin_collection_conn_id` ON `gremlin_collection`(`conn_id`);

CREATE TABLE IF NOT EXISTS `file_mapping` (
`id` INT NOT NULL AUTO_INCREMENT,
`conn_id` INT NOT NULL,
`job_id` INT NOT NULL DEFAULT 0,
`name` VARCHAR(128) NOT NULL,
`path` VARCHAR(256) NOT NULL,
`total_lines` LONG NOT NULL,
`total_size` LONG NOT NULL,
`file_status` TINYINT NOT NULL DEFAULT 0,
`file_setting` VARCHAR(65535) NOT NULL,
`vertex_mappings` VARCHAR(65535) NOT NULL,
`edge_mappings` VARCHAR(65535) NOT NULL,
`load_parameter` VARCHAR(65535) NOT NULL,
`create_time` DATETIME(6) NOT NULL,
`update_time` DATETIME(6) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE (`conn_id`, `job_id`, `name`)
);
CREATE INDEX IF NOT EXISTS `file_mapping_conn_id` ON `file_mapping`(`conn_id`);

CREATE TABLE IF NOT EXISTS `load_task` (
`id` INT NOT NULL AUTO_INCREMENT,
`conn_id` INT NOT NULL,
`job_id` INT NOT NULL DEFAULT 0,
`file_id` INT NOT NULL,
`file_name` VARCHAR(128) NOT NULL,
`options` VARCHAR(65535) NOT NULL,
`vertices` VARCHAR(512) NOT NULL,
`edges` VARCHAR(512) NOT NULL,
`file_total_lines` LONG NOT NULL,
`load_status` TINYINT NOT NULL,
`file_read_lines` LONG NOT NULL,
`last_duration` LONG NOT NULL,
`curr_duration` LONG NOT NULL,
`create_time` DATETIME(6) NOT NULL,
PRIMARY KEY (`id`)
);

CREATE TABLE IF NOT EXISTS `job_manager` (
`id` INT NOT NULL AUTO_INCREMENT,
`conn_id` INT NOT NULL DEFAULT 0,
`job_name` VARCHAR(100) NOT NULL DEFAULT '',
`job_remarks` VARCHAR(200) NOT NULL DEFAULT '',
`job_size` LONG NOT NULL DEFAULT 0,
`job_status` TINYINT NOT NULL DEFAULT 0,
`job_duration` LONG NOT NULL DEFAULT 0,
`update_time` DATETIME(6) NOT NULL,
`create_time` DATETIME(6) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE (`job_name`, `conn_id`)
);

CREATE TABLE IF NOT EXISTS `async_task` (
`id` INT NOT NULL AUTO_INCREMENT,
`conn_id` INT NOT NULL DEFAULT 0,
`task_id` INT NOT NULL DEFAULT 0,
`task_name` VARCHAR(100) NOT NULL DEFAULT '',
`task_reason` VARCHAR(200) NOT NULL DEFAULT '',
`task_type` TINYINT NOT NULL DEFAULT 0,
`algorithm_name` VARCHAR(48) NOT NULL DEFAULT '',
`task_content` VARCHAR(65535) NOT NULL DEFAULT '',
`task_status` TINYINT NOT NULL DEFAULT 0,
`task_duration` LONG NOT NULL DEFAULT 0,
`create_time` DATETIME(6) NOT NULL,
PRIMARY KEY (`id`)
);

CREATE INDEX IF NOT EXISTS `load_task_conn_id` ON `load_task`(`conn_id`);
CREATE INDEX IF NOT EXISTS `load_task_file_id` ON `load_task`(`file_id`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy from hugegraph-hubble/hubble-be/src/main/resources/database/schema.sql

@@ -43,7 +42,6 @@ public void addInterceptors(InterceptorRegistry registry) {
.addPathPatterns("/**");
}

@Bean
Copy link
Member Author

@coderzc coderzc Nov 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'customInterceptor', defined in class path resource [org/apache/hugegraph/config/WebMvcConfig.class], could not be registered. A bean with that name has already been defined in file [/Users/zc/IdeaProjects/incubator-hugegraph-toolchain/hugegraph-hubble/hubble-be/target/classes/org/apache/hugegraph/handler/CustomInterceptor.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true


@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Merging #378 (c75b79c) into master (3cbbf77) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #378   +/-   ##
=========================================
  Coverage     57.46%   57.46%           
  Complexity     1866     1866           
=========================================
  Files           263      263           
  Lines         10244    10244           
  Branches        875      875           
=========================================
  Hits           5887     5887           
  Misses         3975     3975           
  Partials        382      382           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

javeme
javeme previously approved these changes Nov 22, 2022
@coderzc coderzc requested a review from javeme November 23, 2022 10:40
@@ -84,7 +84,7 @@ jobs:
$TRAVIS_DIR/install-hugegraph.sh $SERVER_VERSION

- name: Unit test
run: mvn test -P unit-test -pl hugegraph-hubble -ntp
run: mvn test -P unit-test -pl hugegraph-hubble/hubble-be -ntp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it right?

Copy link
Member Author

@coderzc coderzc Nov 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should perform unit-test of the hubble-be module instead of the hubble module.

@javeme javeme merged commit 0a24e17 into master Nov 23, 2022
@javeme javeme deleted the fix_hubble branch November 23, 2022 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hubble hugegraph-hubble hubble-be
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] Hubble get the exception when add new graph
3 participants