[accumulo] correct cleanup to only happen once per jvm.

closes #340
This commit is contained in:
Sean Busbey 2016-01-24 03:32:51 -06:00
Родитель 0b08f216c3
Коммит 531d6bd65a
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -63,6 +63,16 @@ public class AccumuloClient extends DB {
private Scanner singleScanner = null; // A scanner for reads/deletes.
private Scanner scanScanner = null; // A scanner for use by scan()
static {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
CleanUp.shutdownNow();
}
});
}
@Override
public void init() throws DBException {
colFam = new Text(getProperties().getProperty("accumulo.columnFamily"));
@ -96,7 +106,6 @@ public class AccumuloClient extends DB {
} catch (MutationsRejectedException e) {
throw new DBException(e);
}
CleanUp.shutdownNow();
}
/**