Permalink
Browse files

Customized Threads with generic name for easier monitoring.

  • Loading branch information...
luccioman committed Oct 31, 2017
1 parent 8a48f80 commit 46f37e38dc0e73653edc52112424cae66be6778b
@@ -62,6 +62,7 @@
public RecrawlBusyThread(Switchboard xsb) {
super(3000, 1000); // set lower limits of cycle delay
setName(THREAD_NAME);
this.setIdleSleep(10*60000); // set actual cycle delays
this.setBusySleep(2*60000);
this.setPriority(Thread.MIN_PRIORITY);
@@ -70,6 +70,7 @@
private boolean abort = false; // flag to signal stop of import
public WarcImporter(InputStream f) {
super("WarcImporter - from InputStream");
source = f;
recordCnt = 0;
sourceSize = -1;
@@ -88,6 +89,7 @@ public WarcImporter (InputStream f, String urlinfo) {
}
public WarcImporter(File f) throws FileNotFoundException{
super("WarcImporter - from file " + f.getName());
name = f.getName();
sourceSize = f.length();
source = new FileInputStream(f);
@@ -4297,7 +4297,7 @@ public boolean waitForShutdown() throws InterruptedException {
final int shutdownPort;
if ((shutdownPort = this.getConfigInt(SwitchboardConstants.SERVER_SHUTDOWNPORT, 0)) > 0) {
// init thread to listen to a shutdown port - to receive a shutdown signal
Thread shutdownThread = new Thread() {
Thread shutdownThread = new Thread("Switchboard.waitForShutdown") {
@Override
public void run() {
ServerSocket ss = null;

0 comments on commit 46f37e3

Please sign in to comment.