expand initRemoteCrawler() to terminate worker threads if called to deactivate

remote crawl.
On startup we save the resources for remote crawler if disabled. Once started
threads are running idle after disable remote crawl. Now threads are terminated
to save the resources also while disabeling during runtime.
+ remove empty class Channels
pull/44/head
reger 9 years ago
parent 2048b7e057
commit a6617ad887

@ -1,31 +0,0 @@
/**
* Channels
* Copyright 2010 by Michael Peter Christen
* First released 10.5.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This file is part of YaCy Content Integration
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program in the file lgpl21.txt
* If not, see <http://www.gnu.org/licenses/>.
*/
package net.yacy.cora.document.feed;
public class Channels {
}

@ -1486,7 +1486,9 @@ public final class Switchboard extends serverSwitch {
/**
* Initialisize and perform all settings to enable remote crawls
* (if remote crawl is not in use, save the resources)
* (if remote crawl is not in use, save the resources) If called with
* activate==false worker threads are closed and removed (to free resources)
*
* @param activate true=enable, false=disable
*/
public void initRemoteCrawler(final boolean activate) {
@ -1536,6 +1538,9 @@ public final class Switchboard extends serverSwitch {
}
rcl.setBusySleep(getConfigLong(SwitchboardConstants.CRAWLJOB_REMOTE_CRAWL_LOADER_BUSYSLEEP, 1000));
rcl.setIdleSleep(getConfigLong(SwitchboardConstants.CRAWLJOB_REMOTE_CRAWL_LOADER_IDLESLEEP, 10000));
} else { // activate==false, terminate and remove threads
terminateThread(SwitchboardConstants.CRAWLJOB_REMOTE_CRAWL_LOADER, true);
terminateThread(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL, true);
}
}
@ -3433,6 +3438,10 @@ public final class Switchboard extends serverSwitch {
}
}
public void initBookmarks(boolean b) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public class receiptSending implements Runnable
{
private final Seed initiatorPeer;

Loading…
Cancel
Save