Skip to content
This repository was archived by the owner on Mar 26, 2020. It is now read-only.

Commit e53e656

Browse files
committed
Rename transactionv2 to transaction
This commit does 3 things, 1. Move required types and functions from the old transaction package to the transactionv2 package. 2. Remove the old transaction package. 3. Rename the transactionv2 package to transaction
1 parent ea22407 commit e53e656

19 files changed

+150
-911
lines changed

glusterd2/commands/peers/peer-rpc-svc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/gluster/glusterd2/glusterd2/peer"
99
"github.com/gluster/glusterd2/glusterd2/servers/peerrpc"
1010
"github.com/gluster/glusterd2/glusterd2/store"
11-
"github.com/gluster/glusterd2/glusterd2/transactionv2"
12-
"github.com/gluster/glusterd2/glusterd2/transactionv2/cleanuphandler"
11+
"github.com/gluster/glusterd2/glusterd2/transaction"
12+
"github.com/gluster/glusterd2/glusterd2/transaction/cleanuphandler"
1313
"github.com/gluster/glusterd2/glusterd2/volume"
1414
"github.com/gluster/glusterd2/pkg/utils"
1515

glusterd2/commands/volumes/volume-create.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/gluster/glusterd2/glusterd2/gdctx"
1212
restutils "github.com/gluster/glusterd2/glusterd2/servers/rest/utils"
1313
"github.com/gluster/glusterd2/glusterd2/transaction"
14-
transactionv2 "github.com/gluster/glusterd2/glusterd2/transactionv2"
1514
"github.com/gluster/glusterd2/glusterd2/volume"
1615
"github.com/gluster/glusterd2/pkg/api"
1716
gderrors "github.com/gluster/glusterd2/pkg/errors"
@@ -175,7 +174,7 @@ func volumeCreateHandler(w http.ResponseWriter, r *http.Request) {
175174
return
176175
}
177176

178-
txn, err := transactionv2.NewTxnWithLocks(ctx, req.Name)
177+
txn, err := transaction.NewTxnWithLocks(ctx, req.Name)
179178
if err != nil {
180179
status, err := restutils.ErrToStatusCode(err)
181180
restutils.SendHTTPError(ctx, w, status, err)

glusterd2/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616
"github.com/gluster/glusterd2/glusterd2/pmap"
1717
"github.com/gluster/glusterd2/glusterd2/servers"
1818
"github.com/gluster/glusterd2/glusterd2/store"
19-
"github.com/gluster/glusterd2/glusterd2/transactionv2"
20-
"github.com/gluster/glusterd2/glusterd2/transactionv2/cleanuphandler"
19+
"github.com/gluster/glusterd2/glusterd2/transaction"
20+
"github.com/gluster/glusterd2/glusterd2/transaction/cleanuphandler"
2121
gdutils "github.com/gluster/glusterd2/glusterd2/utils"
2222
"github.com/gluster/glusterd2/glusterd2/volgen"
2323
"github.com/gluster/glusterd2/glusterd2/xlator"

glusterd2/transactionv2/cleanuphandler/cleanup_handler.go renamed to glusterd2/transaction/cleanuphandler/cleanup_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
"github.com/gluster/glusterd2/glusterd2/gdctx"
1010
"github.com/gluster/glusterd2/glusterd2/store"
11-
"github.com/gluster/glusterd2/glusterd2/transactionv2"
11+
"github.com/gluster/glusterd2/glusterd2/transaction"
1212

1313
"github.com/coreos/etcd/clientv3"
1414
"github.com/coreos/etcd/clientv3/concurrency"

glusterd2/transaction/context.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import (
1414
log "github.com/sirupsen/logrus"
1515
)
1616

17-
const etcdTxnTimeout = 10
18-
1917
// TxnCtx is used to carry contextual information across the lifetime of a transaction
2018
type TxnCtx interface {
2119
// Set attaches the given key with value to the context. It updates value if key exists already.
@@ -139,7 +137,7 @@ func (c *Tctx) Commit() error {
139137
return err
140138
}
141139

142-
expTxn.Add("txn_ctx_store_commit", 1)
140+
//expTxn.Add("txn_ctx_store_commit", 1)
143141

144142
c.writeSet = make(map[string]string)
145143
c.readCacheDirty = true
@@ -208,7 +206,7 @@ func (c *Tctx) Delete(key string) error {
208206
"failed to delete key")
209207
return err
210208
}
211-
expTxn.Add("txn_ctx_store_delete", 1)
209+
//expTxn.Add("txn_ctx_store_delete", 1)
212210
return nil
213211
}
214212

glusterd2/transaction/context_mock.go

Lines changed: 0 additions & 62 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

glusterd2/transaction/rpc-client.go

Lines changed: 0 additions & 82 deletions
This file was deleted.

glusterd2/transaction/rpc-service.go

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)