Deveel.Data.TableSourceComposite.CreateTableSource C# (CSharp) Method

CreateTableSource() private method

private CreateTableSource ( TableInfo tableInfo, bool temporary ) : TableSource
tableInfo TableInfo
temporary bool
return TableSource
        private TableSource CreateTableSource(TableInfo tableInfo, bool temporary)
        {
            lock (commitLock) {
                try {
                    int tableId = NextTableId();

                    // Create the object.
                    var storeSystem = StoreSystem;
                    if (temporary)
                        storeSystem = tempStoreSystem;

                    var source = new TableSource(this, storeSystem, LargeObjectStore, tableId, tableInfo.TableName.FullName);
                    source.Create(tableInfo);

                    tableSources.Add(tableId, source);

                    if (!temporary) {
                        MarkUncommitted(tableId);

                        StateStore.Flush();
                    }

                    // And return it.
                    return source;
                } catch (IOException e) {
                    throw new InvalidOperationException(String.Format("Unable to create source for table '{0}'.", tableInfo.TableName), e);
                }
            }
        }