Skip to content

Commit

Permalink
[refactor] Move cassandra implementation to internal package (#6639)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Towards #6637

## Description of the changes
- This PR moves the implementation from `plugin/storage/` to
`internal/storage/`

## How was this change tested?
- CI

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 authored Jan 31, 2025
1 parent 6d8c70e commit 619a9f7
Show file tree
Hide file tree
Showing 73 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ updates:
- /docker/base
- /docker/debug
- /examples/hotrod
- /plugin/storage/cassandra
- /internal/storage/v1/cassandra
schedule:
interval: daily
- package-ecosystem: docker
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ docker-images-anonymizer:

.PHONY: docker-images-cassandra
docker-images-cassandra:
docker build -t $(DOCKER_NAMESPACE)/jaeger-cassandra-schema:${DOCKER_TAG} plugin/storage/cassandra/
docker build -t $(DOCKER_NAMESPACE)/jaeger-cassandra-schema:${DOCKER_TAG} internal/storage/v1/cassandra/
@echo "Finished building jaeger-cassandra-schema =============="

.PHONY: docker-images-elastic
Expand Down
2 changes: 1 addition & 1 deletion cmd/jaeger/internal/extension/jaegerstorage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/confmap"

"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra"
casCfg "github.com/jaegertracing/jaeger/pkg/cassandra/config"
esCfg "github.com/jaegertracing/jaeger/pkg/es/config"
promCfg "github.com/jaegertracing/jaeger/pkg/prometheus/config"
"github.com/jaegertracing/jaeger/plugin/metricstore/prometheus"
"github.com/jaegertracing/jaeger/plugin/storage/badger"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra"
"github.com/jaegertracing/jaeger/plugin/storage/es"
"github.com/jaegertracing/jaeger/plugin/storage/grpc"
"github.com/jaegertracing/jaeger/plugin/storage/memory"
Expand Down
2 changes: 1 addition & 1 deletion cmd/jaeger/internal/extension/jaegerstorage/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/extension"

"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/telemetry"
"github.com/jaegertracing/jaeger/plugin/metricstore/prometheus"
"github.com/jaegertracing/jaeger/plugin/storage/badger"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra"
"github.com/jaegertracing/jaeger/plugin/storage/es"
"github.com/jaegertracing/jaeger/plugin/storage/grpc"
"github.com/jaegertracing/jaeger/plugin/storage/memory"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
nooptrace "go.opentelemetry.io/otel/trace/noop"
"go.uber.org/zap"

"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra"
esCfg "github.com/jaegertracing/jaeger/pkg/es/config"
"github.com/jaegertracing/jaeger/pkg/metrics"
promCfg "github.com/jaegertracing/jaeger/pkg/prometheus/config"
"github.com/jaegertracing/jaeger/plugin/storage/badger"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra"
"github.com/jaegertracing/jaeger/plugin/storage/grpc"
"github.com/jaegertracing/jaeger/plugin/storage/memory"
"github.com/jaegertracing/jaeger/storage"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ import (
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"

cDepStore "github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/dependencystore"
cSamplingStore "github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/samplingstore"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/schema"
cSpanStore "github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/pkg/cassandra"
"github.com/jaegertracing/jaeger/pkg/cassandra/config"
gocqlw "github.com/jaegertracing/jaeger/pkg/cassandra/gocql"
Expand All @@ -23,11 +28,6 @@ import (
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/plugin"
cLock "github.com/jaegertracing/jaeger/plugin/pkg/distributedlock/cassandra"
cDepStore "github.com/jaegertracing/jaeger/plugin/storage/cassandra/dependencystore"
cSamplingStore "github.com/jaegertracing/jaeger/plugin/storage/cassandra/samplingstore"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/schema"
cSpanStore "github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage/samplingstore"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"go.uber.org/zap"

"github.com/jaegertracing/jaeger-idl/model/v1"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra"
cSpanStore "github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore"
cascfg "github.com/jaegertracing/jaeger/pkg/cassandra/config"
"github.com/jaegertracing/jaeger/pkg/jtracer"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra"
cSpanStore "github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.dependencies_v2 (
AND default_time_to_live = ${dependencies_ttl};

-- adaptive sampling tables
-- ./plugin/storage/cassandra/samplingstore/storage.go
-- ./internal/storage/v1/cassandra/samplingstore/storage.go
CREATE TABLE IF NOT EXISTS ${keyspace}.operation_throughput (
bucket int,
ts timeuuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ CREATE TABLE IF NOT EXISTS {{.Keyspace}}.dependencies_v2 (
AND default_time_to_live = {{.DependenciesTTLInSeconds}};

-- adaptive sampling tables
-- ./plugin/storage/cassandra/samplingstore/storage.go
-- ./internal/storage/v1/cassandra/samplingstore/storage.go
CREATE TABLE IF NOT EXISTS {{.Keyspace}}.operation_throughput (
bucket int,
ts timeuuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.dependencies_v2 (
AND default_time_to_live = ${dependencies_ttl};

-- adaptive sampling tables
-- ./plugin/storage/cassandra/samplingstore/storage.go
-- ./internal/storage/v1/cassandra/samplingstore/storage.go
CREATE TABLE IF NOT EXISTS ${keyspace}.operation_throughput (
bucket int,
ts timeuuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (

"go.uber.org/zap"

"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/pkg/cache"
"github.com/jaegertracing/jaeger/pkg/cassandra"
casMetrics "github.com/jaegertracing/jaeger/pkg/cassandra/metrics"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"go.uber.org/zap"

"github.com/jaegertracing/jaeger/internal/metricstest"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/pkg/cassandra/mocks"
"github.com/jaegertracing/jaeger/pkg/testutils"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"go.uber.org/zap"

"github.com/jaegertracing/jaeger-idl/model/v1"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/pkg/cassandra"
casMetrics "github.com/jaegertracing/jaeger/pkg/cassandra/metrics"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/otelsemconv"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (

"github.com/jaegertracing/jaeger-idl/model/v1"
"github.com/jaegertracing/jaeger/internal/metricstest"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/pkg/cassandra"
"github.com/jaegertracing/jaeger/pkg/cassandra/mocks"
"github.com/jaegertracing/jaeger/pkg/testutils"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"go.uber.org/zap"

"github.com/jaegertracing/jaeger-idl/model/v1"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/pkg/cassandra"
casMetrics "github.com/jaegertracing/jaeger/pkg/cassandra/metrics"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package spanstore

import (
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
)

// Option is a function that sets some option on the writer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
)

func TestWriterOptions(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (

"github.com/jaegertracing/jaeger-idl/model/v1"
"github.com/jaegertracing/jaeger/internal/metricstest"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/pkg/cassandra/mocks"
"github.com/jaegertracing/jaeger/pkg/testutils"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

Expand Down
2 changes: 1 addition & 1 deletion plugin/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"go.uber.org/zap"

"github.com/jaegertracing/jaeger/internal/safeexpvar"
"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/plugin"
"github.com/jaegertracing/jaeger/plugin/storage/badger"
"github.com/jaegertracing/jaeger/plugin/storage/blackhole"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra"
"github.com/jaegertracing/jaeger/plugin/storage/es"
"github.com/jaegertracing/jaeger/plugin/storage/grpc"
"github.com/jaegertracing/jaeger/plugin/storage/kafka"
Expand Down
2 changes: 1 addition & 1 deletion plugin/storage/integration/cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zaptest"

"github.com/jaegertracing/jaeger/internal/storage/v1/cassandra"
"github.com/jaegertracing/jaeger/pkg/config"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/testutils"
"github.com/jaegertracing/jaeger/plugin/storage/cassandra"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage_v2/v1adapter"
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/build-upload-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ done

bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c jaeger-es-index-cleaner -d cmd/es-index-cleaner -p "${platforms}" -t release
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c jaeger-es-rollover -d cmd/es-rollover -p "${platforms}" -t release
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -c jaeger-cassandra-schema -d plugin/storage/cassandra/ -p "${platforms}"
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -c jaeger-cassandra-schema -d internal/storage/v1/cassandra/ -p "${platforms}"

# build/upload images for jaeger-tracegen and jaeger-anonymizer
for component in tracegen anonymizer
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e/cassandra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ teardown_cassandra() {

apply_schema() {
local image=cassandra-schema
local schema_dir=plugin/storage/cassandra/
local schema_dir=internal/storage/v1/cassandra/
local schema_version=$1
local keyspace=$2
local params=(
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ REPO_ROOT="$UTILS_DIR/../.."
# Define list of test files explicitly here , to be dynamic to the location of the test file
TEST_FILES=(
"$UTILS_DIR/compute-tags.test.sh"
"$REPO_ROOT/plugin/storage/cassandra/schema/create.test.sh"
"$REPO_ROOT/internal/storage/v1/cassandra/schema/create.test.sh"
)

run_test_file() {
Expand Down

0 comments on commit 619a9f7

Please sign in to comment.