public ColumnData(ColumnDataBase source, IUnmanagedAllocator allocator) : base(source, allocator) { var typed = (ColumnData <T>)source; m_dbType = typed.DbType; DataArray = typed.DataArray; AssignFromDriverRow = typed.AssignFromDriverRow; AssignToDriverRow = typed.AssignToDriverRow; WriteData = typed.WriteData; ReadData = typed.ReadData; }
public long CreateChangeset(DriverChangeBuffer changeBuffer, bool isBulk) { CheckInitialized(); if (changeBuffer == null) { throw new ArgumentNullException("changeBuffer"); } var key = Interlocked.Increment(ref m_lastChangesetHandle); ColumnDataBase[] columnStores = null; var documentContainer = m_dataContainer.RequireDocumentContainer(changeBuffer.TargetEntity); if (changeBuffer.Fields != null && changeBuffer.Fields.Length > 0) { columnStores = new ColumnDataBase[changeBuffer.Fields.Length]; for (var i = 0; i < changeBuffer.Fields.Length; i++) { var field = changeBuffer.Fields[i]; columnStores[i] = documentContainer.RequireColumnStore(field.FieldId); } } var changesetRec = new RamDriverChangeset(this, changeBuffer, isBulk, documentContainer, columnStores); documentContainer.StructureLock.EnterReadLock(); try { if (!m_changesets.TryAdd(key, changesetRec)) { throw new Exception("Internal error"); } return(key); } catch { documentContainer.StructureLock.ExitReadLock(); throw; } }
protected ColumnDataBase(ColumnDataBase source, IUnmanagedAllocator allocator) { // may throw due to insufficient memory NotNulls = new BitVector(source.NotNulls, allocator); }
/// <summary> /// Ctr. /// </summary> public RamDriverChangeset(RamDriver driver, DriverChangeBuffer changeBuffer, bool isBulk, DocumentDataContainer documentContainer, ColumnDataBase[] columnStores) { if (driver == null) { throw new ArgumentNullException("driver"); } if (changeBuffer == null) { throw new ArgumentNullException("changeBuffer"); } if (documentContainer == null) { throw new ArgumentNullException("documentContainer"); } Driver = driver; ChangeBuffer = changeBuffer; IsBulk = isBulk; ColumnStores = columnStores; DocumentContainer = documentContainer; }
public long CreateChangeset(DriverChangeBuffer changeBuffer, bool isBulk) { CheckInitialized(); if (changeBuffer == null) { throw new ArgumentNullException("changeBuffer"); } var key = Interlocked.Increment(ref m_lastChangesetHandle); ColumnDataBase[] columnStores = null; var documentContainer = m_dataContainer.RequireDocumentContainer(changeBuffer.TargetEntity); if (changeBuffer.Fields != null && changeBuffer.Fields.Length > 0) { columnStores = new ColumnDataBase[changeBuffer.Fields.Length]; for (var i = 0; i < changeBuffer.Fields.Length; i++) { var field = changeBuffer.Fields[i]; columnStores[i] = documentContainer.RequireColumnStore(field.FieldId); } } var changesetRec = new RamDriverChangeset(this, changeBuffer, isBulk, documentContainer, columnStores); documentContainer.StructureLock.EnterReadLock(); try { if (!m_changesets.TryAdd(key, changesetRec)) { throw new Exception("Internal error"); } return key; } catch { documentContainer.StructureLock.ExitReadLock(); throw; } }
private static ColumnDataBase CreateColumnStore(DbType dbType, IUnmanagedAllocator allocator, ColumnDataBase migrated) { var dataType = DriverRowData.DeriveSystemType(dbType); var columnStoreType = typeof(ColumnData<>).MakeGenericType(dataType); return migrated == null ? (ColumnDataBase) Activator.CreateInstance(columnStoreType, dbType, allocator) : (ColumnDataBase) Activator.CreateInstance(columnStoreType, migrated, allocator); }
private static ColumnDataBase CreateColumnStore(DbType dbType, IUnmanagedAllocator allocator, ColumnDataBase migrated) { var dataType = DriverRowData.DeriveSystemType(dbType); var columnStoreType = typeof(ColumnData <>).MakeGenericType(dataType); return(migrated == null ? (ColumnDataBase)Activator.CreateInstance(columnStoreType, dbType, allocator) : (ColumnDataBase)Activator.CreateInstance(columnStoreType, migrated, allocator)); }