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
-
Method Summary
Modifier and TypeMethodDescriptiondefault byte[]
Returns the protobuf represention of the model in a byte array.default ProtobufMessageHandler
getObjectFromMessage
(byte[] message) Initialize the model from a protobuf representation.default ProtobufMessageHandler
Initialize the model from a protobuf representation.getObjectFromMessage
(org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream cis) org.apache.hbase.thirdparty.com.google.protobuf.Message
Convert to model to a protobuf Message objectdefault void
Writes 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
-