Skip to content

Commit 429203d

Browse files
committed
Fix details & convention to camel
1 parent 5fa270d commit 429203d

File tree

9 files changed

+63
-63
lines changed

9 files changed

+63
-63
lines changed

lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class LensInterpreter extends Interpreter {
7676

7777
private static Pattern s_queryExecutePattern = Pattern.compile(".*query\\s+execute\\s+(.*)");
7878
private static Map<String, ExecutionDetail> s_paraToQH =
79-
new ConcurrentHashMap<String, ExecutionDetail> (); //tracks paragraphID -> Lens QueryHandle
79+
new ConcurrentHashMap<String, ExecutionDetail> (); //tracks paragraphId -> Lens QueryHandle
8080
private static Map<LensClient, Boolean> s_clientMap =
8181
new ConcurrentHashMap<LensClient, Boolean>();
8282

zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class NotebookRestApi {
7070
Gson gson = new Gson();
7171
private Notebook notebook;
7272
private NotebookServer notebookServer;
73-
private SearchService noteIndex;
73+
private SearchService noteSearchService;
7474
private NotebookAuthorization notebookAuthorization;
7575

7676
public NotebookRestApi() {
@@ -79,7 +79,7 @@ public NotebookRestApi() {
7979
public NotebookRestApi(Notebook notebook, NotebookServer notebookServer, SearchService search) {
8080
this.notebook = notebook;
8181
this.notebookServer = notebookServer;
82-
this.noteIndex = search;
82+
this.noteSearchService = search;
8383
this.notebookAuthorization = notebook.getNotebookAuthorization();
8484
}
8585

@@ -505,7 +505,7 @@ public Response runNoteJobs(@PathParam("noteId") String noteId)
505505
@ZeppelinApi
506506
public Response stopNoteJobs(@PathParam("noteId") String noteId)
507507
throws IOException, IllegalArgumentException {
508-
LOG.info("stop notebook jobs {} ", noteId);
508+
LOG.info("stop note jobs {} ", noteId);
509509
Note note = notebook.getNote(noteId);
510510
if (note == null) {
511511
return new JsonResponse<>(Status.NOT_FOUND, "note not found.").build();
@@ -554,7 +554,7 @@ public Response getNoteJobStatus(@PathParam("noteId") String noteId)
554554
public Response getNoteParagraphJobStatus(@PathParam("noteId") String noteId,
555555
@PathParam("paragraphId") String paragraphId)
556556
throws IOException, IllegalArgumentException {
557-
LOG.info("get notebook paragraph job status.");
557+
LOG.info("get note paragraph job status.");
558558
Note note = notebook.getNote(noteId);
559559
if (note == null) {
560560
return new JsonResponse<>(Status.NOT_FOUND, "note not found.").build();
@@ -829,7 +829,7 @@ public Response search(@QueryParam("q") String queryTerm) {
829829
HashSet<String> userAndRoles = new HashSet<>();
830830
userAndRoles.add(principal);
831831
userAndRoles.addAll(roles);
832-
List<Map<String, String>> notes = noteIndex.query(queryTerm);
832+
List<Map<String, String>> notes = noteSearchService.query(queryTerm);
833833
for (int i = 0; i < notes.size(); i++) {
834834
String[] Id = notes.get(i).get("id").split("/", 2);
835835
String noteId = Id[0];

zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public void unsubscribeNotebookJobInfo(NotebookSocket conn) {
467467
}
468468

469469
public void saveInterpreterBindings(NotebookSocket conn, Message fromMessage) {
470-
String noteId = (String) fromMessage.data.get("noteID");
470+
String noteId = (String) fromMessage.data.get("noteId");
471471
try {
472472
List<String> settingIdList = gson.fromJson(String.valueOf(
473473
fromMessage.data.get("selectedSettingIds")), new TypeToken<ArrayList<String>>() {
@@ -482,9 +482,9 @@ public void saveInterpreterBindings(NotebookSocket conn, Message fromMessage) {
482482

483483
public void getInterpreterBindings(NotebookSocket conn, Message fromMessage)
484484
throws IOException {
485-
String noteID = (String) fromMessage.data.get("noteID");
485+
String noteId = (String) fromMessage.data.get("noteId");
486486
List<InterpreterSettingsList> settingList =
487-
InterpreterBindingUtils.getInterpreterBindings(notebook(), noteID);
487+
InterpreterBindingUtils.getInterpreterBindings(notebook(), noteId);
488488
conn.send(serializeMessage(new Message(OP.INTERPRETER_BINDINGS)
489489
.put("interpreterBindings", settingList)));
490490
}

zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinRestApiTest.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public void testGetNotebookInfo() throws IOException {
8989
paragraph.setText(paragraphText);
9090
note.persist(null);
9191

92-
String sourceNoteID = note.getId();
93-
GetMethod get = httpGet("/notebook/" + sourceNoteID);
92+
String sourceNoteId = note.getId();
93+
GetMethod get = httpGet("/notebook/" + sourceNoteId);
9494
LOG.info("testGetNotebookInfo \n" + get.getResponseBodyAsString());
9595
assertThat("test notebook get method:", get, isAllowed());
9696

@@ -215,9 +215,9 @@ public void testexportNote() throws IOException {
215215
paragraph.setConfig(config);
216216
paragraph.setText("%md This is my new paragraph in my new note");
217217
note.persist(null);
218-
String sourceNoteID = note.getId();
218+
String sourceNoteId = note.getId();
219219
// Call export Notebook REST API
220-
GetMethod get = httpGet("/notebook/export/" + sourceNoteID);
220+
GetMethod get = httpGet("/notebook/export/" + sourceNoteId);
221221
LOG.info("testNotebookExport \n" + get.getResponseBodyAsString());
222222
assertThat("test notebook export method:", get, isAllowed());
223223

@@ -228,7 +228,7 @@ public void testexportNote() throws IOException {
228228
String exportJSON = (String) resp.get("body");
229229
assertNotNull("Can not find new notejson", exportJSON);
230230
LOG.info("export JSON:=" + exportJSON);
231-
ZeppelinServer.notebook.removeNote(sourceNoteID, null);
231+
ZeppelinServer.notebook.removeNote(sourceNoteId, null);
232232
get.releaseConnection();
233233

234234
}
@@ -248,9 +248,9 @@ public void testImportNotebook() throws IOException {
248248
paragraph.setConfig(config);
249249
paragraph.setText("%md This is my new paragraph in my new note");
250250
note.persist(null);
251-
String sourceNoteID = note.getId();
251+
String sourceNoteId = note.getId();
252252
// get note content as JSON
253-
String oldJson = getNoteContent(sourceNoteID);
253+
String oldJson = getNoteContent(sourceNoteId);
254254
// call notebook post
255255
PostMethod importPost = httpPost("/notebook/import/", oldJson);
256256
assertThat(importPost, isCreated());
@@ -310,12 +310,12 @@ public void testCloneNote() throws IOException, CloneNotSupportedException, Ille
310310
paragraph.setConfig(config);
311311
paragraph.setText("%md This is my new paragraph in my new note");
312312
note.persist(null);
313-
String sourceNoteID = note.getId();
313+
String sourceNoteId = note.getId();
314314

315315
String noteName = "clone Note Name";
316316
// Call Clone Notebook REST API
317317
String jsonRequest = "{\"name\":\"" + noteName + "\"}";
318-
PostMethod post = httpPost("/notebook/" + sourceNoteID, jsonRequest);
318+
PostMethod post = httpPost("/notebook/" + sourceNoteId, jsonRequest);
319319
LOG.info("testNotebookClone \n" + post.getResponseBodyAsString());
320320
assertThat("test notebook clone method:", post, isCreated());
321321

@@ -363,7 +363,7 @@ public void testNoteJobs() throws IOException, InterruptedException {
363363

364364
paragraph.setText("%md This is test paragraph.");
365365
note.persist(null);
366-
String noteID = note.getId();
366+
String noteId = note.getId();
367367

368368
note.runAll();
369369
// wait until job is finished or timeout.
@@ -377,24 +377,24 @@ public void testNoteJobs() throws IOException, InterruptedException {
377377
}
378378

379379
// Call Run Notebook Jobs REST API
380-
PostMethod postNoteJobs = httpPost("/notebook/job/" + noteID, "");
380+
PostMethod postNoteJobs = httpPost("/notebook/job/" + noteId, "");
381381
assertThat("test notebook jobs run:", postNoteJobs, isAllowed());
382382
postNoteJobs.releaseConnection();
383383

384384
// Call Stop Notebook Jobs REST API
385-
DeleteMethod deleteNoteJobs = httpDelete("/notebook/job/" + noteID);
385+
DeleteMethod deleteNoteJobs = httpDelete("/notebook/job/" + noteId);
386386
assertThat("test notebook stop:", deleteNoteJobs, isAllowed());
387387
deleteNoteJobs.releaseConnection();
388388
Thread.sleep(1000);
389389

390390
// Call Run paragraph REST API
391-
PostMethod postParagraph = httpPost("/notebook/job/" + noteID + "/" + paragraph.getId(), "");
391+
PostMethod postParagraph = httpPost("/notebook/job/" + noteId + "/" + paragraph.getId(), "");
392392
assertThat("test paragraph run:", postParagraph, isAllowed());
393393
postParagraph.releaseConnection();
394394
Thread.sleep(1000);
395395

396396
// Call Stop paragraph REST API
397-
DeleteMethod deleteParagraph = httpDelete("/notebook/job/" + noteID + "/" + paragraph.getId());
397+
DeleteMethod deleteParagraph = httpDelete("/notebook/job/" + noteId + "/" + paragraph.getId());
398398
assertThat("test paragraph stop:", deleteParagraph, isAllowed());
399399
deleteParagraph.releaseConnection();
400400
Thread.sleep(1000);
@@ -418,7 +418,7 @@ public void testGetNotebookJob() throws IOException, InterruptedException {
418418

419419
paragraph.setText("%sh sleep 1");
420420
note.persist(null);
421-
String noteID = note.getId();
421+
String noteId = note.getId();
422422

423423
note.runAll();
424424

@@ -428,7 +428,7 @@ public void testGetNotebookJob() throws IOException, InterruptedException {
428428
}
429429

430430
// assume that status of the paragraph is running
431-
GetMethod get = httpGet("/notebook/job/" + noteID);
431+
GetMethod get = httpGet("/notebook/job/" + noteId);
432432
assertThat("test get notebook job: ", get, isAllowed());
433433
String responseBody = get.getResponseBodyAsString();
434434
get.releaseConnection();
@@ -471,7 +471,7 @@ public void testRunParagraphWithParams() throws IOException, InterruptedExceptio
471471

472472
paragraph.setText("%spark\nval param = z.input(\"param\").toString\nprintln(param)");
473473
note.persist(null);
474-
String noteID = note.getId();
474+
String noteId = note.getId();
475475

476476
note.runAll();
477477
// wait until job is finished or timeout.
@@ -485,13 +485,13 @@ public void testRunParagraphWithParams() throws IOException, InterruptedExceptio
485485
}
486486

487487
// Call Run paragraph REST API
488-
PostMethod postParagraph = httpPost("/notebook/job/" + noteID + "/" + paragraph.getId(),
488+
PostMethod postParagraph = httpPost("/notebook/job/" + noteId + "/" + paragraph.getId(),
489489
"{\"params\": {\"param\": \"hello\", \"param2\": \"world\"}}");
490490
assertThat("test paragraph run:", postParagraph, isAllowed());
491491
postParagraph.releaseConnection();
492492
Thread.sleep(1000);
493493

494-
Note retrNote = ZeppelinServer.notebook.getNote(noteID);
494+
Note retrNote = ZeppelinServer.notebook.getNote(noteId);
495495
Paragraph retrParagraph = retrNote.getParagraph(paragraph.getId());
496496
Map<String, Object> params = retrParagraph.settings.getParams();
497497
assertEquals("hello", params.get("param"));

zeppelin-web/src/components/websocketEvents/websocketMsg.service.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@
212212
websocketEvents.sendNewEvent({op: 'UNSUBSCRIBE_UPDATE_NOTEBOOK_JOBS'});
213213
},
214214

215-
getInterpreterBindings: function(noteID) {
216-
websocketEvents.sendNewEvent({op: 'GET_INTERPRETER_BINDINGS', data: {noteID: noteID}});
215+
getInterpreterBindings: function(noteId) {
216+
websocketEvents.sendNewEvent({op: 'GET_INTERPRETER_BINDINGS', data: {noteId: noteId}});
217217
},
218218

219-
saveInterpreterBindings: function(noteID, selectedSettingIds) {
219+
saveInterpreterBindings: function(noteId, selectedSettingIds) {
220220
websocketEvents.sendNewEvent({op: 'SAVE_INTERPRETER_BINDINGS',
221-
data: {noteID: noteID, selectedSettingIds: selectedSettingIds}});
221+
data: {noteId: noteId, selectedSettingIds: selectedSettingIds}});
222222
},
223223

224224
listConfigurations: function() {

zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -232,17 +232,17 @@ public Note importNote(String sourceJson, String noteName, AuthenticationInfo su
232232
/**
233233
* Clone existing note.
234234
*
235-
* @param sourceNoteID - the note ID to clone
235+
* @param sourceNoteId - the note ID to clone
236236
* @param newNoteName - the name of the new note
237237
* @return noteId
238238
* @throws IOException, CloneNotSupportedException, IllegalArgumentException
239239
*/
240-
public Note cloneNote(String sourceNoteID, String newNoteName, AuthenticationInfo subject)
240+
public Note cloneNote(String sourceNoteId, String newNoteName, AuthenticationInfo subject)
241241
throws IOException, CloneNotSupportedException, IllegalArgumentException {
242242

243-
Note sourceNote = getNote(sourceNoteID);
243+
Note sourceNote = getNote(sourceNoteId);
244244
if (sourceNote == null) {
245-
throw new IllegalArgumentException(sourceNoteID + "not found");
245+
throw new IllegalArgumentException(sourceNoteId + "not found");
246246
}
247247
Note newNote = createNote(subject);
248248
if (newNoteName != null) {
@@ -612,23 +612,23 @@ private long getUnixTimeLastRunParagraph(Paragraph paragraph) {
612612
return lastRunningUnixTime;
613613
}
614614

615-
public List<Map<String, Object>> getJobListByParagraphId(String paragraphID) {
615+
public List<Map<String, Object>> getJobListByParagraphId(String paragraphId) {
616616
String gotNoteId = null;
617617
List<Note> notes = getAllNotes();
618618
for (Note note : notes) {
619-
Paragraph p = note.getParagraph(paragraphID);
619+
Paragraph p = note.getParagraph(paragraphId);
620620
if (p != null) {
621621
gotNoteId = note.getId();
622622
}
623623
}
624624
return getJobListByNoteId(gotNoteId);
625625
}
626626

627-
public List<Map<String, Object>> getJobListByNoteId(String noteID) {
627+
public List<Map<String, Object>> getJobListByNoteId(String noteId) {
628628
final String CRON_TYPE_NOTEBOOK_KEYWORD = "cron";
629629
long lastRunningUnixTime = 0;
630-
boolean isNotebookRunning = false;
631-
Note jobNote = getNote(noteID);
630+
boolean isNoteRunning = false;
631+
Note jobNote = getNote(noteId);
632632
List<Map<String, Object>> notesInfo = new LinkedList<>();
633633
if (jobNote == null) {
634634
return notesInfo;
@@ -656,7 +656,7 @@ public List<Map<String, Object>> getJobListByNoteId(String noteID) {
656656
for (Paragraph paragraph : jobNote.getParagraphs()) {
657657
// check paragraph's status.
658658
if (paragraph.getStatus().isRunning()) {
659-
isNotebookRunning = true;
659+
isNoteRunning = true;
660660
}
661661

662662
// get data for the job manager.
@@ -675,7 +675,7 @@ public List<Map<String, Object>> getJobListByNoteId(String noteID) {
675675

676676
// notebook json object root information.
677677
info.put("interpreter", interpreterGroupName);
678-
info.put("isRunningJob", isNotebookRunning);
678+
info.put("isRunningJob", isNoteRunning);
679679
info.put("unixTimeLastRun", lastRunningUnixTime);
680680
info.put("paragraphs", paragraphsInfo);
681681
notesInfo.add(info);

zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
public class NotebookRepoSync implements NotebookRepo {
4444
private static final Logger LOG = LoggerFactory.getLogger(NotebookRepoSync.class);
4545
private static final int maxRepoNum = 2;
46-
private static final String pushKey = "pushNoteIDs";
47-
private static final String pullKey = "pullNoteIDs";
48-
private static final String delDstKey = "delDstNoteIDs";
46+
private static final String pushKey = "pushNoteIds";
47+
private static final String pullKey = "pullNoteIds";
48+
private static final String delDstKey = "delDstNoteIds";
4949

5050
private static ZeppelinConfiguration config;
5151
private static final String defaultStorage = "org.apache.zeppelin.notebook.repo.VFSNotebookRepo";
@@ -186,38 +186,38 @@ void sync(int sourceRepoIndex, int destRepoIndex, AuthenticationInfo subject) th
186186
List <NoteInfo> srcNotes = auth.filterByUser(allSrcNotes, subject);
187187
List <NoteInfo> dstNotes = dstRepo.list(subject);
188188

189-
Map<String, List<String>> noteIDs = notesCheckDiff(srcNotes, srcRepo, dstNotes, dstRepo,
189+
Map<String, List<String>> noteIds = notesCheckDiff(srcNotes, srcRepo, dstNotes, dstRepo,
190190
subject);
191-
List<String> pushNoteIDs = noteIDs.get(pushKey);
192-
List<String> pullNoteIDs = noteIDs.get(pullKey);
193-
List<String> delDstNoteIDs = noteIDs.get(delDstKey);
191+
List<String> pushNoteIds = noteIds.get(pushKey);
192+
List<String> pullNoteIds = noteIds.get(pullKey);
193+
List<String> delDstNoteIds = noteIds.get(delDstKey);
194194

195-
if (!pushNoteIDs.isEmpty()) {
195+
if (!pushNoteIds.isEmpty()) {
196196
LOG.info("Notes with the following IDs will be pushed");
197-
for (String id : pushNoteIDs) {
197+
for (String id : pushNoteIds) {
198198
LOG.info("ID : " + id);
199199
}
200-
pushNotes(subject, pushNoteIDs, srcRepo, dstRepo);
200+
pushNotes(subject, pushNoteIds, srcRepo, dstRepo);
201201
} else {
202202
LOG.info("Nothing to push");
203203
}
204204

205-
if (!pullNoteIDs.isEmpty()) {
205+
if (!pullNoteIds.isEmpty()) {
206206
LOG.info("Notes with the following IDs will be pulled");
207-
for (String id : pullNoteIDs) {
207+
for (String id : pullNoteIds) {
208208
LOG.info("ID : " + id);
209209
}
210-
pushNotes(subject, pullNoteIDs, dstRepo, srcRepo);
210+
pushNotes(subject, pullNoteIds, dstRepo, srcRepo);
211211
} else {
212212
LOG.info("Nothing to pull");
213213
}
214214

215-
if (!delDstNoteIDs.isEmpty()) {
215+
if (!delDstNoteIds.isEmpty()) {
216216
LOG.info("Notes with the following IDs will be deleted from dest");
217-
for (String id : delDstNoteIDs) {
217+
for (String id : delDstNoteIds) {
218218
LOG.info("ID : " + id);
219219
}
220-
deleteNotes(subject, delDstNoteIDs, dstRepo);
220+
deleteNotes(subject, delDstNoteIds, dstRepo);
221221
} else {
222222
LOG.info("Nothing to delete from dest");
223223
}

zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ public static enum OP {
135135
UNSUBSCRIBE_UPDATE_NOTEBOOK_JOBS, // [c-s] unsubscribe job information for job management
136136
// @param unixTime
137137
GET_INTERPRETER_BINDINGS, // [c-s] get interpreter bindings
138-
// @param noteID
138+
// @param noteId
139139
SAVE_INTERPRETER_BINDINGS, // [c-s] save interpreter bindings
140-
// @param noteID
140+
// @param noteId
141141
// @param selectedSettingIds
142142
INTERPRETER_BINDINGS, // [s-c] interpreter bindings
143143
ERROR_INFO // [s-c] error information to be sent

zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public void testCloneNote() throws IOException, CloneNotSupportedException,
415415
Paragraph cp = cloneNote.paragraphs.get(0);
416416
assertEquals(cp.getStatus(), Status.READY);
417417

418-
// Keep same ParagraphID
418+
// Keep same ParagraphId
419419
assertEquals(cp.getId(), p.getId());
420420
assertEquals(cp.text, p.text);
421421
assertEquals(cp.getResult().message(), p.getResult().message());
@@ -458,7 +458,7 @@ public void testCloneNoteWithExceptionResult() throws IOException, CloneNotSuppo
458458
Note cloneNote = notebook.cloneNote(note.getId(), "clone note with Exception result", null);
459459
Paragraph cp = cloneNote.paragraphs.get(0);
460460

461-
// Keep same ParagraphID
461+
// Keep same ParagraphId
462462
assertEquals(cp.getId(), p.getId());
463463
assertEquals(cp.text, p.text);
464464
assertNull(cp.getResult());

0 commit comments

Comments
 (0)