public void TestSetUp() { storageSystem = new InMemoryStorageSystem(); testStore = storageSystem.CreateStore("TestStore"); objStore = new ObjectStore(1, testStore); objStore.Create(); }
public bool CloseStore(InMemoryStore store) { if (!StoreExists(store.Name)) throw new InvalidOperationException(String.Format("Store {0} does not exist", store.Name)); return true; }
public bool DeleteStore(InMemoryStore store) { if (store == null) throw new ArgumentNullException("store"); lock (this) { return nameStoreMap.Remove(store.Name); } }
public bool CloseStore(InMemoryStore store) { if (!StoreExists(store.Name)) { throw new InvalidOperationException(String.Format("Store {0} does not exist", store.Name)); } return(true); }
public bool DeleteStore(InMemoryStore store) { if (store == null) { throw new ArgumentNullException("store"); } lock (this) { return(nameStoreMap.Remove(store.Name)); } }
public InMemoryStore CreateStore(string name, int hashSize) { if (String.IsNullOrEmpty(name)) throw new ArgumentNullException("name"); lock (this) { if (StoreExists(name)) throw new ArgumentException(String.Format("The store {0} already exists.", name)); var store = new InMemoryStore(name, hashSize); nameStoreMap[name] = store; return store; } }
public bool DeleteStore(InMemoryStore store) { if (store == null) throw new ArgumentNullException("store"); lock (this) { InMemoryStore removed; if (!nameStoreMap.TryGetValue(store.Name, out removed)) return false; nameStoreMap.Remove(store.Name); if (removed != null) removed.Dispose(); return true; } }
public InMemoryStore CreateStore(string name, int hashSize) { if (String.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } lock (this) { if (StoreExists(name)) { throw new ArgumentException(String.Format("The store {0} already exists.", name)); } var store = new InMemoryStore(name, hashSize); nameStoreMap[name] = store; return(store); } }
public bool DeleteStore(InMemoryStore store) { if (store == null) { throw new ArgumentNullException("store"); } lock (this) { InMemoryStore removed; if (!nameStoreMap.TryGetValue(store.Name, out removed)) { return(false); } nameStoreMap.Remove(store.Name); if (removed != null) { removed.Dispose(); } return(true); } }