mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-24 14:45:56 +00:00
Merge pull request #223 from nlevitt/hbase-refactor
merging reset HBaseAdmin on error
This commit is contained in:
@@ -111,4 +111,16 @@ public class HBase implements Lifecycle {
|
||||
public void start() {
|
||||
isRunning = true;
|
||||
}
|
||||
|
||||
public synchronized void reset() {
|
||||
if (admin != null) {
|
||||
try {
|
||||
admin.close();
|
||||
} catch (IOException e) {
|
||||
logger.warning("problem closing HBaseAdmin " + admin + " - " + e);
|
||||
}
|
||||
|
||||
admin = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ public class HBaseTable extends HBaseTableBean {
|
||||
} 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));
|
||||
@@ -145,6 +146,8 @@ public class HBaseTable extends HBaseTableBean {
|
||||
}
|
||||
hconn.remove();
|
||||
}
|
||||
|
||||
hbase.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user