hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-548) Tool to online single region
Date Thu, 27 Mar 2008 16:35:24 GMT

    [ https://issues.apache.org/jira/browse/HBASE-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582723#action_12582723

stack commented on HBASE-548:

Yeah... I should put it there.  That'd be best place for it.  A method named onlineRegion
(We have a static offlineRegion in HRegion currently.  Should put the two methods together
- they share code).

Another thought I've had is that when we move to jirb or jython or whatever, that we'd be
able to import a repair package/module.   Admins would import the repair package when they
need to go hacking.  The repair package would export functions such as the above.  The functions
would fall through to methods in MetaUtils or we'd just hack up fixes like the above in script.

> Tool to online single region
> ----------------------------
>                 Key: HBASE-548
>                 URL: https://issues.apache.org/jira/browse/HBASE-548
>             Project: Hadoop HBase
>          Issue Type: New Feature
>            Reporter: stack
>            Priority: Minor
> A sequence of events put a region offline in the middle of an online table.  I was unable
to get the region backon by running 'enable table'.  Here is a little bit of code that I ran
to bring the region back online and get the table running again.  This issue is about adding
it to hbase tools (A new package named 'tools'?).
> {code}
>   public static void main(String[] args) throws IOException {
>     HBaseConfiguration c = new HBaseConfiguration();
>     c.set("hbase.master", args[0]);
>     HTable t = new HTable(c, new Text(".META."));
>     Text row = new Text(args[1]);
>     byte [] cell = t.get(row, new Text("info:regioninfo"));
>     HRegionInfo info = Writables.getHRegionInfo(cell);
>     LOG.info(info);
>     long id = t.startUpdate(row);
>     info.setOffline(false);
>     t.put(id, COL_REGIONINFO, Writables.getBytes(info));
>     t.delete(id, COL_SERVER);
>     t.delete(id, COL_STARTCODE);
>     t.commit(id);
>   }
> {code}

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

View raw message