hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-2579) initializing a new HTable object against a nonexistent table throws a NoServerForRegionException instead of a TableNotFoundException when a different table has been created previously
Date Wed, 16 Jan 2008 17:32:36 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-2579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559603#action_12559603
] 

Hudson commented on HADOOP-2579:
--------------------------------

Integrated in Hadoop-Nightly #367 (See [http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Nightly/367/])

> initializing a new HTable object against a nonexistent table throws a NoServerForRegionException
instead of a TableNotFoundException when a different table has been created previously
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-2579
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2579
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>            Reporter: Peter Dolan
>             Fix For: 0.16.0
>
>         Attachments: 2579.patch
>
>
> When a table has been created, initializing a new HTable object for that table works
properly, as expected, but initializing a new HTable against a nonexistent table in the same
context (a table exists), a NoServerForRegionException is thrown instead of TableNotFoundException,
as would be expected.
> If there haven't been any tables created, initializing a new HTable object against 'nosuchTable'
throws TableNotFoundException, as expected.
> Running the following TestCase exposes the issue on my machine.
> {code:title=TestHTable.java|borderStyle=solid}
> package org.apache.hadoop.hbase;
> import java.io.IOException;
> import org.apache.hadoop.io.Text;
> /**
>  * Tests HTable
>  */
> public class TestHTable extends HBaseClusterTestCase implements HConstants {
>   public void testTableNotFoundExceptionWithoutAnyTables() {
>     try {
>       new HTable(conf, new Text("notATable"));
>       fail("Should have thrown a TableNotFoundException");
>     } catch (TableNotFoundException e) {
>       // expected
>     } catch (IOException e) {
>       e.printStackTrace();
>       fail("Should have thrown a TableNotFoundException instead of a " +
>           e.getClass());
>     }
>   }
>   
>   public void testTableNotFoundExceptionWithATable() {
>     try {
>       HColumnDescriptor column =
>         new HColumnDescriptor(COLUMN_FAMILY.toString());
>       HBaseAdmin admin = new HBaseAdmin(conf);
>       HTableDescriptor testTableADesc =
>         new HTableDescriptor("table");
>       testTableADesc.addFamily(column);
>       admin.createTable(testTableADesc);
>       // This should throw a TableNotFoundException, it has not been created
>       new HTable(conf, new Text("notATable"));
>       
>       fail("Should have thrown a TableNotFoundException");
>     } catch (TableNotFoundException e) {
>       // expected
>     } catch (IOException e) {
>       e.printStackTrace();
>       fail("Should have thrown a TableNotFoundException instead of a " +
>           e.getClass());
>     }
>   }
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message