Re: How to use web sockets with Zeppellin

2016-09-07 Thread spacewalk...@163.com
@kant kodali

change   zeppelin-web\ src\components\baseUrl\baseUrl.service.js like this:

 this.getWebsocketUrl = function() {
var wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
return wsProtocol + ‘//your_ip_address:' + this.getPort() + 
skipTrailingSlash(location.pathname) + '/ws';
  };
 
  this.getRestApiBase = function() {
return location.protocol + '//your_ip_address:' + this.getPort() + 
skipTrailingSlash(location.pathname) +
  '/api';
  };
> 在 2016年9月7日,15:39,kant kodali  写道:
> 
> HI Guys,
> 
> I have a server which can handle websocket connections. Now I would like to 
> see if there is a way to tell apache zeppellin to create to websocket connect 
> to my server and display the whatever it received?
> 
> Thanks,
> Kant



Re: How to use web sockets with Zeppellin

2016-09-07 Thread spacewalk...@163.com
@kan kodali, i’m not a front guy either.i’v got the same requirement as you 
recently,  i have to separate zeppelin backend and frontend to different 
servers, i did as what the previous mail says,i works.
for you questions:
1. AFAK,is not configurable. if you are familiar with Grunt ,maybe  a custom 
property  can do.(i’m not sure)
2.   zeppelin use Websocket to handle bidirectional communication with backend 
and frontend. Once is Websocket connection is done, backend run you sql, and 
send result data as json back to frontend, which handling rendering.
3. let me elaborate on my procedure to achieve separating zeppelin backend and 
frontend to different servers。
   1)host1,as zeppelin backend, install zeppelin-xxx.tar.gz(the distribution 
binary), bin/zeppelin-daemon.sh start. then, you got your zeppelin backend 
done, which has a frontend bundled with it . but you would use it.
   2) host2 , as zeppelin frontend. Grab zeppelin-web module(src code),install 
node.js and Grunt,change zeppelin-web/src/components/baseUrl/baseUrl.service.js 
like this, which reference you zeppelin backend address:

this.getWebsocketUrl = function() {
var wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
return wsProtocol + ‘//host1:' + this.getPort() + 
skipTrailingSlash(location.pathname) + '/ws';
  };
 
  this.getRestApiBase = function() {
return location.protocol + ‘//host1:' + this.getPort() + 
skipTrailingSlash(location.pathname) +
  '/api';
  };
   3) in host2, run   " grunt serve “  in zeppelin-web folder.

Done


> 在 2016年9月8日,02:30,kant kodali  写道:
> 
> Hi! Thanks for this but I still see the big picture. I have not used Angular 
> before nor I am a frontend guy. so I have the following questions.
> 
> Why do we need to change the source code? isn't this configurable or isn't 
> there a way to pass url as a parameter? If you think it is the easiest way 
> sure I can change that.
> How change this let me grab data from my websocket server and display it with 
> the charts/graphs (simple to graphs we see when we run sql on Zeppelin 
> notebook)
> if there is a simple example that would be awesome.
> Thanks again!
> 
> 
> 
> 
> 
> On Wed, Sep 7, 2016 5:05 AM, spacewalk...@163.com spacewalk...@163.com 
> <mailto:spacewalk...@163.com> wrote:
> @kant kodali
> 
> change   zeppelin-web\ src\components\baseUrl\baseUrl.service.js like this:
> 
>  this.getWebsocketUrl = function() {
> var wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
> return wsProtocol + ‘//your_ip_address:' + this.getPort() + 
> skipTrailingSlash(location.pathname) + '/ws';
>   };
>  
>   this.getRestApiBase = function() {
> return location.protocol + '//your_ip_address:' + this.getPort() + 
> skipTrailingSlash(location.pathname) +
>   '/api';
>   };
>> 在 2016年9月7日,15:39,kant kodali > <mailto:kanth...@gmail.com>> 写道:
>> 
>> HI Guys,
>> 
>> I have a server which can handle websocket connections. Now I would like to 
>> see if there is a way to tell apache zeppellin to create to websocket 
>> connect to my server and display the whatever it received?
>> 
>> Thanks,
>> Kant



Re: How to use web sockets with Zeppellin

2016-09-07 Thread spacewalk...@163.com
i thought it was a separating zeppelin backend and frontend problem, but what 
@corneadoug say is a high-level WS description, maybe i misinterpretation @kant 
kodali’s issue


> 在 2016年9月8日,09:48,Corneau Damien  写道:
> 
> This change wouldn't solve your issue, it is the address where the front-end 
> send his API requests and listen to WS (zeppelin server)
> I guess your requirements are different.
> 
> The way Zeppelin works is usually pretty simple:
> 
> 1) You type your code in the front-end
> 2) That code is sent to Zeppelin server to be run
> 3) The server send it to the right processing engine
> 4) Processing engine send back the result
> 5) Zeppelin Server send a websocket event
> 6) Front-end show whatever he receives
> 
> You might be able to find a few Notebook examples on how some people used 
> Spark Streaming here:
> https://www.zeppelinhub.com/viewer/showcases/Streaming 
> <https://www.zeppelinhub.com/viewer/showcases/Streaming>
> 
> On Thu, Sep 8, 2016 at 3:30 AM, kant kodali  <mailto:kanth...@gmail.com>> wrote:
> Hi! Thanks for this but I still see the big picture. I have not used Angular 
> before nor I am a frontend guy. so I have the following questions.
> 
> Why do we need to change the source code? isn't this configurable or isn't 
> there a way to pass url as a parameter? If you think it is the easiest way 
> sure I can change that.
> How change this let me grab data from my websocket server and display it with 
> the charts/graphs (simple to graphs we see when we run sql on Zeppelin 
> notebook)
> if there is a simple example that would be awesome.
> Thanks again!
> 
> 
> 
> 
> 
> On Wed, Sep 7, 2016 5:05 AM, spacewalk...@163.com 
> <mailto:spacewalk...@163.com> spacewalk...@163.com 
> <mailto:spacewalk...@163.com> wrote:
> @kant kodali
> 
> change   zeppelin-web\ src\components\baseUrl\baseUrl.service.js like this:
> 
>  this.getWebsocketUrl = function() {
> var wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
> return wsProtocol + ‘//your_ip_address:' + this.getPort() + 
> skipTrailingSlash(location.pathname) + '/ws';
>   };
>  
>   this.getRestApiBase = function() {
> return location.protocol + '//your_ip_address:' + this.getPort() + 
> skipTrailingSlash(location.pathname) +
>   '/api';
>   };
>> 在 2016年9月7日,15:39,kant kodali > <mailto:kanth...@gmail.com>> 写道:
>> 
>> HI Guys,
>> 
>> I have a server which can handle websocket connections. Now I would like to 
>> see if there is a way to tell apache zeppellin to create to websocket 
>> connect to my server and display the whatever it received?
>> 
>> Thanks,
>> Kant
> 
> 



Re: How to use web sockets with Zeppellin

2016-09-07 Thread spacewalk...@163.com
maybe a custom SparkStreamingInterpreter  can handle this.

zeppelin WS protocol is defined in:

https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
 
<https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java>

every [c-s] message is handled by zeppelin backend, [s-c] is handled by 
zeppelin frontend.All you have to do is when new streaming data is there, 
triigger a [s-c] message from backend, a frontend event handler may also 
required.


> 在 2016年9月8日,11:39,kant kodali  写道:
> 
> ok here is a concrete example. I am still trying to connect the dots..If I 
> were to split Zeppelin as both front end and backend then I wouldn't choose 
> to use Zeppelin in the first place. The main motivation for me to explore 
> Zeppelin is that I don't have to spend time developing different 
> visualiztions. I have used tableau before I see Zeppelin to be similar in 
> some ways. ok now here is the problem I am trying to solve and any help I can 
> get will be great!
> 
> say I am trying to build a time series graph(bar graph or whatever works) 
> where my x axis represent time and y axis represent total number of 
> transactions and say every second I get updates through web socket from my 
> server and I need the graph to be updated every second. thats it.
> 
> please let me know if that is feasible.
> 
> Thanks,
> Kant
> 
> On Wed, Sep 7, 2016 at 6:59 PM, spacewalk...@163.com 
> <mailto:spacewalk...@163.com>  <mailto:spacewalk...@163.com>> wrote:
> i thought it was a separating zeppelin backend and frontend problem, but what 
> @corneadoug say is a high-level WS description, maybe i misinterpretation 
> @kant kodali’s issue
> 
> 
>> 在 2016年9月8日,09:48,Corneau Damien > <mailto:cornead...@gmail.com>> 写道:
>> 
>> This change wouldn't solve your issue, it is the address where the front-end 
>> send his API requests and listen to WS (zeppelin server)
>> I guess your requirements are different.
>> 
>> The way Zeppelin works is usually pretty simple:
>> 
>> 1) You type your code in the front-end
>> 2) That code is sent to Zeppelin server to be run
>> 3) The server send it to the right processing engine
>> 4) Processing engine send back the result
>> 5) Zeppelin Server send a websocket event
>> 6) Front-end show whatever he receives
>> 
>> You might be able to find a few Notebook examples on how some people used 
>> Spark Streaming here:
>> https://www.zeppelinhub.com/viewer/showcases/Streaming 
>> <https://www.zeppelinhub.com/viewer/showcases/Streaming>
>> 
>> On Thu, Sep 8, 2016 at 3:30 AM, kant kodali > <mailto:kanth...@gmail.com>> wrote:
>> Hi! Thanks for this but I still see the big picture. I have not used Angular 
>> before nor I am a frontend guy. so I have the following questions.
>> 
>> Why do we need to change the source code? isn't this configurable or isn't 
>> there a way to pass url as a parameter? If you think it is the easiest way 
>> sure I can change that.
>> How change this let me grab data from my websocket server and display it 
>> with the charts/graphs (simple to graphs we see when we run sql on Zeppelin 
>> notebook)
>> if there is a simple example that would be awesome.
>> Thanks again!
>> 
>> 
>> 
>> 
>> 
>> On Wed, Sep 7, 2016 5:05 AM, spacewalk...@163.com 
>> <mailto:spacewalk...@163.com> spacewalk...@163.com 
>> <mailto:spacewalk...@163.com> wrote:
>> @kant kodali
>> 
>> change   zeppelin-web\ src\components\baseUrl\baseUrl.service.js like this:
>> 
>>  this.getWebsocketUrl = function() {
>> var wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
>> return wsProtocol + ‘//your_ip_address:' + this.getPort() + 
>> skipTrailingSlash(location.pathname) + '/ws';
>>   };
>>  
>>   this.getRestApiBase = function() {
>> return location.protocol + '//your_ip_address:' + this.getPort() + 
>> skipTrailingSlash(location.pathname) +
>>   '/api';
>>   };
>>> 在 2016年9月7日,15:39,kant kodali >> <mailto:kanth...@gmail.com>> 写道:
>>> 
>>> HI Guys,
>>> 
>>> I have a server which can handle websocket connections. Now I would like to 
>>> see if there is a way to tell apache zeppellin to create to websocket 
>>> connect to my server and display the whatever it received?
>>> 
>>> Thanks,
>>> Kant
>> 
>> 
> 
> 



Re: Save Report separately

2016-10-27 Thread spacewalk...@163.com
hi Nirav Patel,
Currently zeppelin persists Note as json file,which includes both code and 
result. You can enable GitNotebookRepo as the bakend storage by define  
following property in ${ZEPPELIN_HOME}/conf/zeppelin-site.xml。
Restart zeppelin,then you can commit note as a revision, which  can be used for 
comparison. GitNotebookRepo use ${ZEPPELIN_HOME}/notebook folder as a Git repo, 
you can use git command to manipulate it without zeppelin.


  zeppelin.notebook.storage
  org.apache.zeppelin.notebook.repo.GitNotebookRepo
  notebook persistence layer implementation


> 在 2016年10月27日,13:50,Nirav Patel  写道:
> 
> Is there a way to save state of the notebook in form of "Report" view so it 
> can be used later for comparison or just kept for bookkeeping. Currently only 
> way I can think of to do this is to clone a new notebook every time you want 
> to keep state of Report. 
> 
> Thanks
> 
> 
> 
> 
>  
> 
>     
>    
>       
>