This is an attempt to study Apache Zeppelin in depth. After all, if you want to understand the underlying principles, it is necessary to understand all its exposed functions first, and writing your own Zeppelin interpreter can be very helpful for understanding other interpreters. In fact, the official documentation has already given us some specific instructions on how to do this, and this article is my attempt to follow them (although the steps aren't exactly the same), so if you're interested in writing your own Zeppelin interpreter, come write one with me.
Executive Summary :
Operating System: Unlimited
JDK: 1.8 or higher
IDE: IntelliJ IDEA, with the maven plugin installed
Zeppelin version: 0.8.2, the documentation can be found in the following: How to Installation and startup of Apache Zeppelin
Since my goal is just to understand the principles, I just need to write an "all-in-one" interpreter for dummies, so I'm going to write a simple interpreter that precedes the user input with the number of calls and the number of times "hello" is called. "hello" as the output back to the user , the approximate effect is as follows:
In IDEA, create a new maven project, project name my-zeppelin-interpreter, and then modify the pom.xml :
The screenshot is as follows:
Then create a new Class named com.iamabug.DummyInterpreter and let it inherit from org.apache.zeppelin.interpreter. strong> Use the shortcut Alt + Enter to directly generate the constructor and the methods that need to be overridden , *** there are 6 methods:
I wrote the interpreter class DummyInterpreter as follows:
Installation is divided into the following steps:
Use bin/ zeppelin-daemon.sh restart to restart Zeppelin, then open your browser, click on the anonymous menu in the upper-right corner, select the Interpreter submenu, and then click on the Create button in the upper-right corner of the new page, and the following page will appear:
Enter dummy in Interpreter Enter dummy in Interpreter Name, click the Interpreter group drop-down menu, and select dummy, as shown in the following figure:
You can see the two configuration items properties1 and properties2 in the configuration file, click the blue Save button.
Go back to the home page and create a new note, choosing dummy as the default interpreter, as shown below:
(Here comes the excitement!)
Type random characters into the open notebook and run it. Screenshot:
This works exactly as expected. Note that dummy is the default interpreter, so it works with or without %dummy.
This experiment sort of lived up to expectations, and the problems we encountered were:
I hope this article was useful to you.
Welcome to exchange discussions, spit suggestions, share collections.
Diligent learning is like a seedling rising in the spring, do not see its increase, the day has grown
Drop out of school is like a stone to sharpen the knife, do not see its loss, the day has lost
Concerned about the big data apprenticeship, with the technology of the dry goods to help you grow day to day