fateh288 commented on code in PR #447: URL: https://github.com/apache/ranger/pull/447#discussion_r1881195384
########## tagsync/src/main/java/org/apache/ranger/tagsync/model/AbstractTagSource.java: ########## @@ -25,61 +25,52 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public abstract class AbstractTagSource implements TagSource { - private static final Logger LOG = LoggerFactory.getLogger(AbstractTagSource.class); - private TagSink tagSink; - private String name; +public abstract class AbstractTagSource implements TagSource { + private static final Logger LOG = LoggerFactory.getLogger(AbstractTagSource.class); + private TagSink tagSink; + private String name; - @Override - public void setTagSink(TagSink sink) { - if (sink == null) { - LOG.error("Sink is null!!!"); - } else { - this.tagSink = sink; - } - } + @Override + public void setTagSink(TagSink sink) { + if (sink == null) { + LOG.error("Sink is null!!!"); + } else { + this.tagSink = sink; + } + } - @Override - public void setName(String name) { - this.name = name; - } + @Override + public String getName() { + return name; + } - @Override - public String getName() { - return name; - } + @Override + public void setName(String name) { + this.name = name; + } - @Override - public String toString( ) { - return this.name; - } - - protected void updateSink(final ServiceTags toUpload) throws Exception { - try { - if (toUpload == null) { - if (LOG.isDebugEnabled()) { - LOG.debug("No ServiceTags to upload"); - } - } else { - if (!TagSyncConfig.isTagSyncServiceActive()) { - LOG.error("This TagSync server is not in active state. Cannot commit transaction!"); - throw new RuntimeException("This TagSync server is not in active state. Cannot commit transaction!"); - } - if (LOG.isDebugEnabled()) { - String toUploadJSON = JsonUtils.objectToJson(toUpload); - LOG.debug("Uploading serviceTags=" + toUploadJSON); - } - ServiceTags uploaded = tagSink.upload(toUpload); - if (LOG.isDebugEnabled()) { - String uploadedJSON = JsonUtils.objectToJson(uploaded); - LOG.debug("Uploaded serviceTags=" + uploadedJSON); - } - } - } catch (Exception exception) { - LOG.error("Failed to upload serviceTags: " + JsonUtils.objectToJson(toUpload)); - LOG.error("Exception : ", exception); - throw exception; - } - } + @Override + public String toString() { + return this.name; + } + protected void updateSink(final ServiceTags toUpload) throws Exception { + try { + if (toUpload == null) { + LOG.debug("No ServiceTags to upload"); + } else { + if (!TagSyncConfig.isTagSyncServiceActive()) { + LOG.error("This TagSync server is not in active state. Cannot commit transaction!"); + throw new RuntimeException("This TagSync server is not in active state. Cannot commit transaction!"); + } + LOG.debug("Uploading serviceTags={}", JsonUtils.objectToJson(toUpload)); Review Comment: But this won't be evaluated right ? Is only string substritution done later but these kind of computations passed as params to parameterized string before ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@ranger.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org