Skip to content

Commit 0eb10dd

Browse files
ParkGyeongTaeReamer
authored andcommitted
[ZEPPELIN-6140] Add logs to the runParagraph method
### What is this PR for? This involves revising the description of the runParagraph method and adding clear logs for each step. ### What type of PR is it? Improvement ### Todos * [x] - NotebookService.java ### What is the Jira issue? * https://issues.apache.org/jira/projects/ZEPPELIN/issues/ZEPPELIN-6140 ### How should this be tested? * Debugging ### Screenshots (if appropriate) ![image](https://github.com/user-attachments/assets/a833a92f-1a0b-42e5-9b3c-084fa351a4c7) ### Questions: * Does the license files need to update? No. * Is there breaking changes for older versions? No. * Does this needs documentation? No. Closes #4889 from ParkGyeongTae/add-logs-to-the-runparagraph-method. Signed-off-by: Philipp Dallig <[email protected]>
1 parent fcdd1df commit 0eb10dd

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -392,21 +392,28 @@ public String importNote(String notePath,
392392
}
393393

394394
/**
395-
* Executes given paragraph with passed paragraph info like noteId, paragraphId, title, text and etc.
395+
* Handles the execution of a specified paragraph within a note, applying provided configurations
396+
* such as note ID, paragraph ID, title, text, and execution parameters.
396397
*
397-
* @param note
398-
* @param paragraphId
399-
* @param title
400-
* @param text
401-
* @param params
402-
* @param config
403-
* @param failIfDisabled
404-
* @param blocking
405-
* @param context
406-
* @param callback
407-
* @return return true only when paragraph execution finished, it could end with succeed or error due to user code.
408-
* return false when paragraph execution fails due to zeppelin internal issue.
409-
* @throws IOException
398+
* This method validates the provided note and paragraph ID, checks user permissions, applies
399+
* settings such as text, title, parameters, and configurations to the paragraph, and executes it
400+
* in either blocking or non-blocking mode based on the input. Supports personalized mode for
401+
* executing user-specific paragraph versions.
402+
*
403+
* @param note the note object containing the paragraph
404+
* @param paragraphId the ID of the paragraph to execute
405+
* @param title the title to set for the paragraph
406+
* @param text the content text of the paragraph
407+
* @param params a map of parameters for the paragraph execution
408+
* @param config a map of configuration settings for the paragraph
409+
* @param sessionId session ID for the execution context
410+
* @param failIfDisabled if true, execution fails if the paragraph is disabled
411+
* @param blocking specifies whether the execution should be blocking
412+
* @param context the context providing authentication and execution info
413+
* @param callback callback to handle success or failure results of the paragraph execution
414+
* @return true if the paragraph completes execution successfully (either with success or error due to user code),
415+
* false if execution fails due to an internal Zeppelin issue
416+
* @throws IOException if an I/O error occurs during execution
410417
*/
411418
public boolean runParagraph(Note note,
412419
String paragraphId,
@@ -420,22 +427,25 @@ public boolean runParagraph(Note note,
420427
ServiceContext context,
421428
ServiceCallback<Paragraph> callback) throws IOException {
422429

423-
424430
if (note == null) {
431+
LOGGER.info("Failed to run paragraph {}, Note is null", paragraphId);
425432
return false;
426433
}
434+
427435
LOGGER.info("Start to run paragraph: {} of note: {}", paragraphId, note.getId());
428436
if (!checkPermission(note.getId(), Permission.RUNNER, Message.OP.RUN_PARAGRAPH, context, callback)) {
437+
LOGGER.info("Permission check failed for running paragraph {} of note {}", paragraphId, note.getId());
429438
return false;
430439
}
431440

432-
433441
Paragraph p = note.getParagraph(paragraphId);
434442
if (p == null) {
443+
LOGGER.info("Paragraph {} not found in note {}", paragraphId, note.getId());
435444
callback.onFailure(new ParagraphNotFoundException(paragraphId), context);
436445
return false;
437446
}
438447
if (failIfDisabled && !p.isEnabled()) {
448+
LOGGER.info("Paragraph {} in note {} is disabled, and 'failIfDisabled' flag is set.", paragraphId, note.getId());
439449
callback.onFailure(new IOException("paragraph is disabled."), context);
440450
return false;
441451
}

0 commit comments

Comments
 (0)