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:
parent
62b33ba910
commit
f9b6ae1af6
|
@ -97,7 +97,18 @@ implements WritableComparable<ImmutableBytesWritable> {
|
||||||
* @param b Use passed bytes as backing array for this instance.
|
* @param b Use passed bytes as backing array for this instance.
|
||||||
*/
|
*/
|
||||||
public void set(final byte [] b) {
|
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.bytes = b;
|
||||||
|
this.offset = offset;
|
||||||
|
this.length = length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -110,6 +121,10 @@ implements WritableComparable<ImmutableBytesWritable> {
|
||||||
}
|
}
|
||||||
return this.length;
|
return this.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getLength() {
|
||||||
|
return getSize();
|
||||||
|
}
|
||||||
|
|
||||||
public int getOffset(){
|
public int getOffset(){
|
||||||
return this.offset;
|
return this.offset;
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class IndexTableReduce extends MapReduceBase implements
|
||||||
|
|
||||||
// index and store row key, row key already UTF-8 encoded
|
// index and store row key, row key already UTF-8 encoded
|
||||||
Field keyField = new Field(indexConf.getRowkeyName(),
|
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);
|
Field.Store.YES, Field.Index.UN_TOKENIZED);
|
||||||
keyField.setOmitNorms(true);
|
keyField.setOmitNorms(true);
|
||||||
doc.add(keyField);
|
doc.add(keyField);
|
||||||
|
|
Loading…
Reference in New Issue