# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: org/apache/texera/amber/engine/common/actormessage.proto, org/apache/texera/amber/engine/common/ambermessage.proto, org/apache/texera/amber/engine/common/executionruntimestate.proto
# plugin: python-betterproto
# This file has been @generated

from dataclasses import dataclass
from typing import (
    Dict,
    List,
)

import betterproto

from ... import core as __core__
from ..architecture import (
    rpc as _architecture_rpc__,
    worker as _architecture_worker__,
)


@dataclass(eq=False, repr=False)
class DirectControlMessagePayloadV2(betterproto.Message):
    control_invocation: "_architecture_rpc__.ControlInvocation" = (
        betterproto.message_field(1, group="value")
    )
    return_invocation: "_architecture_rpc__.ReturnInvocation" = (
        betterproto.message_field(2, group="value")
    )


@dataclass(eq=False, repr=False)
class PythonDataHeader(betterproto.Message):
    tag: "__core__.ChannelIdentity" = betterproto.message_field(1)
    payload_type: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class PythonControlMessage(betterproto.Message):
    tag: "__core__.ChannelIdentity" = betterproto.message_field(1)
    payload: "DirectControlMessagePayloadV2" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class BreakpointFault(betterproto.Message):
    worker_name: str = betterproto.string_field(1)
    faulted_tuple: "BreakpointFaultBreakpointTuple" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class BreakpointFaultBreakpointTuple(betterproto.Message):
    id: int = betterproto.int64_field(1)
    is_input: bool = betterproto.bool_field(2)
    tuple: List[str] = betterproto.string_field(3)


@dataclass(eq=False, repr=False)
class OperatorBreakpoints(betterproto.Message):
    unresolved_breakpoints: List["BreakpointFault"] = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class ExecutionBreakpointStore(betterproto.Message):
    operator_info: Dict[str, "OperatorBreakpoints"] = betterproto.map_field(
        1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )


@dataclass(eq=False, repr=False)
class EvaluatedValueList(betterproto.Message):
    values: List["_architecture_rpc__.EvaluatedValue"] = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class OperatorConsole(betterproto.Message):
    console_messages: List["_architecture_rpc__.ConsoleMessage"] = (
        betterproto.message_field(1)
    )
    evaluate_expr_results: Dict[str, "EvaluatedValueList"] = betterproto.map_field(
        2, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )


@dataclass(eq=False, repr=False)
class ExecutionConsoleStore(betterproto.Message):
    operator_console: Dict[str, "OperatorConsole"] = betterproto.map_field(
        1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )


@dataclass(eq=False, repr=False)
class OperatorWorkerMapping(betterproto.Message):
    operator_id: str = betterproto.string_field(1)
    worker_ids: List[str] = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class OperatorStatistics(betterproto.Message):
    input_metrics: List["_architecture_worker__.PortTupleMetricsMapping"] = (
        betterproto.message_field(1)
    )
    output_metrics: List["_architecture_worker__.PortTupleMetricsMapping"] = (
        betterproto.message_field(2)
    )
    num_workers: int = betterproto.int32_field(3)
    data_processing_time: int = betterproto.int64_field(4)
    control_processing_time: int = betterproto.int64_field(5)
    idle_time: int = betterproto.int64_field(6)


@dataclass(eq=False, repr=False)
class OperatorMetrics(betterproto.Message):
    operator_state: "_architecture_rpc__.WorkflowAggregatedState" = (
        betterproto.enum_field(1)
    )
    operator_statistics: "OperatorStatistics" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class ExecutionStatsStore(betterproto.Message):
    start_time_stamp: int = betterproto.int64_field(1)
    end_time_stamp: int = betterproto.int64_field(2)
    operator_info: Dict[str, "OperatorMetrics"] = betterproto.map_field(
        3, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )
    operator_worker_mapping: List["OperatorWorkerMapping"] = betterproto.message_field(
        4
    )


@dataclass(eq=False, repr=False)
class ExecutionMetadataStore(betterproto.Message):
    state: "_architecture_rpc__.WorkflowAggregatedState" = betterproto.enum_field(1)
    fatal_errors: List["__core__.WorkflowFatalError"] = betterproto.message_field(2)
    execution_id: "__core__.ExecutionIdentity" = betterproto.message_field(3)
    is_recovering: bool = betterproto.bool_field(4)


@dataclass(eq=False, repr=False)
class Backpressure(betterproto.Message):
    enable_backpressure: bool = betterproto.bool_field(1)


@dataclass(eq=False, repr=False)
class CreditUpdate(betterproto.Message):
    pass


@dataclass(eq=False, repr=False)
class ActorCommand(betterproto.Message):
    backpressure: "Backpressure" = betterproto.message_field(1, group="sealed_value")
    credit_update: "CreditUpdate" = betterproto.message_field(2, group="sealed_value")


@dataclass(eq=False, repr=False)
class PythonActorMessage(betterproto.Message):
    payload: "ActorCommand" = betterproto.message_field(1)
