public ColumnSerializer(ulong collectionId, long keyId, SessionFactory sessionFactory, RemotePostingsWriter postingsWriter = null, string ixFileExtension = "ix", string pageFileExtension = "ixp") { _keyId = keyId; _collectionId = collectionId; _postingsWriter = postingsWriter; _sessionFactory = sessionFactory; var pixFileName = Path.Combine(_sessionFactory.Dir, string.Format("{0}.{1}.{2}", _collectionId, keyId, pageFileExtension)); var ixFileName = Path.Combine(_sessionFactory.Dir, string.Format("{0}.{1}.{2}", _collectionId, keyId, ixFileExtension)); try { _pageIndexWriter = new PageIndexWriter(_sessionFactory.CreateAppendStream(pixFileName)); _ixStream = _sessionFactory.CreateAppendStream(ixFileName); } catch (IOException) { Thread.Sleep(100); if (_pageIndexWriter != null) { _pageIndexWriter.Dispose(); } if (_ixStream != null) { _ixStream.Dispose(); } _pageIndexWriter = new PageIndexWriter(_sessionFactory.CreateAppendStream(pixFileName)); _ixStream = _sessionFactory.CreateAppendStream(ixFileName); } }
public ColumnSerializer(ulong collectionId, long keyId, SessionFactory sessionFactory, RemotePostingsWriter postingsWriter, string ixFileExtension = "ix", string pageFileExtension = "ixp") { _keyId = keyId; _collectionId = collectionId; _postingsWriter = postingsWriter; _sessionFactory = sessionFactory; var pixFileName = Path.Combine(_sessionFactory.Dir, string.Format("{0}.{1}.{2}", _collectionId, keyId, pageFileExtension)); var ixFileName = Path.Combine(_sessionFactory.Dir, string.Format("{0}.{1}.{2}", _collectionId, keyId, ixFileExtension)); _ixPageIndexWriter = new PageIndexWriter(_sessionFactory.CreateAppendStream(pixFileName)); _ixStream = _sessionFactory.CreateAppendStream(ixFileName); }
public ColumnSerializer( ulong collectionId, long keyId, SessionFactory sessionFactory) { _keyId = keyId; _collectionId = collectionId; _sessionFactory = sessionFactory; var pixFileName = Path.Combine(_sessionFactory.Dir, string.Format("{0}.{1}.ixp", _collectionId, keyId)); var ixFileName = Path.Combine(_sessionFactory.Dir, string.Format("{0}.{1}.ix", _collectionId, keyId)); _ixPageIndexWriter = new PageIndexWriter(_sessionFactory.CreateAppendStream(pixFileName)); _ixStream = _sessionFactory.CreateAppendStream(ixFileName); }