mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +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"
|
etcdutil "k8s.io/kubernetes/pkg/storage/etcd/util"
|
||||||
"k8s.io/kubernetes/pkg/util"
|
"k8s.io/kubernetes/pkg/util"
|
||||||
utilnet "k8s.io/kubernetes/pkg/util/net"
|
utilnet "k8s.io/kubernetes/pkg/util/net"
|
||||||
|
utilcache "k8s.io/kubernetes/pkg/util/cache"
|
||||||
"k8s.io/kubernetes/pkg/watch"
|
"k8s.io/kubernetes/pkg/watch"
|
||||||
|
|
||||||
etcd "github.com/coreos/etcd/client"
|
etcd "github.com/coreos/etcd/client"
|
||||||
@ -128,7 +129,7 @@ func NewEtcdStorage(client etcd.Client, codec runtime.Codec, prefix string, quor
|
|||||||
copier: api.Scheme,
|
copier: api.Scheme,
|
||||||
pathPrefix: path.Join("/", prefix),
|
pathPrefix: path.Join("/", prefix),
|
||||||
quorum: quorum,
|
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.
|
// 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.
|
// 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.
|
// TODO: Measure how much this cache helps after the conversion code is optimized.
|
||||||
cache util.Cache
|
cache utilcache.Cache
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
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.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package util
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package util
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
Loading…
Reference in New Issue
Block a user