com.taobao.metamorphosis.network
类 PutCommand

java.lang.Object
  继承者 com.taobao.metamorphosis.network.AbstractRequestCommand
      继承者 com.taobao.metamorphosis.network.PutCommand
所有已实现的接口:
com.taobao.gecko.core.command.Command, com.taobao.gecko.core.command.CommandHeader, com.taobao.gecko.core.command.RequestCommand, MetaEncodeCommand
直接已知子类:
SyncCommand

public class PutCommand
extends AbstractRequestCommand

发送消息命令,协议格式:

put topic partition value-length flag checksum [transactionkey] opaque\r\n data

data的结构如下:

attribute(0个或者1个,固定长度字符串,取决于flag字段) + binary data

作者:
boyan

字段摘要
protected  int checkSum
           
protected  byte[] data
           
protected  int flag
           
protected  int partition
           
 
从接口 com.taobao.metamorphosis.network.MetaEncodeCommand 继承的字段
CRLF, GET_CMD, OFFSET_CMD, PUT_CMD, QUIT_CMD, RESULT_CMD, SPACE, STATS_CMD, SYNC_CMD, TRANS_CMD, VALUE_CMD, VERSION_CMD
 
构造方法摘要
PutCommand(String topic, int partition, byte[] data, int flag, int checkSum, TransactionId transactionId, Integer opaque)
           
PutCommand(String topic, int partition, byte[] data, TransactionId transactionId, int flag, Integer opaque)
           
 
方法摘要
 com.taobao.gecko.core.buffer.IoBuffer encode()
          编码协议
 boolean equals(Object obj)
           
 int getCheckSum()
           
 byte[] getData()
           
 int getFlag()
           
 int getPartition()
           
 com.taobao.gecko.core.command.CommandHeader getRequestHeader()
           
 TransactionId getTransactionId()
           
 int hashCode()
           
 void setCheckSum(int checkSum)
           
 void setData(byte[] data)
           
 void setPartition(int partition)
           
 void setTransactionId(TransactionId transactionId)
           
 
从类 com.taobao.metamorphosis.network.AbstractRequestCommand 继承的方法
getOpaque, getTopic, setOpaque, setTopic
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

data

protected byte[] data

partition

protected int partition

flag

protected final int flag

checkSum

protected int checkSum
构造方法详细信息

PutCommand

public PutCommand(String topic,
                  int partition,
                  byte[] data,
                  TransactionId transactionId,
                  int flag,
                  Integer opaque)

PutCommand

public PutCommand(String topic,
                  int partition,
                  byte[] data,
                  int flag,
                  int checkSum,
                  TransactionId transactionId,
                  Integer opaque)
方法详细信息

getTransactionId

public TransactionId getTransactionId()

setTransactionId

public void setTransactionId(TransactionId transactionId)

getData

public byte[] getData()

getCheckSum

public int getCheckSum()

setCheckSum

public void setCheckSum(int checkSum)

getFlag

public int getFlag()

setData

public void setData(byte[] data)

setPartition

public void setPartition(int partition)

getPartition

public int getPartition()

getRequestHeader

public com.taobao.gecko.core.command.CommandHeader getRequestHeader()
指定者:
接口 com.taobao.gecko.core.command.RequestCommand 中的 getRequestHeader
覆盖:
AbstractRequestCommand 中的 getRequestHeader

encode

public com.taobao.gecko.core.buffer.IoBuffer encode()
从接口 MetaEncodeCommand 复制的描述
编码协议

返回:
编码后的buffer

hashCode

public int hashCode()
覆盖:
AbstractRequestCommand 中的 hashCode

equals

public boolean equals(Object obj)
覆盖:
AbstractRequestCommand 中的 equals


Copyright © 2010–2013. All rights reserved.