Ejemplo n.º 1
0
 public BlockStoreCache(long maxHeap, string localStorageKey)
 {
     _maxBlockCount = maxHeap/BlockInfoSize;
     _cache = new ConcurrentDictionary<string, BlockInfo>();
     _localStorage = RoleEnvironment.GetLocalResource(localStorageKey);
     int capacity = (_localStorage.MaximumSizeInMegabytes/4) - 10; // Just a bit of a safety buffer
     _diskCache = new BlockStoreDiskCache(_localStorage.RootPath + Path.DirectorySeparatorChar + "bscache",
                                          capacity, AzureBlockStore.AzureBlockSize);
 }
Ejemplo n.º 2
0
        public BlockStoreCache(long maxHeap, string localStorageKey)
        {
            _maxBlockCount = maxHeap / BlockInfoSize;
            _cache         = new ConcurrentDictionary <string, BlockInfo>();
            _localStorage  = RoleEnvironment.GetLocalResource(localStorageKey);
            int capacity = (_localStorage.MaximumSizeInMegabytes / 4) - 10; // Just a bit of a safety buffer

            _diskCache = new BlockStoreDiskCache(_localStorage.RootPath + Path.DirectorySeparatorChar + "bscache",
                                                 capacity, AzureBlockStore.AzureBlockSize);
        }