From: Bryan T. <tho...@us...> - 2007-03-23 20:01:30
|
Update of /cvsroot/cweb/bigdata/src/java/com/bigdata/service In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30146/src/java/com/bigdata/service Modified Files: AbstractServer.java DataServer.java Log Message: Added "standalone" bigdata instance configuration example. This just starts two data servers on the same host right now, but I plan to expand it to a full local bigdata instance. Index: DataServer.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/service/DataServer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DataServer.java 23 Mar 2007 18:42:45 -0000 1.2 --- DataServer.java 23 Mar 2007 20:01:25 -0000 1.3 *************** *** 57,60 **** --- 57,70 ---- * The bigdata data server. * + * @todo reduce the permissions required to start the server with the server + * starter. + * + * @see src/resources/config for sample configurations. + * + * @todo write tests against an standalone installation and then see what it + * looks like when the data services are running on more than one host. + * note that unisolated operations can be tested without a transaction + * server. + * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ *************** *** 130,191 **** log.info(""); ! boolean destroyEnabled = true; ! if (destroyEnabled) { ! ! new Thread() { ! ! public void run() { ! server.shutdownNow(); ! try { ! journal.closeAndDelete(); ! log.info("Journal deleted."); ! ! } catch (Throwable t) { ! log.warn("Could not delete persistent state: " + t, ! t); ! } ! if (!server.serviceIdFile.delete()) { ! log.warn("Could not delete file: " ! + server.serviceIdFile); ! } ! try { ! Thread.sleep(3); ! } catch (InterruptedException ex) { ! } ! log.info("Service Stop requested"); ! System.exit(1); ! } ! }.start(); ! ! } else { ! ! throw new RemoteException( ! "Service Destroy Not Enabled, Operation Ignored"); ! } } ! // /* ! // * JoinAdmin ! // */ // ! // public void addLookupAttributes(Entry[] arg0) throws RemoteException { // ! // log.info(""); // // // TODO Auto-generated method stub --- 140,192 ---- log.info(""); ! new Thread() { ! public void run() { ! server.shutdownNow(); ! log.info("Deleting state."); ! ! try { ! journal.closeAndDelete(); ! log.info("Journal deleted."); ! } catch (Throwable t) { ! log.warn("Could not delete journal: " + t, t); ! } ! if (!server.serviceIdFile.delete()) { ! log.warn("Could not delete file: " ! + server.serviceIdFile); ! } ! try { ! Thread.sleep(3); ! } catch (InterruptedException ex) { ! } ! log.info("Service stopped."); ! System.exit(1); ! } ! ! }.start(); } ! // /* ! // * JoinAdmin ! // */ // ! // public void addLookupAttributes(Entry[] arg0) throws RemoteException { // ! // log.info(""); // // // TODO Auto-generated method stub Index: AbstractServer.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/service/AbstractServer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractServer.java 23 Mar 2007 19:00:47 -0000 1.3 --- AbstractServer.java 23 Mar 2007 20:01:25 -0000 1.4 *************** *** 95,99 **** * * <pre> ! * java -Djava.security.policy=policy.all -cp lib\jini-ext.jar;lib\start.jar com.sun.jini.start.ServiceStarter src/test/com/bigdata/service/TestServerStarter.config * </pre> * --- 95,99 ---- * * <pre> ! * java -Djava.security.policy=policy.all -cp lib\jini-ext.jar;lib\start.jar com.sun.jini.start.ServiceStarter src/test/com/bigdata/service/TestServerStarter.config * </pre> * *************** *** 136,141 **** * for documentation on how to use the ServiceStarter. * ! * @todo reduce the permissions required to start the server with the server ! * starter. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> --- 136,144 ---- * for documentation on how to use the ServiceStarter. * ! * @todo put a lock on the serviceIdFile while the server is running. ! * ! * @todo the {@link DestroyAdmin} implementation on the {@link DataServer} is ! * not working correctly. Untangle the various ways in which things can ! * be stopped vs destroyed. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> *************** *** 181,184 **** --- 184,189 ---- protected Remote proxy; + private boolean open = false; + /** * The object used to inform the hosting environment that the server is *************** *** 314,317 **** --- 319,324 ---- proxy = exporter.export(impl); + open = true; + log.info("Proxy is " + proxy + "(" + proxy.getClass() + ")"); *************** *** 496,501 **** * Shutdown the server taking time only to unregister it from jini. */ ! public void shutdownNow() { /* * Terminate manager threads. --- 503,512 ---- * Shutdown the server taking time only to unregister it from jini. */ ! synchronized public void shutdownNow() { + if(!open) return; + + open = false; + /* * Terminate manager threads. *************** *** 504,509 **** try { ! log.info("Terminating manager threads."); /* * Hand-shaking with the NonActivableServiceDescriptor. --- 515,524 ---- try { ! log.info("Terminating service management threads."); + joinManager.terminate(); + + discoveryManager.terminate(); + /* * Hand-shaking with the NonActivableServiceDescriptor. *************** *** 511,518 **** lifeCycle.unregister(this); - joinManager.terminate(); - - discoveryManager.terminate(); - } catch (Exception ex) { --- 526,529 ---- *************** *** 622,626 **** public void run() { ! log.info("Runing shutdown."); server.shutdownNow(); --- 633,637 ---- public void run() { ! log.info("Running shutdown."); server.shutdownNow(); |