25
25
26
26
from tarantool .response import (
27
27
unpacker_factory as default_unpacker_factory ,
28
- Response ,
29
28
)
30
29
from tarantool .request import (
31
30
packer_factory as default_packer_factory ,
32
31
Request ,
33
- # RequestOK,
34
32
RequestCall ,
35
33
RequestDelete ,
36
34
RequestEval ,
37
35
RequestInsert ,
38
- RequestJoin ,
39
36
RequestReplace ,
40
37
RequestPing ,
41
38
RequestSelect ,
42
- RequestSubscribe ,
43
39
RequestUpdate ,
44
40
RequestUpsert ,
45
41
RequestAuthenticate ,
60
56
DEFAULT_SSL_CIPHERS ,
61
57
DEFAULT_SSL_PASSWORD ,
62
58
DEFAULT_SSL_PASSWORD_FILE ,
63
- REQUEST_TYPE_OK ,
64
- REQUEST_TYPE_ERROR ,
65
59
IPROTO_GREETING_SIZE ,
66
60
ITERATOR_EQ ,
67
61
ITERATOR_ALL ,
@@ -1520,61 +1514,6 @@ def _get_auth_type(self):
1520
1514
1521
1515
return auth_type
1522
1516
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
-
1578
1517
def _ops_process (self , space , update_ops ):
1579
1518
new_ops = []
1580
1519
for operation in update_ops :
@@ -1584,60 +1523,6 @@ def _ops_process(self, space, update_ops):
1584
1523
new_ops .append (operation )
1585
1524
return new_ops
1586
1525
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
-
1641
1526
def insert (self , space_name , values , * , on_push = None , on_push_ctx = None ):
1642
1527
"""
1643
1528
Execute an INSERT request: `insert`_ a tuple to the space.
0 commit comments