2525
2626from tarantool .response import (
2727 unpacker_factory as default_unpacker_factory ,
28- Response ,
2928)
3029from tarantool .request import (
3130 packer_factory as default_packer_factory ,
3231 Request ,
33- # RequestOK,
3432 RequestCall ,
3533 RequestDelete ,
3634 RequestEval ,
3735 RequestInsert ,
38- RequestJoin ,
3936 RequestReplace ,
4037 RequestPing ,
4138 RequestSelect ,
42- RequestSubscribe ,
4339 RequestUpdate ,
4440 RequestUpsert ,
4541 RequestAuthenticate ,
6056 DEFAULT_SSL_CIPHERS ,
6157 DEFAULT_SSL_PASSWORD ,
6258 DEFAULT_SSL_PASSWORD_FILE ,
63- REQUEST_TYPE_OK ,
64- REQUEST_TYPE_ERROR ,
6559 IPROTO_GREETING_SIZE ,
6660 ITERATOR_EQ ,
6761 ITERATOR_ALL ,
@@ -1520,61 +1514,6 @@ def _get_auth_type(self):
15201514
15211515 return auth_type
15221516
1523- def _join_v16 (self , server_uuid ):
1524- """
1525- Execute a JOIN request for Tarantool 1.6 and older.
1526-
1527- :param server_uuid: UUID of Tarantool server to join.
1528- :type server_uuid: :obj:`str`
1529-
1530- :raise: :exc:`~AssertionError`,
1531- :exc:`~tarantool.error.DatabaseError`,
1532- :exc:`~tarantool.error.SchemaError`,
1533- :exc:`~tarantool.error.NetworkError`,
1534- :exc:`~tarantool.error.SslError`
1535- """
1536-
1537- request = RequestJoin (self , server_uuid )
1538- self ._socket .sendall (bytes (request ))
1539-
1540- while True :
1541- resp = Response (self , self ._read_response ())
1542- yield resp
1543- if resp .code == REQUEST_TYPE_OK or resp .code >= REQUEST_TYPE_ERROR :
1544- return
1545- self .close () # close connection after JOIN
1546-
1547- def _join_v17 (self , server_uuid ):
1548- """
1549- Execute a JOIN request for Tarantool 1.7 and newer.
1550-
1551- :param server_uuid: UUID of Tarantool server to join.
1552- :type server_uuid: :obj:`str`
1553-
1554- :raise: :exc:`~AssertionError`,
1555- :exc:`~tarantool.error.DatabaseError`,
1556- :exc:`~tarantool.error.SchemaError`,
1557- :exc:`~tarantool.error.NetworkError`,
1558- :exc:`~tarantool.error.SslError`
1559- """
1560-
1561- request = RequestJoin (self , server_uuid )
1562- self ._socket .sendall (bytes (request ))
1563- state = JoinState .HANDSHAKE
1564- while True :
1565- resp = Response (self , self ._read_response ())
1566- yield resp
1567- if resp .code >= REQUEST_TYPE_ERROR :
1568- return
1569- if resp .code == REQUEST_TYPE_OK :
1570- if state == JoinState .HANDSHAKE :
1571- state = JoinState .INITIAL
1572- elif state == JoinState .INITIAL :
1573- state = JoinState .FINAL
1574- elif state == JoinState .FINAL :
1575- state = JoinState .DONE
1576- return
1577-
15781517 def _ops_process (self , space , update_ops ):
15791518 new_ops = []
15801519 for operation in update_ops :
@@ -1584,60 +1523,6 @@ def _ops_process(self, space, update_ops):
15841523 new_ops .append (operation )
15851524 return new_ops
15861525
1587- def join (self , server_uuid ):
1588- """
1589- Execute a JOIN request: `join`_ a replicaset.
1590-
1591- :param server_uuid: UUID of connector "server".
1592- :type server_uuid: :obj:`str`
1593-
1594- :raise: :exc:`~AssertionError`,
1595- :exc:`~tarantool.error.DatabaseError`,
1596- :exc:`~tarantool.error.SchemaError`,
1597- :exc:`~tarantool.error.NetworkError`,
1598- :exc:`~tarantool.error.SslError`
1599-
1600- .. _join: https://www.tarantool.io/en/doc/latest/dev_guide/internals/box_protocol/#iproto-join-0x41
1601- """
1602-
1603- self ._opt_reconnect ()
1604- if self .version_id < version_id (1 , 7 , 0 ):
1605- return self ._join_v16 (server_uuid )
1606- return self ._join_v17 (server_uuid )
1607-
1608- def subscribe (self , cluster_uuid , server_uuid , vclock = None ):
1609- """
1610- Execute a SUBSCRIBE request: `subscribe`_ to a replicaset
1611- updates. Connection is closed after subscribing.
1612-
1613- :param cluster_uuid: UUID of replicaset cluster.
1614- :type cluster_uuid: :obj:`str`
1615-
1616- :param server_uuid: UUID of connector "server".
1617- :type server_uuid: :obj:`str`
1618-
1619- :param vclock: Connector "server" vclock.
1620- :type vclock: :obj:`dict` or :obj:`None`, optional
1621-
1622- :raise: :exc:`~AssertionError`,
1623- :exc:`~tarantool.error.DatabaseError`,
1624- :exc:`~tarantool.error.SchemaError`,
1625- :exc:`~tarantool.error.NetworkError`,
1626- :exc:`~tarantool.error.SslError`
1627-
1628- .. _subscribe: https://www.tarantool.io/en/doc/latest/dev_guide/internals/box_protocol/#iproto-subscribe-0x42
1629- """
1630-
1631- vclock = vclock or {}
1632- request = RequestSubscribe (self , cluster_uuid , server_uuid , vclock )
1633- self ._socket .sendall (bytes (request ))
1634- while True :
1635- resp = Response (self , self ._read_response ())
1636- yield resp
1637- if resp .code >= REQUEST_TYPE_ERROR :
1638- return
1639- self .close () # close connection after SUBSCRIBE
1640-
16411526 def insert (self , space_name , values , * , on_push = None , on_push_ctx = None ):
16421527 """
16431528 Execute an INSERT request: `insert`_ a tuple to the space.
0 commit comments