Skip to content

Conversation

@kangkaisen
Copy link
Contributor

Fix #760

db.setClusterName(clusterName);
unprotectCreateDb(db);
editLog.logCreateDb(db);
Catalog.getInstance().getEditLog().logCreateDb(db);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's order to make the test for catalog.createDb and catalog.dropDb write easily.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it isn't a good idea to use getInstance() here, because this may lead some error if another Catalog exist in system, and it is strange to call getInstance() to get itself.

In addition I think it is better to limit use of singleton as little as possible.

So, could you find another way to write unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK.

@imay imay merged commit 2a152e0 into apache:master Mar 17, 2019
platoneko pushed a commit to platoneko/doris that referenced this pull request Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants