Package org.apache.accumulo.core.data
Class Column
java.lang.Object
org.apache.accumulo.core.data.Column
- All Implemented Interfaces:
Comparable<Column>
,org.apache.hadoop.io.Writable
,org.apache.hadoop.io.WritableComparable<Column>
A column, specified by family, qualifier, and visibility.
-
Field Summary
Modifier and TypeFieldDescriptionbyte[]
byte[]
byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Compares this column to another.boolean
boolean
Checks if this column equals another.byte[]
Gets the column family.byte[]
Gets the column qualifier.byte[]
Gets the column visibility.int
hashCode()
void
readFields
(DataInput in) toString()
Gets a string representation of this column.org.apache.accumulo.core.data.thrift.TColumn
toThrift()
Converts this column to Thrift.void
write
(DataOutput out)
-
Field Details
-
columnFamily
public byte[] columnFamily -
columnQualifier
public byte[] columnQualifier -
columnVisibility
public byte[] columnVisibility
-
-
Constructor Details
-
Column
public Column()Creates a new blank column. -
Column
public Column(byte[] columnFamily, byte[] columnQualifier, byte[] columnVisibility) Creates a new column.- Parameters:
columnFamily
- familycolumnQualifier
- qualifiercolumnVisibility
- visibility
-
Column
public Column(org.apache.accumulo.core.data.thrift.TColumn tcol) Creates a new column.- Parameters:
tcol
- Thrift column
-
-
Method Details
-
compareTo
Compares this column to another. Column families are compared first, then qualifiers, then visibilities.- Specified by:
compareTo
in interfaceComparable<Column>
- Parameters:
that
- column to compare- Returns:
- comparison result
-
readFields
- Specified by:
readFields
in interfaceorg.apache.hadoop.io.Writable
- Throws:
IOException
-
write
- Specified by:
write
in interfaceorg.apache.hadoop.io.Writable
- Throws:
IOException
-
equals
-
equals
Checks if this column equals another.- Parameters:
that
- column to compare- Returns:
- true if this column equals that, false otherwise
-
hashCode
public int hashCode() -
getColumnFamily
public byte[] getColumnFamily()Gets the column family. Not a defensive copy.- Returns:
- family
-
getColumnQualifier
public byte[] getColumnQualifier()Gets the column qualifier. Not a defensive copy.- Returns:
- qualifier
-
getColumnVisibility
public byte[] getColumnVisibility()Gets the column visibility. Not a defensive copy.- Returns:
- visibility
-
toString
Gets a string representation of this column. The family, qualifier, and visibility are interpreted as strings using the UTF-8 encoding; nulls are interpreted as empty strings. -
toThrift
public org.apache.accumulo.core.data.thrift.TColumn toThrift()Converts this column to Thrift.- Returns:
- Thrift column
-