yifan-c commented on code in PR #99: URL: https://github.com/apache/cassandra-analytics/pull/99#discussion_r1962540747
########## cassandra-analytics-cdc-sidecar/build.gradle: ########## @@ -0,0 +1,142 @@ +import java.nio.file.Paths + +/* + * 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. + */ + +plugins { + id('java-library') + id('maven-publish') +} + +configurations { + all*.exclude(group: 'org.slf4j', module: 'slf4j-log4j12') + all*.exclude(group: 'log4j', module: 'log4j') +} + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + maven(MavenPublication) { + from components.java + groupId project.group + artifactId "${archivesBaseName}" + version System.getenv("CODE_VERSION") ?: "${version}" + } + } +} + +configurations { + fourzero { + description = 'Cassandra 4.0 dependency' + } + fourzerobridge { + description = 'Bridge to Cassandra 4.0' + } + fourzerotypes { + description = 'Cassandra 4.0 Data Types' + } +} + +dependencies { + api(project(':cassandra-bridge')) + + fourzero(project(path: ':cassandra-four-zero', configuration: 'shadow')) + fourzerobridge(project(path: ':cassandra-four-zero-bridge')) + fourzerotypes(project(path: ':cassandra-four-zero-types')) + + implementation project(":cassandra-analytics-common") + implementation project(':cassandra-analytics-cdc') + implementation project(':cassandra-analytics-sidecar-client') + compileOnlyApi("com.datastax.cassandra:cassandra-driver-core:${project.cassandraDriverVersion}") // Cassandra driver is required only if user supplies the CassandraClientSource + + implementation "com.google.guava:guava:${project.guavaVersion}" + + implementation "org.apache.commons:commons-lang3:${project.commonsLang3Version}" + implementation "org.slf4j:slf4j-api:${slf4jApiVersion}" + implementation "com.esotericsoftware:kryo-shaded:${kryoVersion}" + implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}" + implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}" + implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" + + testImplementation project(":cassandra-analytics-common") + + // pull in cassandra-bridge so we can re-use TestSchema to generate arbitrary schemas for the cdc tests + testImplementation project(":cassandra-bridge") + testImplementation("com.datastax.cassandra:cassandra-driver-core:${project.cassandraDriverVersion}") + testImplementation(testFixtures(project(':cassandra-bridge'))) + testImplementation project(":cassandra-four-zero-bridge") + testImplementation project(":cassandra-four-zero-types") + testImplementation project(path: ':cassandra-four-zero', configuration: 'shadow') + testImplementation(group: 'org.quicktheories', name: 'quicktheories', version: "${project.rootProject.quickTheoriesVersion}") + testImplementation(group: 'com.google.guava', name: 'guava', version: '31.1-jre') Review Comment: Can it use `${guavaVersion}`? ########## cassandra-analytics-cdc-sidecar/build.gradle: ########## @@ -0,0 +1,142 @@ +import java.nio.file.Paths + +/* + * 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. + */ + +plugins { + id('java-library') + id('maven-publish') +} + +configurations { + all*.exclude(group: 'org.slf4j', module: 'slf4j-log4j12') + all*.exclude(group: 'log4j', module: 'log4j') +} + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + maven(MavenPublication) { + from components.java + groupId project.group + artifactId "${archivesBaseName}" + version System.getenv("CODE_VERSION") ?: "${version}" + } + } +} + +configurations { + fourzero { + description = 'Cassandra 4.0 dependency' + } + fourzerobridge { + description = 'Bridge to Cassandra 4.0' + } + fourzerotypes { + description = 'Cassandra 4.0 Data Types' + } +} + +dependencies { + api(project(':cassandra-bridge')) + + fourzero(project(path: ':cassandra-four-zero', configuration: 'shadow')) + fourzerobridge(project(path: ':cassandra-four-zero-bridge')) + fourzerotypes(project(path: ':cassandra-four-zero-types')) + + implementation project(":cassandra-analytics-common") + implementation project(':cassandra-analytics-cdc') + implementation project(':cassandra-analytics-sidecar-client') + compileOnlyApi("com.datastax.cassandra:cassandra-driver-core:${project.cassandraDriverVersion}") // Cassandra driver is required only if user supplies the CassandraClientSource + + implementation "com.google.guava:guava:${project.guavaVersion}" + + implementation "org.apache.commons:commons-lang3:${project.commonsLang3Version}" + implementation "org.slf4j:slf4j-api:${slf4jApiVersion}" + implementation "com.esotericsoftware:kryo-shaded:${kryoVersion}" + implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}" + implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}" + implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" + + testImplementation project(":cassandra-analytics-common") + + // pull in cassandra-bridge so we can re-use TestSchema to generate arbitrary schemas for the cdc tests + testImplementation project(":cassandra-bridge") + testImplementation("com.datastax.cassandra:cassandra-driver-core:${project.cassandraDriverVersion}") + testImplementation(testFixtures(project(':cassandra-bridge'))) + testImplementation project(":cassandra-four-zero-bridge") + testImplementation project(":cassandra-four-zero-types") + testImplementation project(path: ':cassandra-four-zero', configuration: 'shadow') + testImplementation(group: 'org.quicktheories', name: 'quicktheories', version: "${project.rootProject.quickTheoriesVersion}") + testImplementation(group: 'com.google.guava', name: 'guava', version: '31.1-jre') + testImplementation(group: 'com.github.luben', name: 'zstd-jni', version: '1.5.0-4') + testImplementation(group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26') + testImplementation "org.quicktheories:quicktheories:${project.rootProject.quickTheoriesVersion}" + testImplementation "org.junit.jupiter:junit-jupiter-api:${project.junitVersion}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${project.junitVersion}" + testImplementation "org.junit.jupiter:junit-jupiter-engine:${project.junitVersion}" + testImplementation "org.mockito:mockito-core:${project.rootProject.mockitoVersion}" + testImplementation "org.mockito:mockito-inline:${project.rootProject.mockitoVersion}" +} + +jar { + dependsOn(configurations.fourzero) + dependsOn(configurations.fourzerobridge) + dependsOn(configurations.fourzerotypes) + +// writeBuildVersion(version, project.projectDir) + + exclude('META-INF/*') + into('bridges') { + from(configurations.fourzero.singleFile) + from(configurations.fourzerobridge.singleFile) + from(configurations.fourzerotypes.singleFile) + } +} + +//private void writeBuildVersion(version, projectDir) { Review Comment: Not needed and `cassandra-analytics-cdc-build.properties` too. ########## cassandra-analytics-cdc-sidecar/src/main/java/org/apache/cassandra/cdc/sidecar/ClusterConfigProvider.java: ########## @@ -0,0 +1,34 @@ +/* + * 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.cassandra.cdc.sidecar; + +import java.util.Set; + +import org.apache.cassandra.spark.data.partitioner.CassandraInstance; +import org.apache.cassandra.spark.data.partitioner.Partitioner; + +public interface ClusterConfigProvider +{ + String dc(); + + Set<CassandraInstance> getCluster(); + + Partitioner partitioner(); +} Review Comment: Add javadocs ########## cassandra-analytics-cdc-sidecar/src/main/java/org/apache/cassandra/cdc/sidecar/SidecarCdcCassandraClient.java: ########## @@ -0,0 +1,72 @@ +/* + * 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.cassandra.cdc.sidecar; + +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import com.datastax.driver.core.ResultSetFuture; +import org.apache.cassandra.bridge.TokenRange; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Interface defining read and write operations to Cassandra via the `SidecarStatePersister` Review Comment: `SidecarStatePersister` is not reference anywhere else in this file. ########## cassandra-analytics-cdc-sidecar/src/main/java/org/apache/cassandra/cdc/sidecar/SidecarDownMonitor.java: ########## @@ -0,0 +1,49 @@ +/* + * 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.cassandra.cdc.sidecar; + +import org.apache.cassandra.spark.data.partitioner.CassandraInstance; + +public interface SidecarDownMonitor Review Comment: javadoc -- 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: commits-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org