Re: How to send RDD result to REST API?

2015-08-31 Thread Cassa L
Hi Ted, My server is expecting JSON. Can I just write HttpClient in spark job and push result of RDD action to the server? I'm trying to figure out how to achieve this. LCassa On Fri, Aug 28, 2015 at 9:45 PM, Ted Yu wrote: > What format does your REST server expect ? >

Re: How to send RDD result to REST API?

2015-08-31 Thread Ted Yu
You can utilize commons-httpclient and push result of RDD to the server. BTW specify commons-httpclient version which is consistent with the hadoop version you use. e.g. the following is brought in along with hadoop 2.6: [INFO] | | | +- commons-httpclient:commons-httpclient:jar:3.1:compile

Re: How to send RDD result to REST API?

2015-08-28 Thread Ted Yu
What format does your REST server expect ? You may have seen this: https://www.paypal-engineering.com/2014/02/13/hello-newman-a-rest-client-for-scala/ On Fri, Aug 28, 2015 at 9:35 PM, Cassa L lcas...@gmail.com wrote: Hi, If I have RDD that counts something e.g.: JavaPairDStreamString,

How to send RDD result to REST API?

2015-08-28 Thread Cassa L
Hi, If I have RDD that counts something e.g.: JavaPairDStreamString, Integer successMsgCounts = successMsgs .flatMap(buffer - Arrays.asList(buffer.getType())) .mapToPair(txnType - new Tuple2String, Integer(Success + txnType, 1))