HBASE-651 table.commit should throw NoSuchColumnFamilyException if column family doesn't exist

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@661512 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-05-29 22:35:36 +00:00
parent f4d0096a06
commit f8c4649209
3 changed files with 42 additions and 4 deletions

View File

@ -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

View File

@ -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());
}

View File

@ -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);
}
}