static void Main(string[] args)
        {
            LogDbClient client = new LogDbClient();

            client.Connect("localhost", 8888, "araqne", "");
            LogCursor cursor = client.Query("logdb tables");

            foreach (IDictionary o in cursor)
            {
                Console.WriteLine(PrettyPrint(o));
            }
            cursor.Dispose();
            client.Close();
        }
Example #2
0
        static void Main(string[] args)
        {
            LogDbClient   client  = new LogDbClient();
            ResultCounter counter = new ResultCounter();
            long          begin   = System.DateTime.Now.Ticks;
            int           queryId = 0;

            try
            {
                client.Connect("localhost", 8888, "araqne", "");
                // createQuery 수행 시 StreamingResultSet 인스턴스를 전달합니다.
                queryId = client.CreateQuery("table iis", counter);
                client.StartQuery(queryId);

                // 스트리밍이 완료될 때까지 대기합니다.
                do
                {
                    counter.latch.Wait(100);
                }while (counter.latch.CurrentCount > 0);

                if (client != null)
                {
                    if (queryId != 0)
                    {
                        client.RemoveQuery(queryId);
                    }

                    long end        = System.DateTime.Now.Ticks;
                    long elapsed    = (end - begin) / 10000;
                    long throughput = counter.count * 1000 / elapsed;

                    Console.WriteLine("Elapsed " + elapsed + " ms, " + throughput + " rows/sec");
                }
            }
            catch (MessageException)
            {
                Console.WriteLine("잘못된 쿼리문입니다");
            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            client.Close();
        }