mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Refactor cache into util sub pkg
This commit is contained in:
parent
d5316c21ef
commit
b6924a322a
@ -35,6 +35,7 @@ import (
|
||||
etcdutil "k8s.io/kubernetes/pkg/storage/etcd/util"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
utilnet "k8s.io/kubernetes/pkg/util/net"
|
||||
utilcache "k8s.io/kubernetes/pkg/util/cache"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
|
||||
etcd "github.com/coreos/etcd/client"
|
||||
@ -128,7 +129,7 @@ func NewEtcdStorage(client etcd.Client, codec runtime.Codec, prefix string, quor
|
||||
copier: api.Scheme,
|
||||
pathPrefix: path.Join("/", prefix),
|
||||
quorum: quorum,
|
||||
cache: util.NewCache(maxEtcdCacheEntries),
|
||||
cache: utilcache.NewCache(maxEtcdCacheEntries),
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,7 +156,7 @@ type etcdHelper struct {
|
||||
// support multi-object transaction that will result in many objects with the same index.
|
||||
// Number of entries stored in the cache is controlled by maxEtcdCacheEntries constant.
|
||||
// TODO: Measure how much this cache helps after the conversion code is optimized.
|
||||
cache util.Cache
|
||||
cache utilcache.Cache
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
2
pkg/util/cache.go → pkg/util/cache/cache.go
vendored
2
pkg/util/cache.go → pkg/util/cache/cache.go
vendored
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package util
|
||||
package cache
|
||||
|
||||
import (
|
||||
"sync"
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package util
|
||||
package cache
|
||||
|
||||
import (
|
||||
"testing"
|
Loading…
Reference in New Issue
Block a user