Skip to content

Commit

Permalink
Update protobuf definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Sep 26, 2024
1 parent b8200fb commit 3a70527
Show file tree
Hide file tree
Showing 12 changed files with 298 additions and 10 deletions.
13 changes: 10 additions & 3 deletions proto/interface.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This file is the entrypoint for the virtual database engine (VDBE) interface
// definitions. We have split the definitions across multiple files to make them
// managable to read.

syntax = "proto3";

package vdbe;
Expand All @@ -6,8 +10,11 @@ import "interface/blueprint.proto";
import "interface/schema.proto";
import "interface/vdbe.proto";

// All the information needed to describe a data infrastructure deployment.
message SystemState {
repeated Table tables = 1;
repeated VirtualEngine vdbes = 2;
Blueprint blueprint = 3;
// Used to uniquely identify the system state.
string schema_name = 1;
repeated Table tables = 2;
repeated VirtualEngine vdbes = 3;
Blueprint blueprint = 4;
}
9 changes: 6 additions & 3 deletions proto/interface/blueprint.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// This file contains definitions for the blueprint (physical realization of a
// set of VDBEs).

syntax = "proto3";

package vdbe;

message Blueprint {
Provisioning aurora = 1;
Provisioning redshift = 2;
RoutingPolicy policy = 3;
Provisioning aurora = 101;
Provisioning redshift = 102;
RoutingPolicy policy = 201;
}

message RoutingPolicy {
Expand Down
11 changes: 7 additions & 4 deletions proto/interface/schema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ syntax = "proto3";

package vdbe;

// Represents a relational table.
message Table {
string name = 1;
repeated TableColumn columns = 2;
}

// Represents a column in a relational table.
message TableColumn {
string name = 1;
DataType type = 2;
bool nullable = 3;
}

// The data types we currently support.
enum DataType {
UNKNOWN = 0;
INT_32 = 1;
INT_64 = 2;
STRING = 3;
DT_UNKNOWN = 0;
DT_INT_32 = 1;
DT_INT_64 = 2;
DT_STRING = 3;
}
3 changes: 3 additions & 0 deletions proto/interface/vdbe.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file contains definitions for virtual database engines (VDBEs).

syntax = "proto3";

package vdbe;
Expand All @@ -17,6 +19,7 @@ message VirtualTable {
bool writable = 2;
}

// These are the query interfaces we currently support.
enum QueryInterface {
QI_UNKNOWN = 0;

Expand Down
34 changes: 34 additions & 0 deletions src/brad/proto_gen/interface/blueprint_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions src/brad/proto_gen/interface/blueprint_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union

DESCRIPTOR: _descriptor.FileDescriptor

class Engine(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = [] # type: ignore
ENGINE_UNKNOWN: _ClassVar[Engine]
ENGINE_AURORA: _ClassVar[Engine]
ENGINE_REDSHIFT: _ClassVar[Engine]
ENGINE_ATHENA: _ClassVar[Engine]
ENGINE_UNKNOWN: Engine
ENGINE_AURORA: Engine
ENGINE_REDSHIFT: Engine
ENGINE_ATHENA: Engine

class Blueprint(_message.Message):
__slots__ = ["aurora", "redshift", "policy"]
AURORA_FIELD_NUMBER: _ClassVar[int]
REDSHIFT_FIELD_NUMBER: _ClassVar[int]
POLICY_FIELD_NUMBER: _ClassVar[int]
aurora: Provisioning
redshift: Provisioning
policy: RoutingPolicy
def __init__(self, aurora: _Optional[_Union[Provisioning, _Mapping]] = ..., redshift: _Optional[_Union[Provisioning, _Mapping]] = ..., policy: _Optional[_Union[RoutingPolicy, _Mapping]] = ...) -> None: ...

class RoutingPolicy(_message.Message):
__slots__ = ["policy"]
POLICY_FIELD_NUMBER: _ClassVar[int]
policy: bytes
def __init__(self, policy: _Optional[bytes] = ...) -> None: ...

class PhysicalSnapshot(_message.Message):
__slots__ = ["vdbes", "tables", "location"]
VDBES_FIELD_NUMBER: _ClassVar[int]
TABLES_FIELD_NUMBER: _ClassVar[int]
LOCATION_FIELD_NUMBER: _ClassVar[int]
vdbes: _containers.RepeatedScalarFieldContainer[str]
tables: _containers.RepeatedScalarFieldContainer[str]
location: Engine
def __init__(self, vdbes: _Optional[_Iterable[str]] = ..., tables: _Optional[_Iterable[str]] = ..., location: _Optional[_Union[Engine, str]] = ...) -> None: ...

class Provisioning(_message.Message):
__slots__ = ["instance_type", "num_nodes"]
INSTANCE_TYPE_FIELD_NUMBER: _ClassVar[int]
NUM_NODES_FIELD_NUMBER: _ClassVar[int]
instance_type: str
num_nodes: int
def __init__(self, instance_type: _Optional[str] = ..., num_nodes: _Optional[int] = ...) -> None: ...
30 changes: 30 additions & 0 deletions src/brad/proto_gen/interface/schema_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions src/brad/proto_gen/interface/schema_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union

DESCRIPTOR: _descriptor.FileDescriptor

class DataType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = [] # type: ignore
DT_UNKNOWN: _ClassVar[DataType]
DT_INT_32: _ClassVar[DataType]
DT_INT_64: _ClassVar[DataType]
DT_STRING: _ClassVar[DataType]
DT_UNKNOWN: DataType
DT_INT_32: DataType
DT_INT_64: DataType
DT_STRING: DataType

class Table(_message.Message):
__slots__ = ["name", "columns"]
NAME_FIELD_NUMBER: _ClassVar[int]
COLUMNS_FIELD_NUMBER: _ClassVar[int]
name: str
columns: _containers.RepeatedCompositeFieldContainer[TableColumn]
def __init__(self, name: _Optional[str] = ..., columns: _Optional[_Iterable[_Union[TableColumn, _Mapping]]] = ...) -> None: ...

class TableColumn(_message.Message):
__slots__ = ["name", "type", "nullable"]
NAME_FIELD_NUMBER: _ClassVar[int]
TYPE_FIELD_NUMBER: _ClassVar[int]
NULLABLE_FIELD_NUMBER: _ClassVar[int]
name: str
type: DataType
nullable: bool
def __init__(self, name: _Optional[str] = ..., type: _Optional[_Union[DataType, str]] = ..., nullable: bool = ...) -> None: ...
30 changes: 30 additions & 0 deletions src/brad/proto_gen/interface/vdbe_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions src/brad/proto_gen/interface/vdbe_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union

DESCRIPTOR: _descriptor.FileDescriptor

class QueryInterface(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = [] # type: ignore
QI_UNKNOWN: _ClassVar[QueryInterface]
QI_SQL_POSTGRESQL: _ClassVar[QueryInterface]
QI_SQL_MYSQL: _ClassVar[QueryInterface]
QI_SQL_AWS_REDSHIFT: _ClassVar[QueryInterface]
QI_SQL_AWS_ATHENA: _ClassVar[QueryInterface]
QI_UNKNOWN: QueryInterface
QI_SQL_POSTGRESQL: QueryInterface
QI_SQL_MYSQL: QueryInterface
QI_SQL_AWS_REDSHIFT: QueryInterface
QI_SQL_AWS_ATHENA: QueryInterface

class VirtualEngine(_message.Message):
__slots__ = ["name", "qi", "tables", "max_staleness_ms"]
NAME_FIELD_NUMBER: _ClassVar[int]
QI_FIELD_NUMBER: _ClassVar[int]
TABLES_FIELD_NUMBER: _ClassVar[int]
MAX_STALENESS_MS_FIELD_NUMBER: _ClassVar[int]
name: str
qi: QueryInterface
tables: _containers.RepeatedCompositeFieldContainer[VirtualTable]
max_staleness_ms: int
def __init__(self, name: _Optional[str] = ..., qi: _Optional[_Union[QueryInterface, str]] = ..., tables: _Optional[_Iterable[_Union[VirtualTable, _Mapping]]] = ..., max_staleness_ms: _Optional[int] = ...) -> None: ...

class VirtualTable(_message.Message):
__slots__ = ["name", "writable"]
NAME_FIELD_NUMBER: _ClassVar[int]
WRITABLE_FIELD_NUMBER: _ClassVar[int]
name: str
writable: bool
def __init__(self, name: _Optional[str] = ..., writable: bool = ...) -> None: ...
29 changes: 29 additions & 0 deletions src/brad/proto_gen/interface_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions src/brad/proto_gen/interface_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from interface import blueprint_pb2 as _blueprint_pb2
from interface import schema_pb2 as _schema_pb2
from interface import vdbe_pb2 as _vdbe_pb2
from google.protobuf.internal import containers as _containers
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union

DESCRIPTOR: _descriptor.FileDescriptor

class SystemState(_message.Message):
__slots__ = ["schema_name", "tables", "vdbes", "blueprint"]
SCHEMA_NAME_FIELD_NUMBER: _ClassVar[int]
TABLES_FIELD_NUMBER: _ClassVar[int]
VDBES_FIELD_NUMBER: _ClassVar[int]
BLUEPRINT_FIELD_NUMBER: _ClassVar[int]
schema_name: str
tables: _containers.RepeatedCompositeFieldContainer[_schema_pb2.Table]
vdbes: _containers.RepeatedCompositeFieldContainer[_vdbe_pb2.VirtualEngine]
blueprint: _blueprint_pb2.Blueprint
def __init__(self, schema_name: _Optional[str] = ..., tables: _Optional[_Iterable[_Union[_schema_pb2.Table, _Mapping]]] = ..., vdbes: _Optional[_Iterable[_Union[_vdbe_pb2.VirtualEngine, _Mapping]]] = ..., blueprint: _Optional[_Union[_blueprint_pb2.Blueprint, _Mapping]] = ...) -> None: ...

0 comments on commit 3a70527

Please sign in to comment.