Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b6924a32
Commit
b6924a32
authored
Mar 09, 2016
by
harry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor cache into util sub pkg
parent
d5316c21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
etcd_helper.go
pkg/storage/etcd/etcd_helper.go
+3
-2
cache.go
pkg/util/cache/cache.go
+1
-1
cache_test.go
pkg/util/cache/cache_test.go
+1
-1
No files found.
pkg/storage/etcd/etcd_helper.go
View file @
b6924a32
...
...
@@ -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
:
util
cache
.
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
util
cache
.
Cache
}
func
init
()
{
...
...
pkg/util/cache.go
→
pkg/util/cache
/cache
.go
View file @
b6924a32
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
util
package
cache
import
(
"sync"
...
...
pkg/util/cache_test.go
→
pkg/util/cache
/cache
_test.go
View file @
b6924a32
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
util
package
cache
import
(
"testing"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment