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

optimize: auto closeable #1884

Merged
merged 4 commits into from
Nov 11, 2019
Merged

optimize: auto closeable #1884

merged 4 commits into from
Nov 11, 2019

Conversation

jsbxyyx
Copy link
Member

@jsbxyyx jsbxyyx commented Nov 9, 2019

Ⅰ. Describe what this PR did

optimize: auto closeable

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Nov 9, 2019

Codecov Report

Merging #1884 into develop will increase coverage by 0.18%.
The diff coverage is 78.12%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1884      +/-   ##
=============================================
+ Coverage      55.16%   55.34%   +0.18%     
- Complexity      2377     2382       +5     
=============================================
  Files            422      423       +1     
  Lines          14395    14270     -125     
  Branches        1730     1693      -37     
=============================================
- Hits            7941     7898      -43     
+ Misses          5709     5662      -47     
+ Partials         745      710      -35
Impacted Files Coverage Δ Complexity Δ
...c/main/java/io/seata/compressor/gzip/GzipUtil.java 88.88% <100%> (+10.1%) 5 <0> (ø) ⬇️
...va/io/seata/core/store/db/LogStoreDataBaseDAO.java 57.48% <100%> (+3%) 21 <0> (ø) ⬇️
...c/main/java/io/seata/common/util/CompressUtil.java 96% <100%> (-0.43%) 7 <0> (ø)
.../io/seata/common/loader/EnhancedServiceLoader.java 63.02% <100%> (+0.73%) 24 <0> (ø) ⬇️
...seata/rm/datasource/undo/AbstractUndoExecutor.java 76.41% <100%> (+2.07%) 21 <0> (ø) ⬇️
...a/io/seata/core/store/db/LockStoreDataBaseDAO.java 50.6% <50%> (+4.17%) 18 <0> (ø) ⬇️
...mon/src/main/java/io/seata/common/util/IOUtil.java 60% <60%> (ø) 3 <3> (?)
...o/seata/server/coordinator/DefaultCoordinator.java 48.41% <0%> (+0.39%) 28% <0%> (+1%) ⬆️
...in/java/io/seata/server/session/GlobalSession.java 85.02% <0%> (+0.48%) 68% <0%> (+1%) ⬆️
... and 1 more

@echooymxq
Copy link
Contributor

why not use try-with-resources?

@helloworlde
Copy link
Contributor

I found all resource in this change could use try-with-resource, and that can be closed automatic. Maybe change to use try-with-resource is better.

@jsbxyyx
Copy link
Member Author

jsbxyyx commented Nov 11, 2019

@echooymxq @helloworlde Not all places can be used try-with-resources.
image

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

@slievrly
Copy link
Member

@jsbxyyx database operation related variable names can be optimized.

@jsbxyyx
Copy link
Member Author

jsbxyyx commented Nov 11, 2019

@slievrly OK.

@helloworlde
Copy link
Contributor

@echooymxq @helloworlde Not all places can be used try-with-resources.
image

It's can be closed by multiple try.

@jsbxyyx
Copy link
Member Author

jsbxyyx commented Nov 11, 2019

@echooymxq @helloworlde Not all places can be used try-with-resources.
image

It's can be closed by multiple try.

If use try-with-resources, the conn close can not has other logic.

Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@zjinlei zjinlei merged commit a737d14 into apache:develop Nov 11, 2019
@slievrly slievrly added this to the 1.0 milestone Dec 2, 2019
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.

None yet

7 participants