mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Load hirb
This commit is contained in:
parent
49b5b27777
commit
b4ad18ddf1
1 changed files with 11 additions and 0 deletions
|
|
@ -24,6 +24,8 @@ import org.slf4j.LoggerFactory;
|
|||
import org.jruby.embed.ScriptingContainer;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
|
|
@ -94,6 +96,15 @@ public class HbaseInterpreter extends Interpreter {
|
|||
|
||||
List<String> paths = new ArrayList<>(Arrays.asList(abs_ruby_src.toAbsolutePath().toString()));
|
||||
this.scriptingContainer.setLoadPaths(paths);
|
||||
|
||||
Path abs_hirb_path = Paths.get(hbase_home, ruby_src, "irb/hirb.rb");
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(abs_hirb_path.toFile());
|
||||
this.scriptingContainer.runScriptlet(fis, "hirb.rb");
|
||||
fis.close();
|
||||
} catch (IOException e) {
|
||||
throw new InterpreterException(e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue