Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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"]}");
                }
            }
        }
Ejemplo n.º 4
0
        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");
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
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;
        }