Brian McQueen
10 years ago
96 changed files with 567 additions and 421 deletions
-
5.project
-
1.travis.yml
-
2Dockerfile
-
42README.md
-
5docs/api.rst
-
19docs/benchmarks.rst
-
2docs/directories.rst
-
2docs/failover.rst
-
6docs/gettingstarted.rst
-
6go/filer/client_operations.go
-
2go/filer/directory.go
-
3go/filer/directory_in_map.go
-
2go/filer/filer.go
-
3go/filer/filer_embedded.go
-
1go/filer/files_in_leveldb.go
-
2go/glog/convenient_api.go
-
3go/images/orientation.go
-
3go/images/resizing.go
-
5go/operation/assign_file_id.go
-
2go/operation/data_struts.go
-
3go/operation/delete_content.go
-
3go/operation/list_masters.go
-
3go/operation/lookup.go
-
3go/operation/submit.go
-
3go/operation/system_message_test.go
-
3go/operation/upload_content.go
-
2go/sequence/sequence.go
-
2go/stats/disk.go
-
2go/stats/disk_notsupported.go
-
2go/stats/memory_notsupported.go
-
5go/storage/cdb_map.go
-
3go/storage/cdb_map_test.go
-
2go/storage/compact_map.go
-
5go/storage/compact_map_perf_test.go
-
3go/storage/compress.go
-
3go/storage/crc.go
-
5go/storage/file_id.go
-
7go/storage/needle.go
-
5go/storage/needle_map.go
-
5go/storage/needle_read_write.go
-
9go/storage/store.go
-
3go/storage/store_vacuum.go
-
26go/storage/volume.go
-
3go/storage/volume_super_block.go
-
3go/storage/volume_vacuum.go
-
2go/storage/volume_version.go
-
3go/tools/read_index.go
-
5go/topology/allocate_volume.go
-
21go/topology/collection.go
-
2go/topology/data_center.go
-
3go/topology/data_node.go
-
5go/topology/node.go
-
5go/topology/store_replicate.go
-
38go/topology/topology.go
-
5go/topology/topology_event_handling.go
-
9go/topology/topology_map.go
-
21go/topology/topology_vacuum.go
-
5go/topology/volume_growth.go
-
5go/topology/volume_growth_test.go
-
5go/topology/volume_layout.go
-
2go/topology/volume_location_list.go
-
37go/util/concurrent_read_map.go
-
3go/util/config.go
-
4go/util/constants.go
-
3go/util/file_util.go
-
3go/util/net_timeout.go
-
159go/weed/benchmark.go
-
2go/weed/compact.go
-
5go/weed/download.go
-
7go/weed/export.go
-
15go/weed/filer.go
-
7go/weed/fix.go
-
12go/weed/master.go
-
2go/weed/mount.go
-
7go/weed/mount_std.go
-
17go/weed/server.go
-
3go/weed/shell.go
-
2go/weed/signal_handling_notsupported.go
-
3go/weed/upload.go
-
3go/weed/version.go
-
11go/weed/volume.go
-
3go/weed/volume_test.go
-
3go/weed/weed.go
-
11go/weed/weed_server/common.go
-
13go/weed/weed_server/filer_server.go
-
22go/weed/weed_server/filer_server_handlers.go
-
3go/weed/weed_server/filer_server_handlers_admin.go
-
9go/weed/weed_server/master_server.go
-
11go/weed/weed_server/master_server_handlers.go
-
15go/weed/weed_server/master_server_handlers_admin.go
-
31go/weed/weed_server/raft_server.go
-
7go/weed/weed_server/raft_server_handlers.go
-
5go/weed/weed_server/volume_server.go
-
13go/weed/weed_server/volume_server_handlers.go
-
5go/weed/weed_server/volume_server_handlers_admin.go
-
3go/weed/weed_server/volume_server_handlers_vacuum.go
@ -1,5 +1,5 @@ |
|||
FROM cydev/go |
|||
RUN go get code.google.com/p/weed-fs/go/weed |
|||
RUN go get github.com/chrislusf/weed-fs/go/weed |
|||
EXPOSE 8080 |
|||
EXPOSE 9333 |
|||
VOLUME /data |
|||
|
@ -1,7 +1,5 @@ |
|||
package glog |
|||
|
|||
import () |
|||
|
|||
/* |
|||
Copying the original glog because it is missing several convenient methods. |
|||
1. remove nano time in log format |
|||
|
@ -1,7 +1,5 @@ |
|||
package operation |
|||
|
|||
import () |
|||
|
|||
type JoinResult struct { |
|||
VolumeSizeLimit uint64 `json:"VolumeSizeLimit,omitempty"` |
|||
Error string `json:"error,omitempty"` |
|||
|
@ -0,0 +1,37 @@ |
|||
package util |
|||
|
|||
import "sync" |
|||
|
|||
// A mostly for read map, which can thread-safely
|
|||
// initialize the map entries.
|
|||
type ConcurrentReadMap struct { |
|||
rmutex sync.RWMutex |
|||
mutex sync.Mutex |
|||
Items map[string]interface{} |
|||
} |
|||
|
|||
func NewConcurrentReadMap() *ConcurrentReadMap { |
|||
return &ConcurrentReadMap{Items: make(map[string]interface{})} |
|||
} |
|||
|
|||
func (m *ConcurrentReadMap) initMapEntry(key string, newEntry func() interface{}) (value interface{}) { |
|||
m.mutex.Lock() |
|||
defer m.mutex.Unlock() |
|||
if value, ok := m.Items[key]; ok { |
|||
return value |
|||
} |
|||
value = newEntry() |
|||
m.Items[key] = value |
|||
return value |
|||
} |
|||
|
|||
func (m *ConcurrentReadMap) Get(key string, newEntry func() interface{}) interface{} { |
|||
m.rmutex.RLock() |
|||
if value, ok := m.Items[key]; ok { |
|||
m.rmutex.RUnlock() |
|||
return value |
|||
} else { |
|||
m.rmutex.RUnlock() |
|||
return m.initMapEntry(key, newEntry) |
|||
} |
|||
} |
@ -1,7 +1,5 @@ |
|||
package util |
|||
|
|||
import () |
|||
|
|||
const ( |
|||
VERSION = "0.64" |
|||
VERSION = "0.67" |
|||
) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue