33 * All Rights Reserved.
44 */
55
6- package io .tarantool .pool .unit ;
6+ package io .tarantool .pool .availability . heartbeat ;
77
88import java .io .IOException ;
99import java .util .stream .Stream ;
2121import io .tarantool .core .protocol .IProtoRawResponse ;
2222import io .tarantool .core .protocol .IProtoResponse ;
2323import io .tarantool .core .protocol .requests .IProtoConstant ;
24- import io .tarantool .pool .availability .heartbeat .PingResult ;
2524
2625class PingResultTest {
2726
@@ -73,22 +72,22 @@ final class IProtoResponses {
7372
7473 private IProtoResponses () {}
7574
76- /** Заголовок обычного (не ошибочного) ответа : request type = 0 (IPROTO_OK). */
75+ /** Normal (non-error) response header : request type = 0 (IPROTO_OK). */
7776 private static final MapValue OK_HEADER =
7877 ValueFactory .newMap (
7978 ValueFactory .newInteger (IProtoConstant .IPROTO_REQUEST_TYPE ), ValueFactory .newInteger (0 ));
8079
81- /** Заголовок ошибочного ответа : 0x8000 | code. */
80+ /** Error response header : 0x8000 | code. */
8281 private static MapValue errorHeader (int code ) {
8382 return ValueFactory .newMap (
8483 ValueFactory .newInteger (IProtoConstant .IPROTO_REQUEST_TYPE ),
8584 ValueFactory .newInteger (IProtoConstant .IPROTO_ERROR_BASE + code ));
8685 }
8786
8887 /**
89- * Собирает ответ из заголовка и тела .
88+ * Builds a response from a header and a body .
9089 *
91- * <p>Формат пакета : [заголовок][тело ]; {@code headerSize} = длина заголовка .
90+ * <p>Packet format : [header][body ]; {@code headerSize} = header length .
9291 */
9392 static IProtoResponse response (MapValue header , Value body ) {
9493 try (final MessageBufferPacker headerPacker = MessagePack .newDefaultBufferPacker ();
@@ -109,20 +108,20 @@ static IProtoResponse response(MapValue header, Value body) {
109108 }
110109 }
111110
112- /** Ответ без тела — как от {@code IPROTO_PING}. */
111+ /** Empty-body response, such as from {@code IPROTO_PING}. */
113112 static IProtoResponse emptyBody () {
114113 return response (OK_HEADER , ValueFactory .emptyMap ());
115114 }
116115
117- /** То же, но с произвольным числом элементов в DATA. */
116+ /** Same, but with an arbitrary number of elements in DATA. */
118117 static IProtoResponse dataArray (Value ... values ) {
119118 final ValueFactory .MapBuilder bodyBuilder = ValueFactory .newMapBuilder ();
120119 bodyBuilder .put (
121120 ValueFactory .newInteger (IProtoConstant .IPROTO_DATA ), ValueFactory .newArray (values ));
122121 return response (OK_HEADER , bodyBuilder .build ());
123122 }
124123
125- /** Ответ-ошибка сервера . */
124+ /** Server error response . */
126125 static IProtoResponse error (int code , String message ) {
127126 final MapValue body =
128127 ValueFactory .newMap (
@@ -133,7 +132,7 @@ static IProtoResponse error(int code, String message) {
133132 return response (errorHeader (code ), body );
134133 }
135134
136- /** Ответ без IPROTO_DATA — например, ответ на IPROTO_ID. */
135+ /** A response without IPROTO_DATA — for example, a response to IPROTO_ID. */
137136 static IProtoResponse withoutData () {
138137 return IProtoResponses .response (
139138 OK_HEADER ,
@@ -142,7 +141,7 @@ static IProtoResponse withoutData() {
142141 ValueFactory .newInteger (IProtoConstant .IPROTO_FEATURES ), ValueFactory .emptyArray ()));
143142 }
144143
145- /** IPROTO_DATA есть, но это не массив . */
144+ /** IPROTO_DATA is present, but it is not an array . */
146145 static IProtoResponse dataNotArray () {
147146 return IProtoResponses .response (
148147 OK_HEADER ,
0 commit comments