Tabnine Logo
MessageSerializer.serializeResponse
Code IndexAdd Tabnine to your IDE (free)

How to use
serializeResponse
method
in
org.apache.flink.queryablestate.network.messages.MessageSerializer

Best Java code snippets using org.apache.flink.queryablestate.network.messages.MessageSerializer.serializeResponse (Showing top 9 results out of 315)

origin: apache/flink

final ByteBuf serialResp = MessageSerializer.serializeResponse(ctx.alloc(), requestId, resp);
origin: apache/flink

ByteBuf buf = MessageSerializer.serializeResponse(channel.alloc(), 1222112277L, response);
buf.skipBytes(4); // skip frame length
origin: apache/flink

  @Override
  public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
    ByteBuf buf = (ByteBuf) msg;
    assertEquals(MessageType.REQUEST, MessageSerializer.deserializeHeader(buf));
    long requestId = MessageSerializer.getRequestId(buf);
    KvStateInternalRequest request = serializer.deserializeRequest(buf);
    buf.release();
    KvStateResponse response = new KvStateResponse(serializedResult);
    ByteBuf serResponse = MessageSerializer.serializeResponse(
        ctx.alloc(),
        requestId,
        response);
    ctx.channel().writeAndFlush(serResponse);
  }
});
origin: apache/flink

ByteBuf response = MessageSerializer.serializeResponse(
    serverChannel.alloc(),
    requestId,
origin: apache/flink

/**
 * Tests response serialization with zero-length serialized result.
 */
@Test
public void testResponseSerializationWithZeroLengthSerializedResult() throws Exception {
  byte[] serializedResult = new byte[0];
  final KvStateResponse response = new KvStateResponse(serializedResult);
  final MessageSerializer<KvStateInternalRequest, KvStateResponse> serializer =
      new MessageSerializer<>(new KvStateInternalRequest.KvStateInternalRequestDeserializer(), new KvStateResponse.KvStateResponseDeserializer());
  ByteBuf buf = MessageSerializer.serializeResponse(alloc, 72727278L, response);
  int frameLength = buf.readInt();
  assertEquals(MessageType.REQUEST_RESULT, MessageSerializer.deserializeHeader(buf));
  assertEquals(72727278L, MessageSerializer.getRequestId(buf));
  KvStateResponse responseDeser = serializer.deserializeResponse(buf);
  assertEquals(buf.readerIndex(), frameLength + 4);
  assertArrayEquals(serializedResult, responseDeser.getContent());
}
origin: apache/flink

/**
 * Tests response serialization.
 */
@Test
public void testResponseSerialization() throws Exception {
  long requestId = Integer.MAX_VALUE + 72727278L;
  byte[] serializedResult = randomByteArray(1024);
  final KvStateResponse response = new KvStateResponse(serializedResult);
  final MessageSerializer<KvStateInternalRequest, KvStateResponse> serializer =
      new MessageSerializer<>(new KvStateInternalRequest.KvStateInternalRequestDeserializer(), new KvStateResponse.KvStateResponseDeserializer());
  ByteBuf buf = MessageSerializer.serializeResponse(alloc, requestId, response);
  int frameLength = buf.readInt();
  assertEquals(MessageType.REQUEST_RESULT, MessageSerializer.deserializeHeader(buf));
  assertEquals(requestId, MessageSerializer.getRequestId(buf));
  KvStateResponse responseDeser = serializer.deserializeResponse(buf);
  assertEquals(buf.readerIndex(), frameLength + 4);
  assertArrayEquals(serializedResult, responseDeser.getContent());
}
origin: apache/flink

unexpectedMessage = MessageSerializer.serializeResponse(channel.alloc(), 192L, stateResponse);
origin: org.apache.flink/flink-queryable-state-client-java_2.11

final ByteBuf serialResp = MessageSerializer.serializeResponse(ctx.alloc(), requestId, resp);
origin: com.alibaba.blink/flink-queryable-state-client-java

final ByteBuf serialResp = MessageSerializer.serializeResponse(ctx.alloc(), requestId, resp);
org.apache.flink.queryablestate.network.messagesMessageSerializerserializeResponse

Javadoc

Serializes the response sent to the org.apache.flink.queryablestate.network.Client.

Popular methods of MessageSerializer

  • <init>
  • deserializeHeader
    De-serializes the header and returns the MessageType. The buffer is expected to be at the header po
  • deserializeRequest
    De-serializes the request sent to the org.apache.flink.queryablestate.network.AbstractServerBase. T
  • deserializeRequestFailure
    De-serializes the RequestFailure sent to the org.apache.flink.queryablestate.network.Client in case
  • deserializeResponse
    De-serializes the response sent to the org.apache.flink.queryablestate.network.Client. The buffer i
  • deserializeServerFailure
    De-serializes the failure message sent to the org.apache.flink.queryablestate.network.Client in case
  • getRequestId
    De-serializes the header and returns the MessageType. The buffer is expected to be at the request i
  • serializeRequestFailure
    Serializes the exception containing the failure message sent to the org.apache.flink.queryablestate.
  • serializeServerFailure
    Serializes the failure message sent to the org.apache.flink.queryablestate.network.Client in case of
  • writeHeader
    Helper for serializing the header.
  • writePayload
    Helper for serializing the messages.
  • serializeRequest
    Serializes the request sent to the org.apache.flink.queryablestate.network.AbstractServerBase.
  • writePayload,
  • serializeRequest

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now