cassandra-sidecar.git
5 weeks agoRefactor range and add toString trunk
Yifan Cai [Fri, 5 Aug 2022 21:54:32 +0000 (14:54 -0700)] 
Refactor range and add toString

2 months agoCASSANDRASC-40 Fix search in list snapshot endpoint
Francisco Guerrero [Wed, 13 Jul 2022 17:39:06 +0000 (10:39 -0700)] 
CASSANDRASC-40 Fix search in list snapshot endpoint

This commit fixes test setup in SnapshotUtils. Because of the incorrect test setup
the execution is providing incorrect results. For example, assume the following path

/cassandra-test/data/ks/tbl/snapshots/test-snapshot

The test was configuring data directories as ["/cassandra-test/data"], but in a real
execution data directories is provided as ["/cassandra-test"]. This is causing the
endpoint to return incorrect values in the JSON payload.

Additionally, the response was providing the port for Cassandra and not the Sidecar
port.

2 months agoCASSANDRAC-39: Allow Cassandra input validation to be configurable
Francisco Guerrero [Sat, 9 Jul 2022 00:09:35 +0000 (17:09 -0700)] 
CASSANDRAC-39: Allow Cassandra input validation to be configurable

It is sometimes desirable to allow configuring the Cassandra input validation in case
we want to further restrict the existing validations. In this commit, we introduce the
ability to inject the ValidationConfiguration. A default YamlValidationConfiguration is
provided and the sidecar.yaml is updated to reflect the existing default validation.

2 months agoCASSANDRASC-38 Add endpoint to list snapshot files
Francisco Guerrero [Wed, 29 Jun 2022 16:10:28 +0000 (09:10 -0700)] 
CASSANDRASC-38 Add endpoint to list snapshot files

This commit adds two new endpoints to allow listing snapshot files.

The first endpoint takes a snapshot name as a path parameter, and searches for
all the snapshots matching the provided name. The result lists all the snapshot
files for all matching snapshots. Additionally, secondary index files can be
included in the response by providing the query param
`includeSecondaryIndexFiles=true`.

```
/api/v1/snapshots/:snapshot
```

The second endpoint takes a keyspace, table name, and snapshot name and searches
for a unique snapshot matching the provided snapshot name in the given keyspace
and table name. The results lists the snapshot files matching the given keyspace,
table name, and snapshot name. Similarly to the first endpoint, secondary index
files can be included in the response by providing the query param
`includeSecondaryIndexFiles=true`.

```
/api/v1/keyspace/:keyspace/table/:table/snapshots/:snapshot
```

2 months agoOptimize file path builder and have separate handler for streaming file
Saranya Krishnakumar [Mon, 27 Jun 2022 17:47:26 +0000 (10:47 -0700)] 
Optimize file path builder and have separate handler for streaming file

patch by Francisco Guerrero, Saranya Krishnakumar; reviewed by Yifan Cai, Dinesh Joshi for CASSANDRASC-37

4 months agoCASSANDRASC-36: Support for ErrorHandler in Sidecar
Francisco Guerrero [Wed, 27 Apr 2022 17:24:00 +0000 (10:24 -0700)] 
CASSANDRASC-36: Support for ErrorHandler in Sidecar

This commit adds a default `ErrorHandler` to the `Route#failureHandler()`. The default implementation
for Sidecar is `ErrorHandlerImpl`.

Additionally, we allow for custom implementations of the `ErrorHandler` to be injected (via module
overrides). This allows downstream projects to provide custom implementations of the `ErrorHandler` to
fit the specific needs of the project.

Patch by Francisco Guerrero; Reviewed by Dinesh Joshi, Saranya Krishnakumar and Yifan Cai for CASSANDRASC-36

5 months agoCASSANDRASC-34: Allow for LoggerHandler to be injected
Francisco Guerrero [Fri, 11 Mar 2022 23:43:24 +0000 (15:43 -0800)] 
CASSANDRASC-34: Allow for LoggerHandler to be injected

Currently, `vertxRouter` adds an instance of `LoggerHandler` to the top level route.
This is prescriptive and it doesn't allow for a different implementation of the LoggerHandler
to be injected.

In this commit, `LoggerHandler` is created in the `MainModule` as a singleton and then
injected in the `vertxRouter` method. This allows for a new implementation of the `LoggerHandler`
to be provided.

5 months agoAdd the CONTRIBUTING.md doc with guidelines and best practices
Francisco Guerrero [Tue, 29 Mar 2022 19:09:06 +0000 (12:09 -0700)] 
Add the CONTRIBUTING.md doc with guidelines and best practices

The document delves into the contribution guidelines, source code best practices
and source code style.

7 months agoOptionally support multiple cassandra instances in Sidecar
Saranya Krishnakumar [Fri, 21 Jan 2022 21:57:49 +0000 (13:57 -0800)] 
Optionally support multiple cassandra instances in Sidecar

10 months agoninja fix to changelog and build
Yifan Cai [Sat, 13 Nov 2021 03:49:59 +0000 (19:49 -0800)] 
ninja fix to changelog and build

10 months agoCall the start method of CassandraAdaptorDelegate to start periodic health checl
Saranya Krishnakumar [Wed, 20 Oct 2021 18:23:55 +0000 (11:23 -0700)] 
Call the start method of CassandraAdaptorDelegate to start periodic health checl

patch by Saranya Krishnakumar; reviewed by Yifan Cai, Dinesh Joshi for CASSANDRASC-32

11 months agoAvoid having sidecar's health response code depend on Cassandra's health information
Saranya Krishnakumar [Wed, 22 Sep 2021 22:50:39 +0000 (15:50 -0700)] 
Avoid having sidecar's health response code depend on Cassandra's health information

patch by Saranya Krishnakumar; reviewed by Yifan Cai, Dinesh Joshi for CASSANDRASC-29

11 months agoAdd Stream SSTable API to Sidecar to stream SSTable components through zero copy...
Saranya Krishnakumar [Tue, 28 Sep 2021 22:28:29 +0000 (15:28 -0700)] 
Add Stream SSTable API to Sidecar to stream SSTable components through zero copy streaming

Patch by Saranya Krishnakumar; reviewed by Dinesh Joshi, Yifan Cai for CASSANDRASC-28

11 months agoFix broken sidecar gradle configuration due to Cassandra 40 version
Yifan Cai [Tue, 28 Sep 2021 21:48:32 +0000 (14:48 -0700)] 
Fix broken sidecar gradle configuration due to Cassandra 40 version

Patch by Yifan Cai; reviewed by Dinesh Joshi and Saranya Krishnakumar for CASSANDRASC-31

14 months agoFix checkstyle error in CassandraPod.java
Saranya Krishnakumar [Tue, 13 Jul 2021 19:21:13 +0000 (12:21 -0700)] 
Fix checkstyle error in CassandraPod.java

2 years agoSupport for multiple Cassandra versions 14/head
Jon Haddad [Wed, 29 Apr 2020 23:48:12 +0000 (16:48 -0700)] 
Support for multiple Cassandra versions

This patch lays the groundwork to support multiple Cassandra versions.
New submodules were created for common libraries as well as specific
Cassandra versions.  Several dependencies are moved to the common
submodule due to their universal nature.

Most importantly, this patch introduces Junit Test Template for testing multiple
Cassandra versions.  Test should be annotated with a
@CassandraIntegrationTest.  These tests require Docker and Kubernetes be available.
A single version is currently supported, 4.0.  A dockerfile sets up the image
from the beta tarball and initializes the session.

Cassandra driver was upgraded to version 3.9, previous versions errored
with Java 11.

CircleCI tests are run using microk8s.

Patch by Jon Haddad; Reviewed by Dinesh Joshi for CASSANDRASC-23

2 years agoNinja-Fix: CHANGES.txt for CASSANDRASC-22
Dinesh A. Joshi [Thu, 30 Apr 2020 18:34:52 +0000 (11:34 -0700)] 
Ninja-Fix: CHANGES.txt for CASSANDRASC-22

2 years agoRESTEasy integration with dynamically generated Swagger OpenAPI, Swagger UI and JAX-RS.
Dinesh A. Joshi [Mon, 25 Nov 2019 04:37:46 +0000 (20:37 -0800)] 
RESTEasy integration with dynamically generated Swagger OpenAPI, Swagger UI and JAX-RS.

This patch introduces JAX-RS based annotation for defining APIs. It removes the manually
created api.yaml (OpenAPI spec) of the API definitions in favor of the dynamically
generated spec based on JAX-RS annotations. It also introduces Swagger UI to browse the
Sidecar APIs and to experiment with them. Finally, it updates the CircleCI workflows
such that the builds are run across both Docker and Machine images. We also gate packaging
builds on success of the compile and test builds. The rationale for running the builds
across both Docker and Machine images is that running the build on a Machine image exposed
a race condition.

Patch by Dinesh Joshi; Reviewed by Jon Haddad and Yifan Cai for CASSANDRASC-22

2 years agoSet up asciidoc based documentation.
Jon Haddad [Thu, 23 Apr 2020 21:49:37 +0000 (14:49 -0700)] 
Set up asciidoc based documentation.

Patch by Jon Haddad; Reviewed by Dinesh Joshi for CASSANDRASC-15

2 years agoNinja fix to changelog
Jon Haddad [Thu, 23 Apr 2020 23:33:21 +0000 (16:33 -0700)] 
Ninja fix to changelog

2 years agoGradle can now generate Deb packages, RPMs and Docker containers
Jon Haddad [Tue, 21 Apr 2020 23:00:09 +0000 (16:00 -0700)] 
Gradle can now generate Deb packages, RPMs and Docker containers

Patch by Jon Haddad; Reviewed by Jake Luciani and Dinesh Joshi for CASSANDRASC-14

2 years agoSecurity patch for snake yaml
Jon Haddad [Mon, 9 Mar 2020 19:45:10 +0000 (12:45 -0700)] 
Security patch for snake yaml

Bumped commons-configuration2 to latest version and correctly use
YAMLConfiguration.

Patch by Jon Haddad; Reviewed by Dinesh Joshi for CASSANDRASC-12

2 years agoLinked to JIRA for issues
Jon Haddad [Tue, 17 Mar 2020 23:33:43 +0000 (16:33 -0700)] 
Linked to JIRA for issues

2 years agoNinja fix changelog
Jon Haddad [Mon, 9 Mar 2020 18:11:17 +0000 (11:11 -0700)] 
Ninja fix changelog

2 years agoImproving CircleCI build reliability
Jon Haddad [Wed, 4 Mar 2020 21:56:46 +0000 (13:56 -0800)] 
Improving CircleCI build reliability

Switched to Circle machine image - docker has issues with networking in tests
Fix storing of test results
Updated readme with Java 11
Upgrade vertx
Wait for vertx server startup before sending requests
Update simulacron to latest bug fix version
added spotbugs exclude config to avoid incorrect NPE error on java 11
Configure CircleCi to run tests with Java 11

Patch by Jon Haddad; Reviewed by Dinesh Joshi for CASSANDRA-15611

2 years agoUpgraded gradle and replaced FindBugs with SpotBugs.
Jon Haddad [Tue, 3 Mar 2020 23:24:50 +0000 (15:24 -0800)] 
Upgraded gradle and replaced FindBugs with SpotBugs.

* Upgrading from findbugs (JDK 8 only) to Spotbugs.  FindBugs was abandoned
  years ago and will not be updated.
* Upgraded Gradle to version 6.2.1

Patch by Jon Haddad; Reviewed by Dinesh Joshi for CASSANDRA-15610.

2 years agoImproving local HealthServiceIntegrationTest reliablility
Jon Haddad [Sat, 29 Feb 2020 00:54:19 +0000 (16:54 -0800)] 
Improving local HealthServiceIntegrationTest reliablility

There appears to be a race condidtion with the simulacron library that causes
test failure if we don't wait long enough.  This patch simply extends
the window that we can wait for a test node to come back online.

Patch by Jon Haddad; Reviewed by Dinesh Joshi for CASSANDRA-15615

2 years agoUpdated readme to point to Slack instead of IRC
Jon Haddad [Mon, 2 Mar 2020 20:42:13 +0000 (12:42 -0800)] 
Updated readme to point to Slack instead of IRC

3 years agoRead config from sidecar.config System Property instead of classpath
Andrew Tolbert [Sun, 28 Jul 2019 05:11:22 +0000 (00:11 -0500)] 
Read config from sidecar.config System Property instead of classpath

Alters configuration processing to read from `sidecar.config` system
property instead of using `Configurations` file resolution, which seems
to read from classpath first.

Also does the following:

* Move `conf` into `src/dist/config`.  This causes the `conf` directory
  to be included in the tar and zip distributions where it previously
  was not.
* Don't add `conf` directory to classpath.  For logging add
  `-Dlogback.configuration` to arguments.  Also add `logback-test.xml`
  to have different logging behavior for tests.
* Copy agents into `build/install/appName/agents` directly instead of
  `src/dist`. Make `copyDist` depend on `copyJolokia`. This also has
  the side effect of having agents copied to the project directory, so
  `bin/CassandraSidecarDaemon` works after `./gradlew build`.
* Improve logging to include full address instead of just port.
* Add generated paths to gitignore

patch by Andrew Tolbert; reviewed by Dinesh Joshi and Vinay Chella for CASSANDRA-15288

3 years agoupdate CHANGES.txt with missing jiras
Chris Lohfink [Tue, 5 Mar 2019 22:44:57 +0000 (16:44 -0600)] 
update CHANGES.txt with missing jiras

3 years agoAdd integration tests task
Chris Lohfink [Tue, 5 Mar 2019 17:14:48 +0000 (11:14 -0600)] 
Add integration tests task
Patch by Chris Lohfink, reviewed by Dinesh Joshi and Vinay Chella for CASSANDRA-15031

3 years agoninja: missed updating change log
Chris Lohfink [Mon, 25 Feb 2019 18:28:09 +0000 (12:28 -0600)] 
ninja: missed updating change log

3 years agoAdd support for SSL and bindable address to sidecar
Dinesh Joshi [Fri, 22 Feb 2019 15:19:28 +0000 (09:19 -0600)] 
Add support for SSL and bindable address to sidecar
Patch by Dinesh Joshi; reviewed by Vinay Chella and Chris Lohfink for CASSANDRA-15030

3 years agoAutogenerate API docs for sidecar
Chris Lohfink [Fri, 22 Feb 2019 02:14:52 +0000 (20:14 -0600)] 
Autogenerate API docs for sidecar
Patch by Chris Lohfink, reviewed by Dinesh Joshi for CASSANDRA-15028

3 years agoC* Management process
Dinesh Joshi [Tue, 19 Feb 2019 02:16:35 +0000 (18:16 -0800)] 
C* Management process

patch by Dinesh Joshi; reviewed by jasobrown and Chris Lohfink for CASSANDRA-14395

Co-authored-by: Vinay Chella <vinaykumarcse@gmail.com>
Co-authored-by: Joey Lynch <joe.e.lynch@gmail.com>