Memory now evicts bucket if no more objects in memory struct

- To avoid race in expiration while accessing memory driver structs with
  in two competing write locks. Use lru Len() instead to know exact length
  to schedule for eviction.

- squash both bucket and object structs, instead use a separate map to keep
  mutable info of lastAccessTime which can be independently used inside the
  expiration routine.
This commit is contained in:
Harshavardhana
2015-04-29 23:36:30 -07:00
parent 63ba97fd8e
commit f8a16dd22b
2 changed files with 79 additions and 74 deletions

View File

@@ -19,6 +19,9 @@ package server
import (
"errors"
"fmt"
"reflect"
"time"
"github.com/minio-io/minio/pkg/api"
"github.com/minio-io/minio/pkg/api/web"
"github.com/minio-io/minio/pkg/iodine"
@@ -26,8 +29,6 @@ import (
"github.com/minio-io/minio/pkg/storage/drivers/donut"
"github.com/minio-io/minio/pkg/storage/drivers/memory"
"github.com/minio-io/minio/pkg/utils/log"
"reflect"
"time"
)
// MemoryFactory is used to build memory api servers