Skip to content
Snippets Groups Projects
Commit ddddd65d authored by Bingyi Sun 【孙秉义】's avatar Bingyi Sun 【孙秉义】 Committed by yefu.chen
Browse files

Delete internal/errors package


Signed-off-by: default avatarsunby <bingyi.sun@zilliz.com>
parent 447a1520
No related branches found
No related tags found
No related merge requests found
......@@ -3,12 +3,13 @@ package funcutil
import (
"context"
"encoding/json"
"errors"
"fmt"
"net"
"strconv"
"time"
"errors"
"github.com/go-basic/ipv4"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb2"
......
package rocksmq
import (
"fmt"
"strconv"
"sync"
"errors"
"github.com/zilliztech/milvus-distributed/internal/allocator"
"github.com/tecbot/gorocksdb"
"github.com/zilliztech/milvus-distributed/internal/errors"
"github.com/zilliztech/milvus-distributed/internal/kv"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
......@@ -165,7 +167,7 @@ func (rmq *RocksMQ) DestroyChannel(channelName string) error {
func (rmq *RocksMQ) CreateConsumerGroup(groupName string, channelName string) (*Consumer, error) {
key := groupName + "/" + channelName + "/current_id"
if rmq.checkKeyExist(key) {
return nil, errors.New("ConsumerGroup " + groupName + " already exists.")
return nil, fmt.Errorf("ConsumerGroup %s already exists", groupName)
}
err := rmq.kv.Save(key, DefaultMessageID)
if err != nil {
......@@ -323,7 +325,7 @@ func (rmq *RocksMQ) Seek(groupName string, channelName string, msgID UniqueID) e
/* Step I: Check if key exists */
key := groupName + "/" + channelName + "/current_id"
if !rmq.checkKeyExist(key) {
return errors.New("ConsumerGroup " + groupName + ", channel " + channelName + " not exists.")
return fmt.Errorf("ConsumerGroup %s, channel %s not exists", groupName, channelName)
}
storeKey, err := combKey(channelName, msgID)
......
......@@ -2,10 +2,11 @@ package trace
import (
"context"
"errors"
"runtime"
"strings"
"errors"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/opentracing/opentracing-go/log"
......
......@@ -2,11 +2,12 @@ package trace
import (
"context"
"errors"
"fmt"
"io"
"testing"
"errors"
"github.com/opentracing/opentracing-go"
oplog "github.com/opentracing/opentracing-go/log"
"github.com/uber/jaeger-client-go/config"
......
......@@ -7,14 +7,12 @@ import (
"strings"
"github.com/apache/pulsar-client-go/pulsar"
"github.com/zilliztech/milvus-distributed/internal/errors"
)
// BytesToUint64 converts a byte slice to uint64.
func BytesToInt64(b []byte) (int64, error) {
if len(b) != 8 {
return 0, errors.Errorf("invalid data, must 8 bytes, but %d", len(b))
return 0, fmt.Errorf("invalid data, must 8 bytes, but %d", len(b))
}
return int64(binary.BigEndian.Uint64(b)), nil
......@@ -30,7 +28,7 @@ func Int64ToBytes(v int64) []byte {
// BytesToUint64 converts a byte slice to uint64.
func BytesToUint64(b []byte) (uint64, error) {
if len(b) != 8 {
return 0, errors.Errorf("invalid data, must 8 bytes, but %d", len(b))
return 0, fmt.Errorf("invalid data, must 8 bytes, but %d", len(b))
}
return binary.BigEndian.Uint64(b), nil
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment