apache-ignite

Форк
0
73 строки · 2.5 Кб
1
# Licensed to the Apache Software Foundation (ASF) under one or more
2
# contributor license agreements.  See the NOTICE file distributed with
3
# this work for additional information regarding copyright ownership.
4
# The ASF licenses this file to You under the Apache License, Version 2.0
5
# (the "License"); you may not use this file except in compliance with
6
# the License.  You may obtain a copy of the License at
7
#
8
#    http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License
15

16
"""
17
Module contains classes and utility methods to create communication configuration for ignite nodes.
18
"""
19

20
from abc import ABCMeta, abstractmethod
21

22

23
class CommunicationSpi(metaclass=ABCMeta):
24
    """
25
    Abstract class for CommunicationSpi.
26
    """
27
    @property
28
    @abstractmethod
29
    def type(self):
30
        """
31
        Type of CommunicationSpi.
32
        """
33

34
    @property
35
    @abstractmethod
36
    def class_name(self):
37
        """
38
        Class name of CommunicationSpi.
39
        """
40

41

42
class TcpCommunicationSpi(CommunicationSpi):
43
    """
44
    TcpCommunicationSpi.
45
    """
46

47
    def __init__(self,
48
                 local_port=47100,
49
                 local_port_range=100,
50
                 idle_connection_timeout: int = None,
51
                 socket_write_timeout: int = None,
52
                 selectors_count: int = None,
53
                 connections_per_node: int = None,
54
                 use_paired_connections: bool = None,
55
                 message_queue_limit: int = None,
56
                 unacknowledged_messages_buffer_size: int = None):
57
        self.local_port = local_port
58
        self.local_port_range = local_port_range
59
        self.idle_connection_timeout: int = idle_connection_timeout
60
        self.socket_write_timeout: int = socket_write_timeout
61
        self.selectors_count: int = selectors_count
62
        self.connections_per_node: int = connections_per_node
63
        self.use_paired_connections: bool = use_paired_connections
64
        self.message_queue_limit: int = message_queue_limit
65
        self.unacknowledged_messages_buffer_size: int = unacknowledged_messages_buffer_size
66

67
    @property
68
    def class_name(self):
69
        return "org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi"
70

71
    @property
72
    def type(self):
73
        return "TCP"
74

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.