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

remove commented code #111

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions pkg/udf/example_plugins/bad_plugin/bad_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ func (u *CounterUDF) Call(key []byte, value []byte, params []byte) (res []byte,
return res, nil
}

// not all interface functions are implemented
//func (u *CounterUDF) GetVersion() uint32 {
// return 1
//}

//func (u *CounterUDF) GetName() string {
// return "counter"
//}

func GetUDFInterface() (f interface{}, err error) {
f = &CounterUDF{}
return
Expand Down
19 changes: 0 additions & 19 deletions test/testutil/server/ssnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,6 @@ func (n *SSNode) Delete(namespace string, key []byte) (err error) {
return c.Delete(key)
}

//func (n *SSNode) Start() {
// if n.Server != nil {
// n.Server.Start()
// }
//}
//
//func (n *SSNode) Stop() {
// if n.Server != nil {
// n.Server.Stop()
// }
//}
//
//func (n *SSNode) Restart() {
// if n.Server != nil {
// n.Server.Stop()
// n.Server.Start()
// }
//}

func (n *SSNode) String() string {
if n.Server == nil {
glog.Error("SSNode.Server is null")
Expand Down
39 changes: 0 additions & 39 deletions test/testutil/ssclient/advssclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,45 +258,6 @@ func (c *AdvSSClient) Clone(request *proto.OperationalMessage) (response *proto.
return response, err
}

//func (c *AdvSSClient) StartRedist(zoneid uint16, nodeid uint16, nodeInfo []string, changeMap map[uint16]uint16) (err error) {
// cfg := etcd.NewConfig("127.0.0.1:2379")
// cli := etcd.NewEtcdClient(cfg, "testcluster")
// if cli == nil {
// return errors.New("failed to connect to ETCD server")
// }
//
// // Set new node
// for id, node := range nodeInfo {
// if node == "" {
// continue
// }
//
// key := etcd.KeyRedistNode(int(zoneid), id)
// err = cli.PutValue(key, node)
// if err != nil {
// return err
// }
// }
//
// // Set change map
// key := etcd.KeyRedist(int(zoneid), int(nodeid))
// var value string
// for k, v := range changeMap {
// if value == "" {
// value = fmt.Sprintf("%d_%d", k, v)
// } else {
// value = value + fmt.Sprintf(",%d_%d", k, v)
// }
// }
// err = cli.PutValue(key, value)
// if err != nil {
// return err
// }
//
// key = etcd.KeyRedistEnable(int(zoneid))
// return cli.PutValue(key, "yes")
//}

func (c *AdvSSClient) StopRedist(zoneid uint16) (err error) {
cfg := etcd.NewConfig("127.0.0.1:2379")
cli := etcd.NewEtcdClient(cfg, "testcluster")
Expand Down
174 changes: 0 additions & 174 deletions test/unittest/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1154,177 +1154,3 @@ func printStatus(funcname string, params *mock.MockParams, err error) {
"5{"+strconv.Itoa(int(params.MockInfoList[4].Status))+" <"+response[4]+">}, "+
"rcerr=", err)
}

/*********************************************************************
* -- StatusCode (complete loop)
* This test will loop each SS (3 SS as unit) and defined status code.
* It can simulate all the status code combination get from SS
**********************************************************************/
//func TestCreateLoopProtoStatusThreeSS(t *testing.T) {
// cvalue := []byte("Value to be stored for Create")
// key := testutil.GenerateRandomKey(32)
// params := mock.NewMockParams(5)
//
// for i := 0; i < 3; i++ {
// for a := 0; a < len(createStatusArray)-2; a++ { //loop through 6 status codes for first SS response
// params.MockInfoList[i].Status = createStatusArray[a]
// fmt.Println("len is ", len(createStatusArray), "a is", a, "i is", i, "status is", params.MockInfoList[i].Status)
//
// for j := i + 1; j < 4; j++ {
// for b := 0; b < len(createStatusArray)-2; b++ { //loop through 6 status codes for second SS response
// params.MockInfoList[j].Status = createStatusArray[b]
//
// for k := j + 1; k <= 4; k++ { //loop through 6 status codes for third SS response
// for c := 0; c < len(createStatusArray)-2; c++ {
// params.MockInfoList[k].Status = createStatusArray[c]
// _, err := Mockclient.Create(key, cvalue, 180, params)
// /*testutil.NEAssert(t, rc, 12, "create in TestCreateLoopProtoStatusThreeSS " +
// strconv.Itoa(i) + "{" + strconv.Itoa(int(createStatusArray[a])) + "}," +
// strconv.Itoa(j) + "{" + strconv.Itoa(int(createStatusArray[b])) + "}," +
// strconv.Itoa(k) + "{" + strconv.Itoa(int(createStatusArray[c])) + "}," +
// "should hit no storage server error, rc=" )
// */
// printStatus("Tcreate in TestCreateLoopProtoStatusThreeSS ", params, err)
// }
// }
// }
// }
// }
// }
// /****************************************************************************
// * When simulate SS at position 1 timeout, above loop misses below iteration
// * First SS at position 0 loop through status code 0-6, second SS iterate
// * through position 2,3,4 and loop through status code 0-6
// ****************************************************************************/
// params.MockInfoList[1].Delay = 1000000
// for j := 0; j <= 0; j++ {
// for a := 0; a < len(createStatusArray)-2; a++ {
// params.MockInfoList[j].Status = createStatusArray[a]
//
// for k := 2; k <= 4; k++ {
// for b := 0; b < 7; b++ {
// params.MockInfoList[k].Status = createStatusArray[b]
//
// _, err := Mockclient.Create(key, cvalue, 180, params)
// printTimeoutStatus("TestCreateOneTimeoutTwoStatus SS at p1 missing loop", params, err)
// }
// }
// }
// }
// params.MockInfoList[1].Delay = 0
//
// /****************************************************************************
// * When simulate SS at position 2 timeout, above loop misses below iteration
// * a> First SS at position 0 loop through status code 0-6, second SS iterate
// * through position 1,3,4 and loop through status code 0-6
// * b> First SS at position 1 loop through status code 0-6, second SS iterate
// through position 3,4 and loop through status code 0-6
// ****************************************************************************/
// params.MockInfoList[2].Delay = 1000000
// secondSS := [3]int{1, 3, 4}
// for j := 0; j <= 0; j++ {
// for a := 0; a < len(createStatusArray)-2; a++ {
// params.MockInfoList[j].Status = createStatusArray[a]
//
// for k := 0; k <= 2; k++ {
// for b := 0; b < 7; b++ {
// fmt.Println("one SS at position " + strconv.Itoa(j) + ", " +
// "one SS at position " + strconv.Itoa(secondSS[k]))
// params.MockInfoList[secondSS[k]].Status = createStatusArray[b]
//
// _, err := Mockclient.Create(key, cvalue, 180, params)
// printTimeoutStatus("TestCreateOneTimeoutTwoStatus SS at p2 missing loop1", params, err)
// }
// }
// }
// }
// secondSSP := [2]int{3, 4}
// for j := 1; j <= 1; j++ {
// for a := 0; a < len(createStatusArray)-2; a++ {
// params.MockInfoList[j].Status = createStatusArray[a]
//
// for k := 0; k <= 1; k++ {
// for b := 0; b < len(createStatusArray)-2; b++ {
// params.MockInfoList[secondSSP[k]].Status = createStatusArray[b]
// fmt.Println("one SS at position " + strconv.Itoa(j) + ", " +
// "one SS at position " + strconv.Itoa(secondSSP[k]))
//
// _, err := Mockclient.Create(key, cvalue, 180, params)
// printTimeoutStatus("TestCreateOneTimeoutTwoStatus SS at p2 missing loop2", params, err)
// }
// }
// }
// }
// params.MockInfoList[2].Delay = 0
//
// /************************************************
// * Timeout happens for SS in position 3
// ************************************************/
// params.MockInfoList[3].Delay = 1000000
// for i := 0; i < 2; i++ { //Loop through SS at position 0,1 to simulate set SS status code
// for a := 0; a < len(createStatusArray)-2; a++ {
// params.MockInfoList[i].Status = createStatusArray[a]
//
// for j := i + 1; j <= 2; j++ { //Loop through SS at position 1,2 to simulate set SS status code
// for b := 0; b < len(createStatusArray)-2; b++ {
// params.MockInfoList[j].Status = createStatusArray[b]
//
// _, err := Mockclient.Create(key, cvalue, 180, params)
// /*testutil.NEAssert(t, rc, 12, "create in TestCreateOneTimeoutTwoStatus 2 " +
// strconv.Itoa(j) + "{" + strconv.Itoa(int(createStatusArray[a])) + "}," +
// strconv.Itoa(k) + "{" + strconv.Itoa(int(createStatusArray[b])) + "}," +
// "3{timeout}, should hit no storage server error, rc=" ) */
// printTimeoutStatus("printTestCreateOneTimeoutTwoStatus 4th SS loop1 ", params, err)
// }
// }
// }
// }
// /****************************************************************************
// * Add one more situation -- set status code for one SS at position 4.
// * First SS iterate through position 0,1,2 loop through status code 0-6,
// * second SS at position 4 loop through status code 0-6
// ****************************************************************************/
// for j := 0; j < 3; j++ {
// for a := 0; a < len(createStatusArray)-2; a++ {
// params.MockInfoList[j].Status = createStatusArray[a]
//
// for k := 4; k <= 4; k++ {
// for b := 0; b < len(createStatusArray)-2; b++ {
// params.MockInfoList[k].Status = createStatusArray[b]
//
// _, err := Mockclient.Create(key, cvalue, 180, params)
// /*testutil.NEAssert(t, rc, 12, "create in TestCreateOneTimeoutTwoStatus 3 " +
// strconv.Itoa(j) + "{" + strconv.Itoa(int(createStatusArray[a])) + "}," + " 3{timeout}," +
// strconv.Itoa(k) + "{" + strconv.Itoa(int(createStatusArray[b])) + "}," +
// "should hit no storage server error, rc=" ) */
// printTimeoutStatus("printTestCreateOneTimeoutTwoStatus 4th SS loop2 ", params, err)
// }
// }
// }
// }
// params.MockInfoList[3].Delay = 0 //recover back to normal, no timeout
//
// /************************************************
// * Timeout happens for SS in position 4
// ************************************************/
// params.MockInfoList[4].Delay = 1000000
// for j := 0; j < 3; j++ { //Loop through SS at position 0,1,2 to simulate set SS status code
// for a := 0; a < len(createStatusArray)-2; a++ {
// params.MockInfoList[j].Status = createStatusArray[a]
//
// for k := j + 1; k < 4; k++ { //Loop through SS at position 1,2,3 to simulate set SS status code
// for b := 0; b < 7; b++ {
// params.MockInfoList[k].Status = createStatusArray[b]
//
// _, err := Mockclient.Create(key, cvalue, 180, params)
// /*testutil.NEAssert(t, rc, 12, "create in TestCreateOneTimeoutTwoStatus 4 " +
// strconv.Itoa(j) + "{" + strconv.Itoa(int(createStatusArray[a])) + "}," +
// strconv.Itoa(k) + "{" + strconv.Itoa(int(createStatusArray[b])) + "}," +
// "4{timeout},should hit no storage server error, rc=" ) */
// printTimeoutStatus("printTestCreateOneTimeoutTwoStatus 5th SS ", params, err)
// }
// }
// }
// }
// params.MockInfoList[4].Delay = 0 //recover back to normal, no timeout
//}