Skip to content

Commit 38f8ba8

Browse files
committed
[ZEPPELIN-4541]. Add api to checkpoint paragraph output between interpreter and zeppelin-server
1 parent 9be2d18 commit 38f8ba8

31 files changed

+967
-21
lines changed

rlang/src/test/java/org/apache/zeppelin/r/ShinyInterpreterTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.zeppelin.interpreter.InterpreterResult;
2929
import org.apache.zeppelin.interpreter.InterpreterResultMessage;
3030
import org.apache.zeppelin.interpreter.LazyOpenInterpreter;
31+
import org.apache.zeppelin.interpreter.remote.RemoteInterpreterEventClient;
3132
import org.junit.After;
3233
import org.junit.Before;
3334
import org.junit.Test;
@@ -42,6 +43,7 @@
4243
import static junit.framework.TestCase.assertEquals;
4344
import static org.junit.Assert.assertTrue;
4445
import static org.junit.Assert.fail;
46+
import static org.mockito.Mockito.mock;
4547

4648
public class ShinyInterpreterTest {
4749

@@ -240,6 +242,7 @@ protected InterpreterContext getInterpreterContext() {
240242
.setInterpreterOut(new InterpreterOutput(null))
241243
.setLocalProperties(new HashMap<>())
242244
.setInterpreterClassName(ShinyInterpreter.class.getName())
245+
.setIntpEventClient(mock(RemoteInterpreterEventClient.class))
243246
.build();
244247
return context;
245248
}

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventClient.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,15 @@ public synchronized void runParagraphs(String noteId,
235235
}
236236
}
237237

238+
public synchronized void checkpointOutput(String noteId, String paragraphId) {
239+
try {
240+
intpEventServiceClient.checkpointOutput(noteId, paragraphId);
241+
} catch (TException e) {
242+
LOGGER.warn("Fail to checkpointOutput of paragraph: " +
243+
paragraphId + " of note: " + noteId, e);
244+
}
245+
}
246+
238247
public synchronized void onAppOutputAppend(
239248
String noteId, String paragraphId, int index, String appId, String output) {
240249
AppOutputAppendEvent event =

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/AngularObjectId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package org.apache.zeppelin.interpreter.thrift;
2525

2626
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
27-
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-06")
27+
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-07")
2828
public class AngularObjectId implements org.apache.thrift.TBase<AngularObjectId, AngularObjectId._Fields>, java.io.Serializable, Cloneable, Comparable<AngularObjectId> {
2929
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AngularObjectId");
3030

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/AppOutputAppendEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package org.apache.zeppelin.interpreter.thrift;
2525

2626
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
27-
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-06")
27+
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-07")
2828
public class AppOutputAppendEvent implements org.apache.thrift.TBase<AppOutputAppendEvent, AppOutputAppendEvent._Fields>, java.io.Serializable, Cloneable, Comparable<AppOutputAppendEvent> {
2929
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AppOutputAppendEvent");
3030

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/AppOutputUpdateEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package org.apache.zeppelin.interpreter.thrift;
2525

2626
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
27-
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-06")
27+
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-07")
2828
public class AppOutputUpdateEvent implements org.apache.thrift.TBase<AppOutputUpdateEvent, AppOutputUpdateEvent._Fields>, java.io.Serializable, Cloneable, Comparable<AppOutputUpdateEvent> {
2929
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AppOutputUpdateEvent");
3030

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/AppStatusUpdateEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package org.apache.zeppelin.interpreter.thrift;
2525

2626
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
27-
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-06")
27+
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-07")
2828
public class AppStatusUpdateEvent implements org.apache.thrift.TBase<AppStatusUpdateEvent, AppStatusUpdateEvent._Fields>, java.io.Serializable, Cloneable, Comparable<AppStatusUpdateEvent> {
2929
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AppStatusUpdateEvent");
3030

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/InterpreterCompletion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package org.apache.zeppelin.interpreter.thrift;
2525

2626
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
27-
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-06")
27+
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-07")
2828
public class InterpreterCompletion implements org.apache.thrift.TBase<InterpreterCompletion, InterpreterCompletion._Fields>, java.io.Serializable, Cloneable, Comparable<InterpreterCompletion> {
2929
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InterpreterCompletion");
3030

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/OutputAppendEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package org.apache.zeppelin.interpreter.thrift;
2525

2626
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
27-
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-06")
27+
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-07")
2828
public class OutputAppendEvent implements org.apache.thrift.TBase<OutputAppendEvent, OutputAppendEvent._Fields>, java.io.Serializable, Cloneable, Comparable<OutputAppendEvent> {
2929
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OutputAppendEvent");
3030

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/OutputUpdateAllEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package org.apache.zeppelin.interpreter.thrift;
2525

2626
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
27-
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-06")
27+
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-07")
2828
public class OutputUpdateAllEvent implements org.apache.thrift.TBase<OutputUpdateAllEvent, OutputUpdateAllEvent._Fields>, java.io.Serializable, Cloneable, Comparable<OutputUpdateAllEvent> {
2929
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OutputUpdateAllEvent");
3030

zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/thrift/OutputUpdateEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package org.apache.zeppelin.interpreter.thrift;
2525

2626
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
27-
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-06")
27+
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-01-07")
2828
public class OutputUpdateEvent implements org.apache.thrift.TBase<OutputUpdateEvent, OutputUpdateEvent._Fields>, java.io.Serializable, Cloneable, Comparable<OutputUpdateEvent> {
2929
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OutputUpdateEvent");
3030

0 commit comments

Comments
 (0)