public void Initialize(EnumerationPointer pointer, IndexedLocalCache cache) { _cache = cache; _pointer = pointer; _snapshot = CacheSnapshotPool.Instance.GetSnaphot(pointer.Id, cache); }
internal EnumerationDataChunk GetNextChunk(EnumerationPointer pointer) { EnumerationDataChunk nextChunk = null; IEnumerationProvider provider = GetProvider(pointer); if (pointer.isDisposable && provider != null) { provider.Dispose(); if (_index.ContainsKey(pointer)) { _index.Remove(pointer); } nextChunk = new EnumerationDataChunk(); nextChunk.Pointer = pointer; } else if (provider != null) { nextChunk = provider.GetNextChunk(pointer); //Dispose the provider if this is the last chunk for it if (nextChunk.IsLastChunk) { provider.Dispose(); if (_index.ContainsKey(pointer)) { _index.Remove(pointer); } } } return(nextChunk); }
public void Dispose() { CacheSnapshotPool.Instance.DiposeSnapshot(_pointer.Id, _cache); //Disposes the snapshot from pool for this particular pointer _cache = null; _pointer = null; _snapshot = null; }
internal GetNextChunkCommand(EnumerationPointer pointer) { base.name = "GetNextChunkCommand"; _getNextChunkCommand = new Alachisoft.NCache.Common.Protobuf.GetNextChunkCommand(); _getNextChunkCommand.enumerationPointer = EnumerationPointerConversionUtil.ConvertToProtobufEnumerationPointer(pointer); }
public override EnumerationDataChunk GetNextChunk(EnumerationPointer pointer, OperationContext operationContext) { if (_enumerationIndex == null) { _enumerationIndex = new EnumerationIndex(this); } return(_enumerationIndex.GetNextChunk(pointer)); }
public override bool HasEnumerationPointer(EnumerationPointer pointer) { if (_enumerationIndex == null) { return(false); } return(_enumerationIndex.Contains(pointer)); }
public void DisposeEnumerator(EnumerationPointer pointer) { if (_cache != null) { //Just a dummy call to dispose enumerator pointer.isDisposable = true; pointer.IsSocketServerDispose = true; _cache.GetNextChunk(pointer, new OperationContext()); } }
public void Initialize(EnumerationPointer pointer, IndexedLocalCache cache) { _cache = cache; _pointer = pointer; if (System.Configuration.ConfigurationSettings.AppSettings.Get("NCacheServer.EnumeratorChunkSize") != null) { _chunkSize = Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings.Get("NCacheServer.EnumeratorChunkSize")); } _snapshot = CacheSnapshotPool.Instance.GetSnaphot(pointer.Id, cache); }
internal bool Contains(EnumerationPointer pointer) { if (_index != null) { return(_index.ContainsKey(pointer)); } else { return(false); } }
public override EnumerationDataChunk GetNextChunk(EnumerationPointer pointer, OperationContext operationContext) { base.Sync.AcquireWriterLock(-1); try { return(this.Internal.GetNextChunk(pointer, operationContext)); } finally { base.Sync.ReleaseWriterLock(); } }
public override bool HasEnumerationPointer(EnumerationPointer pointer) { base.Sync.AcquireWriterLock(-1); try { return(this.Internal.HasEnumerationPointer(pointer)); } finally { base.Sync.ReleaseWriterLock(); } }
protected void Clustered_GetNextChunk(ArrayList dests, EnumerationPointer pointer, OperationContext operationContext) { try { Function func = new Function((int)OpCodes.GetNextChunk, new object[] { pointer, operationContext }, true); RspList results = Cluster.BroadcastToMultiple(dests, func, GroupRequest.GET_ALL, false); ClusterHelper.ValidateResponses(results, null, Name); } catch (CacheException e) { throw; } catch (Exception e) { throw new GeneralFailureException(e.Message, e); } }
public void Initialize(string group, string subGroup) { EnumerationPointer pointer = null; if (!String.IsNullOrEmpty(group)) { pointer = new GroupEnumerationPointer(group, subGroup); } else { pointer = new EnumerationPointer(); } _currentChunk = _cache.GetNextChunk(pointer, new OperationContext()); if (_currentChunk != null && _currentChunk.Data != null) { List <string> data = _currentChunk.Data; _currentChunkEnumerator = data.GetEnumerator(); } }
private IEnumerationProvider GetProvider(EnumerationPointer pointer) { if (_index == null) { _index = new Dictionary <EnumerationPointer, IEnumerationProvider>(); } IEnumerationProvider provider = null; if (_index.ContainsKey(pointer)) { provider = _index[pointer]; } else if (pointer.ChunkId == -1 && !pointer.IsSocketServerDispose && !pointer.isDisposable) { provider = new SnapshotEnumerationProvider(); provider.Initialize(pointer, _cache); _index.Add(pointer, provider); } return(provider); }
public virtual bool HasEnumerationPointer(EnumerationPointer pointer) { return(false); }
public override EnumerationDataChunk GetNextChunk(EnumerationPointer pointer, OperationContext operationContext) { return(Internal.GetNextChunk(pointer, operationContext)); }
public virtual EnumerationDataChunk GetNextChunk(EnumerationPointer pointer) { return(null); }
public void Initialize(EnumerationPointer pointer, LocalCache cache) { throw new Exception("The method or operation is not implemented."); }
public EnumerationDataChunk GetNextChunk(EnumerationPointer pointer) { throw new Exception("The method or operation is not implemented."); }
public virtual EnumerationDataChunk GetNextChunk(EnumerationPointer pointer, OperationContext operationContext) { return(null); }