You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@griffin.apache.org by gu...@apache.org on 2017/10/16 02:20:25 UTC
incubator-griffin git commit: update several coding style
Repository: incubator-griffin
Updated Branches:
refs/heads/master 982da9945 -> 65b8efad3
update several coding style
Author: ahutsunshine <ah...@gmail.com>
Closes #140 from ahutsunshine/master.
Project: http://git-wip-us.apache.org/repos/asf/incubator-griffin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-griffin/commit/65b8efad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-griffin/tree/65b8efad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-griffin/diff/65b8efad
Branch: refs/heads/master
Commit: 65b8efad3c5760e4afbfe870a098bbb81391e33f
Parents: 982da99
Author: ahutsunshine <ah...@gmail.com>
Authored: Mon Oct 16 10:20:24 2017 +0800
Committer: Lionel Liu <bh...@163.com>
Committed: Mon Oct 16 10:20:24 2017 +0800
----------------------------------------------------------------------
.../apache/griffin/core/job/JobServiceImpl.java | 6 +-
.../apache/griffin/core/job/SparkSubmitJob.java | 14 ++-
.../griffin/core/job/entity/JobInstance.java | 6 +-
.../griffin/core/job/entity/JobRequestBody.java | 21 ++--
.../griffin/core/job/repo/JobInstanceRepo.java | 5 +-
.../core/measure/MeasureServiceImpl.java | 4 +-
.../measure/entity/AbstractAuditableEntity.java | 100 +++++++++++++++++++
.../core/measure/entity/AuditableEntity.java | 96 ------------------
.../core/measure/entity/DataConnector.java | 2 +-
.../griffin/core/measure/entity/DataSource.java | 2 +-
.../core/measure/entity/EvaluateRule.java | 2 +-
.../griffin/core/measure/entity/Measure.java | 2 +-
.../griffin/core/measure/entity/Rule.java | 4 +-
.../hive/HiveMetaStoreServiceImpl.java | 8 +-
.../metastore/kafka/KafkaSchemaServiceImpl.java | 4 +-
15 files changed, 149 insertions(+), 127 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java b/service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java
index a31ed03..95a294e 100644
--- a/service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java
+++ b/service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java
@@ -253,14 +253,14 @@ public class JobServiceImpl implements JobService {
*
* @param measure
*/
- //TODO
public void deleteJobsRelateToMeasure(Measure measure) throws SchedulerException {
Scheduler scheduler = factory.getObject();
- for (JobKey jobKey : scheduler.getJobKeys(GroupMatcher.anyGroup())) {//get all jobs
+ //get all jobs
+ for (JobKey jobKey : scheduler.getJobKeys(GroupMatcher.anyGroup())) {
JobDetail jobDetail = scheduler.getJobDetail(jobKey);
JobDataMap jobDataMap = jobDetail.getJobDataMap();
if (jobDataMap.getString("measureId").equals(measure.getId().toString())) {
- //select jobs related to measureId,
+ //select jobs related to measureId
deleteJob(jobKey.getGroup(), jobKey.getName());
LOGGER.info("{} {} is paused and logically deleted.", jobKey.getGroup(), jobKey.getName());
}
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/job/SparkSubmitJob.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/job/SparkSubmitJob.java b/service/src/main/java/org/apache/griffin/core/job/SparkSubmitJob.java
index a6d7487..fd51e3a 100644
--- a/service/src/main/java/org/apache/griffin/core/job/SparkSubmitJob.java
+++ b/service/src/main/java/org/apache/griffin/core/job/SparkSubmitJob.java
@@ -92,10 +92,12 @@ public class SparkSubmitJob implements Job {
long currentBlockStartTimestamp = setCurrentBlockStartTimestamp(System.currentTimeMillis());
LOGGER.info("currentBlockStartTimestamp: {}", currentBlockStartTimestamp);
try {
- if (StringUtils.isNotEmpty(sourcePattern))
+ if (StringUtils.isNotEmpty(sourcePattern)) {
setAllDataConnectorPartitions(measure.getDataSources(), sourcePattern.split("-"), partitionItems, "source", currentBlockStartTimestamp);
- if (StringUtils.isNotEmpty(targetPattern))
+ }
+ if (StringUtils.isNotEmpty(targetPattern)) {
setAllDataConnectorPartitions(measure.getDataSources(), targetPattern.split("-"), partitionItems, "target", currentBlockStartTimestamp);
+ }
} catch (Exception e) {
LOGGER.error("Can not execute job.Set partitions error. {}", e.getMessage());
return;
@@ -140,8 +142,9 @@ public class SparkSubmitJob implements Job {
}
private void setAllDataConnectorPartitions(List<DataSource> sources, String[] patternItemSet, String[] partitionItems, String sourceName, long timestamp) {
- if (sources == null)
+ if (sources == null) {
return;
+ }
for (DataSource dataSource : sources) {
setDataSourcePartitions(dataSource, patternItemSet, partitionItems, sourceName, timestamp);
}
@@ -150,8 +153,9 @@ public class SparkSubmitJob implements Job {
private void setDataSourcePartitions(DataSource dataSource, String[] patternItemSet, String[] partitionItems, String sourceName, long timestamp) {
String name = dataSource.getName();
for (DataConnector dataConnector : dataSource.getConnectors()) {
- if (sourceName.equals(name))
+ if (sourceName.equals(name)) {
setDataConnectorPartitions(dataConnector, patternItemSet, partitionItems, timestamp);
+ }
}
}
@@ -226,7 +230,7 @@ public class SparkSubmitJob implements Job {
// measure
String measureJson;
measureJson = GriffinUtil.toJson(measure);
- args.add(measureJson); //partition
+ args.add(measureJson);
args.add(sparkJobProps.getProperty("sparkJob.args_3"));
sparkJobDO.setArgs(args);
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/job/entity/JobInstance.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/job/entity/JobInstance.java b/service/src/main/java/org/apache/griffin/core/job/entity/JobInstance.java
index 4521999..2cb5949 100644
--- a/service/src/main/java/org/apache/griffin/core/job/entity/JobInstance.java
+++ b/service/src/main/java/org/apache/griffin/core/job/entity/JobInstance.java
@@ -20,12 +20,12 @@ under the License.
package org.apache.griffin.core.job.entity;
import org.apache.griffin.core.job.entity.LivySessionStates.State;
-import org.apache.griffin.core.measure.entity.AuditableEntity;
+import org.apache.griffin.core.measure.entity.AbstractAuditableEntity;
import javax.persistence.*;
@Entity
-public class JobInstance extends AuditableEntity {
+public class JobInstance extends AbstractAuditableEntity {
private static final long serialVersionUID = -4748881017029815874L;
@@ -36,7 +36,7 @@ public class JobInstance extends AuditableEntity {
private State state;
private String appId;
@Lob
- @Column(length = 1024) //2^10=1024
+ @Column(length = 1024)
private String appUri;
private long timestamp;
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/job/entity/JobRequestBody.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/job/entity/JobRequestBody.java b/service/src/main/java/org/apache/griffin/core/job/entity/JobRequestBody.java
index dd28bf1..0d0ea40 100644
--- a/service/src/main/java/org/apache/griffin/core/job/entity/JobRequestBody.java
+++ b/service/src/main/java/org/apache/griffin/core/job/entity/JobRequestBody.java
@@ -78,18 +78,27 @@ public class JobRequestBody {
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
JobRequestBody that = (JobRequestBody) o;
- if (sourcePattern != null ? !sourcePattern.equals(that.sourcePattern) : that.sourcePattern != null)
+ if (sourcePattern != null ? !sourcePattern.equals(that.sourcePattern) : that.sourcePattern != null) {
+ return false;
+ }
+ if (targetPattern != null ? !targetPattern.equals(that.targetPattern) : that.targetPattern != null) {
return false;
- if (targetPattern != null ? !targetPattern.equals(that.targetPattern) : that.targetPattern != null)
+ }
+ if (blockStartTimestamp != null ? !blockStartTimestamp.equals(that.blockStartTimestamp) : that.blockStartTimestamp != null) {
return false;
- if (blockStartTimestamp != null ? !blockStartTimestamp.equals(that.blockStartTimestamp) : that.blockStartTimestamp != null)
+ }
+ if (jobStartTime != null ? !jobStartTime.equals(that.jobStartTime) : that.jobStartTime != null){
return false;
- if (jobStartTime != null ? !jobStartTime.equals(that.jobStartTime) : that.jobStartTime != null) return false;
+ }
return interval != null ? interval.equals(that.interval) : that.interval == null;
}
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/job/repo/JobInstanceRepo.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/job/repo/JobInstanceRepo.java b/service/src/main/java/org/apache/griffin/core/job/repo/JobInstanceRepo.java
index d07b2b7..3cbc139 100644
--- a/service/src/main/java/org/apache/griffin/core/job/repo/JobInstanceRepo.java
+++ b/service/src/main/java/org/apache/griffin/core/job/repo/JobInstanceRepo.java
@@ -39,8 +39,7 @@ public interface JobInstanceRepo extends CrudRepository<JobInstance, Long> {
* the prototype job is determined by SCHED_NAME, group name and job name in table QRTZ_JOB_DETAILS.
*/
@Query("select s from JobInstance s " +
- "where s.groupName= ?1 and s.jobName=?2 "/*+
- "order by s.timestamp desc"*/)
+ "where s.groupName= ?1 and s.jobName=?2 ")
List<JobInstance> findByGroupNameAndJobName(String group, String name, Pageable pageable);
@Query("select s from JobInstance s " +
@@ -58,6 +57,6 @@ public interface JobInstanceRepo extends CrudRepository<JobInstance, Long> {
@Modifying
@Query("update JobInstance s " +
"set s.state= ?2, s.appId= ?3, s.appUri= ?4 where s.id= ?1")
- void update(Long Id, LivySessionStates.State state, String appId, String appUri);
+ void update(Long id, LivySessionStates.State state, String appId, String appUri);
}
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/measure/MeasureServiceImpl.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/measure/MeasureServiceImpl.java b/service/src/main/java/org/apache/griffin/core/measure/MeasureServiceImpl.java
index dd97336..ec09f2a 100644
--- a/service/src/main/java/org/apache/griffin/core/measure/MeasureServiceImpl.java
+++ b/service/src/main/java/org/apache/griffin/core/measure/MeasureServiceImpl.java
@@ -81,8 +81,9 @@ public class MeasureServiceImpl implements MeasureService {
List<Measure> aliveMeasureList = measureRepo.findByNameAndDeleted(measure.getName(), false);
if (aliveMeasureList.size() == 0) {
try {
- if (measureRepo.save(measure) != null)
+ if (measureRepo.save(measure) != null) {
return GriffinOperationMessage.CREATE_MEASURE_SUCCESS;
+ }
else {
return GriffinOperationMessage.CREATE_MEASURE_FAIL;
}
@@ -109,6 +110,7 @@ public class MeasureServiceImpl implements MeasureService {
return res;
}
+ @Override
public GriffinOperationMessage updateMeasure(@RequestBody Measure measure) {
if (!measureRepo.exists(measure.getId())) {
return GriffinOperationMessage.RESOURCE_NOT_FOUND;
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/measure/entity/AbstractAuditableEntity.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/measure/entity/AbstractAuditableEntity.java b/service/src/main/java/org/apache/griffin/core/measure/entity/AbstractAuditableEntity.java
new file mode 100644
index 0000000..548c4dc
--- /dev/null
+++ b/service/src/main/java/org/apache/griffin/core/measure/entity/AbstractAuditableEntity.java
@@ -0,0 +1,100 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+package org.apache.griffin.core.measure.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.MappedSuperclass;
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+@MappedSuperclass
+public abstract class AbstractAuditableEntity implements Serializable {
+
+// private static final long serialVersionUID = 1L;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private Long id;
+
+ @JsonIgnore
+ Timestamp createdDate = new Timestamp(System.currentTimeMillis());
+
+ @JsonIgnore
+ Timestamp modifiedDate;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Timestamp getCreatedDate() {
+ return createdDate;
+ }
+
+ public void setCreatedDate(Timestamp createdDate) {
+ this.createdDate = createdDate;
+ }
+
+ public Timestamp getModifiedDate() {
+ return modifiedDate;
+ }
+
+ public void setModifiedDate(Timestamp modifiedDate) {
+ this.modifiedDate = modifiedDate;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ AbstractAuditableEntity other = (AbstractAuditableEntity) obj;
+ if (id == null) {
+ if (other.id != null) {
+ return false;
+ }
+ } else if (!id.equals(other.id)) {
+ return false;
+ }
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/measure/entity/AuditableEntity.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/measure/entity/AuditableEntity.java b/service/src/main/java/org/apache/griffin/core/measure/entity/AuditableEntity.java
deleted file mode 100644
index 546bad9..0000000
--- a/service/src/main/java/org/apache/griffin/core/measure/entity/AuditableEntity.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package org.apache.griffin.core.measure.entity;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.MappedSuperclass;
-import java.io.Serializable;
-import java.sql.Timestamp;
-import java.util.Date;
-
-@MappedSuperclass
-public abstract class AuditableEntity implements Serializable {
-
-// private static final long serialVersionUID = 1L;
-
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long id;
-
- @JsonIgnore
- Timestamp createdDate = new Timestamp(new Date().getTime());
-
- @JsonIgnore
- Timestamp modifiedDate;
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public Timestamp getCreatedDate() {
- return createdDate;
- }
-
- public void setCreatedDate(Timestamp createdDate) {
- this.createdDate = createdDate;
- }
-
- public Timestamp getModifiedDate() {
- return modifiedDate;
- }
-
- public void setModifiedDate(Timestamp modifiedDate) {
- this.modifiedDate = modifiedDate;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- AuditableEntity other = (AuditableEntity) obj;
- if (id == null) {
- if (other.id != null)
- return false;
- } else if (!id.equals(other.id))
- return false;
- return true;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/measure/entity/DataConnector.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/measure/entity/DataConnector.java b/service/src/main/java/org/apache/griffin/core/measure/entity/DataConnector.java
index 300c04e..59f611d 100644
--- a/service/src/main/java/org/apache/griffin/core/measure/entity/DataConnector.java
+++ b/service/src/main/java/org/apache/griffin/core/measure/entity/DataConnector.java
@@ -32,7 +32,7 @@ import java.io.IOException;
import java.util.Map;
@Entity
-public class DataConnector extends AuditableEntity {
+public class DataConnector extends AbstractAuditableEntity {
private static final long serialVersionUID = -4748881017029815594L;
private final static Logger LOGGER = LoggerFactory.getLogger(DataConnector.class);
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/measure/entity/DataSource.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/measure/entity/DataSource.java b/service/src/main/java/org/apache/griffin/core/measure/entity/DataSource.java
index 18d8fc7..e967374 100644
--- a/service/src/main/java/org/apache/griffin/core/measure/entity/DataSource.java
+++ b/service/src/main/java/org/apache/griffin/core/measure/entity/DataSource.java
@@ -24,7 +24,7 @@ import javax.persistence.*;
import java.util.List;
@Entity
-public class DataSource extends AuditableEntity {
+public class DataSource extends AbstractAuditableEntity {
private static final long serialVersionUID = -4748881017079815794L;
private String name;
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java b/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java
index e114537..8ef5294 100644
--- a/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java
+++ b/service/src/main/java/org/apache/griffin/core/measure/entity/EvaluateRule.java
@@ -28,7 +28,7 @@ import java.util.List;
@Entity
-public class EvaluateRule extends AuditableEntity {
+public class EvaluateRule extends AbstractAuditableEntity {
private static final long serialVersionUID = 4240072518233967528L;
@OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.REMOVE})
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/measure/entity/Measure.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/measure/entity/Measure.java b/service/src/main/java/org/apache/griffin/core/measure/entity/Measure.java
index 18ce2e2..98460d5 100644
--- a/service/src/main/java/org/apache/griffin/core/measure/entity/Measure.java
+++ b/service/src/main/java/org/apache/griffin/core/measure/entity/Measure.java
@@ -25,7 +25,7 @@ import javax.persistence.*;
import java.util.List;
@Entity
-public class Measure extends AuditableEntity {
+public class Measure extends AbstractAuditableEntity {
private static final long serialVersionUID = -4748881017029815714L;
private String name;
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/measure/entity/Rule.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/measure/entity/Rule.java b/service/src/main/java/org/apache/griffin/core/measure/entity/Rule.java
index ca24073..ebc35d3 100644
--- a/service/src/main/java/org/apache/griffin/core/measure/entity/Rule.java
+++ b/service/src/main/java/org/apache/griffin/core/measure/entity/Rule.java
@@ -26,9 +26,9 @@ import javax.persistence.Entity;
@Entity
-public class Rule extends AuditableEntity {
+public class Rule extends AbstractAuditableEntity {
- //three type:1.griffin-dsl 2.df-opr 3.spark-sql
+ /**three type:1.griffin-dsl 2.df-opr 3.spark-sql**/
private String dslType;
private String dqType;
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/metastore/hive/HiveMetaStoreServiceImpl.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/metastore/hive/HiveMetaStoreServiceImpl.java b/service/src/main/java/org/apache/griffin/core/metastore/hive/HiveMetaStoreServiceImpl.java
index 1386000..db57e9b 100644
--- a/service/src/main/java/org/apache/griffin/core/metastore/hive/HiveMetaStoreServiceImpl.java
+++ b/service/src/main/java/org/apache/griffin/core/metastore/hive/HiveMetaStoreServiceImpl.java
@@ -60,10 +60,11 @@ public class HiveMetaStoreServiceImpl implements HiveMetaStoreService {
}
private String getUseDbName(String dbName) {
- if (!StringUtils.hasText(dbName))
+ if (!StringUtils.hasText(dbName)) {
return defaultDbName;
- else
+ } else {
return dbName;
+ }
}
@Override
@@ -108,8 +109,9 @@ public class HiveMetaStoreServiceImpl implements HiveMetaStoreService {
Map<String, List<Table>> results = new HashMap<>();
Iterable<String> dbs = getAllDatabases();
//MetaException happens
- if (dbs == null)
+ if (dbs == null) {
return results;
+ }
for (String db : dbs) {
results.put(db, getTables(db));
}
http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/65b8efad/service/src/main/java/org/apache/griffin/core/metastore/kafka/KafkaSchemaServiceImpl.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/metastore/kafka/KafkaSchemaServiceImpl.java b/service/src/main/java/org/apache/griffin/core/metastore/kafka/KafkaSchemaServiceImpl.java
index 79723ca..c64ee02 100644
--- a/service/src/main/java/org/apache/griffin/core/metastore/kafka/KafkaSchemaServiceImpl.java
+++ b/service/src/main/java/org/apache/griffin/core/metastore/kafka/KafkaSchemaServiceImpl.java
@@ -45,7 +45,9 @@ public class KafkaSchemaServiceImpl implements KafkaSchemaService {
private String registryUrl(final String path) {
if (StringUtils.hasText(path)) {
String usePath = path;
- if (!path.startsWith("/")) usePath = "/" + path;
+ if (!path.startsWith("/")){
+ usePath = "/" + path;
+ }
return this.url + usePath;
}
return "";