naming service shutdown stuff
This commit is contained in:
@ -412,6 +412,8 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
}
|
||||
props.setProperty(PROP_ADDED, Long.toString(_context.clock().now()));
|
||||
synchronized(_bf) {
|
||||
if (_isClosed)
|
||||
return false;
|
||||
try {
|
||||
SkipList sl = _bf.getIndex(listname, _stringSerializer, _destSerializer);
|
||||
if (sl == null)
|
||||
@ -450,6 +452,8 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
}
|
||||
}
|
||||
synchronized(_bf) {
|
||||
if (_isClosed)
|
||||
return false;
|
||||
try {
|
||||
SkipList sl = _bf.getIndex(listname, _stringSerializer, _destSerializer);
|
||||
if (sl == null)
|
||||
@ -518,6 +522,8 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
" starting with " + startsWith + " search string " + search +
|
||||
" limit=" + limit + " skip=" + skip);
|
||||
synchronized(_bf) {
|
||||
if (_isClosed)
|
||||
return Collections.EMPTY_MAP;
|
||||
try {
|
||||
SkipList sl = _bf.getIndex(listname, _stringSerializer, _destSerializer);
|
||||
if (sl == null) {
|
||||
@ -575,6 +581,8 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
}
|
||||
}
|
||||
synchronized(_bf) {
|
||||
if (_isClosed)
|
||||
return 0;
|
||||
try {
|
||||
SkipList sl = _bf.getIndex(listname, _stringSerializer, _destSerializer);
|
||||
if (sl == null)
|
||||
@ -590,6 +598,10 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
}
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
close();
|
||||
}
|
||||
|
||||
////////// End NamingService API
|
||||
|
||||
private void dumpDB() {
|
||||
@ -619,7 +631,7 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
}
|
||||
}
|
||||
|
||||
public void close() {
|
||||
private void close() {
|
||||
synchronized(_bf) {
|
||||
try {
|
||||
_bf.close();
|
||||
|
@ -179,4 +179,10 @@ public class MetaNamingService extends DummyNamingService {
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
for (NamingService ns : _services) {
|
||||
ns.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ public abstract class NamingService {
|
||||
* Should not be called by others.
|
||||
* @since 0.8.5
|
||||
*/
|
||||
public void stop() {}
|
||||
public void shutdown() {}
|
||||
|
||||
//// End New API
|
||||
|
||||
|
@ -934,6 +934,7 @@ public class Router {
|
||||
}
|
||||
}
|
||||
try { _context.clientManager().shutdown(); } catch (Throwable t) { _log.log(Log.CRIT, "Error shutting down the client manager", t); }
|
||||
try { _context.namingService().shutdown(); } catch (Throwable t) { _log.log(Log.CRIT, "Error shutting down the naming service", t); }
|
||||
try { _context.jobQueue().shutdown(); } catch (Throwable t) { _log.log(Log.CRIT, "Error shutting down the job queue", t); }
|
||||
//try { _context.adminManager().shutdown(); } catch (Throwable t) { _log.log(Log.CRIT, "Error shutting down the admin manager", t); }
|
||||
try { _context.statPublisher().shutdown(); } catch (Throwable t) { _log.log(Log.CRIT, "Error shutting down the stats manager", t); }
|
||||
|
Reference in New Issue
Block a user