static void Main(string[] args) { if (args.Length == 0) { Usage(); return; } if (args.Length >= 2) { TrinityConfig.StorageRoot = args[1]; } Global.LoadTSLStorageExtension(args[0]); Global.LocalStorage.LoadStorage(); TrinityConfig.HttpPort = 80; FanoutSearchModule.EnableExternalQuery(true); FanoutSearchModule.SetQueryTimeout(3000); FanoutSearchModule.RegisterIndexService(Indexer); FanoutSearch.LambdaDSL.SetDialect("g", "v", "outV", "outE", "Action"); TrinityServer server = new TrinityServer(); server.RegisterCommunicationModule <FanoutSearchModule>(); server.Start(); }
static void Main(string[] args) { FanoutSearchModule.EnableExternalQuery(true); FanoutSearchModule.SetQueryTimeout(30000); FanoutSearchModule.RegisterIndexService(Indexer); FanoutSearchModule.RegisterExpressionSerializerFactory(() => new ExpressionSerializer()); LambdaDSL.SetDialect("MyGraph", "StartFrom", "VisitNode", "FollowEdge", "Action"); TrinityConfig.HttpPort = 80; var server = new TrinityServer(); server.RegisterCommunicationModule <FanoutSearchModule>(); server.Start(); if (!Trinity.Global.LocalStorage.LoadStorage() || !Trinity.Global.LocalStorage.Movie_Accessor_Selector().Any()) { Trinity.Global.LocalStorage.LoadStorage(); ImportMovieData(@"D:\MovieDomain\GraphEngineServer\bin\Debug\"); Trinity.Global.LocalStorage.SaveStorage(); } else { Console.WriteLine("=============================Movie had been imported once. Skipping this turn."); } //TestMovieData(@"D:\MovieDomain\GraphEngineServer\bin\Debug\"); //ImportToyData(); //PrepareSeedEntity(); }
static unsafe void Main(string[] args) { //TrinityConfig.LoggingLevel = LogLevel.Debug; for (int i = -10; i < 10; i++) { Tweet t = new Tweet(cell_id: i, Content: $"推文正文:{i}", TweetTime: DateTime.Now); Global.LocalStorage.SaveTweet(t); } Global.LocalStorage.SaveStorage(); FanoutSearchModule.EnableExternalQuery(true); LambdaDSL.SetDialect("LessNet", "Start", "Node", "Edge", "Action"); FanoutSearchModule.SetQueryTimeout(3000); //FanoutSearchModule.RegisterIndexService(Indexer); FanoutSearchModule.RegisterExpressionSerializerFactory(ExpressionSerializerFactory); TwitterDatabaseServer server = new TwitterDatabaseServer(); server.RegisterCommunicationModule <FanoutSearchModule>(); server.Start(); }