Package org.apache.giraph.comm.requests

Examples of org.apache.giraph.comm.requests.RequestType


    // Decode the request
    ChannelBuffer buffer = (ChannelBuffer) msg;
    ChannelBufferInputStream inputStream = new ChannelBufferInputStream(buffer);
    int enumValue = inputStream.readByte();
    RequestType type = RequestType.values()[enumValue];
    Class<? extends WritableRequest> writableRequestClass =
        type.getRequestClass();

    WritableRequest writableRequest =
        ReflectionUtils.newInstance(writableRequestClass, conf);
    writableRequest.readFields(inputStream);
    if (LOG.isDebugEnabled()) {
View Full Code Here


    // 1. Convert message to a stream that can be decoded.
    ChannelBuffer buffer = (ChannelBuffer) msg;
    ChannelBufferInputStream inputStream = new ChannelBufferInputStream(buffer);
    // 2. Get first byte: message type:
    int enumValue = inputStream.readByte();
    RequestType type = RequestType.values()[enumValue];
    if (LOG.isDebugEnabled()) {
      LOG.debug("decode: Got a response of type " + type + " from server:" +
        channel.getRemoteAddress());
    }
    // 3. Create object of the type determined in step 2.
    Class<? extends WritableRequest> writableRequestClass =
      type.getRequestClass();
    WritableRequest serverResponse =
      ReflectionUtils.newInstance(writableRequestClass, conf);
    // 4. Deserialize the inputStream's contents into the newly-constructed
    // serverResponse object.
    try {
View Full Code Here

    }

    // Decode the request
    ByteBuf buf = (ByteBuf) msg;
    int enumValue = buf.readByte();
    RequestType type = RequestType.values()[enumValue];
    Class<? extends WritableRequest> requestClass = type.getRequestClass();
    WritableRequest request =
        ReflectionUtils.newInstance(requestClass, conf);
    request = RequestUtils.decodeWritableRequest(buf, request);

    if (LOG.isDebugEnabled()) {
View Full Code Here

    // 1. Convert message to a stream that can be decoded.
    ByteBuf buf = (ByteBuf) msg;
    ByteBufInputStream inputStream = new ByteBufInputStream(buf);
    // 2. Get first byte: message type:
    int enumValue = inputStream.readByte();
    RequestType type = RequestType.values()[enumValue];
    if (LOG.isDebugEnabled()) {
      LOG.debug("decode: Got a response of type " + type + " from server:" +
        ctx.channel().remoteAddress());
    }
    // 3. Create object of the type determined in step 2.
    Class<? extends WritableRequest> writableRequestClass =
      type.getRequestClass();
    WritableRequest serverResponse =
      ReflectionUtils.newInstance(writableRequestClass, conf);
    // 4. Deserialize the inputStream's contents into the newly-constructed
    // serverResponse object.
    try {
View Full Code Here

TOP

Related Classes of org.apache.giraph.comm.requests.RequestType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.