diff --git a/CHANGES.txt b/CHANGES.txt index 57f43b44541..035363b9099 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -29,6 +29,8 @@ Hbase Change Log HBASE-646 EOFException opening HStoreFile info file (spin on HBASE-645and 550) HBASE-648 If mapfile index is empty, run repair HBASE-640 TestMigrate failing on hudson + HASE-651 Table.commit should throw NoSuchColumnFamilyException if column + family doesn't exist IMPROVEMENTS HBASE-559 MR example job to count table rows diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 153a31b777b..9095343bbe8 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -1556,17 +1556,18 @@ public class HRegion implements HConstants { } } - /** + /* * Make sure this is a valid column for the current table * @param columnName - * @throws IOException + * @throws NoSuchColumnFamilyException */ - private void checkColumn(final byte [] columnName) throws IOException { + private void checkColumn(final byte [] columnName) + throws NoSuchColumnFamilyException { if (columnName == null) { return; } if (!regionInfo.getTableDesc().hasFamily(columnName)) { - throw new IOException("Column family on " + + throw new NoSuchColumnFamilyException("Column family on " + Bytes.toString(columnName) + " does not exist in region " + this + " in table " + regionInfo.getTableDesc()); } diff --git a/src/java/org/apache/hadoop/hbase/regionserver/NoSuchColumnFamilyException.java b/src/java/org/apache/hadoop/hbase/regionserver/NoSuchColumnFamilyException.java new file mode 100644 index 00000000000..2df326d0ced --- /dev/null +++ b/src/java/org/apache/hadoop/hbase/regionserver/NoSuchColumnFamilyException.java @@ -0,0 +1,35 @@ +/** + * Copyright 2008 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.regionserver; + +import java.io.IOException; + +/** + * Thrown if request for nonexistent column family. + */ +public class NoSuchColumnFamilyException extends IOException { + public NoSuchColumnFamilyException() { + super(); + } + + public NoSuchColumnFamilyException(String message) { + super(message); + } +} \ No newline at end of file