Skip to content

Commit

Permalink
Fix the startup issue in streaming integrator tooling distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuGayan committed Jul 22, 2019
1 parent 8bd6b77 commit 08ab182
Show file tree
Hide file tree
Showing 79 changed files with 310 additions and 311 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ public Map<String, SiddhiAppRuntime> getActiveSiddhiAppRuntimes() {

@Override
public void enableSiddhiAppStatistics(Level statsEnabled) {
//ignore the server runtime statistics
//ignore the editor runtime statistics
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class DockerUtils {
private static final String SIDDHI_FILES_DIR = "siddhi-files";
private static final String README_FILE = "README.md";
private static final String DOCKER_COMPOSE_FILE = "docker-compose.yml";
private static final String DOCKER_COMPOSE_EDITOR_FILE = "docker-compose.server.yml";
private static final String DOCKER_COMPOSE_EDITOR_FILE = "docker-compose.editor.yml";
private static final String DOCKER_COMPOSE_WORKER_FILE = "docker-compose.worker.yml";
private static final String PRODUCT_VERSION_TOKEN = "\\{\\{PRODUCT_VERSION}}";
private final ConfigProvider configProvider;
Expand Down Expand Up @@ -124,7 +124,7 @@ private Map<String, Path> getFileMap(String profile, List<String> siddhiFiles) {
// Add readme.md and the respective docker-compose.yml files.
files.put(README_FILE, Paths.get(RUNTIME_PATH, RESOURCES_DIR, README_FILE));
files.put(DOCKER_COMPOSE_FILE, Paths.get(RUNTIME_PATH, RESOURCES_DIR,
"server".equals(profile) ? DOCKER_COMPOSE_EDITOR_FILE : DOCKER_COMPOSE_WORKER_FILE));
"editor".equals(profile) ? DOCKER_COMPOSE_EDITOR_FILE : DOCKER_COMPOSE_WORKER_FILE));

// Add selected Siddhi files.
for (String siddhiFile : siddhiFiles) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* EditorConsoleService Websocket - Client connect to this
*/
@Component(
name = "server-console-service",
name = "editor-console-service",
service = WebSocketEndpoint.class,
immediate = true
)
Expand Down Expand Up @@ -93,7 +93,7 @@ public void onClose(WebSocketConnection webSocketConnection) {
if (webSocketConnection.isOpen()) {
try {
ConsoleLogEvent clientCloseEvent = new ConsoleLogEvent();
clientCloseEvent.setMessage("Connection closed (Possibly due to opening the server in a "
clientCloseEvent.setMessage("Connection closed (Possibly due to opening the editor in a "
+ "new Tab/Window) ! Refresh to reconnect to the console.");
clientCloseEvent.setLevel("ERROR");
clientCloseEvent.setFqcn(EditorConsoleService.class.getCanonicalName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public Response write(String payload) {
if (null != fileNamePath) {
String siddhiAppName = fileNamePath.toString().replace(Constants.SIDDHI_APP_FILE_EXTENSION, "");
if (null != EditorDataHolder.getDebugProcessorService().getSiddhiAppRuntimeHolder(siddhiAppName)) {
//making the app faulty until the file gets deployed again for server usage purposes
//making the app faulty until the file gets deployed again for editor usage purposes
EditorDataHolder.getDebugProcessorService().getSiddhiAppRuntimeHolder(siddhiAppName).setMode(
DebugRuntime.Mode.FAULTY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ protected void setMicroservicesServer(MicroservicesServer microservicesServer) {
e.getMessage(), e);
}
String startingURL = entry.getValue().getScheme() + "://" + hostname + ":" + entry.getValue()
.getPort() + "/server";
.getPort() + "/editor";
logger.info("Editor Started on : " + startingURL);
}
});
logger.debug("Microservices server registered to startup component of server");
logger.debug("Microservices server registered to startup component of editor");
}

protected void unsetMicroservicesServer(MicroservicesServer microservicesServer) {
logger.debug("Microservices server unregistered from startup component of server");
logger.debug("Microservices server unregistered from startup component of editor");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import java.nio.charset.Charset;

/**
* WorkspaceDeployer is responsible for all server workspace related deployment tasks
* WorkspaceDeployer is responsible for all editor workspace related deployment tasks
*/
@Component(
name = "workspace-artifact-deployer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.wso2.carbon.siddhi.editor.core.exception.SiddhiAppDeployerServiceStubException;

/**
* Interface for services related to deploying siddhi apps of server.
* Interface for services related to deploying siddhi apps of editor.
*/
public interface SiddhiAppApiHelperService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ div[class*="col-sm-12"] {
/*//////////////////////////////////////////////////*/

/*//////////////////////////////////////////////////*/
/** ace server (source view) related styles | Start -> **/
/** ace editor (source view) related styles | Start -> **/

.nav-tabs-bar{
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ define(['require', 'jquery', 'log', 'backbone', 'file_browser'],
}
}
var downloadURL = window.location.protocol + "//" + window.location.host +
"/server/docker/download?q=" + encodeURIComponent(JSON.stringify(payload));
"/editor/docker/download?q=" + encodeURIComponent(JSON.stringify(payload));
$('#frm-download').attr('src', downloadURL);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
define(["jquery"], function (jQuery) {
var self = {};
self.siddhiStoreUrl = window.location.protocol + "//" + window.location.host + "/server/stores/query";
self.siddhiStoreUrl = window.location.protocol + "//" + window.location.host + "/editor/stores/query";
self.retrieveStoresQuery = function (appName, query, successCallback, errorCallback) {
jQuery.ajax({
async: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ define(["jquery"], function (jQuery) {
self.HTTP_POST = "POST";
self.HTTP_PUT = "PUT";
self.HTTP_DELETE = "DELETE";
self.siddhiAppsUrl = window.location.protocol + "//" + window.location.host + "/server";
self.siddhiAppsUrl = window.location.protocol + "//" + window.location.host + "/editor";

self.retrieveSampleEvent = function (appName, streamName, eventFormat, successCallback, errorCallback) {
jQuery.ajax({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define(['require', 'lodash', 'log', 'jquery', 'backbone', 'command', 'sample_pre
initialize: function (options) {
var errMsg;
if (!_.has(options, 'tab')) {
errMsg = 'unable to find a reference for server tab';
errMsg = 'unable to find a reference for editor tab';
log.error(errMsg);
throw errMsg;
}
Expand Down Expand Up @@ -88,7 +88,7 @@ define(['require', 'lodash', 'log', 'jquery', 'backbone', 'command', 'sample_pre
buttonWrap.append(newButton);
buttonWrap.append(openButton);

var productNameWrapHeader = $('<h2><img src="/server/commons/images/wso2-logo.svg">' +
var productNameWrapHeader = $('<h2><img src="/editor/commons/images/wso2-logo.svg">' +
'<h1>Stream Processor Studio</h1></h2>');
productNameWrap.append(productNameWrapHeader);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ define(['ace/ace', 'jquery', 'lodash', 'log','dialogs','./service-client','welco
};

this.saveFileBrowserBased = function saveFile() {
var editor = ace.edit('siddhi-server');
var editor = ace.edit('siddhi-editor');
var code = editor.getValue();
var filename = "untitled";
var match = plan_regex.exec(code);
Expand All @@ -76,7 +76,7 @@ define(['ace/ace', 'jquery', 'lodash', 'log','dialogs','./service-client','welco
};

this.saveFile = function saveFile() {
var editor = ace.edit('siddhi-server');
var editor = ace.edit('siddhi-editor');
var code = editor.getValue();
var filename = "untitled";
var match = plan_regex.exec(code);
Expand All @@ -87,7 +87,7 @@ define(['ace/ace', 'jquery', 'lodash', 'log','dialogs','./service-client','welco
filePath = (filePath.slice(-1) === '/') ? filePath + filename : filePath + '/' + filename;
$.ajax({
type: "POST",
url: window.location.protocol + "//" + window.location.host + "/server/save",
url: window.location.protocol + "//" + window.location.host + "/editor/save",
data: JSON.stringify({
siddhiApp: code,
filePath: filePath
Expand Down Expand Up @@ -762,7 +762,7 @@ define(['ace/ace', 'jquery', 'lodash', 'log','dialogs','./service-client','welco
//Run hint tour
app.commandManager.registerHandler('tour-guide', this.runGuide, this);

app.commandManager.registerHandler('deploy-to-server', this.handleDeploy, this);
app.commandManager.registerHandler('deploy-to-editor', this.handleDeploy, this);
}
});

Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (typeof define === "function")
exports.define = define;

/**
* Embeds the Ace server into the DOM, at the element provided by `el`.
* Embeds the Ace editor into the DOM, at the element provided by `el`.
* @param {String | DOMElement} el Either the id of an element, or the element itself
*
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
/**
* Creates a new `BackgroundTokenizer` object.
* @param {Tokenizer} tokenizer The tokenizer to use
* @param {Editor} editor The server to associate with
* @param {Editor} editor The editor to associate with
*
* @constructor
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ var EditSession = function(text, mode) {
};

/**
* [Returns the value of the distance between the top of the server and the topmost part of the visible content.]{: #EditSession.getScrollTop}
* [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop}
* @returns {Number}
**/
this.getScrollTop = function() {
Expand All @@ -993,7 +993,7 @@ var EditSession = function(text, mode) {

this.$scrollLeft = 0;
/**
* [Sets the value of the distance between the left of the server and the leftmost part of the visible content.]{: #EditSession.setScrollLeft}
* [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft}
**/
this.setScrollLeft = function(scrollLeft) {
// scrollLeft = Math.round(scrollLeft);
Expand All @@ -1005,7 +1005,7 @@ var EditSession = function(text, mode) {
};

/**
* [Returns the value of the distance between the left of the server and the leftmost part of the visible content.]{: #EditSession.getScrollLeft}
* [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft}
* @returns {Number}
**/
this.getScrollLeft = function() {
Expand Down Expand Up @@ -1610,7 +1610,7 @@ var EditSession = function(text, mode) {
};

/**
* Sets the line length for soft wrap in the server. Lines will break
* Sets the line length for soft wrap in the editor. Lines will break
* at a minimum of the given length minus 20 chars and at a maximum
* of the given number of chars.
* @param {number} limit The maximum line length in chars, for soft wrapping lines.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function FoldLine(foldData, folds) {
&& fold.start.column != column
&& fold.start.row != row)
{
//throwing here breaks whole server
//throwing here breaks whole editor
//TODO: properly handle this
window.console && window.console.log(row, column, fold);
} else if (fold.start.row == row) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,15 +485,15 @@ var Editor = function(renderer, session) {
};

/**
* Gets the current font size of the server text.
* Gets the current font size of the editor text.
*/
this.getFontSize = function () {
return this.getOption("fontSize") ||
dom.computedStyle(this.container, "fontSize");
};

/**
* Set a new font size (in pixels) for the server text.
* Set a new font size (in pixels) for the editor text.
* @param {String} size A font size ( _e.g._ "12px")
*
*
Expand Down Expand Up @@ -652,7 +652,7 @@ var Editor = function(renderer, session) {
};

/**
* Emitted once the server comes into focus.
* Emitted once the editor comes into focus.
* @event focus
*
*
Expand All @@ -667,7 +667,7 @@ var Editor = function(renderer, session) {
};

/**
* Emitted once the server has been blurred.
* Emitted once the editor has been blurred.
* @event blur
*
*
Expand Down Expand Up @@ -730,7 +730,7 @@ var Editor = function(renderer, session) {
if (!this.$blockScrolling) {
config.warn("Automatically scrolling cursor into view after selection change",
"this will be disabled in the next version",
"set server.$blockScrolling = Infinity to disable this message"
"set editor.$blockScrolling = Infinity to disable this message"
);
this.renderer.scrollCursorIntoView();
}
Expand Down Expand Up @@ -1163,7 +1163,7 @@ var Editor = function(renderer, session) {
};

/**
* If `showInvisibles` is set to `true`, invisible characters&mdash;like spaces or new lines&mdash;are show in the server.
* If `showInvisibles` is set to `true`, invisible characters&mdash;like spaces or new lines&mdash;are show in the editor.
* @param {Boolean} showInvisibles Specifies whether or not to show invisible characters
*
**/
Expand All @@ -1188,7 +1188,7 @@ var Editor = function(renderer, session) {
};

/**
* If `showPrintMargin` is set to `true`, the print margin is shown in the server.
* If `showPrintMargin` is set to `true`, the print margin is shown in the editor.
* @param {Boolean} showPrintMargin Specifies whether or not to show the print margin
*
**/
Expand Down Expand Up @@ -1222,16 +1222,16 @@ var Editor = function(renderer, session) {
};

/**
* If `readOnly` is true, then the server is set to read-only mode, and none of the content can change.
* @param {Boolean} readOnly Specifies whether the server can be modified or not
* If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change.
* @param {Boolean} readOnly Specifies whether the editor can be modified or not
*
**/
this.setReadOnly = function(readOnly) {
this.setOption("readOnly", readOnly);
};

/**
* Returns `true` if the server is set to read-only mode.
* Returns `true` if the editor is set to read-only mode.
* @returns {Boolean}
**/
this.getReadOnly = function() {
Expand Down Expand Up @@ -1907,7 +1907,7 @@ var Editor = function(renderer, session) {
};

/**
* Moves the server to the specified row.
* Moves the editor to the specified row.
* @related VirtualRenderer.scrollToRow
**/
this.scrollToRow = function(row) {
Expand Down Expand Up @@ -1974,7 +1974,7 @@ var Editor = function(renderer, session) {


/**
* Selects all the text in server.
* Selects all the text in editor.
* @related Selection.selectAll
**/
this.selectAll = function() {
Expand Down Expand Up @@ -2527,7 +2527,7 @@ var Editor = function(renderer, session) {

/**
*
* Cleans up the entire server.
* Cleans up the entire editor.
**/
this.destroy = function() {
this.renderer.destroy();
Expand All @@ -2538,7 +2538,7 @@ var Editor = function(renderer, session) {
};

/**
* Enables automatic scrolling of the cursor into view when server itself is inside scrollable element
* Enables automatic scrolling of the cursor into view when editor itself is inside scrollable element
* @param {Boolean} enable default true
**/
this.setAutoScrollEditorIntoView = function(enable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module.exports = {
"test: should use stop worker of old document" : function(next) {
var self = this;

// 1. Open an server and set the session to CssMode
// 1. Open an editor and set the session to CssMode
self.editor.setSession(self.session1);
self.session1.setMode(new CssMode());

Expand Down
Loading

0 comments on commit 08ab182

Please sign in to comment.