HBASE-1407 Changing internal structure of ImmutableBytesWritable -- fix broken build

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@773978 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-05-12 16:59:01 +00:00
parent 62b33ba910
commit f9b6ae1af6
2 changed files with 16 additions and 1 deletions

View File

@ -97,7 +97,18 @@ implements WritableComparable<ImmutableBytesWritable> {
* @param b Use passed bytes as backing array for this instance.
*/
public void set(final byte [] b) {
set(b, 0, b.length);
}
/**
* @param b Use passed bytes as backing array for this instance.
* @param offset
* @param length
*/
public void set(final byte [] b, final int offset, final int length) {
this.bytes = b;
this.offset = offset;
this.length = length;
}
/**
@ -110,6 +121,10 @@ implements WritableComparable<ImmutableBytesWritable> {
}
return this.length;
}
public int getLength() {
return getSize();
}
public int getOffset(){
return this.offset;

View File

@ -76,7 +76,7 @@ public class IndexTableReduce extends MapReduceBase implements
// index and store row key, row key already UTF-8 encoded
Field keyField = new Field(indexConf.getRowkeyName(),
Bytes.toString(key.get()),
Bytes.toString(key.get(), key.getOffset(), key.getLength()),
Field.Store.YES, Field.Index.UN_TOKENIZED);
keyField.setOmitNorms(true);
doc.add(keyField);