Esempio n. 1
0
        /// <summary>
        /// Create a new index manager
        /// </summary>
        /// <param name="myVertexStore">The vertex store of the graphDB</param>
        /// <param name="myPluginManager">The sones graphDB plugin manager</param>
        /// <param name="myPluginDefinitions">The parameters for plugin-indices</param>
        public IndexManager(IDManager myIDManager, GraphDBPluginManager myPluginManager, GraphApplicationSettings myApplicationSettings, List<PluginDefinition> myPluginDefinitions = null)
        {
            _idManager = myIDManager;
            _pluginManager = myPluginManager;
            _applicationSettings = myApplicationSettings;

            _indexPluginParameter = myPluginDefinitions != null
                ? myPluginDefinitions.ToDictionary(key => key.NameOfPlugin, value => value)
                : new Dictionary<string, PluginDefinition>();
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new meta manager 
 /// </summary>
 /// <param name="myVertexStore">The vertex store on which all other manager rely on</param>
 /// <param name="myPlugins">The plugin definitions</param>
 /// <param name="myPluginManager">Used to load pluginable manager</param>
 /// <param name="myApplicationSettings">The current application settings</param>
 private MetaManager(IVertexStore myVertexStore, IDManager myIDManager, GraphDBPluginManager myPluginManager, GraphDBPlugins myPlugins, GraphApplicationSettings myApplicationSettings)
 {
     _vertexStore = myVertexStore;
     _vertexTypeManager = new VertexTypeManager(myIDManager);
     _vertexManager = new VertexManager(myIDManager);
     _edgeTypeManager = new EdgeTypeManager(myIDManager);
     _queryPlanManager = new QueryPlanManager();
     _indexManager = new IndexManager(myIDManager, myPluginManager, myApplicationSettings, myPlugins.IndexPlugins);
 }
Esempio n. 3
0
 public ExecuteVertexHandler(IDManager myIDManager)
 {
     _idManager = myIDManager;
 }
Esempio n. 4
0
        public static IMetaManager CreateMetaManager(IVertexStore myVertexStore, IDManager myIDManager, GraphDBPlugins myPlugins, GraphDBPluginManager myPluginManager, GraphApplicationSettings myApplicationSettings, TransactionToken myTransaction, SecurityToken mySecurity)
        {
            var result = new MetaManager(myVertexStore, myIDManager, myPluginManager, myPlugins, myApplicationSettings);

            DBCreationManager creationManager = new DBCreationManager(result.SystemSecurityToken, result.SystemTransactionToken);
            if (!creationManager.CheckBaseGraph(myVertexStore))
            {
                creationManager.CreateBaseGraph(myVertexStore);
            }

            result.Initialize();
            result.Load();

            SetMaxID(myVertexStore, myIDManager, myTransaction, mySecurity, result);

            return result;
        }
Esempio n. 5
0
 private static void SetMaxID(IVertexStore myVertexStore, IDManager myIDManager, TransactionToken myTransaction, SecurityToken mySecurity, MetaManager result)
 {
     foreach (var aUserDefinedVertexType in result._vertexTypeManager.ExecuteManager.GetAllVertexTypes(myTransaction, mySecurity).Where(_ => _.IsUserDefined))
     {
         myIDManager[aUserDefinedVertexType.ID].SetToMaxID(myVertexStore.GetHighestVertexID(mySecurity, myTransaction, aUserDefinedVertexType.ID) + 1);
     }
 }
Esempio n. 6
0
 public ExecuteVertexTypeManager(IDManager myIDManager)
 {
     _idManager = myIDManager;
 }
Esempio n. 7
0
 public ExecuteEdgeTypeManager(IDManager myIDManager)
 {
     _idManager = myIDManager;
 }
Esempio n. 8
0
 private static void SetMaxID(IVertexStore myVertexStore, 
                                 IDManager myIDManager, 
                                 Int64 myTransaction, 
                                 SecurityToken mySecurity, 
                                 MetaManager result)
 {
     foreach (var aUserDefinedVertexType in result._vertexTypeManager.ExecuteManager.GetAllTypes(myTransaction, mySecurity))
     {
         myIDManager.GetVertexTypeUniqeID(aUserDefinedVertexType.ID).SetToMaxID(myVertexStore.GetHighestVertexID(mySecurity, myTransaction, aUserDefinedVertexType.ID) + 1);
     }
 }
Esempio n. 9
0
        public static IMetaManager CreateMetaManager(   IVertexStore myVertexStore, 
                                                        IDManager myIDManager, 
                                                        GraphDBPlugins myPlugins, 
                                                        GraphDBPluginManager myPluginManager, 
                                                        GraphApplicationSettings myApplicationSettings, 
                                                        ITransactionable myTransactionManager, 
                                                        SecurityToken mySecurity)
        {
            var result = new MetaManager(myVertexStore, myIDManager, myPluginManager, myPlugins, myApplicationSettings);

            var transactionID = myTransactionManager.BeginTransaction(mySecurity);

            DBCreationManager creationManager = new DBCreationManager(  result.SystemSecurityToken,
                                                                        transactionID, 
                                                                        result._baseGraphStorageManager);
            
            if (!creationManager.CheckBaseGraph(myVertexStore))
            {
                creationManager.CreateBaseGraph(myVertexStore);
            }

            creationManager.AddUserDefinedDataTypes(myVertexStore, myPluginManager);
            
            result.Initialize();
            result.Load(transactionID);

            SetMaxID(myVertexStore, myIDManager, transactionID, mySecurity, result);

            myTransactionManager.CommitTransaction(mySecurity, transactionID);

            return result;
        }
Esempio n. 10
0
 public VertexTypeManager(IDManager myIDManager)
 {
     _check   = new CheckVertexTypeManager();
     _execute = new ExecuteVertexTypeManager(myIDManager);
 }