Beispiel #1
0
class CreateTopicsRequest_v1(Request):
    """Request to create topic (version 1)."""

    API_KEY = 19
    API_VERSION = 1
    RESPONSE_TYPE = CreateTopicsResponse_v1
    SCHEMA = types.Schema(
        (
            "create_topic_requests",
            types.Array(
                ("topic", types.String("utf-8")),
                ("num_partitions", types.Int32),
                ("replication_factor", types.Int16),
                (
                    "replica_assignment",
                    types.Array(
                        ("partition_id", types.Int32),
                        ("replicas", types.Array(types.Int32)),
                    ),
                ),
                (
                    "configs",
                    types.Array(
                        ("config_key", types.String("utf-8")),
                        ("config_value", types.String("utf-8")),
                    ),
                ),
            ),
        ),
        ("timeout", types.Int32),
        ("validate_only", types.Boolean),
    )
Beispiel #2
0
class CreateTopicsResponse_v0(Response):
    """Response from Create Topic request (version 0)."""

    API_KEY = 19
    API_VERSION = 0
    SCHEMA = types.Schema(('topic_error_codes',
                           types.Array(('topic', types.String('utf-8')),
                                       ('error_code', types.Int16))), )
Beispiel #3
0
class CreateTopicsRequest_v0(Request):
    """Request to create topic (version 0)."""

    API_KEY = 19
    API_VERSION = 0
    RESPONSE_TYPE = CreateTopicsResponse_v0
    SCHEMA = types.Schema(
        ('create_topic_requests',
         types.Array(('topic', types.String('utf-8')),
                     ('num_partitions', types.Int32),
                     ('replication_factor', types.Int16),
                     ('replica_assignment',
                      types.Array(('partition_id', types.Int32),
                                  ('replicas', types.Array(types.Int32)))),
                     ('configs',
                      types.Array(('config_key', types.String('utf-8')),
                                  ('config_value', types.String('utf-8')))))),
        ('timeout', types.Int32),
    )
Beispiel #4
0
class CreateTopicsResponse_v0(Response):
    """Response from Create Topic request (version 0)."""

    API_KEY = 19
    API_VERSION = 0
    SCHEMA = types.Schema((
        "topic_error_codes",
        types.Array(("topic", types.String("utf-8")),
                    ("error_code", types.Int16)),
    ), )