org.apache.hadoop.hbase.rest.model
Class NamespacesInstanceModel

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.model.NamespacesInstanceModel
All Implemented Interfaces:
Serializable, ProtobufMessageHandler

@InterfaceAudience.Private
public class NamespacesInstanceModel
extends Object
implements Serializable, ProtobufMessageHandler

List a HBase namespace's key/value properties.

See Also:
Serialized Form

Constructor Summary
NamespacesInstanceModel()
          Default constructor.
NamespacesInstanceModel(HBaseAdmin admin, String namespaceName)
          Constructor
NamespacesInstanceModel(String namespaceName)
          Constructor to use if namespace does not exist in HBASE.
 
Method Summary
 void addProperty(String key, String value)
          Add property to the namespace.
 byte[] createProtobufOutput()
           
 String getNamespaceName()
           
 ProtobufMessageHandler getObjectFromMessage(byte[] message)
          Initialize the model from a protobuf representation.
 Map<String,String> getProperties()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamespacesInstanceModel

public NamespacesInstanceModel()
Default constructor. Do not use.


NamespacesInstanceModel

public NamespacesInstanceModel(String namespaceName)
                        throws IOException
Constructor to use if namespace does not exist in HBASE.

Parameters:
namespaceName: - the namespace name.
Throws:
IOException

NamespacesInstanceModel

public NamespacesInstanceModel(HBaseAdmin admin,
                               String namespaceName)
                        throws IOException
Constructor

Parameters:
admin: - the administrative API
namespaceName: - the namespace name.
Throws:
IOException
Method Detail

addProperty

public void addProperty(String key,
                        String value)
Add property to the namespace.

Parameters:
key: - attribute name
value - attribute value

getProperties

public Map<String,String> getProperties()
Returns:
The map of uncategorized namespace properties.

getNamespaceName

public String getNamespaceName()

toString

public String toString()
Overrides:
toString in class Object

createProtobufOutput

public byte[] createProtobufOutput()
Specified by:
createProtobufOutput in interface ProtobufMessageHandler
Returns:
the protobuf represention of the model

getObjectFromMessage

public ProtobufMessageHandler getObjectFromMessage(byte[] message)
                                            throws IOException
Description copied from interface: ProtobufMessageHandler
Initialize the model from a protobuf representation.

Specified by:
getObjectFromMessage in interface ProtobufMessageHandler
Parameters:
message - the raw bytes of the protobuf message
Returns:
reference to self for convenience
Throws:
IOException


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.