Skip to content

Commit

Permalink
Revert "Define the models for the new Events Analytics Platform (#6126)"
Browse files Browse the repository at this point in the history
This reverts commit ca49db8.

Co-authored-by: colin-sentry <161344340+colin-sentry@users.noreply.github.com>
  • Loading branch information
getsentry-bot and colin-sentry committed Jul 22, 2024
1 parent 794fec5 commit b1376d6
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 305 deletions.
1 change: 0 additions & 1 deletion snuba/clusters/storage_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"FUNCTIONS": "functions",
"SEARCH_ISSUES": "search_issues",
"SPANS": "spans",
"EVENTS_ANALYTICS_PLATFORM": "events_analytics_platform",
"GROUP_ATTRIBUTES": "group_attributes",
"METRICS_SUMMARIES": "metrics_summaries",
"PROFILE_CHUNKS": "profile_chunks",
Expand Down
5 changes: 0 additions & 5 deletions snuba/migrations/group_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ def __init__(self) -> None:
super().__init__("snuba.snuba_migrations.spans")


class EventsAnalyticsPlatformLoader(DirectoryLoader):
def __init__(self) -> None:
super().__init__("snuba.snuba_migrations.events_analytics_platform")


class GroupAttributesLoader(DirectoryLoader):
def __init__(self) -> None:
super().__init__("snuba.snuba_migrations.group_attributes")
Expand Down
7 changes: 0 additions & 7 deletions snuba/migrations/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from snuba.datasets.readiness_state import ReadinessState
from snuba.migrations.group_loader import (
DiscoverLoader,
EventsAnalyticsPlatformLoader,
EventsLoader,
FunctionsLoader,
GenericMetricsLoader,
Expand Down Expand Up @@ -43,7 +42,6 @@ class MigrationGroup(Enum):
TEST_MIGRATION = "test_migration"
SEARCH_ISSUES = "search_issues"
SPANS = "spans"
EVENTS_ANALYTICS_PLATFORM = "events_analytics_platform"
GROUP_ATTRIBUTES = "group_attributes"
METRICS_SUMMARIES = "metrics_summaries"
PROFILE_CHUNKS = "profile_chunks"
Expand Down Expand Up @@ -166,11 +164,6 @@ def __init__(
storage_sets_keys={StorageSetKey.SPANS},
readiness_state=ReadinessState.COMPLETE,
),
MigrationGroup.EVENTS_ANALYTICS_PLATFORM: _MigrationGroup(
loader=EventsAnalyticsPlatformLoader(),
storage_sets_keys={StorageSetKey.EVENTS_ANALYTICS_PLATFORM},
readiness_state=ReadinessState.PARTIAL,
),
MigrationGroup.GROUP_ATTRIBUTES: _MigrationGroup(
loader=GroupAttributesLoader(),
storage_sets_keys={StorageSetKey.GROUP_ATTRIBUTES},
Expand Down
33 changes: 0 additions & 33 deletions snuba/migrations/table_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,39 +132,6 @@ def _get_engine_type(self, cluster: ClickhouseCluster, table_name: str) -> str:
return f"ReplicatedReplacingMergeTree({zoo_path}, '{{replica}}')"


class CollapsingMergeTree(MergeTree):
def __init__(
self,
storage_set: StorageSetKey,
order_by: str,
primary_key: Optional[str] = None,
sign_column: Optional[str] = None,
partition_by: Optional[str] = None,
sample_by: Optional[str] = None,
ttl: Optional[str] = None,
settings: Optional[Mapping[str, str]] = None,
unsharded: bool = False,
) -> None:
super().__init__(
storage_set=storage_set,
order_by=order_by,
primary_key=primary_key,
partition_by=partition_by,
sample_by=sample_by,
ttl=ttl,
settings=settings,
unsharded=unsharded,
)
self.__sign_column = sign_column

def _get_engine_type(self, cluster: ClickhouseCluster, table_name: str) -> str:
if cluster.is_single_node():
return f"CollapsingMergeTree({self.__sign_column})"
else:
zoo_path = self._get_zookeeper_path(cluster, table_name)
return f"ReplicatedCollapsingMergeTree({zoo_path}, '{{replica}}', {self.__sign_column})"


class SummingMergeTree(MergeTree):
def _get_engine_type(self, cluster: ClickhouseCluster, table_name: str) -> str:
if cluster.is_single_node():
Expand Down
1 change: 0 additions & 1 deletion snuba/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
"search_issues",
"generic_metrics_counters",
"spans",
"events_analytics_platform",
"group_attributes",
"generic_metrics_gauges",
"metrics_summaries",
Expand Down
1 change: 0 additions & 1 deletion snuba/settings/settings_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"search_issues",
"generic_metrics_counters",
"spans",
"events_analytics_platform",
"group_attributes",
"generic_metrics_gauges",
"metrics_summaries",
Expand Down
1 change: 0 additions & 1 deletion snuba/settings/settings_test_distributed_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"search_issues",
"generic_metrics_counters",
"spans",
"events_analytics_platform",
"group_attributes",
"generic_metrics_gauges",
"metrics_summaries",
Expand Down
194 changes: 0 additions & 194 deletions snuba/snuba_migrations/events_analytics_platform/0001_spans_v2.py

This file was deleted.

62 changes: 0 additions & 62 deletions snuba/utils/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,38 +385,6 @@ def get_raw(self) -> Array[TModifiers]:
return Array(inner_type=self.inner_type.get_raw())


class Map(ColumnType[TModifiers]):
def __init__(
self,
key: ColumnType[TModifiers],
value: ColumnType[TModifiers],
modifiers: Optional[TModifiers] = None,
) -> None:
super().__init__(modifiers)
self.key = key
self.value = value

def _repr_content(self) -> str:
return repr(self.key) + ", " + repr(self.value)

def __eq__(self, other: object) -> bool:
return (
self.__class__ == other.__class__
and self.key == cast(Map[TModifiers], other).key
and self.value == cast(Map[TModifiers], other).value
and self.get_modifiers() == cast(Map[TModifiers], other).get_modifiers()
)

def _for_schema_impl(self) -> str:
return f"Map({self.key.for_schema()}, {self.value.for_schema()})"

def set_modifiers(self, modifiers: Optional[TModifiers]) -> Map[TModifiers]:
return Map(key=self.key, value=self.value, modifiers=modifiers)

def get_raw(self) -> Map[TModifiers]:
return Map(key=self.key.get_raw(), value=self.value.get_raw())


class Nested(ColumnType[TModifiers]):
def __init__(
self,
Expand Down Expand Up @@ -498,10 +466,6 @@ class String(ColumnType[TModifiers]):
pass


class Bool(ColumnType[TModifiers]):
pass


class UUID(ColumnType[TModifiers]):
pass

Expand Down Expand Up @@ -566,32 +530,6 @@ def get_raw(self) -> UInt[TModifiers]:
return UInt(self.size)


class Int(ColumnType[TModifiers]):
def __init__(self, size: int, modifiers: Optional[TModifiers] = None) -> None:
super().__init__(modifiers)
assert size in (8, 16, 32, 64)
self.size = size

def _repr_content(self) -> str:
return str(self.size)

def __eq__(self, other: object) -> bool:
return (
self.__class__ == other.__class__
and self.get_modifiers() == cast(Int[TModifiers], other).get_modifiers()
and self.size == cast(Int[TModifiers], other).size
)

def _for_schema_impl(self) -> str:
return "Int{}".format(self.size)

def set_modifiers(self, modifiers: Optional[TModifiers]) -> Int[TModifiers]:
return Int(size=self.size, modifiers=modifiers)

def get_raw(self) -> Int[TModifiers]:
return Int(self.size)


class Float(ColumnType[TModifiers]):
def __init__(
self,
Expand Down

0 comments on commit b1376d6

Please sign in to comment.