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

feat: undolog add decompressor func #457

Merged
merged 236 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from 229 commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
3a50c2a
Initial commit
AlexStocks May 3, 2022
4c6ad0f
add config file
luky116 May 4, 2022
004badf
init
luky116 May 9, 2022
f646586
add rm
luky116 May 12, 2022
580ab4a
add processor
luky116 May 14, 2022
0939057
bug fix
luky116 May 14, 2022
b6e759a
use processor on message
luky116 May 14, 2022
4016001
change default config
luky116 May 14, 2022
4579084
Merge pull request #1 from luky116/init
AlexStocks May 14, 2022
9f2665a
init github Actions
liiibpm May 18, 2022
3fd0b4c
init github Actions
liiibpm May 18, 2022
1944ae1
Merge pull request #2 from liiibpm/main
AlexStocks May 28, 2022
9095355
add tcc process
luky116 Jun 7, 2022
dd38d07
Adjust the structure of the project
luky116 Jun 7, 2022
634657b
Adjust the structure of the project
luky116 Jun 8, 2022
6d0ea72
Adjust the structure of the project
luky116 Jun 13, 2022
83cccac
fix linter error
AlexStocks Jun 13, 2022
bfa69cc
Merge pull request #4 from luky116/init
AlexStocks Jun 13, 2022
7ceb462
fix cli
luky116 Jun 13, 2022
8a78ef8
Merge pull request #5 from luky116/init
AlexStocks Jun 13, 2022
986e5f8
add apache license
luky116 Jun 13, 2022
38b6804
Merge pull request #6 from luky116/init
AlexStocks Jun 14, 2022
4c36bc4
fix config
luky116 Jun 14, 2022
114147c
add unit test
Jun 15, 2022
ed9b0a7
add go imports shell
luky116 Jun 16, 2022
a1da44e
Adjust project directory
luky116 Jun 17, 2022
1044c64
remove iota
Jun 17, 2022
29d735b
fix cli bug
Jun 17, 2022
681f298
remove the useless comments
luky116 Jun 17, 2022
7511240
Merge remote-tracking branch 'my/addUnitTest' into addUnitTest
luky116 Jun 17, 2022
38ef36c
Merge pull request #10 from luky116/addUnitTest
AlexStocks Jun 17, 2022
e334fc5
fix branch commit bug
luky116 Jun 18, 2022
0a92500
Merge pull request #15 from luky116/fixBranchCommitBug
AlexStocks Jun 19, 2022
abb4f0d
remove goetty package
luky116 Jun 19, 2022
0c507d4
Merge pull request #18 from luky116/removeGoetty
AlexStocks Jun 20, 2022
1527d84
Optimize codec code
Jun 20, 2022
5f48f35
Merge pull request #19 from luky116/optimizeCodec
AlexStocks Jun 23, 2022
b441c09
Create enhancement.md
luky116 Jun 25, 2022
0665905
Merge pull request #21 from luky116/patch-1
AlexStocks Jun 25, 2022
2b5e21c
style:change bool to struct{}
Jun 29, 2022
3c20d22
Merge pull request #34 from baerwang/optimization
AlexStocks Jun 29, 2022
2fc1aaf
fix commit and rollback codec
luky116 Jun 29, 2022
55f6e13
realize branchReport
liiibpm Jun 30, 2022
27bac0a
add seata-go samples
luky116 Jun 30, 2022
6c37558
solve conflice
luky116 Jun 30, 2022
682a97c
add processor unittest
cgDeepLearn Jul 1, 2022
fdc2e0b
Merge pull request #31 from luky116/fix-codec
AlexStocks Jul 1, 2022
fa3a28b
Merge pull request #36 from luky116/add-samples
AlexStocks Jul 2, 2022
cd28efc
remove blank and annotation
cgDeepLearn Jul 2, 2022
2c8e490
Merge branch 'seata:main' into main
liiibpm Jul 2, 2022
14a3850
branchReport return value judgment
liiibpm Jul 2, 2022
8b4dedf
optimize-zap-log
106umao Jul 4, 2022
32a3b94
update changed the format of log
106umao Jul 6, 2022
22f7be4
remove the duplicate code same with sample/local
106umao Jul 6, 2022
598b039
optimize format of logging
106umao Jul 9, 2022
9d10508
optimize format of logging
106umao Jul 9, 2022
0473b67
optimize format of logging
106umao Jul 9, 2022
6f862b2
Merge pull request #37 from liiibpm/main
AlexStocks Jul 10, 2022
c3c5d46
Merge pull request #39 from cgDeepLearn/processor-unittest
AlexStocks Jul 10, 2022
84f8ec2
Update logging.go
AlexStocks Jul 10, 2022
58ee495
Merge pull request #45 from 106umao/optimize-zap-log
AlexStocks Jul 10, 2022
511859f
Merge pull request #46 from 106umao/duplicate-code
AlexStocks Jul 10, 2022
ae5eab8
feature add action context for tcc
106umao Jul 11, 2022
12e2194
add err check for unmarshal json
106umao Jul 11, 2022
d130a9e
Merge pull request #48 from 106umao/ActionContextForTcc
AlexStocks Jul 12, 2022
5e2319e
Feat add two phase (#122)
luky116 Jul 19, 2022
ed33bad
fix getty auto close bug (#130)
luky116 Jul 19, 2022
d356756
optimize named for the resource manager api and tcc resource, adjust …
106umao Jul 23, 2022
233e919
docs: add readme ,contributing and pr template doc (#153)
luky116 Jul 26, 2022
1290838
add license (#146)
Penglq Jul 26, 2022
e1b03ed
bugfix: fix rollback response status bug (#155)
luky116 Jul 28, 2022
62f61c1
feature add unit test and labeler workflow (#165)
106umao Jul 28, 2022
6500da6
fix typo in reademe (#167)
106umao Jul 28, 2022
ab0f45b
doc: add seata server startup docker compose file (#172)
luky116 Jul 30, 2022
d8eca5c
doc: add release 0.1.0 changes note (#169)
luky116 Jul 30, 2022
d7f6ffa
optimize add ut for message (#154)
106umao Aug 1, 2022
74c0e5c
optimieze add ut for tm (#163)
106umao Aug 1, 2022
c37c161
[modify] git ignore add build products in 'dist/' (#177)
elrond-g Aug 4, 2022
05bf7b1
bugfix fix ut bug of msg, it will cause ci failed (#176)
106umao Aug 5, 2022
6c8fb25
optimize: optimise way of init seata (#187)
luky116 Aug 8, 2022
b07c2cf
Feature add tcc branch report (#190)
wang1309 Aug 9, 2022
d147103
refactor(pkg/rm): optimize function's parameters into one struct (#196)
Aug 10, 2022
fbbd682
feature add integration for grpc (#158)
106umao Aug 11, 2022
1797722
optimize: remove unnecessary codes (#208)
a631807682 Aug 11, 2022
7f3d6d9
Add unit testing for getty (#203)
betterwinsone Aug 11, 2022
45bf050
optimize workflow, add condecov and issue, stale robot (#202)
106umao Aug 12, 2022
df69626
Feature add tcc branch report unit test (#210)
wang1309 Aug 12, 2022
e1dcdfe
optimize: support instance BusinessActionContext outside the TCC try …
luky116 Aug 13, 2022
dc93beb
add dubbo transtation filter test (#204)
jasondeng1997 Aug 14, 2022
ed7bef5
optimize ResourceManagerInbound function's parameters into one struct…
liiibpm Aug 15, 2022
ebad10e
feature add tcc grpc sample,adjust register resource and branch regis…
106umao Aug 16, 2022
c5ce148
fix enhancement: make time parameters easier to read (#215)
jasondeng1997 Aug 16, 2022
b591b73
feature/datasource_at merge to master (#213)
chuntaojun Aug 17, 2022
40133c5
add rm test (#192)
Aug 22, 2022
bd18186
optimize: add some todo comment, add a undo hook sample (#238)
luky116 Aug 23, 2022
fb985f5
replace the underline naming in the code with the hump naming method …
jasondeng1997 Aug 23, 2022
739821f
fix: do register resource where execute OpenConnector function (#237)
luky116 Aug 24, 2022
37b8e40
optimize Add unit testing for common (#229)
miaoxueyu Aug 24, 2022
c230965
bugfix: fix infinite loop of asyncCallback (#230)
PangXing Aug 24, 2022
47682c4
feature: add undo log manager delete (#240)
wang1309 Sep 2, 2022
70a93e2
frature: add update sql parser (#243)
luky116 Sep 3, 2022
0db6531
feature: add license github action (#254)
luky116 Sep 5, 2022
5da5904
fix global transation time out (#258)
luky116 Sep 6, 2022
3b395cf
feature add fence for tcc, and add fence sample in tcc local mode. (#…
106umao Sep 15, 2022
7167a33
frature: add update sql parser and remove tidb parser (#264)
jasondeng1997 Sep 17, 2022
328aee7
fix ci failed because mock is invalid (#263)
106umao Sep 17, 2022
47053ee
optimize: nested loop retries (#261)
106umao Sep 18, 2022
f60f768
feat: add http tcc (#280)
georgehao Sep 21, 2022
5e029a8
feat: optimize retry (#284)
georgehao Sep 22, 2022
b753049
optimize: split client.Init into rm.Init and tm.Init methods (#286)
jasondeng1997 Sep 25, 2022
533afe8
optimize: optimize global transaction usage (#281)
106umao Sep 26, 2022
485312c
feat: add has undo log table (#245)
wang1309 Sep 26, 2022
7167474
(WIP)refactor:seata conn (#287)
chuntaojun Sep 27, 2022
0042b76
feat: add mysql update undo log builder (#288)
luky116 Sep 28, 2022
b9b7d8c
change dubbo-go version (#302)
luky116 Oct 8, 2022
d0f98f4
test:add DoParser ut (#299)
baerwang Oct 8, 2022
ba06918
config github action not to automatically close ps or issue (#305)
luky116 Oct 8, 2022
38924b0
add mysql delete undo log builder (#296)
raspberry-hu Oct 8, 2022
8bbc5b5
feat: add sync worker and fmt (#303)
georgehao Oct 9, 2022
15d6a1a
Feat add mysql update after undo log builder (#289)
luky116 Oct 9, 2022
93aa852
format:format code
wangrui130-tal Oct 11, 2022
1db393f
format:format code
wangrui130-tal Oct 11, 2022
eadf8bf
feat:add mysql table meta func && sql addEscape, delEscape func issue…
wang1309 Oct 13, 2022
61a4c23
feat: init compressor type (#309)
luky116 Oct 15, 2022
7d1dfdf
refactor compress (#318)
luky116 Oct 15, 2022
4109db9
Feat multi undo log builder (#301)
luky116 Oct 15, 2022
0ab3ea2
Merge remote-tracking branch 'upstream/master'
Oct 16, 2022
14ab243
Merge remote-tracking branch 'upstream/master'
wang1309 Oct 16, 2022
b20f33b
feat: fix fanout test data race (#326)
georgehao Oct 23, 2022
8fbdd3f
Refactor seata conn (#295)
chuntaojun Oct 23, 2022
661a647
feat(compressor): deflate compress (#321)
Oct 23, 2022
eea542f
Add LZ4 compressor support. (#324)
WyattJia Oct 23, 2022
ea67dc4
add zstd compress (#327)
betterwinsone Oct 28, 2022
4c9195f
Feat add gzip (#322)
wang1309 Oct 28, 2022
10c6872
feat:add undo log manager-flush undo log func #269 (#307)
betterwinsone Oct 29, 2022
7c68aef
Feat add zip #315 (#329)
raspberry-hu Oct 30, 2022
c97ff1b
Feat/multi update (#325)
georgehao Oct 30, 2022
2f4277f
feature: add select for update (#319)
luky116 Oct 30, 2022
48794de
wip:multi delete sql (#330)
baerwang Oct 31, 2022
446ed79
Merge remote-tracking branch 'upstream/master'
wangrui130-tal Nov 1, 2022
c73bf46
Merge remote-tracking branch 'upstream/master'
wangrui130-tal Nov 1, 2022
2dd7ac0
test: strengthen ut (#332)
baerwang Nov 5, 2022
f592e1b
optimize at (#336)
luky116 Nov 12, 2022
f9de2fc
Merge remote-tracking branch 'upstream/master'
Nov 12, 2022
a686a43
Merge remote-tracking branch 'upstream/master'
wang1309 Nov 12, 2022
38b554e
Feat add undo func (#320)
wang1309 Nov 13, 2022
e8cfa01
optimize: add insert undo log function (#337)
luky116 Nov 13, 2022
6713885
doc: add sample undo_log table sql
Code-Fight Nov 17, 2022
4c61c3a
optimize at commit branch (#346)
luky116 Nov 18, 2022
e0db439
fix:timeout config & panic log lost (#350)
Code-Fight Nov 19, 2022
e3d7b14
optimize meta data (#352)
luky116 Nov 19, 2022
268a72e
optimize commit (#354)
luky116 Nov 20, 2022
eaee521
optimize commit (#354)
luky116 Nov 20, 2022
b72477c
feat: modify some receiver name (#353)
georgehao Nov 20, 2022
1c22b98
Optimize rollback (#356)
luky116 Nov 20, 2022
25ef488
feat: add gin for at and fix async worker bug (#357)
georgehao Nov 20, 2022
24ea75b
feature: support ONLY_CARE_UPDATE_COLUMNS (#355)
Code-Fight Nov 20, 2022
9229a4b
Rollback (#358)
georgehao Nov 20, 2022
fed3ad4
fix bug (#359)
luky116 Nov 20, 2022
7846472
Rollback1 (#360)
georgehao Nov 20, 2022
d7254d9
Fix meta data (#363)
luky116 Nov 21, 2022
1dc20df
Fix decode image(#365)
luky116 Nov 22, 2022
6880911
add data check before rollbeck (#366)
luky116 Nov 23, 2022
b181fba
doc: v1.0.2-RC1 release file (#338)
raspberry-hu Nov 23, 2022
9bb236e
optimize: remove unless function (#369)
Code-Fight Nov 25, 2022
ae4ac1d
doc: update 1.0.2-RC1 change log (#370)
luky116 Nov 26, 2022
a2511f0
fix: at sample (#374)
luky116 Nov 26, 2022
6727499
optimize: simplify to make codes more readable (#367)
Charlie17Li Nov 30, 2022
2cbbf2f
feat:add yml config (#285)
zhangymPerson Nov 30, 2022
beabfc3
feat: support for propagation of global transactions (#262)
106umao Dec 1, 2022
05de141
feature:build undo log by insert target SQL (#333)
Code-Fight Dec 3, 2022
f3a7c86
Merge remote-tracking branch 'upstream/master'
Dec 6, 2022
ad8f6be
Merge remote-tracking branch 'upstream/master'
wang1309 Dec 6, 2022
f71bfa7
fix at smaple sql (#385)
jasondeng1997 Dec 6, 2022
1eccddf
fix: loop recursion problem in OpenConnector (#387)
106umao Dec 6, 2022
c9fffa5
add tcc fence config logic (#383)
luky116 Dec 7, 2022
9f6d875
optimize some format (#392)
georgehao Dec 8, 2022
85d7aea
optimize at base executor (#394)
luky116 Dec 10, 2022
1b67327
feat: add tm config (#398)
Dec 12, 2022
1ef83f7
feat: add getty config (#399)
lxfeng1997 Dec 13, 2022
e6aab85
fix branch register response (#401)
luky116 Dec 13, 2022
35f29ac
optimize protocol init (#400)
Code-Fight Dec 16, 2022
f1320b5
optimize RM init (#390)
Code-Fight Dec 16, 2022
8846c93
Merge remote-tracking branch 'upstream/master'
wang1309 Dec 16, 2022
0f1fcce
Merge remote-tracking branch 'upstream/master'
wang1309 Dec 16, 2022
bead900
feat: support xa mysql connection (#380)
Charlie17Li Dec 16, 2022
7563891
Feat xa branch xid (#389)
wang1309 Dec 16, 2022
a82fb71
[AT] add insert on duplicate (#405)
Iunyasha Dec 17, 2022
6e314e6
optimize: refactor at executor (#397)
luky116 Dec 20, 2022
c7ff490
refactor: use new tm config in tm module. (#411)
Dec 23, 2022
bcbb864
Merge remote-tracking branch 'upstream/master'
wang1309 Dec 24, 2022
d598b76
Merge remote-tracking branch 'upstream/master'
wang1309 Dec 24, 2022
7f368a4
roptimize: efactor delete and insert executor (#409)
luky116 Dec 24, 2022
a1d9108
optimize: add log init (#408)
Code-Fight Dec 24, 2022
8965710
Merge remote-tracking branch 'upstream/master'
wang1309 Dec 24, 2022
447de4c
Merge remote-tracking branch 'upstream/master'
wang1309 Dec 24, 2022
3d420a1
feature: add transport config (#406)
Chovyyyyyy Dec 24, 2022
857a35b
refactor(compressor): rename defalte_compress_test.go to deflate_comp…
Dec 29, 2022
04d1523
feat: add RM config (#412)
liiibpm Dec 31, 2022
03ad2e6
optimize readme (#417)
luky116 Jan 1, 2023
f3fb86a
feat: add service and seata config (#413)
lxfeng1997 Jan 1, 2023
856eb1a
feat: add Undo config (#410)
jasondeng1997 Jan 1, 2023
abfb512
fix undo config (#418)
luky116 Jan 1, 2023
0a5cd26
opt: optimize comments and dead code (#388)
106umao Jan 1, 2023
33151a4
Apply getty config (#421)
lxfeng1997 Jan 2, 2023
f87fbea
feat: use undo config (#419)
luky116 Jan 2, 2023
f55f05f
remove unused config (#422)
luky116 Jan 2, 2023
2eb98b3
bugfix: repair init getty failed (#423)
lxfeng1997 Jan 2, 2023
9eacf87
fix getty config (#424)
luky116 Jan 2, 2023
9f1165e
bugfix: at model execution failed (#429)
lxfeng1997 Jan 2, 2023
e86afc7
Optimize getty config (#430)
lxfeng1997 Jan 2, 2023
2c732df
use config (#436)
luky116 Jan 3, 2023
f374404
doc: add v1.0.2-RC3 change log (#431)
luky116 Jan 3, 2023
3a107da
Merge remote-tracking branch 'upstream/master'
wang1309 Jan 3, 2023
a71af57
Merge remote-tracking branch 'upstream/master'
wang1309 Jan 3, 2023
72a5fee
rename change-log to 1.0.3 (#443)
luky116 Jan 5, 2023
40f50b7
Merge remote-tracking branch 'upstream/master'
wang1309 Jan 7, 2023
55e90d2
Merge remote-tracking branch 'upstream/master'
wang1309 Jan 7, 2023
8eb2521
Merge branch 'master' of github.com:wang1309/seata-go
wang1309 Jan 7, 2023
26915c7
Merge remote-tracking branch 'upstream/master'
wang1309 Jan 7, 2023
866b4d0
Merge remote-tracking branch 'upstream/master'
wang1309 Jan 14, 2023
51bc2c5
feat:add undo decompress func, issue-449
wang1309 Jan 15, 2023
8b880a6
fix:delete test data
wang1309 Jan 15, 2023
e5e21b2
fix: ci fail fix
wang1309 Jan 15, 2023
2f3bfc4
fix: ci fail fix
wang1309 Jan 15, 2023
9404a61
fix: ci fail fix
wang1309 Jan 15, 2023
4b0aff5
fix:delete init func && compressortype_string
wang1309 Feb 4, 2023
2fcb612
fix:add compressor_type_string
wang1309 Feb 4, 2023
d6554f1
fix:optimize code
wang1309 Feb 11, 2023
cfdea8b
fix code review porblem
wang1309 Feb 16, 2023
b89174c
Merge branch 'master' into feat_undolog_addComposer
wang1309 Feb 16, 2023
b244cab
fix:code review fixed
wang1309 Feb 26, 2023
77130c7
Merge remote-tracking branch 'upstream/master'
wang1309 Mar 9, 2023
12ea3b7
Merge branch 'master' into feat_undolog_addComposer
wang1309 Mar 9, 2023
dc9e442
fix:solve conflict
wang1309 Mar 9, 2023
42c5079
fixed:solve conflict
wang1309 Mar 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.18
require (
dubbo.apache.org/dubbo-go/v3 v3.0.3-rc2
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/agiledragon/gomonkey/v2 v2.2.0
github.com/apache/dubbo-getty v1.4.9-0.20220825024508-3da63c3257fa
github.com/arana-db/parser v0.2.5
github.com/dsnet/compress v0.0.1
Expand All @@ -31,6 +30,8 @@ require (
vimagination.zapto.org/byteio v0.0.0-20200222190125-d27cba0f0b10
)

require github.com/agiledragon/gomonkey/v2 v2.9.0

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.1 // indirect
github.com/RoaringBitmap/roaring v1.2.0 // indirect
Expand Down Expand Up @@ -122,7 +123,7 @@ require (
go.opentelemetry.io/otel/trace v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/text v0.6.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -141,9 +142,9 @@ require (
github.com/pingcap/log v0.0.0-20210906054005-afc726e70354 // indirect
go.etcd.io/etcd/client/v2 v2.305.0 // indirect
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.4.0 // indirect
google.golang.org/genproto v0.0.0-20220630174209-ad1d48641aa7 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
moul.io/http2curl v1.0.0 // indirect
Expand Down
19 changes: 10 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vaj
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3NjkJ5vDLgYjCQu0Xlw=
github.com/agiledragon/gomonkey v2.0.2+incompatible/go.mod h1:2NGfXu1a80LLr2cmWXGBDaHEjb1idR6+FVlX5T3D9hw=
github.com/agiledragon/gomonkey/v2 v2.2.0 h1:QJWqpdEhGV/JJy70sZ/LDnhbSlMrqHAWHcNOjz1kyuI=
github.com/agiledragon/gomonkey/v2 v2.2.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/agiledragon/gomonkey/v2 v2.9.0 h1:PDiKKybR596O6FHW+RVSG0Z7uGCBNbmbUXh3uCNQ7Hc=
github.com/agiledragon/gomonkey/v2 v2.9.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down Expand Up @@ -1034,8 +1034,8 @@ golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211105192438-b53810dc28af/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw=
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1063,8 +1063,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -1150,8 +1150,8 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 h1:ohgcoMbSofXygzo6AD2I1kz3BFmW1QArPYTtwEM3UXc=
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1162,8 +1162,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
1 change: 0 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"sync"

"github.com/seata/seata-go/pkg/datasource"

at "github.com/seata/seata-go/pkg/datasource/sql"
"github.com/seata/seata-go/pkg/integration"
"github.com/seata/seata-go/pkg/remoting/getty"
Expand Down
4 changes: 4 additions & 0 deletions pkg/compressor/bzip2_compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import (
type Bzip2 struct {
}

func NewBizp2() *Bzip2 {
Copy link
Contributor

Choose a reason for hiding this comment

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

没有参数不用New

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

return &Bzip2{}
}

// Compress Bzip2 compress
func (g *Bzip2) Compress(b []byte) ([]byte, error) {
var buffer bytes.Buffer
Expand Down
15 changes: 0 additions & 15 deletions pkg/compressor/compressor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@

package compressor

type CompressorType int8
Copy link
Contributor

Choose a reason for hiding this comment

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

这个看看是否可以直接写在这里

Copy link
Contributor Author

Choose a reason for hiding this comment

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

感觉可能还是放在compress_type 文件一起好点,比较内聚一点。


const (
CompressorNone CompressorType = iota
CompressorGzip
CompressorZip
CompressorSevenz
CompressorBzip2
CompressorLz4
CompressorDefault
CompressorZstd
CompressorDeflate
CompressorMax
)

type Compressor interface {
Compress([]byte) ([]byte, error)
Decompress([]byte) ([]byte, error)
Expand Down
40 changes: 40 additions & 0 deletions pkg/compressor/compressor_factory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.
*/

package compressor

var compressorFactory map[string]Compressor

func (c CompressorType) GetCompressor() Compressor {
if compressorFactory == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

switch

不用单例模式

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

compressorFactory = map[string]Compressor{
CompressorNone.String(): NewNone(),
CompressorGzip.String(): NewGzip(),
CompressorZip.String(): NewZip(),
CompressorBzip2.String(): NewBizp2(),
CompressorLz4.String(): NewLz4(),
CompressorZstd.String(): NewZstd(),
CompressorDeflate.String(): NewDeflateCompress(),
}
}

if v, ok := compressorFactory[c.String()]; ok {
return v
} else {
panic("compressor type not implement")
}
}
59 changes: 59 additions & 0 deletions pkg/compressor/compressor_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* 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.
*/

package compressor

//go:generate stringer -type=CompressorType
type CompressorType int8

const (
CompressorNone CompressorType = iota
Copy link
Contributor

Choose a reason for hiding this comment

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

加一个单测

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

CompressorGzip
CompressorZip
CompressorSevenz
CompressorBzip2
CompressorLz4
CompressorDefault
Copy link
Contributor

Choose a reason for hiding this comment

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

image

CompressorDefault和CompressorMaxl好像和java对不上?
CompressorDeflate应该在CompressorZstd前面

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

CompressorZstd
CompressorDeflate
CompressorMaxl
)

var compressor map[string]CompressorType

func GetByName(name string) CompressorType {
if compressor == nil {
Copy link
Contributor

@luky116 luky116 Feb 11, 2023

Choose a reason for hiding this comment

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

改为switch...case,每次返回一个新的对象,这样就不要用这个map了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

嗯嗯,请教一下为何改为 switch case,感觉这里实现问题不大。

compressor = map[string]CompressorType{
CompressorNone.String(): CompressorNone,
CompressorGzip.String(): CompressorGzip,
CompressorZip.String(): CompressorZip,
CompressorSevenz.String(): CompressorSevenz,
CompressorBzip2.String(): CompressorBzip2,
CompressorLz4.String(): CompressorLz4,
CompressorDefault.String(): CompressorDefault,
CompressorZstd.String(): CompressorZstd,
CompressorDeflate.String(): CompressorDeflate,
CompressorMaxl.String(): CompressorMaxl,
}
}

if v, ok := compressor[name]; ok {
return v
} else {
return CompressorNone
}
}
49 changes: 49 additions & 0 deletions pkg/compressor/compressortype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/compressor/deflate_compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import (

type DeflateCompress struct{}

func NewDeflateCompress() *DeflateCompress {
return &DeflateCompress{}
}

func (*DeflateCompress) Compress(data []byte) ([]byte, error) {
var buf bytes.Buffer
fw, err := flate.NewWriter(&buf, flate.BestCompression)
Expand Down
4 changes: 4 additions & 0 deletions pkg/compressor/gzip_compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import (
type Gzip struct {
}

func NewGzip() *Gzip {
return &Gzip{}
}

// Compress gzip compress
func (g *Gzip) Compress(b []byte) ([]byte, error) {
var buffer bytes.Buffer
Expand Down
4 changes: 4 additions & 0 deletions pkg/compressor/lz4_compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import (
type Lz4 struct {
}

func NewLz4() *Lz4 {
return &Lz4{}
}

func (l *Lz4) Compress(data []byte) ([]byte, error) {

buffer := make([]byte, lz4.CompressBlockBound(len(data)))
Expand Down
37 changes: 37 additions & 0 deletions pkg/compressor/none_compressor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* 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.
*/

package compressor

type NoneCompressor struct {
}

func NewNone() *NoneCompressor {
return &NoneCompressor{}
}

func (n *NoneCompressor) Compress(data []byte) ([]byte, error) {
return data, nil
}

func (n *NoneCompressor) Decompress(data []byte) ([]byte, error) {
return data, nil
}

func (n *NoneCompressor) GetCompressorType() CompressorType {
return CompressorNone
}
4 changes: 4 additions & 0 deletions pkg/compressor/zip_compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import (

type Zip struct{}

func NewZip() *Zip {
return &Zip{}
}

func (z Zip) Compress(data []byte) ([]byte, error) {
var buf bytes.Buffer
var zp = zlib.NewWriter(&buf)
Expand Down
4 changes: 4 additions & 0 deletions pkg/compressor/zstd_compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import (

type Zstd struct{}

func NewZstd() *Zstd {
Copy link
Contributor

Choose a reason for hiding this comment

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

如果new没有参数,可以不用写New函数?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

嗯,感觉还是有好一点,这能够收敛一下,后期也好维护。

return &Zstd{}
}

func (z Zstd) Compress(data []byte) ([]byte, error) {
var encoder, err = zstd.NewWriter(nil)
if err != nil {
Expand Down
Loading