HBASE-833 Doing an insert with an unknown family throws a NPE in HRS
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@686322 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1fb69ec11a
commit
9460067fd8
|
@ -25,6 +25,7 @@ Release 0.3.0 - Unreleased
|
|||
(Jean-Daniel Cryans via Stack)
|
||||
HBASE-831 committing BatchUpdate with no row should complain
|
||||
(Andrew Purtell via Jim Kellerman)
|
||||
HBASE-833 Doing an insert with an unknown family throws a NPE in HRS
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-801 When a table haven't disable, shell could response in a "user
|
||||
|
|
|
@ -53,6 +53,7 @@ import org.apache.hadoop.conf.Configuration;
|
|||
import org.apache.hadoop.fs.FileSystem;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.hbase.HBaseConfiguration;
|
||||
import org.apache.hadoop.hbase.HColumnDescriptor;
|
||||
import org.apache.hadoop.hbase.HConstants;
|
||||
import org.apache.hadoop.hbase.HMsg;
|
||||
import org.apache.hadoop.hbase.HRegionInfo;
|
||||
|
@ -1159,15 +1160,18 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
|
|||
batchUpdate.iterator(); iter.hasNext();) {
|
||||
|
||||
BatchOperation operation = iter.next();
|
||||
int maxLength =
|
||||
desc.getFamily(HStoreKey.getFamily(operation.getColumn())).
|
||||
getMaxValueLength();
|
||||
if(operation.getValue() != null)
|
||||
if(operation.getValue().length > maxLength) {
|
||||
throw new IOException("Value in column " +
|
||||
Bytes.toString(operation.getColumn()) + " is too long. " +
|
||||
operation.getValue().length + " instead of " + maxLength);
|
||||
if (operation.getValue() != null) {
|
||||
HColumnDescriptor fam =
|
||||
desc.getFamily(HStoreKey.getFamily(operation.getColumn()));
|
||||
if (fam != null) {
|
||||
int maxLength = fam.getMaxValueLength();
|
||||
if (operation.getValue().length > maxLength) {
|
||||
throw new IOException("Value in column "
|
||||
+ Bytes.toString(operation.getColumn()) + " is too long. "
|
||||
+ operation.getValue().length + " instead of " + maxLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue