コード例 #1
0
        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();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: sefira/NeuralMovieQAQ
        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();
        }
コード例 #3
0
ファイル: Fixture.cs プロジェクト: chaosddp/GraphEngine
 public TrinityServerFixture()
 {
     Global.Initialize();
     LambdaDSL.SetDialect("MAG", "StartFrom", "VisitNode", "FollowEdge", "Action");
     FanoutSearchModule.SetQueryTimeout(-1);
     FanoutSearchModule.RegisterIndexService(FakeIndexService);
     server = new TrinityServer();
     server.RegisterCommunicationModule <FanoutSearchModule>();
     server.Start();
 }
コード例 #4
0
        internal static void Initialize()
        {
            Global.Initialize();
            LambdaDSL.SetDialect("MAG", "StartFrom", "VisitNode", "FollowEdge", "Action");
            FanoutSearchModule.SetQueryTimeout(-1);
            FanoutSearchModule.RegisterIndexService(FakeIndexService);
            FanoutSearchModule.RegisterExpressionSerializerFactory(() => new ExpressionSerializer());
            TrinityServer server = new TrinityServer();

            server.RegisterCommunicationModule <FanoutSearchModule>();
            server.Start();
        }
コード例 #5
0
        static void Main(string[] args)
        {
            FanoutSearchModule.ForceRunAsClient(true);
            FanoutSearchModule.RegisterExpressionSerializerFactory(() => new ExpressionSerializer());

            foreach (var path in StartFrom(2391729982219739490, new[] { "Name" }))
            {
                foreach (var node in path)
                {
                    Console.WriteLine($"{node.id}: { node["Name"]}");
                }
            }
        }
コード例 #6
0
ファイル: LIKQTest.cs プロジェクト: shekhar249/GraphEngine
        public static void Initialize(TestContext context)
        {
            TrinityServer server = new TrinityServer();

            TrinityConfig.HttpPort     = 8080;
            TrinityConfig.ServerPort   = 7304;
            TrinityConfig.LoggingLevel = Trinity.Diagnostics.LogLevel.Debug;
            FanoutSearchModule.RegisterExpressionSerializerFactory(() => new ExpressionSerializer());
            server.RegisterCommunicationModule <FanoutSearchModule>();
            server.Start();


            Console.WriteLine("Local Server started");
            BSP.BarrierSync((FixedMemoryCloud)Global.CloudStorage);
            Console.WriteLine("All Server started");
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: afcentry/Test
        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();
        }
コード例 #8
0
        public void Initialize(string LogDirectory, string StorageRoot, bool LogEchoOnConsole, Trinity.Diagnostics.LogLevel LogLevel)
        {
            if (!_isInitialized)
            {
                TrinityConfig.LogEchoOnConsole      = LogEchoOnConsole;
                LoggingConfig.Instance.LogDirectory = LogDirectory;
                LoggingConfig.Instance.LoggingLevel = LogLevel;
                StorageConfig.Instance.StorageRoot  = StorageRoot;

                Global.Initialize();

                LambdaDSL.SetDialect("MAG", "StartFrom", "VisitNode", "FollowEdge", "Action");
                FanoutSearchModule.SetQueryTimeout(-1);

                TrinityServer server = new TrinityServer();
                server.RegisterCommunicationModule <FanoutSearchModule>();
                server.Start();

                _isInitialized = true;
            }
        }
コード例 #9
0
        private static void Initialize()
        {
            //  Setup LIKQ index service
            FanoutSearchModule.RegisterIndexService(IndexService);
            //  Set LIKQ starting node keyword to 'Freebase'
            LambdaDSL.SetDialect("Freebase", "StartFrom", "VisitNode", "FollowEdge", "Action");
            //  Plug-in Freebase ICell adapter
            FanoutSearchModule.RegisterUseICellOperationMethod(CellGroupAccessor.New);
            //  Plug-in Serialize.Linq expression serializer
            FanoutSearchModule.RegisterExpressionSerializerFactory(ExpressionSerializerFactory);
            //  Configure LIKQ timeout
            FanoutSearchModule.SetQueryTimeout(1000000);

            string storage_path = Path.Combine(Global.MyAssemblyPath, "storage");

            if (Directory.Exists(storage_path) && Directory.GetFileSystemEntries(storage_path).Count() == 0)
            {
                Directory.Delete(storage_path);
            }

            if (!Directory.Exists(storage_path))
            {
                DownloadDataFile();
            }

            Global.LocalStorage.LoadStorage();
            string sqlite_db_path = Path.Combine(storage_path, "freebase.sqlite");

            if (!File.Exists(sqlite_db_path))
            {
                BuildIndex(sqlite_db_path);
            }

            s_dbconn = new SQLiteConnection($"Data Source={sqlite_db_path};Version=3;");
            s_dbconn.Open();

            return;
        }
コード例 #10
0
 /// <summary>
 /// Tries to serialize the string collection to a string, then convert to T.
 /// Only works when T is string/object
 /// </summary>
 private static T _convert <T>(IEnumerable <string> values)
 {
     return((T)(object)FanoutSearchModule.ToJsonArray(values));
 }
コード例 #11
0
        public LocalStressTest()
        {
            //Load some data
            Global.LocalStorage.SaveMyCell(0, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(1, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(2, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(3, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(4, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(5, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(6, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(7, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(8, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });
            Global.LocalStorage.SaveMyCell(9, new List <long> {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            }, f2: new List <float> {
                1, 2, 3, 4, 5, 6, 7, 8
            });


            // WARM UP
            _stress_test_impl(10, 10);
            // Set timeout, and disable cache
            FanoutSearchModule.SetCacheEnabled(false);
            FanoutSearchModule.SetQueryTimeout(800);
        }
コード例 #12
0
ファイル: Traversal_Lambda.cs プロジェクト: d3m0n5/GDB
 public LambdaTraversal()
 {
     Global.LocalStorage.ResetStorage();
     mod = Global.CommunicationInstance.GetCommunicationModule <FanoutSearchModule>();
 }