You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/06/05 05:22:57 UTC
[09/67] [abbrv] kylin git commit: Revert "reformat code"
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/controller2/JobControllerV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller2/JobControllerV2.java b/server-base/src/main/java/org/apache/kylin/rest/controller2/JobControllerV2.java
index fef9fa3..abc8621 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller2/JobControllerV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller2/JobControllerV2.java
@@ -114,8 +114,7 @@ public class JobControllerV2 extends BasicController {
@RequestParam(value = "projectName", required = false) String projectName, //
@RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset, //
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize, //
- @RequestParam(value = "sortby", required = false, defaultValue = "last_modify") String sortby,
- @RequestParam(value = "reverse", required = false, defaultValue = "true") Boolean reverse) {
+ @RequestParam(value = "sortby", required = false, defaultValue = "last_modify") String sortby, @RequestParam(value = "reverse", required = false, defaultValue = "true") Boolean reverse) {
MsgPicker.setMsg(lang);
HashMap<String, Object> data = new HashMap<String, Object>();
@@ -127,8 +126,7 @@ public class JobControllerV2 extends BasicController {
}
}
- List<JobInstance> jobInstanceList = jobService.searchJobs(cubeName, projectName, statusList,
- JobTimeFilterEnum.getByCode(timeFilter));
+ List<JobInstance> jobInstanceList = jobService.searchJobs(cubeName, projectName, statusList, JobTimeFilterEnum.getByCode(timeFilter));
if (sortby.equals("last_modify")) {
if (reverse) {
@@ -173,8 +171,7 @@ public class JobControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/{jobId}", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{jobId}", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
public EnvelopeResponse getV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId) {
MsgPicker.setMsg(lang);
@@ -190,11 +187,9 @@ public class JobControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/{jobId}/steps/{stepId}/output", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{jobId}/steps/{stepId}/output", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getStepOutputV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId,
- @PathVariable String stepId) {
+ public EnvelopeResponse getStepOutputV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId, @PathVariable String stepId) {
MsgPicker.setMsg(lang);
Map<String, String> result = new HashMap<String, String>();
@@ -211,8 +206,7 @@ public class JobControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/{jobId}/resume", method = { RequestMethod.PUT }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{jobId}/resume", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
public EnvelopeResponse resumeV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId) {
MsgPicker.setMsg(lang);
@@ -229,11 +223,9 @@ public class JobControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/{jobId}/cancel", method = { RequestMethod.PUT }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{jobId}/cancel", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse cancelV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId)
- throws IOException {
+ public EnvelopeResponse cancelV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId) throws IOException {
MsgPicker.setMsg(lang);
final JobInstance jobInstance = jobService.getJobInstance(jobId);
@@ -247,8 +239,7 @@ public class JobControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/{jobId}/pause", method = { RequestMethod.PUT }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{jobId}/pause", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
public EnvelopeResponse pauseV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId) {
MsgPicker.setMsg(lang);
@@ -264,11 +255,9 @@ public class JobControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/{jobId}/steps/{stepId}/rollback", method = { RequestMethod.PUT }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{jobId}/steps/{stepId}/rollback", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse rollbackV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId,
- @PathVariable String stepId) {
+ public EnvelopeResponse rollbackV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId, @PathVariable String stepId) {
MsgPicker.setMsg(lang);
final JobInstance jobInstance = jobService.getJobInstance(jobId);
@@ -283,11 +272,9 @@ public class JobControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/{jobId}/drop", method = { RequestMethod.DELETE }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{jobId}/drop", method = { RequestMethod.DELETE }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse dropJobV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId)
- throws IOException {
+ public EnvelopeResponse dropJobV2(@RequestHeader("Accept-Language") String lang, @PathVariable String jobId) throws IOException {
MsgPicker.setMsg(lang);
JobInstance jobInstance = jobService.getJobInstance(jobId);
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelControllerV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelControllerV2.java b/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelControllerV2.java
index 0199b77..aa907a6 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelControllerV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelControllerV2.java
@@ -76,8 +76,7 @@ import com.google.common.collect.Sets;
public class ModelControllerV2 extends BasicController {
private static final Logger logger = LoggerFactory.getLogger(ModelControllerV2.class);
- public static final char[] VALID_MODELNAME = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_"
- .toCharArray();
+ public static final char[] VALID_MODELNAME = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_".toCharArray();
@Autowired
@Qualifier("modelMgmtService")
@@ -93,12 +92,7 @@ public class ModelControllerV2 extends BasicController {
@RequestMapping(value = "", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getModelsPaging(@RequestHeader("Accept-Language") String lang,
- @RequestParam(value = "modelName", required = false) String modelName,
- @RequestParam(value = "projectName", required = false) String projectName,
- @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset,
- @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize)
- throws IOException {
+ public EnvelopeResponse getModelsPaging(@RequestHeader("Accept-Language") String lang, @RequestParam(value = "modelName", required = false) String modelName, @RequestParam(value = "projectName", required = false) String projectName, @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset, @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) throws IOException {
MsgPicker.setMsg(lang);
HashMap<String, Object> data = new HashMap<String, Object>();
@@ -137,15 +131,13 @@ public class ModelControllerV2 extends BasicController {
@RequestMapping(value = "", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse updateModelDescV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody ModelRequest modelRequest) throws IOException {
+ public EnvelopeResponse updateModelDescV2(@RequestHeader("Accept-Language") String lang, @RequestBody ModelRequest modelRequest) throws IOException {
MsgPicker.setMsg(lang);
DataModelDesc modelDesc = deserializeDataModelDescV2(modelRequest);
modelService.validateModelDesc(modelDesc);
- String projectName = (null == modelRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME
- : modelRequest.getProject();
+ String projectName = (null == modelRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME : modelRequest.getProject();
ResourceStore store = ResourceStore.getStore(KylinConfig.getInstanceFromEnv());
Checkpoint cp = store.checkpoint();
@@ -168,18 +160,15 @@ public class ModelControllerV2 extends BasicController {
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, data, "");
}
- @RequestMapping(value = "/draft", method = { RequestMethod.PUT }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/draft", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse updateModelDescDraftV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody ModelRequest modelRequest) throws IOException {
+ public EnvelopeResponse updateModelDescDraftV2(@RequestHeader("Accept-Language") String lang, @RequestBody ModelRequest modelRequest) throws IOException {
MsgPicker.setMsg(lang);
DataModelDesc modelDesc = deserializeDataModelDescV2(modelRequest);
modelService.validateModelDesc(modelDesc);
- String projectName = (null == modelRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME
- : modelRequest.getProject();
+ String projectName = (null == modelRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME : modelRequest.getProject();
ResourceStore store = ResourceStore.getStore(KylinConfig.getInstanceFromEnv());
Checkpoint cp = store.checkpoint();
@@ -202,11 +191,9 @@ public class ModelControllerV2 extends BasicController {
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, data, "");
}
- @RequestMapping(value = "/{modelName}", method = { RequestMethod.DELETE }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{modelName}", method = { RequestMethod.DELETE }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void deleteModelV2(@RequestHeader("Accept-Language") String lang, @PathVariable String modelName)
- throws IOException {
+ public void deleteModelV2(@RequestHeader("Accept-Language") String lang, @PathVariable String modelName) throws IOException {
MsgPicker.setMsg(lang);
Message msg = MsgPicker.getMsg();
@@ -217,11 +204,9 @@ public class ModelControllerV2 extends BasicController {
modelService.dropModel(desc);
}
- @RequestMapping(value = "/{modelName}/clone", method = { RequestMethod.PUT }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{modelName}/clone", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse cloneModelV2(@RequestHeader("Accept-Language") String lang, @PathVariable String modelName,
- @RequestBody ModelRequest modelRequest) throws IOException {
+ public EnvelopeResponse cloneModelV2(@RequestHeader("Accept-Language") String lang, @PathVariable String modelName, @RequestBody ModelRequest modelRequest) throws IOException {
MsgPicker.setMsg(lang);
Message msg = MsgPicker.getMsg();
@@ -281,22 +266,18 @@ public class ModelControllerV2 extends BasicController {
return desc;
}
- @RequestMapping(value = "/checkNameAvailability/{modelName}", method = RequestMethod.GET, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/checkNameAvailability/{modelName}", method = RequestMethod.GET, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse checkNameAvailabilityV2(@RequestHeader("Accept-Language") String lang,
- @PathVariable String modelName) throws IOException {
+ public EnvelopeResponse checkNameAvailabilityV2(@RequestHeader("Accept-Language") String lang, @PathVariable String modelName) throws IOException {
MsgPicker.setMsg(lang);
boolean ret = modelService.checkNameAvailability(modelName);
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, ret, "");
}
- @RequestMapping(value = "/{modelName}/usedCols", method = RequestMethod.GET, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{modelName}/usedCols", method = RequestMethod.GET, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getUsedColsV2(@RequestHeader("Accept-Language") String lang,
- @PathVariable String modelName) {
+ public EnvelopeResponse getUsedColsV2(@RequestHeader("Accept-Language") String lang, @PathVariable String modelName) {
MsgPicker.setMsg(lang);
Map<String, Set<String>> data = new HashMap<>();
@@ -312,8 +293,7 @@ public class ModelControllerV2 extends BasicController {
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, data, "");
}
- private void populateUsedColResponse(TblColRef tblColRef, Set<CubeInstance> cubeInstances,
- Map<String, Set<String>> ret) {
+ private void populateUsedColResponse(TblColRef tblColRef, Set<CubeInstance> cubeInstances, Map<String, Set<String>> ret) {
String columnIdentity = tblColRef.getIdentity();
if (!ret.containsKey(columnIdentity)) {
ret.put(columnIdentity, Sets.<String> newHashSet());
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelDescControllerV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelDescControllerV2.java b/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelDescControllerV2.java
index db3e901..47aa902 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelDescControllerV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller2/ModelDescControllerV2.java
@@ -61,8 +61,7 @@ public class ModelDescControllerV2 extends BasicController {
* @return
* @throws IOException
*/
- @RequestMapping(value = "/{modelName}", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{modelName}", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
public EnvelopeResponse getModelV2(@RequestHeader("Accept-Language") String lang, @PathVariable String modelName) {
MsgPicker.setMsg(lang);
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/controller2/ProjectControllerV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller2/ProjectControllerV2.java b/server-base/src/main/java/org/apache/kylin/rest/controller2/ProjectControllerV2.java
index c316fa5..4c43b61 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller2/ProjectControllerV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller2/ProjectControllerV2.java
@@ -54,8 +54,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
public class ProjectControllerV2 extends BasicController {
private static final Logger logger = LoggerFactory.getLogger(ProjectControllerV2.class);
- private static final char[] VALID_PROJECTNAME = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_"
- .toCharArray();
+ private static final char[] VALID_PROJECTNAME = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_".toCharArray();
@Autowired
@Qualifier("projectService")
@@ -63,9 +62,7 @@ public class ProjectControllerV2 extends BasicController {
@RequestMapping(value = "", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getProjectsV2(@RequestHeader("Accept-Language") String lang,
- @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset,
- @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
+ public EnvelopeResponse getProjectsV2(@RequestHeader("Accept-Language") String lang, @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset, @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
MsgPicker.setMsg(lang);
int offset = pageOffset * pageSize;
@@ -74,12 +71,9 @@ public class ProjectControllerV2 extends BasicController {
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, projectService.listProjects(limit, offset), "");
}
- @RequestMapping(value = "/readable", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/readable", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getReadableProjectsV2(@RequestHeader("Accept-Language") String lang,
- @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset,
- @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
+ public EnvelopeResponse getReadableProjectsV2(@RequestHeader("Accept-Language") String lang, @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset, @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
MsgPicker.setMsg(lang);
HashMap<String, Object> data = new HashMap<String, Object>();
@@ -104,8 +98,7 @@ public class ProjectControllerV2 extends BasicController {
@RequestMapping(value = "", method = { RequestMethod.POST }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse saveProjectV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody ProjectRequest projectRequest) throws IOException {
+ public EnvelopeResponse saveProjectV2(@RequestHeader("Accept-Language") String lang, @RequestBody ProjectRequest projectRequest) throws IOException {
MsgPicker.setMsg(lang);
Message msg = MsgPicker.getMsg();
@@ -116,8 +109,7 @@ public class ProjectControllerV2 extends BasicController {
}
if (!StringUtils.containsOnly(projectDesc.getName(), VALID_PROJECTNAME)) {
- logger.info("Invalid Project name {}, only letters, numbers and underline supported.",
- projectDesc.getName());
+ logger.info("Invalid Project name {}, only letters, numbers and underline supported.", projectDesc.getName());
throw new BadRequestException(String.format(msg.getINVALID_PROJECT_NAME(), projectDesc.getName()));
}
@@ -129,8 +121,7 @@ public class ProjectControllerV2 extends BasicController {
@RequestMapping(value = "", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse updateProjectV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody ProjectRequest projectRequest) throws IOException {
+ public EnvelopeResponse updateProjectV2(@RequestHeader("Accept-Language") String lang, @RequestBody ProjectRequest projectRequest) throws IOException {
MsgPicker.setMsg(lang);
Message msg = MsgPicker.getMsg();
@@ -159,11 +150,9 @@ public class ProjectControllerV2 extends BasicController {
return projectDesc;
}
- @RequestMapping(value = "/{projectName}", method = { RequestMethod.DELETE }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{projectName}", method = { RequestMethod.DELETE }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void deleteProjectV2(@RequestHeader("Accept-Language") String lang, @PathVariable String projectName)
- throws IOException {
+ public void deleteProjectV2(@RequestHeader("Accept-Language") String lang, @PathVariable String projectName) throws IOException {
MsgPicker.setMsg(lang);
ProjectInstance project = projectService.getProjectManager().getProject(projectName);
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/controller2/QueryControllerV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller2/QueryControllerV2.java b/server-base/src/main/java/org/apache/kylin/rest/controller2/QueryControllerV2.java
index d268c4e..7f71801 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller2/QueryControllerV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller2/QueryControllerV2.java
@@ -72,8 +72,7 @@ public class QueryControllerV2 extends BasicController {
@Qualifier("queryService")
private QueryService queryService;
- @RequestMapping(value = "/query", method = RequestMethod.POST, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/query", method = RequestMethod.POST, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
public EnvelopeResponse queryV2(@RequestHeader("Accept-Language") String lang, @RequestBody SQLRequest sqlRequest) {
MsgPicker.setMsg(lang);
@@ -83,48 +82,37 @@ public class QueryControllerV2 extends BasicController {
// TODO should be just "prepare" a statement, get back expected ResultSetMetaData
- @RequestMapping(value = "/query/prestate", method = RequestMethod.POST, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/query/prestate", method = RequestMethod.POST, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse prepareQueryV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody PrepareSqlRequest sqlRequest) {
+ public EnvelopeResponse prepareQueryV2(@RequestHeader("Accept-Language") String lang, @RequestBody PrepareSqlRequest sqlRequest) {
MsgPicker.setMsg(lang);
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, queryService.doQueryWithCache(sqlRequest), "");
}
- @RequestMapping(value = "/saved_queries", method = RequestMethod.POST, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/saved_queries", method = RequestMethod.POST, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void saveQueryV2(@RequestHeader("Accept-Language") String lang, @RequestBody SaveSqlRequest sqlRequest)
- throws IOException {
+ public void saveQueryV2(@RequestHeader("Accept-Language") String lang, @RequestBody SaveSqlRequest sqlRequest) throws IOException {
MsgPicker.setMsg(lang);
String creator = SecurityContextHolder.getContext().getAuthentication().getName();
- Query newQuery = new Query(sqlRequest.getName(), sqlRequest.getProject(), sqlRequest.getSql(),
- sqlRequest.getDescription());
+ Query newQuery = new Query(sqlRequest.getName(), sqlRequest.getProject(), sqlRequest.getSql(), sqlRequest.getDescription());
queryService.saveQuery(creator, newQuery);
}
- @RequestMapping(value = "/saved_queries/{id}", method = RequestMethod.DELETE, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/saved_queries/{id}", method = RequestMethod.DELETE, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void removeQueryV2(@RequestHeader("Accept-Language") String lang, @PathVariable String id)
- throws IOException {
+ public void removeQueryV2(@RequestHeader("Accept-Language") String lang, @PathVariable String id) throws IOException {
MsgPicker.setMsg(lang);
String creator = SecurityContextHolder.getContext().getAuthentication().getName();
queryService.removeQuery(creator, id);
}
- @RequestMapping(value = "/saved_queries/{project}", method = RequestMethod.GET, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/saved_queries/{project}", method = RequestMethod.GET, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getQueriesV2(@RequestHeader("Accept-Language") String lang, @PathVariable String project,
- @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset,
- @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize)
- throws IOException {
+ public EnvelopeResponse getQueriesV2(@RequestHeader("Accept-Language") String lang, @PathVariable String project, @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset, @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) throws IOException {
MsgPicker.setMsg(lang);
HashMap<String, Object> data = new HashMap<String, Object>();
@@ -153,11 +141,9 @@ public class QueryControllerV2 extends BasicController {
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, data, "");
}
- @RequestMapping(value = "/query/format/{format}", method = RequestMethod.GET, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/query/format/{format}", method = RequestMethod.GET, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void downloadQueryResultV2(@RequestHeader("Accept-Language") String lang, @PathVariable String format,
- SQLRequest sqlRequest, HttpServletResponse response) {
+ public void downloadQueryResultV2(@RequestHeader("Accept-Language") String lang, @PathVariable String format, SQLRequest sqlRequest, HttpServletResponse response) {
MsgPicker.setMsg(lang);
SQLResponse result = queryService.doQueryWithCache(sqlRequest);
@@ -187,15 +173,12 @@ public class QueryControllerV2 extends BasicController {
}
}
- @RequestMapping(value = "/tables_and_columns", method = RequestMethod.GET, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/tables_and_columns", method = RequestMethod.GET, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getMetadataV2(@RequestHeader("Accept-Language") String lang, MetaRequest metaRequest)
- throws SQLException, IOException {
+ public EnvelopeResponse getMetadataV2(@RequestHeader("Accept-Language") String lang, MetaRequest metaRequest) throws SQLException, IOException {
MsgPicker.setMsg(lang);
- return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, queryService.getMetadataV2(metaRequest.getProject()),
- "");
+ return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, queryService.getMetadataV2(metaRequest.getProject()), "");
}
public void setQueryService(QueryService queryService) {
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/controller2/StreamingControllerV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller2/StreamingControllerV2.java b/server-base/src/main/java/org/apache/kylin/rest/controller2/StreamingControllerV2.java
index 3289ca8..c5bebf5 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller2/StreamingControllerV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller2/StreamingControllerV2.java
@@ -78,38 +78,26 @@ public class StreamingControllerV2 extends BasicController {
@Qualifier("tableService")
private TableService tableService;
- @RequestMapping(value = "/getConfig", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/getConfig", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getStreamingsV2(@RequestHeader("Accept-Language") String lang,
- @RequestParam(value = "table", required = false) String table,
- @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset,
- @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize)
- throws IOException {
+ public EnvelopeResponse getStreamingsV2(@RequestHeader("Accept-Language") String lang, @RequestParam(value = "table", required = false) String table, @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset, @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) throws IOException {
MsgPicker.setMsg(lang);
int offset = pageOffset * pageSize;
int limit = pageSize;
- return new EnvelopeResponse(ResponseCode.CODE_SUCCESS,
- streamingService.getStreamingConfigs(table, limit, offset), "");
+ return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, streamingService.getStreamingConfigs(table, limit, offset), "");
}
- @RequestMapping(value = "/getKfkConfig", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/getKfkConfig", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getKafkaConfigsV2(@RequestHeader("Accept-Language") String lang,
- @RequestParam(value = "kafkaConfigName", required = false) String kafkaConfigName,
- @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset,
- @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize)
- throws IOException {
+ public EnvelopeResponse getKafkaConfigsV2(@RequestHeader("Accept-Language") String lang, @RequestParam(value = "kafkaConfigName", required = false) String kafkaConfigName, @RequestParam(value = "pageOffset", required = false, defaultValue = "0") Integer pageOffset, @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) throws IOException {
MsgPicker.setMsg(lang);
int offset = pageOffset * pageSize;
int limit = pageSize;
- return new EnvelopeResponse(ResponseCode.CODE_SUCCESS,
- kafkaConfigService.getKafkaConfigs(kafkaConfigName, limit, offset), "");
+ return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, kafkaConfigService.getKafkaConfigs(kafkaConfigName, limit, offset), "");
}
/**
@@ -120,8 +108,7 @@ public class StreamingControllerV2 extends BasicController {
@RequestMapping(value = "", method = { RequestMethod.POST }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void saveStreamingConfigV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody StreamingRequest streamingRequest) throws IOException {
+ public void saveStreamingConfigV2(@RequestHeader("Accept-Language") String lang, @RequestBody StreamingRequest streamingRequest) throws IOException {
MsgPicker.setMsg(lang);
Message msg = MsgPicker.getMsg();
@@ -174,8 +161,7 @@ public class StreamingControllerV2 extends BasicController {
if (saveKafkaSuccess == false || saveStreamingSuccess == false) {
if (saveStreamingSuccess == true) {
- StreamingConfig sConfig = streamingService.getStreamingManager()
- .getStreamingConfig(streamingConfig.getName());
+ StreamingConfig sConfig = streamingService.getStreamingManager().getStreamingConfig(streamingConfig.getName());
try {
streamingService.dropStreamingConfig(sConfig);
} catch (IOException e) {
@@ -197,8 +183,7 @@ public class StreamingControllerV2 extends BasicController {
@RequestMapping(value = "", method = { RequestMethod.PUT }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void updateStreamingConfigV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody StreamingRequest streamingRequest) throws IOException {
+ public void updateStreamingConfigV2(@RequestHeader("Accept-Language") String lang, @RequestBody StreamingRequest streamingRequest) throws IOException {
MsgPicker.setMsg(lang);
Message msg = MsgPicker.getMsg();
@@ -221,11 +206,9 @@ public class StreamingControllerV2 extends BasicController {
}
}
- @RequestMapping(value = "/{configName}", method = { RequestMethod.DELETE }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{configName}", method = { RequestMethod.DELETE }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void deleteConfigV2(@RequestHeader("Accept-Language") String lang, @PathVariable String configName)
- throws IOException {
+ public void deleteConfigV2(@RequestHeader("Accept-Language") String lang, @PathVariable String configName) throws IOException {
MsgPicker.setMsg(lang);
Message msg = MsgPicker.getMsg();
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/controller2/TableControllerV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller2/TableControllerV2.java b/server-base/src/main/java/org/apache/kylin/rest/controller2/TableControllerV2.java
index 86c317b..4e2506c 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller2/TableControllerV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller2/TableControllerV2.java
@@ -65,13 +65,10 @@ public class TableControllerV2 extends BasicController {
@RequestMapping(value = "", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getTableDescV2(@RequestHeader("Accept-Language") String lang,
- @RequestParam(value = "ext", required = false) boolean withExt,
- @RequestParam(value = "project", required = true) String project) throws IOException {
+ public EnvelopeResponse getTableDescV2(@RequestHeader("Accept-Language") String lang, @RequestParam(value = "ext", required = false) boolean withExt, @RequestParam(value = "project", required = true) String project) throws IOException {
MsgPicker.setMsg(lang);
- return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, tableService.getTableDescByProject(project, withExt),
- "");
+ return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, tableService.getTableDescByProject(project, withExt), "");
}
/**
@@ -81,11 +78,9 @@ public class TableControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/{tableName:.+}", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/{tableName:.+}", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse getTableDescV2(@RequestHeader("Accept-Language") String lang,
- @PathVariable String tableName) {
+ public EnvelopeResponse getTableDescV2(@RequestHeader("Accept-Language") String lang, @PathVariable String tableName) {
MsgPicker.setMsg(lang);
Message msg = MsgPicker.getMsg();
@@ -95,27 +90,20 @@ public class TableControllerV2 extends BasicController {
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, table, "");
}
- @RequestMapping(value = "/load", method = { RequestMethod.POST }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/load", method = { RequestMethod.POST }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse loadHiveTablesV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody HiveTableRequestV2 requestV2) throws Exception {
+ public EnvelopeResponse loadHiveTablesV2(@RequestHeader("Accept-Language") String lang, @RequestBody HiveTableRequestV2 requestV2) throws Exception {
MsgPicker.setMsg(lang);
- return new EnvelopeResponse(ResponseCode.CODE_SUCCESS,
- tableService.loadHiveTables(requestV2.getTables(), requestV2.getProject(), requestV2.isNeedProfile()),
- "");
+ return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, tableService.loadHiveTables(requestV2.getTables(), requestV2.getProject(), requestV2.isNeedProfile()), "");
}
- @RequestMapping(value = "/load", method = { RequestMethod.DELETE }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/load", method = { RequestMethod.DELETE }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public EnvelopeResponse unLoadHiveTablesV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody HiveTableRequestV2 requestV2) throws IOException {
+ public EnvelopeResponse unLoadHiveTablesV2(@RequestHeader("Accept-Language") String lang, @RequestBody HiveTableRequestV2 requestV2) throws IOException {
MsgPicker.setMsg(lang);
- return new EnvelopeResponse(ResponseCode.CODE_SUCCESS,
- tableService.unloadHiveTables(requestV2.getTables(), requestV2.getProject()), "");
+ return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, tableService.unloadHiveTables(requestV2.getTables(), requestV2.getProject()), "");
}
/**
@@ -125,11 +113,9 @@ public class TableControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/cardinality", method = { RequestMethod.POST }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/cardinality", method = { RequestMethod.POST }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- public void generateCardinalityV2(@RequestHeader("Accept-Language") String lang,
- @RequestBody HiveTableRequestV2 requestV2) throws Exception {
+ public void generateCardinalityV2(@RequestHeader("Accept-Language") String lang, @RequestBody HiveTableRequestV2 requestV2) throws Exception {
MsgPicker.setMsg(lang);
String submitter = SecurityContextHolder.getContext().getAuthentication().getName();
@@ -147,8 +133,7 @@ public class TableControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/hive", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/hive", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
private EnvelopeResponse showHiveDatabasesV2(@RequestHeader("Accept-Language") String lang) throws Exception {
MsgPicker.setMsg(lang);
@@ -163,11 +148,9 @@ public class TableControllerV2 extends BasicController {
* @throws IOException
*/
- @RequestMapping(value = "/hive/{database}", method = { RequestMethod.GET }, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/hive/{database}", method = { RequestMethod.GET }, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
- private EnvelopeResponse showHiveTablesV2(@RequestHeader("Accept-Language") String lang,
- @PathVariable String database) throws Exception {
+ private EnvelopeResponse showHiveTablesV2(@RequestHeader("Accept-Language") String lang, @PathVariable String database) throws Exception {
MsgPicker.setMsg(lang);
return new EnvelopeResponse(ResponseCode.CODE_SUCCESS, tableService.getHiveTableNames(database), "");
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/controller2/UserControllerV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller2/UserControllerV2.java b/server-base/src/main/java/org/apache/kylin/rest/controller2/UserControllerV2.java
index 1c8cf7d..ebf8b36 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller2/UserControllerV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller2/UserControllerV2.java
@@ -57,8 +57,7 @@ public class UserControllerV2 extends BasicController {
@Qualifier("userService")
UserService userService;
- @RequestMapping(value = "/authentication", method = RequestMethod.POST, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/authentication", method = RequestMethod.POST, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
public EnvelopeResponse authenticateV2(@RequestHeader("Accept-Language") String lang) {
EnvelopeResponse response = authenticatedUserV2(lang);
@@ -66,8 +65,7 @@ public class UserControllerV2 extends BasicController {
return response;
}
- @RequestMapping(value = "/authentication", method = RequestMethod.GET, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/authentication", method = RequestMethod.GET, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
public EnvelopeResponse authenticatedUserV2(@RequestHeader("Accept-Language") String lang) {
MsgPicker.setMsg(lang);
@@ -94,8 +92,7 @@ public class UserControllerV2 extends BasicController {
throw new BadRequestException(msg.getAUTH_INFO_NOT_FOUND());
}
- @RequestMapping(value = "/authentication/authorities", method = RequestMethod.GET, produces = {
- "application/vnd.apache.kylin-v2+json" })
+ @RequestMapping(value = "/authentication/authorities", method = RequestMethod.GET, produces = { "application/vnd.apache.kylin-v2+json" })
@ResponseBody
public EnvelopeResponse getAuthoritiesV2(@RequestHeader("Accept-Language") String lang) throws IOException {
MsgPicker.setMsg(lang);
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/exception/BadRequestException.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/exception/BadRequestException.java b/server-base/src/main/java/org/apache/kylin/rest/exception/BadRequestException.java
index ec6006a..53d619a 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/exception/BadRequestException.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/exception/BadRequestException.java
@@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
*/
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
public class BadRequestException extends RuntimeException {
-
+
private static final long serialVersionUID = -6798154278095441848L;
private String code;
@@ -51,6 +51,7 @@ public class BadRequestException extends RuntimeException {
this.code = code;
}
+
public String getCode() {
return code;
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/init/InitialTaskManager.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/init/InitialTaskManager.java b/server-base/src/main/java/org/apache/kylin/rest/init/InitialTaskManager.java
index 77a16a9..8bba674 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/init/InitialTaskManager.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/init/InitialTaskManager.java
@@ -42,7 +42,7 @@ public class InitialTaskManager implements InitializingBean {
private void runInitialTasks() {
// init metrics system for kylin
QueryMetricsFacade.init();
-
+
KylinConfig kylinConfig = KylinConfig.getInstanceFromEnv();
String initTasks = kylinConfig.getInitTasks();
if (!StringUtils.isEmpty(initTasks)) {
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java b/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java
index 8670c25..64fcbc8 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java
@@ -18,10 +18,6 @@
package org.apache.kylin.rest.job;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
@@ -43,6 +39,10 @@ import org.apache.kylin.storage.hybrid.HybridManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* 1. Create new HybridCube
* bin/kylin.sh org.apache.kylin.tool.HybridCubeCLI -action create -name hybrid_name -project project_name -model model_name -cubes cube1,cube2
@@ -55,21 +55,15 @@ public class HybridCubeCLI extends AbstractApplication {
private static final Logger logger = LoggerFactory.getLogger(HybridCubeCLI.class);
- private static final Option OPTION_ACTION = OptionBuilder.withArgName("action").hasArg().isRequired(true)
- .withDescription("create/update/delete").create("action");
+ private static final Option OPTION_ACTION = OptionBuilder.withArgName("action").hasArg().isRequired(true).withDescription("create/update/delete").create("action");
- private static final Option OPTION_HYBRID_NAME = OptionBuilder.withArgName("name").hasArg().isRequired(true)
- .withDescription("HybridCube name").create("name");
+ private static final Option OPTION_HYBRID_NAME = OptionBuilder.withArgName("name").hasArg().isRequired(true).withDescription("HybridCube name").create("name");
- private static final Option OPTION_PROJECT = OptionBuilder.withArgName("project").hasArg().isRequired(true)
- .withDescription("the target project for the hybrid cube").create("project");
+ private static final Option OPTION_PROJECT = OptionBuilder.withArgName("project").hasArg().isRequired(true).withDescription("the target project for the hybrid cube").create("project");
- private static final Option OPTION_MODEL = OptionBuilder.withArgName("model").hasArg().isRequired(true)
- .withDescription("the target model for the hybrid cube").create("model");
+ private static final Option OPTION_MODEL = OptionBuilder.withArgName("model").hasArg().isRequired(true).withDescription("the target model for the hybrid cube").create("model");
- private static final Option OPTION_CUBES = OptionBuilder.withArgName("cubes").hasArg().isRequired(false)
- .withDescription("the cubes used in HybridCube, seperated by comma, empty if to delete HybridCube")
- .create("cubes");
+ private static final Option OPTION_CUBES = OptionBuilder.withArgName("cubes").hasArg().isRequired(false).withDescription("the cubes used in HybridCube, seperated by comma, empty if to delete HybridCube").create("cubes");
private final Options options;
@@ -158,32 +152,27 @@ public class HybridCubeCLI extends AbstractApplication {
}
- private HybridInstance create(String hybridName, List<RealizationEntry> realizationEntries, String projectName,
- String owner) throws IOException {
+ private HybridInstance create(String hybridName, List<RealizationEntry> realizationEntries, String projectName, String owner) throws IOException {
checkSegmentOffset(realizationEntries);
HybridInstance hybridInstance = HybridInstance.create(kylinConfig, hybridName, realizationEntries);
store.putResource(hybridInstance.getResourcePath(), hybridInstance, HybridManager.HYBRID_SERIALIZER);
- ProjectManager.getInstance(kylinConfig).moveRealizationToProject(RealizationType.HYBRID,
- hybridInstance.getName(), projectName, owner);
+ ProjectManager.getInstance(kylinConfig).moveRealizationToProject(RealizationType.HYBRID, hybridInstance.getName(), projectName, owner);
hybridManager.reloadHybridInstance(hybridName);
logger.info("HybridInstance was created at: " + hybridInstance.getResourcePath());
return hybridInstance;
}
- private void update(HybridInstance hybridInstance, List<RealizationEntry> realizationEntries, String projectName,
- String owner) throws IOException {
+ private void update(HybridInstance hybridInstance, List<RealizationEntry> realizationEntries, String projectName, String owner) throws IOException {
checkSegmentOffset(realizationEntries);
hybridInstance.setRealizationEntries(realizationEntries);
store.putResource(hybridInstance.getResourcePath(), hybridInstance, HybridManager.HYBRID_SERIALIZER);
- ProjectManager.getInstance(kylinConfig).moveRealizationToProject(RealizationType.HYBRID,
- hybridInstance.getName(), projectName, owner);
+ ProjectManager.getInstance(kylinConfig).moveRealizationToProject(RealizationType.HYBRID, hybridInstance.getName(), projectName, owner);
hybridManager.reloadHybridInstance(hybridInstance.getName());
logger.info("HybridInstance was updated at: " + hybridInstance.getResourcePath());
}
private void delete(HybridInstance hybridInstance) throws IOException {
- ProjectManager.getInstance(kylinConfig).removeRealizationsFromProjects(RealizationType.HYBRID,
- hybridInstance.getName());
+ ProjectManager.getInstance(kylinConfig).removeRealizationsFromProjects(RealizationType.HYBRID, hybridInstance.getName());
store.deleteResource(hybridInstance.getResourcePath());
hybridManager.reloadAllHybridInstance();
logger.info("HybridInstance was deleted at: " + hybridInstance.getResourcePath());
@@ -208,8 +197,7 @@ public class HybridCubeCLI extends AbstractApplication {
lastOffset = segment.getSourceOffsetEnd();
} else {
if (lastOffset > segment.getSourceOffsetStart()) {
- throw new RuntimeException("Segments has overlap, could not hybrid. Last Segment End: " + lastOffset
- + ", Next Segment Start: " + segment.getSourceOffsetStart());
+ throw new RuntimeException("Segments has overlap, could not hybrid. Last Segment End: " + lastOffset + ", Next Segment Start: " + segment.getSourceOffsetStart());
}
lastOffset = segment.getSourceOffsetEnd();
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java b/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java
index f85789b..d92107b 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/job/StorageCleanupJob.java
@@ -57,8 +57,8 @@ import org.apache.kylin.job.execution.AbstractExecutable;
import org.apache.kylin.job.execution.ExecutableManager;
import org.apache.kylin.job.execution.ExecutableState;
import org.apache.kylin.metadata.realization.IRealizationConstants;
-import org.apache.kylin.source.ISourceMetadataExplorer;
import org.apache.kylin.source.SourceFactory;
+import org.apache.kylin.source.ISourceMetadataExplorer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -69,18 +69,15 @@ import com.google.common.collect.Maps;
public class StorageCleanupJob extends AbstractApplication {
@SuppressWarnings("static-access")
- protected static final Option OPTION_DELETE = OptionBuilder.withArgName("delete").hasArg().isRequired(false)
- .withDescription("Delete the unused storage").create("delete");
- protected static final Option OPTION_FORCE = OptionBuilder.withArgName("force").hasArg().isRequired(false)
- .withDescription("Warning: will delete all kylin intermediate hive tables").create("force");
+ protected static final Option OPTION_DELETE = OptionBuilder.withArgName("delete").hasArg().isRequired(false).withDescription("Delete the unused storage").create("delete");
+ protected static final Option OPTION_FORCE = OptionBuilder.withArgName("force").hasArg().isRequired(false).withDescription("Warning: will delete all kylin intermediate hive tables").create("force");
protected static final Logger logger = LoggerFactory.getLogger(StorageCleanupJob.class);
public static final int deleteTimeout = 10; // Unit minute
protected boolean delete = false;
protected boolean force = false;
- protected static ExecutableManager executableManager = ExecutableManager
- .getInstance(KylinConfig.getInstanceFromEnv());
+ protected static ExecutableManager executableManager = ExecutableManager.getInstance(KylinConfig.getInstanceFromEnv());
private void cleanUnusedHBaseTables(Configuration conf) throws IOException {
CubeManager cubeMgr = CubeManager.getInstance(KylinConfig.getInstanceFromEnv());
@@ -103,8 +100,7 @@ public class StorageCleanupJob extends AbstractApplication {
String tablename = seg.getStorageLocationIdentifier();
if (allTablesNeedToBeDropped.contains(tablename)) {
allTablesNeedToBeDropped.remove(tablename);
- logger.info("Exclude table " + tablename + " from drop list, as the table belongs to cube "
- + cube.getName() + " with status " + cube.getStatus());
+ logger.info("Exclude table " + tablename + " from drop list, as the table belongs to cube " + cube.getName() + " with status " + cube.getStatus());
}
}
}
@@ -118,8 +114,7 @@ public class StorageCleanupJob extends AbstractApplication {
try {
futureTask.get(deleteTimeout, TimeUnit.MINUTES);
} catch (TimeoutException e) {
- logger.warn("It fails to delete htable " + htableName + ", for it cost more than "
- + deleteTimeout + " minutes!");
+ logger.warn("It fails to delete htable " + htableName + ", for it cost more than " + deleteTimeout + " minutes!");
futureTask.cancel(true);
} catch (Exception e) {
e.printStackTrace();
@@ -213,8 +208,7 @@ public class StorageCleanupJob extends AbstractApplication {
if (!state.isFinalState()) {
String path = JobBuilderSupport.getJobWorkingDir(engineConfig.getHdfsWorkingDirectory(), jobId);
allHdfsPathsNeedToBeDeleted.remove(path);
- logger.info("Skip " + path + " from deletion list, as the path belongs to job " + jobId
- + " with status " + state);
+ logger.info("Skip " + path + " from deletion list, as the path belongs to job " + jobId + " with status " + state);
}
}
@@ -225,8 +219,7 @@ public class StorageCleanupJob extends AbstractApplication {
if (jobUuid != null && jobUuid.equals("") == false) {
String path = JobBuilderSupport.getJobWorkingDir(engineConfig.getHdfsWorkingDirectory(), jobUuid);
allHdfsPathsNeedToBeDeleted.remove(path);
- logger.info("Skip " + path + " from deletion list, as the path belongs to segment " + seg
- + " of cube " + cube.getName());
+ logger.info("Skip " + path + " from deletion list, as the path belongs to segment " + seg + " of cube " + cube.getName());
}
}
}
@@ -352,21 +345,17 @@ public class StorageCleanupJob extends AbstractApplication {
String segmentId = uuid.replace("_", "-");
if (segmentId2JobId.containsKey(segmentId)) {
- String path = JobBuilderSupport.getJobWorkingDir(engineConfig.getHdfsWorkingDirectory(),
- segmentId2JobId.get(segmentId)) + "/" + tableToDelete;
+ String path = JobBuilderSupport.getJobWorkingDir(engineConfig.getHdfsWorkingDirectory(), segmentId2JobId.get(segmentId)) + "/" + tableToDelete;
Path externalDataPath = new Path(path);
FileSystem fs = HadoopUtil.getWorkingFileSystem();
if (fs.exists(externalDataPath)) {
fs.delete(externalDataPath, true);
logger.info("Hive table {}'s external path {} deleted", tableToDelete, path);
} else {
- logger.info(
- "Hive table {}'s external path {} not exist. It's normal if kylin.source.hive.keep-flat-table set false (By default)",
- tableToDelete, path);
+ logger.info("Hive table {}'s external path {} not exist. It's normal if kylin.source.hive.keep-flat-table set false (By default)", tableToDelete, path);
}
} else {
- logger.warn("Hive table {}'s job ID not found, segmentId2JobId: {}", tableToDelete,
- segmentId2JobId.toString());
+ logger.warn("Hive table {}'s job ID not found, segmentId2JobId: {}", tableToDelete, segmentId2JobId.toString());
}
}
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetrics.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetrics.java b/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetrics.java
index 74857a3..eb1bed6 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetrics.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetrics.java
@@ -18,15 +18,15 @@
package org.apache.kylin.rest.metrics;
-import javax.annotation.concurrent.ThreadSafe;
-
import org.apache.hadoop.metrics2.annotation.Metric;
import org.apache.hadoop.metrics2.annotation.Metrics;
-import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
import org.apache.hadoop.metrics2.lib.MetricsRegistry;
import org.apache.hadoop.metrics2.lib.MutableCounterLong;
import org.apache.hadoop.metrics2.lib.MutableQuantiles;
import org.apache.hadoop.metrics2.lib.MutableRate;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
+
+import javax.annotation.concurrent.ThreadSafe;
/**
* properties and methods about query.
@@ -69,14 +69,10 @@ public class QueryMetrics {
for (int i = 0; i < intervals.length; i++) {
int interval = intervals[i];
- queryLatencyTimeMillisQuantiles[i] = registry.newQuantiles("QueryLatency" + interval + "s",
- "Query queue time in milli second", "ops", "", interval);
- scanRowCountQuantiles[i] = registry.newQuantiles("ScanRowCount" + interval + "s",
- "Scan row count in milli second", "ops", "", interval);
- resultRowCountQuantiles[i] = registry.newQuantiles("ResultRowCount" + interval + "s",
- "Result row count in milli second", "ops", "", interval);
- cacheHitCountQuantiles[i] = registry.newQuantiles("CacheHitCount" + interval + "s",
- "Cache Hit Count in milli second", "ops", "", interval);
+ queryLatencyTimeMillisQuantiles[i] = registry.newQuantiles("QueryLatency" + interval + "s", "Query queue time in milli second", "ops", "", interval);
+ scanRowCountQuantiles[i] = registry.newQuantiles("ScanRowCount" + interval + "s", "Scan row count in milli second", "ops", "", interval);
+ resultRowCountQuantiles[i] = registry.newQuantiles("ResultRowCount" + interval + "s", "Result row count in milli second", "ops", "", interval);
+ cacheHitCountQuantiles[i] = registry.newQuantiles("CacheHitCount" + interval + "s", "Cache Hit Count in milli second", "ops", "", interval);
}
queryLatency = registry.newRate("QueryLatency", "", true);
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetricsFacade.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetricsFacade.java b/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetricsFacade.java
index 37003f8..48a8e58 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetricsFacade.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetricsFacade.java
@@ -18,10 +18,6 @@
package org.apache.kylin.rest.metrics;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.annotation.concurrent.ThreadSafe;
-
import org.apache.hadoop.metrics2.MetricsException;
import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
import org.apache.kylin.common.KylinConfig;
@@ -30,6 +26,9 @@ import org.apache.kylin.rest.response.SQLResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.annotation.concurrent.ThreadSafe;
+import java.util.concurrent.ConcurrentHashMap;
+
/**
* The entrance of metrics features.
*/
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/msg/CnMessage.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/msg/CnMessage.java b/server-base/src/main/java/org/apache/kylin/rest/msg/CnMessage.java
index a9f7807..53cbaba 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/msg/CnMessage.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/msg/CnMessage.java
@@ -21,7 +21,7 @@ package org.apache.kylin.rest.msg;
/**
* Created by luwei on 17-4-12.
*/
-public class CnMessage extends Message {
+public class CnMessage extends Message{
private static CnMessage instance = null;
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/request/HiveTableRequestV2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/request/HiveTableRequestV2.java b/server-base/src/main/java/org/apache/kylin/rest/request/HiveTableRequestV2.java
index 8f46816..f043d15 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/request/HiveTableRequestV2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/request/HiveTableRequestV2.java
@@ -32,6 +32,7 @@ public class HiveTableRequestV2 {
private boolean needProfile = true;
+
public String[] getTables() {
return tables;
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java b/server-base/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java
index 16316c8..6e9117d 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java
@@ -18,10 +18,10 @@
package org.apache.kylin.rest.request;
-import java.util.Map;
-
import com.google.common.collect.Maps;
+import java.util.Map;
+
public class JobBuildRequest2 {
private long sourceOffsetStart;
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java b/server-base/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java
index 50db98a..e296248 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java
@@ -41,7 +41,7 @@ public class PrepareSqlRequest extends SQLRequest {
this.params = params;
}
- public static class StateParam implements Serializable {
+ public static class StateParam implements Serializable{
private String className;
private String value;
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java b/server-base/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java
index 64e5f82..508a35f 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java
@@ -38,7 +38,7 @@ public class ErrorResponse extends EnvelopeResponse {
public ErrorResponse(String url, Exception exception) {
super();
-
+
this.url = url;
this.exception = exception.getLocalizedMessage();
this.msg = exception.getLocalizedMessage();
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/response/SQLResponse.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/response/SQLResponse.java b/server-base/src/main/java/org/apache/kylin/rest/response/SQLResponse.java
index 10972ad..d841dee 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/response/SQLResponse.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/response/SQLResponse.java
@@ -66,8 +66,7 @@ public class SQLResponse implements Serializable {
public SQLResponse() {
}
- public SQLResponse(List<SelectedColumnMeta> columnMetas, List<List<String>> results, int affectedRowCount,
- boolean isException, String exceptionMessage) {
+ public SQLResponse(List<SelectedColumnMeta> columnMetas, List<List<String>> results, int affectedRowCount, boolean isException, String exceptionMessage) {
this.columnMetas = columnMetas;
this.results = results;
this.affectedRowCount = affectedRowCount;
@@ -75,8 +74,7 @@ public class SQLResponse implements Serializable {
this.exceptionMessage = exceptionMessage;
}
- public SQLResponse(List<SelectedColumnMeta> columnMetas, List<List<String>> results, String cube,
- int affectedRowCount, boolean isException, String exceptionMessage) {
+ public SQLResponse(List<SelectedColumnMeta> columnMetas, List<List<String>> results, String cube, int affectedRowCount, boolean isException, String exceptionMessage) {
this.columnMetas = columnMetas;
this.results = results;
this.cube = cube;
@@ -85,8 +83,7 @@ public class SQLResponse implements Serializable {
this.exceptionMessage = exceptionMessage;
}
- public SQLResponse(List<SelectedColumnMeta> columnMetas, List<List<String>> results, String cube,
- int affectedRowCount, boolean isException, String exceptionMessage, boolean isPartial, boolean isAdhoc) {
+ public SQLResponse(List<SelectedColumnMeta> columnMetas, List<List<String>> results, String cube, int affectedRowCount, boolean isException, String exceptionMessage, boolean isPartial, boolean isAdhoc) {
this.columnMetas = columnMetas;
this.results = results;
this.cube = cube;
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java b/server-base/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java
index 7100bd6..b595c72 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.client.Table;
/**
*/
-@Deprecated //use ResourceStore interface instead.
+@Deprecated //use ResourceStore interface instead.
public interface AclHBaseStorage {
String ACL_INFO_FAMILY = "i";
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java b/server-base/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java
index 73cd7ed..592791c 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java
@@ -47,8 +47,7 @@ public class AuthoritiesPopulator extends DefaultLdapAuthoritiesPopulator {
* @param contextSource
* @param groupSearchBase
*/
- public AuthoritiesPopulator(ContextSource contextSource, String groupSearchBase, String adminRole,
- String defaultRole) {
+ public AuthoritiesPopulator(ContextSource contextSource, String groupSearchBase, String adminRole, String defaultRole) {
super(contextSource, groupSearchBase);
this.adminRoleAsAuthority = new SimpleGrantedAuthority(adminRole);
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java b/server-base/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java
index 539836e..7d9d9ac 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java
@@ -52,14 +52,11 @@ public class CrossDomainFilter implements Filter {
* javax.servlet.ServletResponse, javax.servlet.FilterChain)
*/
@Override
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
- throws IOException, ServletException {
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if (KylinConfig.getInstanceFromEnv().isWebCrossDomainEnabled()) {
((HttpServletResponse) response).addHeader("Access-Control-Allow-Origin", "*");
- ((HttpServletResponse) response).addHeader("Access-Control-Allow-Methods",
- "GET, POST, PUT, DELETE, OPTIONS");
- ((HttpServletResponse) response).addHeader("Access-Control-Allow-Headers",
- "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With, Accept, Authorization");
+ ((HttpServletResponse) response).addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
+ ((HttpServletResponse) response).addHeader("Access-Control-Allow-Headers", "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With, Accept, Authorization");
}
chain.doFilter(request, response);
http://git-wip-us.apache.org/repos/asf/kylin/blob/19585846/server-base/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java b/server-base/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java
index efc5196..dc475c9 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java
@@ -18,6 +18,8 @@
package org.apache.kylin.rest.security;
+import com.google.common.hash.HashFunction;
+import com.google.common.hash.Hashing;
import org.apache.kylin.common.util.ByteArray;
import org.apache.kylin.rest.service.UserService;
import org.slf4j.Logger;
@@ -33,9 +35,6 @@ import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.util.Assert;
-import com.google.common.hash.HashFunction;
-import com.google.common.hash.Hashing;
-
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
@@ -92,8 +91,7 @@ public class KylinAuthenticationProvider implements AuthenticationProvider {
if (authed.getDetails() == null) {
//authed.setAuthenticated(false);
- throw new UsernameNotFoundException(
- "User not found in LDAP, check whether he/she has been added to the groups.");
+ throw new UsernameNotFoundException("User not found in LDAP, check whether he/she has been added to the groups.");
}
if (authed.getDetails() instanceof UserDetails) {