asynchronous - How do I make an async call to Hive in Java? -


I want to execute a hive query on the server in an asynchronous way. The hive query will take a lot of time to complete, so I would not want to block the call. I am currently using the Thurff to create blocks on a blocked call (Client.execute ()), but I have not seen an example of creating a non-blocking call. Here is the blocking code:

  TSocket transport = New TSocket ("hive.example.com", 10000); transport.setTimeout (999999999); TBRI protocol protocol = new TBRI protocol (transport); client client = new thrifthigh.client (protocol); transport.open (); Client.execute (HQL); // Omitted HQL list & lt; string & gt; Punk {String row: rows} {// Content with line}} transport.close ();  
<; (string for: lines) {} ({rows = client.fetchN (1000)) = P> Trying / holding blocks is difficult to keep it in the code given above.

Do anyone have any ideas, which is the way to make ASCIC calls? Can support hive / thrift Is this a better way?

Thank you!

AFAIK, Time Written Thruph The alike does not generate customers. The reason given in this link (search text for "asynchronous") is that the thrift was designed for the data center where latency is considered less.

Unfortunately, you know that the delay between experience of calls and results is not always due to the network, but it is being done by logic! We are calling this problem from the Java application server in the Cassandra database where we want to limit the total threads.

Summary: Whatever you can do now, make sure that you have enough resources to control the required numbers, wait concurrent threads and wait for a more efficient implementation.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -