Package org.apache.hadoop.hbase.rest
Interface ProtobufMessageHandler
- All Known Implementing Classes:
CellModel,CellSetModel,NamespacesInstanceModel,NamespacesModel,RowModel,ScannerModel,StorageClusterStatusModel,TableInfoModel,TableListModel,TableSchemaModel,VersionModel
Common interface for models capable of supporting protobuf marshalling and unmarshalling. Hooks
up to the ProtobufMessageBodyConsumer and ProtobufMessageBodyProducer adapters.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault byte[]Returns the protobuf represention of the model in a byte array.default ProtobufMessageHandlergetObjectFromMessage(byte[] message) Initialize the model from a protobuf representation.default ProtobufMessageHandlerInitialize the model from a protobuf representation.getObjectFromMessage(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) org.apache.hbase.thirdparty.com.google.protobuf.MessageConvert to model to a protobuf Message objectdefault voidWrites the protobuf represention of the model to os
-
Field Details
-
BUFFER_SIZE
- See Also:
-
-
Method Details
-
writeProtobufOutput
Writes the protobuf represention of the model to os- Throws:
IOException
-
createProtobufOutput
Returns the protobuf represention of the model in a byte array. UsewriteProtobufOutput(OutputStream)for better performance- Returns:
- the protobuf encoded object in a byte array
-
messageFromObject
org.apache.hbase.thirdparty.com.google.protobuf.Message messageFromObject()Convert to model to a protobuf Message object- Returns:
- the protobuf Message object
-
getObjectFromMessage
Initialize the model from a protobuf representation. UsegetObjectFromMessage(InputStream)for better performance- Parameters:
message- the raw bytes of the protobuf message- Returns:
- reference to self for convenience
- Throws:
IOException
-
getObjectFromMessage
Initialize the model from a protobuf representation.- Parameters:
is- InputStream providing the protobuf message- Returns:
- reference to self for convenience
- Throws:
IOException
-
getObjectFromMessage
ProtobufMessageHandler getObjectFromMessage(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) throws IOException - Throws:
IOException
-