本文整理汇总了Java中org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner.Entry.getKey方法的典型用法代码示例。如果您正苦于以下问题:Java Entry.getKey方法的具体用法?Java Entry.getKey怎么用?Java Entry.getKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner.Entry
的用法示例。
在下文中一共展示了Entry.getKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFully
import org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner.Entry; //导入方法依赖的package包/类
@Override
public void readFully(TreeMap<Slice, Slice> data) throws IOException
{
scanner.rewind();
for (; !scanner.atEnd(); scanner.advance()) {
Entry en = scanner.entry();
int klen = en.getKeyLength();
int vlen = en.getValueLength();
byte[] key = new byte[klen];
byte[] value = new byte[vlen];
en.getKey(key);
en.getValue(value);
data.put(new Slice(key, 0, key.length), new Slice(value, 0, value.length));
}
}
示例2: peek
import org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner.Entry; //导入方法依赖的package包/类
@Override
public boolean peek(Slice key, Slice value) throws IOException
{
if (scanner.atEnd()) {
return false;
}
Entry en = scanner.entry();
byte[] rkey = new byte[en.getKeyLength()];
byte[] rval = new byte[en.getValueLength()];
en.getKey(rkey);
en.getValue(rval);
key.buffer = rkey;
key.offset = 0;
key.length = en.getKeyLength();
value.buffer = rval;
value.offset = 0;
value.length = en.getValueLength();
return true;
}
示例3: next
import org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner.Entry; //导入方法依赖的package包/类
@Override
public boolean next() throws IOException {
if (scanner.atEnd()) return false;
Entry entry = scanner.entry();
keyLength = entry.getKeyLength();
checkKeyBuffer(keyLength);
entry.getKey(keyBuffer);
valueLength = entry.getValueLength();
checkValueBuffer(valueLength);
entry.getValue(valueBuffer);
scanner.advance();
return true;
}
示例4: next
import org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner.Entry; //导入方法依赖的package包/类
public boolean next() throws IOException {
if (scanner.atEnd()) return false;
Entry entry = scanner.entry();
keyLength = entry.getKeyLength();
checkKeyBuffer(keyLength);
entry.getKey(keyBuffer);
valueLength = entry.getValueLength();
checkValueBuffer(valueLength);
entry.getValue(valueBuffer);
scanner.advance();
return true;
}