yifan-c commented on code in PR #51:
URL: https://github.com/apache/cassandra-sidecar/pull/51#discussion_r1279858353


##########
build.gradle:
##########
@@ -72,11 +77,22 @@ allprojects {
         excludeFilter = file("${project.rootDir}/spotbugs-exclude.xml")
     }
 
-    tasks.withType(com.github.spotbugs.SpotBugsTask) {
+    tasks.withType(SpotBugsTask) {
         reports.xml.enabled = false
         reports.html.enabled = true
     }
 
+    codeCheckTasks.dependsOn(tasks.withType(Checkstyle))
+    codeCheckTasks.dependsOn(tasks.withType(RatTask))
+    codeCheckTasks.dependsOn(tasks.withType(SpotBugsTask))
+
+    tasks.withType(Test) {
+        shouldRunAfter(codeCheckTasks)
+        shouldRunAfter(tasks.withType(Checkstyle))
+        shouldRunAfter(tasks.withType(RatTask))
+        shouldRunAfter(tasks.withType(SpotBugsTask))
+    }
+

Review Comment:
   So, you want to achieve the effect of `check` with `test`? If you run 
`./gradlew check`, it should run test and the checks specified.



##########
common/src/main/java/org/apache/cassandra/sidecar/cluster/InstancesConfigImpl.java:
##########
@@ -75,7 +79,18 @@ public InstanceMetadata instanceFromHost(String host) throws 
NoSuchElementExcept
         InstanceMetadata instanceMetadata = hostToInstanceMetadata.get(host);
         if (instanceMetadata == null)
         {
-            throw new NoSuchElementException("Instance with host address " + 
host + " not found");
+            try
+            {
+                instanceMetadata = 
hostToInstanceMetadata.get(dnsResolver.resolve(host));
+            }
+            catch (UnknownHostException e)
+            {
+                throw new RuntimeException(e);

Review Comment:
   nit: Should it throw `NoSuchElementException` in this case too? An 
unresolved host is very much the same as the instance metadata cannot be found. 
From API consumer's perspective, it either looks up the instance metadata, or 
the value does not exist.



##########
adapters/base/build.gradle:
##########
@@ -59,7 +60,7 @@ publishing {
         maven(MavenPublication) {
             from components.java
             groupId project.group
-            artifactId "${archivesBaseName}"
+            artifactId "adapters-base"

Review Comment:
   Just providing a data point
   https://mvnrepository.com/search?q=base
   All the artifacts in the first page has `-base` instead of `base-`



##########
.gitignore:
##########
@@ -77,7 +77,7 @@ src/dist/*
 *.logdir_IS_UNDEFINED
 
 # Sidecar version - generated by build.gradle
-src/main/resources/sidecar.version
+common/src/main/resources/sidecar.version

Review Comment:
   nit: it could be just `sidecar.version`



##########
src/test/integration/org/apache/cassandra/sidecar/testing/CassandraSidecarTestContext.java:
##########
@@ -142,6 +182,8 @@ public String toString()
     public void close()
     {
         instancesConfig.instances().forEach(instance -> 
instance.delegate().close());
+        // TODO: Do we need to close sessions?
+//        sessionProviders.

Review Comment:
   It is to be resolved? 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to