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)
|
(Jean-Daniel Cryans via Stack)
|
||||||
HBASE-831 committing BatchUpdate with no row should complain
|
HBASE-831 committing BatchUpdate with no row should complain
|
||||||
(Andrew Purtell via Jim Kellerman)
|
(Andrew Purtell via Jim Kellerman)
|
||||||
|
HBASE-833 Doing an insert with an unknown family throws a NPE in HRS
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HBASE-801 When a table haven't disable, shell could response in a "user
|
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.FileSystem;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.hbase.HBaseConfiguration;
|
import org.apache.hadoop.hbase.HBaseConfiguration;
|
||||||
|
import org.apache.hadoop.hbase.HColumnDescriptor;
|
||||||
import org.apache.hadoop.hbase.HConstants;
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
import org.apache.hadoop.hbase.HMsg;
|
import org.apache.hadoop.hbase.HMsg;
|
||||||
import org.apache.hadoop.hbase.HRegionInfo;
|
import org.apache.hadoop.hbase.HRegionInfo;
|
||||||
|
@ -1159,15 +1160,18 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
|
||||||
batchUpdate.iterator(); iter.hasNext();) {
|
batchUpdate.iterator(); iter.hasNext();) {
|
||||||
|
|
||||||
BatchOperation operation = iter.next();
|
BatchOperation operation = iter.next();
|
||||||
int maxLength =
|
if (operation.getValue() != null) {
|
||||||
desc.getFamily(HStoreKey.getFamily(operation.getColumn())).
|
HColumnDescriptor fam =
|
||||||
getMaxValueLength();
|
desc.getFamily(HStoreKey.getFamily(operation.getColumn()));
|
||||||
if(operation.getValue() != null)
|
if (fam != null) {
|
||||||
if(operation.getValue().length > maxLength) {
|
int maxLength = fam.getMaxValueLength();
|
||||||
throw new IOException("Value in column " +
|
if (operation.getValue().length > maxLength) {
|
||||||
Bytes.toString(operation.getColumn()) + " is too long. " +
|
throw new IOException("Value in column "
|
||||||
operation.getValue().length + " instead of " + maxLength);
|
+ Bytes.toString(operation.getColumn()) + " is too long. "
|
||||||
|
+ operation.getValue().length + " instead of " + maxLength);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue