Skip to content

Commit

Permalink
enhance: Use internal json(sonic) to replace std json lib (#37708)
Browse files Browse the repository at this point in the history
Related to #35020

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia authored Nov 18, 2024
1 parent 3743fc2 commit b0bd290
Show file tree
Hide file tree
Showing 101 changed files with 109 additions and 105 deletions.
2 changes: 1 addition & 1 deletion internal/datacoord/compaction_task_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package datacoord

import (
"context"
"encoding/json"
"strconv"
"sync"
"time"
Expand All @@ -28,6 +27,7 @@ import (
"go.uber.org/zap"
"google.golang.org/protobuf/proto"

"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/metastore"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/pkg/log"
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/compaction_task_meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ package datacoord

import (
"context"
"encoding/json"
"testing"
"time"

"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"

"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/metastore/mocks"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/pkg/util/metricsinfo"
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/import_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package datacoord

import (
"encoding/json"
"time"

"github.com/hashicorp/golang-lru/v2/expirable"
"golang.org/x/exp/maps"

"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/metastore"
"github.com/milvus-io/milvus/pkg/util/lock"
"github.com/milvus-io/milvus/pkg/util/timerecord"
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/import_meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package datacoord

import (
"encoding/json"
"fmt"
"math/rand"
"testing"
Expand All @@ -26,6 +25,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/metastore/mocks"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/proto/internalpb"
Expand Down
3 changes: 1 addition & 2 deletions internal/datacoord/import_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
package datacoord

import (
"encoding/json"

"google.golang.org/protobuf/proto"

"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/pkg/util/funcutil"
"github.com/milvus-io/milvus/pkg/util/metricsinfo"
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/import_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package datacoord

import (
"context"
"encoding/json"
"fmt"
"math/rand"
"path"
Expand All @@ -33,6 +32,7 @@ import (

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus/internal/datacoord/allocator"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/metastore/mocks"
mocks2 "github.com/milvus-io/milvus/internal/mocks"
"github.com/milvus-io/milvus/internal/proto/datapb"
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/index_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package datacoord

import (
"context"
"encoding/json"
"fmt"
"strconv"
"sync"
Expand All @@ -33,6 +32,7 @@ import (

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/metastore"
"github.com/milvus-io/milvus/internal/metastore/model"
"github.com/milvus-io/milvus/internal/proto/indexpb"
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/index_meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package datacoord

import (
"context"
"encoding/json"
"sync"
"testing"
"time"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/stretchr/testify/mock"

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus/internal/json"
mockkv "github.com/milvus-io/milvus/internal/kv/mocks"
"github.com/milvus-io/milvus/internal/metastore"
"github.com/milvus-io/milvus/internal/metastore/kv/datacoord"
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/metrics_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package datacoord

import (
"context"
"encoding/json"
"sync"

"github.com/cockroachdb/errors"
Expand All @@ -28,6 +27,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus/internal/datacoord/session"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/proto/indexpb"
"github.com/milvus-io/milvus/internal/types"
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/metrics_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package datacoord

import (
"context"
"encoding/json"
"testing"

"github.com/cockroachdb/errors"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
"github.com/milvus-io/milvus/internal/datacoord/session"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/types"
"github.com/milvus-io/milvus/pkg/util/merr"
Expand Down
2 changes: 1 addition & 1 deletion internal/datanode/importv2/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package importv2

import (
"context"
"encoding/json"
"io"
"strconv"
"strings"
Expand All @@ -33,6 +32,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/flushcommon/syncmgr"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/mocks"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/proto/internalpb"
Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/proxy/httpserver/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package httpserver
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
Expand All @@ -17,6 +16,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/types"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/proxy/httpserver/handler_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package httpserver
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
Expand All @@ -20,6 +19,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/mocks"
"github.com/milvus-io/milvus/internal/proxy"
"github.com/milvus-io/milvus/internal/types"
Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/proxy/httpserver/handler_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package httpserver

import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
Expand All @@ -24,6 +23,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proxy"
"github.com/milvus-io/milvus/internal/types"
Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/proxy/httpserver/handler_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package httpserver
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
Expand All @@ -18,6 +17,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
mhttp "github.com/milvus-io/milvus/internal/http"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/mocks"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proxy"
Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/proxy/httpserver/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package httpserver

import (
"encoding/json"
"math"
"strconv"
"strings"
Expand All @@ -15,6 +14,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/pkg/common"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/proxy/httpserver/wrap_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package httpserver

import (
"encoding/binary"
"encoding/json"
"fmt"
"math"

Expand All @@ -12,6 +11,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/proxy/httpserver/wrap_request_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package httpserver

import (
"encoding/json"
"testing"

"github.com/stretchr/testify/assert"

"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/json"
)

func TestFieldData_AsSchemapb(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/proxy/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"crypto/tls"
"crypto/x509"
"encoding/json"
"fmt"
"net/http/httptest"
"os"
Expand All @@ -45,6 +44,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
grpcproxyclient "github.com/milvus-io/milvus/internal/distributed/proxy/client"
"github.com/milvus-io/milvus/internal/distributed/proxy/httpserver"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/mocks"
"github.com/milvus-io/milvus/internal/proxy"
"github.com/milvus-io/milvus/internal/util/hookutil"
Expand Down
2 changes: 1 addition & 1 deletion internal/flushcommon/pipeline/flow_graph_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ package pipeline

import (
"context"
"encoding/json"
"fmt"

"go.uber.org/zap"

"github.com/milvus-io/milvus/internal/flushcommon/util"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/metrics"
"github.com/milvus-io/milvus/pkg/util/metricsinfo"
Expand Down
2 changes: 1 addition & 1 deletion internal/flushcommon/pipeline/flow_graph_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package pipeline

import (
"context"
"encoding/json"
"fmt"
"os"
"testing"
Expand All @@ -35,6 +34,7 @@ import (
"github.com/milvus-io/milvus/internal/flushcommon/syncmgr"
"github.com/milvus-io/milvus/internal/flushcommon/util"
"github.com/milvus-io/milvus/internal/flushcommon/writebuffer"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/util/metrics"
"github.com/milvus-io/milvus/internal/util/sessionutil"
Expand Down
2 changes: 1 addition & 1 deletion internal/flushcommon/syncmgr/sync_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package syncmgr

import (
"context"
"encoding/json"
"fmt"
"strconv"
"time"
Expand All @@ -14,6 +13,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/allocator"
"github.com/milvus-io/milvus/internal/flushcommon/metacache"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/storage"
"github.com/milvus-io/milvus/pkg/config"
"github.com/milvus-io/milvus/pkg/log"
Expand Down
2 changes: 1 addition & 1 deletion internal/flushcommon/syncmgr/sync_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package syncmgr

import (
"context"
"encoding/json"
"math/rand"
"strconv"
"testing"
Expand All @@ -22,6 +21,7 @@ import (
"github.com/milvus-io/milvus/internal/flushcommon/broker"
"github.com/milvus-io/milvus/internal/flushcommon/metacache"
"github.com/milvus-io/milvus/internal/flushcommon/metacache/pkoracle"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/mocks"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/storage"
Expand Down
2 changes: 1 addition & 1 deletion internal/flushcommon/syncmgr/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package syncmgr

import (
"context"
"encoding/json"
"fmt"
"path"
"time"
Expand All @@ -31,6 +30,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/allocator"
"github.com/milvus-io/milvus/internal/flushcommon/metacache"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/storage"
"github.com/milvus-io/milvus/pkg/common"
Expand Down
2 changes: 1 addition & 1 deletion internal/http/healthz/healthz_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package healthz

import (
"context"
"encoding/json"
"fmt"
"net/http"
"sync"
Expand All @@ -27,6 +26,7 @@ import (

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/pkg/log"
)

Expand Down
Loading

0 comments on commit b0bd290

Please sign in to comment.