@InterfaceAudience.Private
public interface Dictionary
Modifier and Type | Field and Description |
---|---|
static byte |
NOT_IN_DICTIONARY |
Modifier and Type | Method and Description |
---|---|
short |
addEntry(byte[] data,
int offset,
int length)
Adds an entry to the dictionary.
|
void |
clear()
Flushes the dictionary, empties all values.
|
short |
findEntry(byte[] data,
int offset,
int length)
Finds the index of an entry.
|
short |
findEntry(ByteBuffer data,
int offset,
int length)
Finds the index of an entry.
|
byte[] |
getEntry(short idx)
Gets an entry from the dictionary.
|
void |
init(int initialSize) |
static void |
write(OutputStream out,
byte[] data,
int offset,
int length,
Dictionary dict)
Helper methods to write the dictionary data to the OutputStream
|
static void |
write(OutputStream out,
ByteBuffer data,
int offset,
int length,
Dictionary dict)
Helper methods to write the dictionary data to the OutputStream
|
static final byte NOT_IN_DICTIONARY
void init(int initialSize)
byte[] getEntry(short idx)
idx
- index of the entryshort findEntry(byte[] data, int offset, int length)
data
- the byte array that we're looking upoffset
- Offset into data
to add to Dictionary.length
- Length beyond offset
that comprises entry; must be > 0.NOT_IN_DICTIONARY
if not foundshort findEntry(ByteBuffer data, int offset, int length)
data
- the ByteBuffer that we're looking upoffset
- Offset into data
to add to Dictionary.length
- Length beyond offset
that comprises entry; must be > 0.NOT_IN_DICTIONARY
if not foundshort addEntry(byte[] data, int offset, int length)
findEntry(byte[], int, int)
} to add without duplicating
dictionary entries.data
- the entry to addoffset
- Offset into data
to add to Dictionary.length
- Length beyond offset
that comprises entry; must be > 0.void clear()
static void write(OutputStream out, byte[] data, int offset, int length, Dictionary dict) throws IOException
out
- the outputstream to which data needs to be writtendata
- the data to be written in byte[]offset
- the offsetlength
- length to be writtendict
- the dictionary whose contents are to writtenIOException
static void write(OutputStream out, ByteBuffer data, int offset, int length, Dictionary dict) throws IOException
out
- the outputstream to which data needs to be writtendata
- the data to be written in ByteBufferoffset
- the offsetlength
- length to be writtendict
- the dictionary whose contents are to writtenIOException
Copyright © 2007–2019 Cloudera. All rights reserved.