Skip to content

Commit

Permalink
[accumulo] correct cleanup to only happen once per jvm.
Browse files Browse the repository at this point in the history
  • Loading branch information
busbey committed Jan 25, 2016
1 parent f839ed0 commit 1a719ef
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -96,7 +106,6 @@ public void cleanup() throws DBException {
} catch (MutationsRejectedException e) {
throw new DBException(e);
}
CleanUp.shutdownNow();
}

/**
Expand Down

0 comments on commit 1a719ef

Please sign in to comment.