org.apache.hadoop.hbase.io.hfile
Class HFile.FileInfo

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.HFile.FileInfo
All Implemented Interfaces:
Map<byte[],byte[]>, SortedMap<byte[],byte[]>
Enclosing class:
HFile

public static class HFile.FileInfo
extends Object
implements SortedMap<byte[],byte[]>

Metadata for this file. Conjured by the writer. Read in by the reader.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static byte[] MAX_TAGS_LEN
           
 
Constructor Summary
HFile.FileInfo()
           
 
Method Summary
 HFile.FileInfo append(byte[] k, byte[] v, boolean checkPrefix)
          Append the given key/value pair to the file info, optionally checking the key prefix.
 void clear()
           
 Comparator<? super byte[]> comparator()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<byte[],byte[]>> entrySet()
           
 boolean equals(Object o)
           
 byte[] firstKey()
           
 byte[] get(Object key)
           
 int hashCode()
           
 SortedMap<byte[],byte[]> headMap(byte[] toKey)
           
 boolean isEmpty()
           
 Set<byte[]> keySet()
           
 byte[] lastKey()
           
 byte[] put(byte[] key, byte[] value)
           
 void putAll(Map<? extends byte[],? extends byte[]> m)
           
 byte[] remove(Object key)
           
 int size()
           
 SortedMap<byte[],byte[]> subMap(byte[] fromKey, byte[] toKey)
           
 SortedMap<byte[],byte[]> tailMap(byte[] fromKey)
           
 Collection<byte[]> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_TAGS_LEN

public static final byte[] MAX_TAGS_LEN
Constructor Detail

HFile.FileInfo

public HFile.FileInfo()
Method Detail

append

public HFile.FileInfo append(byte[] k,
                             byte[] v,
                             boolean checkPrefix)
                      throws IOException
Append the given key/value pair to the file info, optionally checking the key prefix.

Parameters:
k - key to add
v - value to add
checkPrefix - whether to check that the provided key does not start with the reserved prefix
Returns:
this file info object
Throws:
IOException - if the key or value is invalid

clear

public void clear()
Specified by:
clear in interface Map<byte[],byte[]>

comparator

public Comparator<? super byte[]> comparator()
Specified by:
comparator in interface SortedMap<byte[],byte[]>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<byte[],byte[]>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<byte[],byte[]>

entrySet

public Set<Map.Entry<byte[],byte[]>> entrySet()
Specified by:
entrySet in interface Map<byte[],byte[]>
Specified by:
entrySet in interface SortedMap<byte[],byte[]>

equals

public boolean equals(Object o)
Specified by:
equals in interface Map<byte[],byte[]>
Overrides:
equals in class Object

firstKey

public byte[] firstKey()
Specified by:
firstKey in interface SortedMap<byte[],byte[]>

get

public byte[] get(Object key)
Specified by:
get in interface Map<byte[],byte[]>

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<byte[],byte[]>
Overrides:
hashCode in class Object

headMap

public SortedMap<byte[],byte[]> headMap(byte[] toKey)
Specified by:
headMap in interface SortedMap<byte[],byte[]>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<byte[],byte[]>

keySet

public Set<byte[]> keySet()
Specified by:
keySet in interface Map<byte[],byte[]>
Specified by:
keySet in interface SortedMap<byte[],byte[]>

lastKey

public byte[] lastKey()
Specified by:
lastKey in interface SortedMap<byte[],byte[]>

put

public byte[] put(byte[] key,
                  byte[] value)
Specified by:
put in interface Map<byte[],byte[]>

putAll

public void putAll(Map<? extends byte[],? extends byte[]> m)
Specified by:
putAll in interface Map<byte[],byte[]>

remove

public byte[] remove(Object key)
Specified by:
remove in interface Map<byte[],byte[]>

size

public int size()
Specified by:
size in interface Map<byte[],byte[]>

subMap

public SortedMap<byte[],byte[]> subMap(byte[] fromKey,
                                       byte[] toKey)
Specified by:
subMap in interface SortedMap<byte[],byte[]>

tailMap

public SortedMap<byte[],byte[]> tailMap(byte[] fromKey)
Specified by:
tailMap in interface SortedMap<byte[],byte[]>

values

public Collection<byte[]> values()
Specified by:
values in interface Map<byte[],byte[]>
Specified by:
values in interface SortedMap<byte[],byte[]>


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