class HBaseTable extends HBaseTableBean {

    static final Logger logger =
            Logger.getLogger(HBaseTable.class.getName());

    protected boolean create = false;
    protected HConnection hconn = null;
    protected ThreadLocal<HTableInterface> htable = new ThreadLocal<HTableInterface>();

    public boolean getCreate() {
        return create;
    }
    /** Create the named table if it doesn't exist. */
    public void setCreate(boolean create) {
        this.create = create;
    }

    public HBaseTable() {
    }

    protected synchronized HConnection hconnection() throws IOException {
        if (hconn == null) {
            hconn = HConnectionManager.createConnection(hbase.configuration());
        }
        return hconn;
    }

    protected HTableInterface htable() throws IOException {
        if (htable.get() == null) {
            htable.set(hconnection().getTable(htableName));
        }
        return htable.get();
    }

    @Override
    public void put(Put p) throws IOException {
        try {
            htable().put(p);
        } catch (IOException e) {
            reset();
            throw e;
        }
    }

    @Override
    public Result get(Get g) throws IOException {
        try {
            return htable().get(g);
        } catch (IOException e) {
            reset();
            throw e;
        }
    }

    public HTableDescriptor getHtableDescriptor() throws IOException {
        try {
            return htable().getTableDescriptor();
        } catch (IOException e) {
            reset();
            throw e;
        }
    }

    @Override
    public void start() {<FILL_FUNCTION_BODY>}

    protected void reset() {
        if (htable.get() != null) {
            try {
                htable.get().close();
            } catch (IOException e) {
                logger.log(Level.WARNING, "htablename='" + htableName + "' htable.close() threw " + e, e);
            }
            htable.remove();
        }

        if (hconn != null) {
            try {
                hconn.close();
            } catch (IOException e) {
                logger.log(Level.WARNING, "hconn.close() threw " + e, e);
            }
            // HConnectionManager.deleteStaleConnection(hconn);
            hconn = null;
        }

        hbase.reset();
    }

    @Override
    public synchronized void stop() {
        super.stop();
        reset();
    }
}

        if (getCreate()) {
            int attempt = 1;
            while (true) {
                try {
                    HBaseAdmin admin = hbase.admin();
                    if (!admin.tableExists(htableName)) {
                        HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(htableName));
                        logger.info("hbase table '" + htableName + "' does not exist, creating it... " + desc);
                        admin.createTable(desc);
                    }
                    break;
                } catch (IOException e) {
                    logger.log(Level.WARNING, "(attempt " + attempt + ") problem creating hbase table " + htableName, e);
                    attempt++;
                    reset();
                    // back off up to 60 seconds between retries
                    try {
                        Thread.sleep(Math.min(attempt * 1000, 60000));
                    } catch (InterruptedException e1) {
                    }
                }
            }
        }

        super.start();
    
<methods>public void <init>() ,public abstract Result get(Get) throws java.io.IOException,public org.archive.modules.recrawl.hbase.HBase getHbase() ,public abstract HTableDescriptor getHtableDescriptor() throws java.io.IOException,public java.lang.String getHtableName() ,public java.lang.String getName() ,public boolean isRunning() ,public abstract void put(Put) throws java.io.IOException,public void setHbase(org.archive.modules.recrawl.hbase.HBase) ,public void setHtableName(java.lang.String) ,public void setName(java.lang.String) ,public void start() ,public synchronized void stop() <variables>protected org.archive.modules.recrawl.hbase.HBase hbase,protected java.lang.String htableName,protected transient boolean isRunning