{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/carbon-ml/pulls/comments/35504529","id":35504529,"diff_hunk":"@@ -309,6 +309,38 @@ private MLModelConfigurationContext buildMLModelConfigurationContext(long modelI\n \n     }\n \n+    public String streamingPredict(int tenantId, String userName, long modelId, String dataFormat, InputStream dataStream)\n+            throws MLModelHandlerException {\n+        List<String[]> data = new ArrayList<String[]>();\n+        CSVFormat csvFormat = DataTypeFactory.getCSVFormat(dataFormat);\n+        BufferedReader br = new BufferedReader(new InputStreamReader(dataStream));\n+        try {\n+            String line;\n+            while ((line = br.readLine()) != null) {\n+                String[] dataRow = line.split(csvFormat.getDelimiter() + \"\");\n+                data.add(dataRow);\n+            }\n+            List<String> predictions = (List<String>) predict(tenantId, userName, modelId, data);\n+            String predictionsWithData = new String();\n+            for(int i = 0; i < predictions.size(); i++) {\n+                predictionsWithData += Arrays.toString(data.get(i)).replaceAll(MLConstants.WHITE_SPACE_SQUARE_BRACKET_REGEX, \"\")\n+                        + csvFormat.getDelimiter() + predictions.get(i) + MLConstants.NEW_LINE;\n+            }\n+            return predictionsWithData;\n+        } catch (IOException e) {\n+            String msg = \"Failed to read the data points for prediction for model [id] \" + modelId;\n+            log.error(msg, e);\n+            throw new MLModelHandlerException(msg, e);\n+        } finally {\n+            try {\n+                dataStream.close();\n+                br.close();\n+            } catch (IOException ignore) {","path":"components/ml/org.wso2.carbon.ml.core/src/main/java/org/wso2/carbon/ml/core/impl/MLModelHandler.java","position":30,"original_position":30,"commit_id":"1357bfa9aca92392b9e37ff7851131cd4dbd7f56","original_commit_id":"1357bfa9aca92392b9e37ff7851131cd4dbd7f56","user":{"login":"nuwand","id":6469654,"avatar_url":"https://avatars.githubusercontent.com/u/6469654?v=3","gravatar_id":"","url":"https://api.github.com/users/nuwand","html_url":"https://github.com/nuwand","followers_url":"https://api.github.com/users/nuwand/followers","following_url":"https://api.github.com/users/nuwand/following{/other_user}","gists_url":"https://api.github.com/users/nuwand/gists{/gist_id}","starred_url":"https://api.github.com/users/nuwand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuwand/subscriptions","organizations_url":"https://api.github.com/users/nuwand/orgs","repos_url":"https://api.github.com/users/nuwand/repos","events_url":"https://api.github.com/users/nuwand/events{/privacy}","received_events_url":"https://api.github.com/users/nuwand/received_events","type":"User","site_admin":false},"body":"Rather than ignoring, I think its better to at least log with a WARN message.","created_at":"2015-07-27T04:02:00Z","updated_at":"2015-07-27T04:02:00Z","html_url":"https://github.com/wso2/carbon-ml/pull/21#discussion_r35504529","pull_request_url":"https://api.github.com/repos/wso2/carbon-ml/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-ml/pulls/comments/35504529"},"html":{"href":"https://github.com/wso2/carbon-ml/pull/21#discussion_r35504529"},"pull_request":{"href":"https://api.github.com/repos/wso2/carbon-ml/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/carbon-ml/pulls/21","id":39066083,"html_url":"https://github.com/wso2/carbon-ml/pull/21","diff_url":"https://github.com/wso2/carbon-ml/pull/21.diff","patch_url":"https://github.com/wso2/carbon-ml/pull/21.patch","issue_url":"https://api.github.com/repos/wso2/carbon-ml/issues/21","number":21,"state":"closed","locked":false,"title":"Fix https://wso2.org/jira/browse/ML-110","user":{"login":"cdathuraliya","id":9251719,"avatar_url":"https://avatars.githubusercontent.com/u/9251719?v=3","gravatar_id":"","url":"https://api.github.com/users/cdathuraliya","html_url":"https://github.com/cdathuraliya","followers_url":"https://api.github.com/users/cdathuraliya/followers","following_url":"https://api.github.com/users/cdathuraliya/following{/other_user}","gists_url":"https://api.github.com/users/cdathuraliya/gists{/gist_id}","starred_url":"https://api.github.com/users/cdathuraliya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdathuraliya/subscriptions","organizations_url":"https://api.github.com/users/cdathuraliya/orgs","repos_url":"https://api.github.com/users/cdathuraliya/repos","events_url":"https://api.github.com/users/cdathuraliya/events{/privacy}","received_events_url":"https://api.github.com/users/cdathuraliya/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-02T09:58:06Z","updated_at":"2015-07-27T04:02:00Z","closed_at":"2015-07-02T11:22:56Z","merged_at":"2015-07-02T11:22:56Z","merge_commit_sha":"d979462abf92b41c391c05ba33231ddb39d22fa6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/carbon-ml/pulls/21/commits","review_comments_url":"https://api.github.com/repos/wso2/carbon-ml/pulls/21/comments","review_comment_url":"https://api.github.com/repos/wso2/carbon-ml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/carbon-ml/issues/21/comments","statuses_url":"https://api.github.com/repos/wso2/carbon-ml/statuses/1357bfa9aca92392b9e37ff7851131cd4dbd7f56","head":{"label":"cdathuraliya:master","ref":"master","sha":"1357bfa9aca92392b9e37ff7851131cd4dbd7f56","user":{"login":"cdathuraliya","id":9251719,"avatar_url":"https://avatars.githubusercontent.com/u/9251719?v=3","gravatar_id":"","url":"https://api.github.com/users/cdathuraliya","html_url":"https://github.com/cdathuraliya","followers_url":"https://api.github.com/users/cdathuraliya/followers","following_url":"https://api.github.com/users/cdathuraliya/following{/other_user}","gists_url":"https://api.github.com/users/cdathuraliya/gists{/gist_id}","starred_url":"https://api.github.com/users/cdathuraliya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdathuraliya/subscriptions","organizations_url":"https://api.github.com/users/cdathuraliya/orgs","repos_url":"https://api.github.com/users/cdathuraliya/repos","events_url":"https://api.github.com/users/cdathuraliya/events{/privacy}","received_events_url":"https://api.github.com/users/cdathuraliya/received_events","type":"User","site_admin":false},"repo":{"id":35543627,"name":"carbon-ml","full_name":"cdathuraliya/carbon-ml","owner":{"login":"cdathuraliya","id":9251719,"avatar_url":"https://avatars.githubusercontent.com/u/9251719?v=3","gravatar_id":"","url":"https://api.github.com/users/cdathuraliya","html_url":"https://github.com/cdathuraliya","followers_url":"https://api.github.com/users/cdathuraliya/followers","following_url":"https://api.github.com/users/cdathuraliya/following{/other_user}","gists_url":"https://api.github.com/users/cdathuraliya/gists{/gist_id}","starred_url":"https://api.github.com/users/cdathuraliya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdathuraliya/subscriptions","organizations_url":"https://api.github.com/users/cdathuraliya/orgs","repos_url":"https://api.github.com/users/cdathuraliya/repos","events_url":"https://api.github.com/users/cdathuraliya/events{/privacy}","received_events_url":"https://api.github.com/users/cdathuraliya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cdathuraliya/carbon-ml","description":"","fork":true,"url":"https://api.github.com/repos/cdathuraliya/carbon-ml","forks_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/forks","keys_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/teams","hooks_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/hooks","issue_events_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/issues/events{/number}","events_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/events","assignees_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/assignees{/user}","branches_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/branches{/branch}","tags_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/tags","blobs_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/statuses/{sha}","languages_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/languages","stargazers_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/stargazers","contributors_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/contributors","subscribers_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/subscribers","subscription_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/subscription","commits_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/contents/{+path}","compare_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/merges","archive_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/downloads","issues_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/issues{/number}","pulls_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/pulls{/number}","milestones_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/milestones{/number}","notifications_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/labels{/name}","releases_url":"https://api.github.com/repos/cdathuraliya/carbon-ml/releases{/id}","created_at":"2015-05-13T10:49:08Z","updated_at":"2015-07-02T11:40:20Z","pushed_at":"2015-07-23T10:00:47Z","git_url":"git://github.com/cdathuraliya/carbon-ml.git","ssh_url":"git@github.com:cdathuraliya/carbon-ml.git","clone_url":"https://github.com/cdathuraliya/carbon-ml.git","svn_url":"https://github.com/cdathuraliya/carbon-ml","homepage":null,"size":7181,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2:master","ref":"master","sha":"82dcfd25ac0ed4b0767b19cdf9e8f893de24f353","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":35467512,"name":"carbon-ml","full_name":"wso2/carbon-ml","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/carbon-ml","description":"","fork":false,"url":"https://api.github.com/repos/wso2/carbon-ml","forks_url":"https://api.github.com/repos/wso2/carbon-ml/forks","keys_url":"https://api.github.com/repos/wso2/carbon-ml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/carbon-ml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/carbon-ml/teams","hooks_url":"https://api.github.com/repos/wso2/carbon-ml/hooks","issue_events_url":"https://api.github.com/repos/wso2/carbon-ml/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/carbon-ml/events","assignees_url":"https://api.github.com/repos/wso2/carbon-ml/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/carbon-ml/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/carbon-ml/tags","blobs_url":"https://api.github.com/repos/wso2/carbon-ml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/carbon-ml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/carbon-ml/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/carbon-ml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/carbon-ml/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/carbon-ml/languages","stargazers_url":"https://api.github.com/repos/wso2/carbon-ml/stargazers","contributors_url":"https://api.github.com/repos/wso2/carbon-ml/contributors","subscribers_url":"https://api.github.com/repos/wso2/carbon-ml/subscribers","subscription_url":"https://api.github.com/repos/wso2/carbon-ml/subscription","commits_url":"https://api.github.com/repos/wso2/carbon-ml/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/carbon-ml/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/carbon-ml/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/carbon-ml/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/carbon-ml/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/carbon-ml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/carbon-ml/merges","archive_url":"https://api.github.com/repos/wso2/carbon-ml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/carbon-ml/downloads","issues_url":"https://api.github.com/repos/wso2/carbon-ml/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/carbon-ml/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/carbon-ml/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/carbon-ml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/carbon-ml/labels{/name}","releases_url":"https://api.github.com/repos/wso2/carbon-ml/releases{/id}","created_at":"2015-05-12T04:50:29Z","updated_at":"2015-07-02T11:45:08Z","pushed_at":"2015-07-26T13:05:49Z","git_url":"git://github.com/wso2/carbon-ml.git","ssh_url":"git@github.com:wso2/carbon-ml.git","clone_url":"https://github.com/wso2/carbon-ml.git","svn_url":"https://github.com/wso2/carbon-ml","homepage":null,"size":8023,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":0,"forks":8,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-ml/pulls/21"},"html":{"href":"https://github.com/wso2/carbon-ml/pull/21"},"issue":{"href":"https://api.github.com/repos/wso2/carbon-ml/issues/21"},"comments":{"href":"https://api.github.com/repos/wso2/carbon-ml/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/carbon-ml/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/carbon-ml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/carbon-ml/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/carbon-ml/statuses/1357bfa9aca92392b9e37ff7851131cd4dbd7f56"}}}}