From: <btm...@us...> - 2010-11-08 23:56:10
|
Revision: 3919 http://bigdata.svn.sourceforge.net/bigdata/?rev=3919&view=rev Author: btmurphy Date: 2010-11-08 23:56:01 +0000 (Mon, 08 Nov 2010) Log Message: ----------- [branch dev-btm]: CHECKPOINT FOR SAFETY - phase 1 of callable executor (client service) smart proxy work. Includes fixes to issues identified by the tests; in particular the com.bigdata.service and com.bigdata.jini tests Modified Paths: -------------- branches/dev-btm/bigdata/src/java/com/bigdata/bfs/GlobalFileSystemHelper.java branches/dev-btm/bigdata/src/java/com/bigdata/event/EventQueueSenderTask.java branches/dev-btm/bigdata/src/java/com/bigdata/journal/AbstractTask.java branches/dev-btm/bigdata/src/java/com/bigdata/journal/ScaleOutIndexManager.java branches/dev-btm/bigdata/src/java/com/bigdata/relation/AbstractResource.java branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/DefaultResourceLocator.java branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/IResourceLocator.java branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/ResourceLocatorMap.java branches/dev-btm/bigdata/src/java/com/bigdata/relation/rule/eval/AbstractStepTask.java branches/dev-btm/bigdata/src/java/com/bigdata/resources/LocalResourceManager.java branches/dev-btm/bigdata/src/java/com/bigdata/resources/StoreManager.java branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractFederation.java branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractIndexCache.java branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractScaleOutFederation.java branches/dev-btm/bigdata/src/java/com/bigdata/service/ClientService.java branches/dev-btm/bigdata/src/java/com/bigdata/service/ClientTaskWrapper.java branches/dev-btm/bigdata/src/java/com/bigdata/service/IClientServiceCallable.java branches/dev-btm/bigdata/src/java/com/bigdata/service/IndexCache.java branches/dev-btm/bigdata/src/java/com/bigdata/service/MetadataService.java branches/dev-btm/bigdata/src/java/com/bigdata/service/ndx/ClientIndexView.java branches/dev-btm/bigdata/src/test/com/bigdata/relation/locator/TestDefaultResourceLocator.java branches/dev-btm/bigdata/src/test/com/bigdata/service/AbstractEmbeddedFederationTestCase.java branches/dev-btm/bigdata/src/test/com/bigdata/service/TestEDS.java branches/dev-btm/bigdata/src/test/com/bigdata/service/TestEmbeddedClient.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/executor/Constants.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/executor/EmbeddedCallableExecutor.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/executor/ServiceImpl.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/jini/start/config/ZookeeperServerConfiguration.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/jini/start/process/ZookeeperProcessHelper.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/loadbalancer/ServiceImpl.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/Constants.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/EmbeddedShardLocator.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/ServiceImpl.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/service/jini/AbstractServer.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/service/jini/DataServer.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/service/jini/JiniClient.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/service/jini/lookup/ServiceCache.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/service/jini/master/AbstractClientTask.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/service/jini/master/ResourceBufferTask.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/service/jini/master/TaskMaster.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/service/jini/util/JiniServicesHelper.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/shard/Constants.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/shard/ServiceImpl.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/transaction/ServiceImpl.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/util/config/ConfigDeployUtil.java branches/dev-btm/bigdata-jini/src/java/com/bigdata/zookeeper/ZooHelper.java branches/dev-btm/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/AbstractFedZooTestCase.java branches/dev-btm/bigdata-jini/src/test/com/bigdata/service/jini/TestAll.java branches/dev-btm/bigdata-jini/src/test/com/bigdata/service/jini/TestBigdataClient.java branches/dev-btm/bigdata-jini/src/test/com/bigdata/service/jini/master/TestAll.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/load/MappedRDFDataLoadMaster.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/load/MappedRDFFileLoadTask.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/magic/IRISUtils.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicAccessPath.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/magic/TempMagicStore.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/rio/AsynchronousStatementBufferFactory.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleFastClosure_3_5_6_7_9.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/rules/RDFJoinNexus.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOAccessPath.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPORelation.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/store/DataLoader.java branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/store/TripleStoreUtility.java branches/dev-btm/bigdata-rdf/src/test/com/bigdata/rdf/rio/EDSAsyncLoader.java branches/dev-btm/bigdata-rdf/src/test/com/bigdata/rdf/store/StressTestCentos.java branches/dev-btm/bigdata-rdf/src/test/com/bigdata/rdf/store/TestLocalTripleStoreTransactionSemantics.java branches/dev-btm/bigdata-rdf/src/test/com/bigdata/rdf/store/TestRelationLocator.java branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSailHelper.java branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/bench/NanoSparqlServer.java branches/dev-btm/bigdata-sails/src/test/com/bigdata/rdf/stress/LoadClosureAndQueryTest.java Modified: branches/dev-btm/bigdata/src/java/com/bigdata/bfs/GlobalFileSystemHelper.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/bfs/GlobalFileSystemHelper.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/bfs/GlobalFileSystemHelper.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -107,14 +107,30 @@ /** * {@link ITx#READ_COMMITTED} view. */ - public BigdataFileSystem getReadCommitted() { - - if (INFO) +//BTM - PRE_CLIENT_SERVICE - BEGIN +//BTM - PRE_CLIENT_SERVICE public BigdataFileSystem getReadCommitted() { +//BTM - PRE_CLIENT_SERVICE +//BTM - PRE_CLIENT_SERVICE if (INFO) +//BTM - PRE_CLIENT_SERVICE log.info(""); +//BTM - PRE_CLIENT_SERVICE +//BTM - PRE_CLIENT_SERVICE return (BigdataFileSystem) indexManager.getResourceLocator().locate( +//BTM - PRE_CLIENT_SERVICE GLOBAL_FILE_SYSTEM_NAMESPACE, ITx.READ_COMMITTED); +//BTM - PRE_CLIENT_SERVICE +//BTM - PRE_CLIENT_SERVICE } + public BigdataFileSystem getReadCommitted + (IConcurrencyManager concurrencyManager, + IBigdataDiscoveryManagement discoveryManager) + { + if (INFO) { log.info(""); - - return (BigdataFileSystem) indexManager.getResourceLocator().locate( - GLOBAL_FILE_SYSTEM_NAMESPACE, ITx.READ_COMMITTED); - + } + return (BigdataFileSystem) indexManager.getResourceLocator() + .locate( indexManager, + concurrencyManager, + discoveryManager, + GLOBAL_FILE_SYSTEM_NAMESPACE, + ITx.READ_COMMITTED ); } +//BTM - PRE_CLIENT_SERVICE - END } Modified: branches/dev-btm/bigdata/src/java/com/bigdata/event/EventQueueSenderTask.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/event/EventQueueSenderTask.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/event/EventQueueSenderTask.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -75,7 +75,12 @@ try { EventReceivingService serviceRef = (EventReceivingService)(discoveryMgr.getLoadBalancerService()); - + if (serviceRef == null) { + logger.log(Level.WARN, "cannot send events to load " + +"balancer from "+serviceName + +" - load balancer unavailable"); + return; + } final long begin = System.currentTimeMillis();//for logging final LinkedList<Event> queuedEvents = new LinkedList<Event>(); Modified: branches/dev-btm/bigdata/src/java/com/bigdata/journal/AbstractTask.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/journal/AbstractTask.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -2325,15 +2325,22 @@ // unisolated view - will create if it does not exist. //BTM - PRE_CLIENT_SERVICE - BEGIN //BTM - PRE_CLIENT_SERVICE return new GlobalFileSystemHelper(this).getGlobalFileSystem(); +//BTM - PRE_CLIENT_SERVICE } +//BTM - PRE_CLIENT_SERVICE +//BTM - PRE_CLIENT_SERVICE // read committed view IFF it exists otherwise [null] +//BTM - PRE_CLIENT_SERVICE return new GlobalFileSystemHelper(this).getReadCommitted(); return new GlobalFileSystemHelper(this) .getGlobalFileSystem (concurrencyManager, resourceManager.getDiscoveryManager()); -//BTM - PRE_CLIENT_SERVICE - END } // read committed view IFF it exists otherwise [null] - return new GlobalFileSystemHelper(this).getReadCommitted(); + return new GlobalFileSystemHelper(this) + .getReadCommitted + (concurrencyManager, + resourceManager.getDiscoveryManager()); +//BTM - PRE_CLIENT_SERVICE - END } @@ -2711,7 +2718,13 @@ }; - return new GlobalFileSystemHelper(tmp).getReadCommitted(); +//BTM - PRE_CLIENT_SERVICE - BEGIN +//BTM - PRE_CLIENT_SERVICE return new GlobalFileSystemHelper(tmp).getReadCommitted(); + return new GlobalFileSystemHelper(tmp) + .getReadCommitted + (concurrencyManager, + resourceManager.getDiscoveryManager()); +//BTM - PRE_CLIENT_SERVICE - END } Modified: branches/dev-btm/bigdata/src/java/com/bigdata/journal/ScaleOutIndexManager.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/journal/ScaleOutIndexManager.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/journal/ScaleOutIndexManager.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -276,7 +276,7 @@ tempStoreFactory.closeAll(); } - // Required IIndexManager + // Required by IIndexManager public void registerIndex(IndexMetadata metadata) { registerIndex(metadata, null); Modified: branches/dev-btm/bigdata/src/java/com/bigdata/relation/AbstractResource.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/relation/AbstractResource.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/relation/AbstractResource.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -542,9 +542,18 @@ } - container = getIndexManager() - .getResourceLocator() - .locate(getContainerNamespace(), getTimestamp()); +//BTM - PRE_CLIENT_SERVICE - BEGIN +//BTM - PRE_CLIENT_SERVICE container = getIndexManager() +//BTM - PRE_CLIENT_SERVICE .getResourceLocator() +//BTM - PRE_CLIENT_SERVICE .locate(getContainerNamespace(), getTimestamp()); + container = + getIndexManager().getResourceLocator() + .locate( getIndexManager(), + getConcurrencyManager(), + getDiscoveryManager(), + getContainerNamespace(), + getTimestamp() ); +//BTM - PRE_CLIENT_SERVICE - END } Modified: branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/DefaultResourceLocator.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/DefaultResourceLocator.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/DefaultResourceLocator.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -52,6 +52,10 @@ import com.bigdata.service.IBigdataFederation; import com.bigdata.sparse.SparseRowStore; +//BTM - FOR_CLIENT_SERVICE +import com.bigdata.discovery.IBigdataDiscoveryManagement; +import com.bigdata.journal.IConcurrencyManager; + /** * Generic implementation relies on a ctor for the resource with the following * method signature: @@ -181,7 +185,15 @@ } // @todo hotspot 2% total query time. - public T locate(final String namespace, final long timestamp) { +//BTM - FOR_CLIENT_SERVICE - BEGIN +//BTM - FOR_CLIENT_SERVICE public T locate(final String namespace, final long timestamp) { + public T locate(IIndexManager indexManager, + IConcurrencyManager concurrencyManager, + IBigdataDiscoveryManagement discoveryManager, + final String namespace, + final long timestamp) + { +//BTM - FOR_CLIENT_SERVICE - END if (namespace == null) throw new IllegalArgumentException(); @@ -258,7 +270,14 @@ } // pass request to delegate. - resource = delegate.locate(namespace, timestamp); +//BTM - FOR_CLIENT_SERVICE - BEGIN +//BTM - FOR_CLIENT_SERVICE resource = delegate.locate(namespace, timestamp); + resource = delegate.locate(indexManager, + concurrencyManager, + discoveryManager, + namespace, + timestamp); +//BTM - FOR_CLIENT_SERVICE - END if (resource != null) { @@ -317,8 +336,17 @@ } // create a new instance of the relation. - resource = newInstance(cls, foundOn.get(), namespace, timestamp, - properties); +//BTM - FOR_CLIENT_SERVICE - BEGIN +//BTM - FOR_CLIENT_SERVICE resource = newInstance(cls, foundOn.get(), namespace, timestamp, +//BTM - FOR_CLIENT_SERVICE properties); + resource = newInstance(cls, + foundOn.get(),//indexManager + concurrencyManager, + discoveryManager, + namespace, + timestamp, + properties); +//BTM - FOR_CLIENT_SERVICE - END // Add to the cache. put(resource); @@ -544,9 +572,19 @@ * * @return A new instance of the identifed resource. */ +//BTM - FOR_CLIENT_SERVICE - BEGIN +//BTM - FOR_CLIENT_SERVICE protected T newInstance(final Class<? extends T> cls, +//BTM - FOR_CLIENT_SERVICE final IIndexManager indexManager, final String namespace, +//BTM - FOR_CLIENT_SERVICE final long timestamp, final Properties properties) { protected T newInstance(final Class<? extends T> cls, - final IIndexManager indexManager, final String namespace, - final long timestamp, final Properties properties) { + final IIndexManager indexManager, + final IConcurrencyManager concurrencyManager, + final IBigdataDiscoveryManagement discoveryManager, + final String namespace, + final long timestamp, + final Properties properties) + { +//BTM - FOR_CLIENT_SERVICE - END if (cls == null) throw new IllegalArgumentException(); @@ -563,12 +601,24 @@ final Constructor<? extends T> ctor; try { - ctor = cls.getConstructor(new Class[] {// - IIndexManager.class,// - String.class,// relation namespace - Long.class, // timestamp of the view - Properties.class // configuration properties. - }); +//BTM - FOR_CLIENT_SERVICE - BEGIN +//BTM - FOR_CLIENT_SERVICE ctor = cls.getConstructor(new Class[] {// +//BTM - FOR_CLIENT_SERVICE IIndexManager.class,// +//BTM - FOR_CLIENT_SERVICE String.class,// relation namespace +//BTM - FOR_CLIENT_SERVICE Long.class, // timestamp of the view +//BTM - FOR_CLIENT_SERVICE Properties.class // configuration properties. +//BTM - FOR_CLIENT_SERVICE }); + ctor = cls.getConstructor + (new Class[] + { IIndexManager.class, + IConcurrencyManager.class, + IBigdataDiscoveryManagement.class, + String.class, // relation namespace + Long.class, // timestamp of the view + Properties.class // configuration properties. + } + ); +//BTM - FOR_CLIENT_SERVICE - END } catch (Exception e) { @@ -580,12 +630,24 @@ final T r; try { - r = ctor.newInstance(new Object[] {// - indexManager,// - namespace, // - timestamp, // - properties // - }); +//BTM - FOR_CLIENT_SERVICE - BEGIN +//BTM - FOR_CLIENT_SERVICE r = ctor.newInstance(new Object[] {// +//BTM - FOR_CLIENT_SERVICE indexManager,// +//BTM - FOR_CLIENT_SERVICE namespace, // +//BTM - FOR_CLIENT_SERVICE timestamp, // +//BTM - FOR_CLIENT_SERVICE properties // +//BTM - FOR_CLIENT_SERVICE }); + r = ctor.newInstance + (new Object[] + { indexManager, + concurrencyManager, + discoveryManager, + namespace, + timestamp, + properties + } + ); +//BTM - FOR_CLIENT_SERVICE - END r.init(); Modified: branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/IResourceLocator.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/IResourceLocator.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/IResourceLocator.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -32,6 +32,11 @@ import com.bigdata.relation.IRelation; import com.bigdata.service.IBigdataFederation; +//BTM - FOR_CLIENT_SERVICE +import com.bigdata.discovery.IBigdataDiscoveryManagement; +import com.bigdata.journal.IConcurrencyManager; +import com.bigdata.journal.IIndexManager; + /** * An object that knows how to resolve a resource identifier (aka namespace) to * an {@link ILocatableResource} instance. "Locating" a relation means (a) @@ -68,6 +73,13 @@ * <code>null</code> if the resource declaration could not be * resolved. */ - public T locate(String namespace, long timestamp); +//BTM - FOR_CLIENT_SERVICE - BEGIN +//BTM - FOR_CLIENT_SERVICE public T locate(String namespace, long timestamp); + public T locate(IIndexManager indexManager, + IConcurrencyManager concurrencyManager, + IBigdataDiscoveryManagement discoveryManager, + String namespace, + long timestamp); +//BTM - FOR_CLIENT_SERVICE - END } Modified: branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/ResourceLocatorMap.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/ResourceLocatorMap.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/relation/locator/ResourceLocatorMap.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -33,6 +33,11 @@ import com.bigdata.relation.IRelation; +//BTM - FOR_CLIENT_SERVICE +import com.bigdata.discovery.IBigdataDiscoveryManagement; +import com.bigdata.journal.IConcurrencyManager; +import com.bigdata.journal.IIndexManager; + /** * A mapping between {@link String}s and {@link IResourceLocator}s. * This can be used to locate local, temporary or virtual relations. @@ -77,7 +82,15 @@ } - public T locate(String relationName, long timestamp) { +//BTM - PRE_CLIENT_SERVICE - BEGIN +//BTM - PRE_CLIENT_SERVICE public T locate(String relationName, long timestamp) { + public T locate(IIndexManager indexManager, + IConcurrencyManager concurrencyManager, + IBigdataDiscoveryManagement discoveryManager, + String relationName, + long timestamp) + { +//BTM - PRE_CLIENT_SERVICE - END if (relationName == null) throw new IllegalArgumentException(); @@ -90,7 +103,14 @@ } - return relationLocator.locate(relationName, timestamp); +//BTM - PRE_CLIENT_SERVICE - BEGIN +//BTM - PRE_CLIENT_SERVICE return relationLocator.locate(relationName, timestamp); + return relationLocator.locate(indexManager, + concurrencyManager, + discoveryManager, + relationName, + timestamp); +//BTM - PRE_CLIENT_SERVICE - END } Modified: branches/dev-btm/bigdata/src/java/com/bigdata/relation/rule/eval/AbstractStepTask.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/relation/rule/eval/AbstractStepTask.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/relation/rule/eval/AbstractStepTask.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -766,9 +766,18 @@ if (!c.containsKey(relationIdentifier)) { - final IRelation relation = (IRelation) indexManager - .getResourceLocator().locate(relationIdentifier, - timestamp); +//BTM - PRE_CLIENT_SERVICE - BEGIN +//BTM - PRE_CLIENT_SERVICE final IRelation relation = (IRelation) indexManager +//BTM - PRE_CLIENT_SERVICE .getResourceLocator().locate(relationIdentifier, +//BTM - PRE_CLIENT_SERVICE timestamp); + final IRelation relation = + (IRelation) indexManager.getResourceLocator() + .locate(indexManager, + concurrencyManager, + discoveryManager, + relationIdentifier, + timestamp); +//BTM - PRE_CLIENT_SERVICE - BEGIN c.put(relationIdentifier, relation); @@ -839,9 +848,18 @@ if (!c.containsKey(relationName)) { - final IRelation relation = (IRelation) indexManager - .getResourceLocator().locate(relationName, - timestamp); +//BTM - PRE_CLIENT_SERVICE - BEGIN +//BTM - PRE_CLIENT_SERVICE final IRelation relation = (IRelation) indexManager +//BTM - PRE_CLIENT_SERVICE .getResourceLocator().locate(relationName, +//BTM - PRE_CLIENT_SERVICE timestamp); + final IRelation relation = + (IRelation) indexManager.getResourceLocator() + .locate(indexManager, + concurrencyManager, + discoveryManager, + relationName, + timestamp); +//BTM - PRE_CLIENT_SERVICE - END c.put(relationName, relation); Modified: branches/dev-btm/bigdata/src/java/com/bigdata/resources/LocalResourceManager.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/resources/LocalResourceManager.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/resources/LocalResourceManager.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -419,13 +419,17 @@ } //false ==> allow in-progress tasks to complete - queueStatsTaskFuture.cancel(false); + if (queueStatsTaskFuture != null) { + queueStatsTaskFuture.cancel(false); + } Util.shutdownExecutorService (scheduledExecutor, timeout, serviceName+".scheduledExecutor", logger); - threadPool.shutdownNow(); + if (threadPool != null) { + threadPool.shutdownNow(); + } //send one last event report (same logic as in AbstractFederation) new EventQueueSenderTask Modified: branches/dev-btm/bigdata/src/java/com/bigdata/resources/StoreManager.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/resources/StoreManager.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/resources/StoreManager.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -746,6 +746,7 @@ */ public boolean awaitRunning() { +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","*** StoreManager.awaitRunning >>> isOpen="+isOpen()+", isStarting="+isStarting()); while (isOpen() && isStarting()) { try { @@ -762,8 +763,10 @@ } +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","*** StoreManager.awaitRunning >>> END LOOP: isOpen="+isOpen()+", isStarting="+isStarting()); } +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","*** StoreManager.awaitRunning >>> RETURN isRunning="+isRunning()+"\n\n"); return isRunning(); } @@ -1358,21 +1361,21 @@ try { -System.out.println("\nStoreManager#Startup >>> start()"); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager#Startup >>> start()"); start(); // successful startup -System.out.println("StoreManager#Startup >>> set isStarting to FALSE"); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager#Startup >>> set isStarting to FALSE"); starting.set(false); // Purge any resources that we no longer require. -System.out.println("StoreManager#Startup >>> PURGE old resources during startup"); if(purgeOldResourcesDuringStartup) purgeOldResources(); } catch (Throwable ex) { -System.out.println("StoreManager#Startup >>> EXCEPTION >>> "+ex); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager#Startup >>> EXCEPTION >>> "+ex+"\n"+com.bigdata.util.Util.getThrowableStackTrace(ex)+"\n"); + // avoid possibility that isRunning() could become true. open.set(false); @@ -1392,7 +1395,7 @@ * flag is turned off. */ -System.out.println("StoreManager#Startup >>> FINALLY >>> set isStarting to FALSE"); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager#Startup >>> FINALLY >>> set isStarting to FALSE"); starting.set(false); if (log.isInfoEnabled()) @@ -1430,30 +1433,29 @@ final private void start() throws InterruptedException { if (!isStarting()) { - throw new IllegalStateException(); - } /* * Verify that the concurrency manager has been set and wait a while * it if is not available yet. */ - { - int nwaits = 0; - while (true) { - try { - getConcurrencyManager(); - break; - } catch (IllegalStateException ex) { - Thread.sleep(100/* ms */); - if (++nwaits % 50 == 0) - log.warn("Waiting for concurrency manager"); - } - } - } + {//begin block + int nwaits = 0; + while (true) { + try { + getConcurrencyManager(); + break; + } catch (IllegalStateException ex) { + Thread.sleep(100/* ms */); + if (++nwaits % 50 == 0) + log.warn("Waiting for concurrency manager"); + } + }//end loop + }//end block - try { +//BTM - PRE_CLIENT_SERVICE try { +//BTM - PRE_CLIENT_SERVICE //BTM - BEGIN - PRE_CLIENT_SERVICE //BTM - PRE_CLIENT_SERVICE final IBigdataFederation<?> fed = getFederation(); //BTM - PRE_CLIENT_SERVICE if (fed == null) { @@ -1496,65 +1498,66 @@ //BTM - PRE_CLIENT_SERVICE log.warn("\n"+stackTrace+"\n"); //BTM - PRE_CLIENT_SERVICE} //BTM - PRE_CLIENT_SERVICE +//BTM - PRE_CLIENT_SERVICE } catch (UnsupportedOperationException ex) { +//BTM - PRE_CLIENT_SERVICE log.warn("Federation not available - running in test case?"); +//BTM - PRE_CLIENT_SERVICE } //BTM - maintain original logic for now - final IBigdataDiscoveryManagement discoveryMgr = + try { + final IBigdataDiscoveryManagement discoveryMgr = getDiscoveryManager(); - if (discoveryMgr == null) { - // Some of the unit tests do not start - // the txs until after the shard service. - // For those tests getDiscoveryManager() - // will return null during startup() of - // the shard service. To have a common - // code path, an exception is thrown - // here, but caught below. - throw new UnsupportedOperationException(); - } - // Wait no more than N seconds for discovery - int nWait = 30; - boolean discoveredTxnSrvc = false; - for(int i=0; i<nWait; i++) { - if (discoveryMgr.getTransactionService() - != null) - { - discoveredTxnSrvc = true; - break; - } - try { - Thread.sleep(1000L); - } catch(InterruptedException ie) { } - if (log.isDebugEnabled()) { - log.debug - ("waiting for transaction " - +"service discovery"); - } - } - if(discoveredTxnSrvc) { - if (log.isDebugEnabled()) { - log.debug - ("discovered transaction " - +"service"); - } - } else { - log.warn("transaction service " - +"unreachable"); -StackTraceElement[] e = (Thread.currentThread()).getStackTrace(); -StringBuffer buf = new StringBuffer(" "+(e[0]).toString()+"\n"); -for(int i=1;i<e.length;i++) { - buf.append(" "+(e[i]).toString()+"\n"); -} -String stackTrace = buf.toString(); -log.warn("\n"+stackTrace+"\n"); - }//endif(discoveredTxnSrvc) +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager.start >>> DISCOVERY MGR = "+discoveryMgr+"\n"); + if (discoveryMgr == null) { + // Some of the unit tests do not start + // the txs until after the shard service. + // For those tests getDiscoveryManager() + // will return null during startup() of + // the shard service. To have a common + // code path, an exception is thrown + // here, but caught below. + + throw new UnsupportedOperationException + ("null discoveryMgr"); + } + + // Wait no more than N seconds for discovery + int nWait = 120; + boolean discoveredTxnSrvc = false; + for(int i=0; i<nWait; i++) { + if (discoveryMgr.getTransactionService() != null) { + discoveredTxnSrvc = true; + break; + } + try { + Thread.sleep(1000L); + } catch(InterruptedException ie) { } + + if (log.isDebugEnabled()) { + log.debug("waiting for transaction " + +"service discovery"); + } + if(discoveredTxnSrvc) { + if (log.isDebugEnabled()) { + log.debug("discovered transaction service"); + } + } else { + log.warn("transaction service unreachable"); + }//endif(discoveredTxnSrvc) + }//endloop(nWait) +//BTM if(discoveredTxnSrvc) { +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager.start >>> TRANSACTION SERVICE DISCOVERED"); +//BTM }else{ +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager.start >>> TRANSACTION SERVICE UNREACHABLE\n"); +//BTM } + } catch (UnsupportedOperationException ex) { +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager.start >>> FEDERATION UNAVAILABLE - test case?\n"); + log.warn("Federation not available - running in test case?"); + } //BTM - END - PRE_CLIENT_SERVICE - } catch (UnsupportedOperationException ex) { - log.warn("Federation not available - running in test case?"); - } - - /* - * Look for pre-existing data files. - */ + /* + * Look for pre-existing data files. + */ if (!isTransient) { if (log.isInfoEnabled()) @@ -1562,7 +1565,9 @@ final Stats stats = new Stats(); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager.start >>> scanDataDirectory [dataDir="+dataDir+"]"); scanDataDirectory(dataDir, stats); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager.start >>> SCAN DONE [dataDir="+dataDir+", stats="+stats+"]"); final int nbad = stats.badFiles.size(); @@ -2122,7 +2127,7 @@ private void scanDataDirectory(File dir, Stats stats) throws InterruptedException { -System.out.println("\nStoreManager.scanDataDirectory >>> dir="+dir); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager.scanDataDirectory >>> [dataDir="+dir+"]"); if (dir == null) throw new IllegalArgumentException(); @@ -2138,11 +2143,12 @@ if (file.isDirectory()) { -System.out.println("\nStoreManager.scanDataDirectory >>> dir="+file); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanDataDirectory >>> PROCESSING DIRECTORY [dir="+file+"]"); scanDataDirectory(file, stats); } else { -System.out.println("\nStoreManager.scanDataDirectory >>> scanFile: "+file); + +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanDataDirectory >>> scanFile [file="+file+"]"); scanFile(file, stats); } @@ -2152,7 +2158,6 @@ } private void scanFile(File file, Stats stats) throws InterruptedException { -System.out.println("\nStoreManager.scanFile >>> "+file); if (Thread.interrupted()) throw new InterruptedException(); @@ -2167,6 +2172,7 @@ // #of bytes in the file as reported by the OS. final long len = file.length(); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","\nStoreManager.scanFile >>> [file="+file+", length="+len+"]"); if (len > 0 && name.endsWith(Options.JNL)) { @@ -2182,7 +2188,7 @@ try { -System.out.println("\nStoreManager.scanFile >>> NEW ManagedJournal: "+file); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanFile >>> JNL >>> NEW ManagedJournal"); tmp = new ManagedJournal(properties); } catch (Exception ex) { @@ -2194,6 +2200,7 @@ stats.badFiles.add(file.getAbsolutePath()); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanFile >>> JNL >>> EXCEPTION - "+ex+"\n"+com.bigdata.util.Util.getThrowableStackTrace(ex)+"\n"); return; } @@ -2222,7 +2229,7 @@ final IndexSegmentStore segStore; try { -System.out.println("\nStoreManager.scanFile >>> NEW IndexSegmentStore: "+file); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanFile >>> SEG >>> NEW IndexSegmentStore("+file+")"); segStore = new IndexSegmentStore(file); } catch (Exception ex) { @@ -2234,6 +2241,7 @@ stats.badFiles.add(file.getAbsolutePath()); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanFile >>> SEG >>> EXCEPTION - "+ex+"\n"+com.bigdata.util.Util.getThrowableStackTrace(ex)+"\n"); return; } @@ -2270,7 +2278,7 @@ && (name.endsWith(Options.JNL) || name .endsWith(Options.SEG))) { -System.out.println("\nStoreManager.scanFile >>> Ignoring empty file: "+file); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanFile >>> Ignoring empty file: "+file); log.warn("Ignoring empty file: " + file); } else { @@ -2279,7 +2287,7 @@ * This file is not relevant to the resource manager. */ -System.out.println("\nStoreManager.scanFile >>> Ignoring irrelevant file: "+file); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanFile >>> Ignoring irrelevant file: "+file); log.warn("Ignoring file: " + file); } @@ -2305,7 +2313,7 @@ // } // addResource(resource, file.getAbsoluteFile()); -System.out.println("\nStoreManager.scanFile >>> addResource: file="+file); +//BTM com.bigdata.util.Util.printStr("TestBigdataClientRemote.txt","StoreManager.scanFile >>> addResource: file="+file); addResource(resource, file); } @@ -3349,7 +3357,7 @@ this.releaseTime = txService.getReleaseTime(); //BTM -log.warn("\n*** StoreManager.purgeOldResources: this.releaseTime="+this.releaseTime+"\n"); +log.warn("*** StoreManager.purgeOldResources: this.releaseTime="+this.releaseTime); } else { Modified: branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractFederation.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractFederation.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractFederation.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -89,6 +89,7 @@ import com.bigdata.journal.ConcurrencyManager; import com.bigdata.journal.IIndexManager; import com.bigdata.journal.LocalTransactionManager; +import java.io.File; /** * Abstract base class for {@link IBigdataFederation} implementations. @@ -113,6 +114,7 @@ //BTM - FOR_CLIENT_SERVICE - BEGIN protected ResourceManager fedResourceMgr; protected IConcurrencyManager fedConcurrencyMgr; +private static int dataDirCounter = 0; //BTM - FOR_CLIENT_SERVICE - END /** @@ -674,16 +676,50 @@ // tempStoreFactory = new TemporaryStoreFactory(this.client // .getTempStoreMaxExtent()); -//BTM - FOR_CLIENT_SERVICE - BEGIN - for passing concurrencyMgr to getGlobalFileSystem and TemporaryStoreFactory.getTempStore +//BTM - FOR_CLIENT_SERVICE - BEGIN +//BTM - FOR_CLIENT_SERVICE - NOTE: getGlobalFileSystem and TemporaryStoreFactory.getTempStore +//BTM - FOR_CLIENT_SERVICE - now expect a ConcurrencyManager to be passed into them. +//BTM - FOR_CLIENT_SERVICE - Thus, the code below was added to provide a ConcurrencyManager +//BTM - FOR_CLIENT_SERVICE - that this AbstractFederation can input when those methods +//BTM - FOR_CLIENT_SERVICE - are invoked. It is not expected that the ConcurrencyManager +//BTM - FOR_CLIENT_SERVICE - created here will be employed in other places in the +//BTM - FOR_CLIENT_SERVICE - code. Note also that in order to create a ConcurrencyManager, +//BTM - FOR_CLIENT_SERVICE - a ResourceManager must first be created and, that ResourceManager +//BTM - FOR_CLIENT_SERVICE - expects the properties that are input to its constructor +//BTM - FOR_CLIENT_SERVICE - will include a valid value for the property named, +//BTM - FOR_CLIENT_SERVICE - "com.bigdata.resources.StoreManager.dataDir". Without this +//BTM - FOR_CLIENT_SERVICE - property, the StoreManager on which the ResourceManager +//BTM - FOR_CLIENT_SERVICE - is based will fail to start. Additionally, it is very +//BTM - FOR_CLIENT_SERVICE - important that the value to which that property is set +//BTM - FOR_CLIENT_SERVICE - be unique for each instance of the ResourceManager/StoreManager +//BTM - FOR_CLIENT_SERVICE - that is created; otherwise, the StoreManager will again +//BTM - FOR_CLIENT_SERVICE - fail to start, and will ultimately throw an +//BTM - FOR_CLIENT_SERVICE - OverlappingFileLockException. Thus, to satisfy this +//BTM - FOR_CLIENT_SERVICE - requirement, the static variable named, 'dataDirCounter' +//BTM - FOR_CLIENT_SERVICE - is declared and incremented for each instantiation of +//BTM - FOR_CLIENT_SERVICE - this class; which provides a unique token that is used +//BTM - FOR_CLIENT_SERVICE - to modify the value of the system property relative to +//BTM - FOR_CLIENT_SERVICE - the other instances of the ResourceManager that are +//BTM - FOR_CLIENT_SERVICE - are created. + Properties resourceMgrProps = (Properties) (client.getProperties()).clone(); + resourceMgrProps.setProperty + ("com.bigdata.resources.StoreManager.dataDir", + System.getProperty("java.io.tmpdir") + +File.separator + +(FedResourceManager.class).getName() + +File.separator + +"StoreManager" + +File.separator + +"dataDir_"+(dataDirCounter++)); this.fedResourceMgr = new FedResourceManager ( (IBigdataDiscoveryManagement)this, (ILocalResourceManagement)this, (IIndexManager)this, - client.getProperties() ); + resourceMgrProps ); this.fedConcurrencyMgr = new ConcurrencyManager - (client.getProperties(), + (resourceMgrProps, new LocalTransactionManager ( (IBigdataDiscoveryManagement)this ), this.fedResourceMgr); @@ -798,7 +834,6 @@ assertOpen(); try { - UUID indexUUID = getMetadataService().registerScaleOutIndex( metadata, separatorKeys, dataServiceUUIDs); @@ -839,22 +874,18 @@ public void dropIndex(String name) { -String dbgFlnm = "TestEmbeddedClient.txt"; if (log.isInfoEnabled()) log.info("name=" + name); assertOpen(); -com.bigdata.util.Util.printStr(dbgFlnm, " AbstractFederation.dropIndex[name="+name+"] - assertOpen = OK"); try { -com.bigdata.util.Util.printStr(dbgFlnm, " AbstractFederation.dropIndex - metadataService = "+getMetadataService()); getMetadataService().dropScaleOutIndex(name); if (log.isInfoEnabled()) log.info("dropped scale-out index."); -com.bigdata.util.Util.printStr(dbgFlnm, " AbstractFederation.dropIndex - getIndexCache = "+getIndexCache()); getIndexCache().dropIndexFromCache(name); } catch (Exception e) { @@ -1752,7 +1783,7 @@ this.shutdown(); } - // For tests + // For tasks started by ClientService and for tests public IConcurrencyManager getConcurrencyManager() { return fedConcurrencyMgr; Modified: branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractIndexCache.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractIndexCache.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractIndexCache.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -105,14 +105,16 @@ final NT nt = new NT(name, timestamp); // test cache before synchronization. +log.warn("\nAbstractIndexCache.getIndex >>> 1a. ndx = indexCache.get("+nt+")\n"); T ndx = indexCache.get(nt); if (ndx != null) { +log.warn("\nAbstractIndexCache.getIndex >>> 1b. NOT NULL - ndx = "+ndx+")\n"); return ndx; } -log.warn("\nAbstractIndexCache.constructor >>> 1. ndx == NULL\n"); +log.warn("\nAbstractIndexCache.getIndex >>> 1b. ndx == NULL\n"); /* * Acquire a lock for the index name and timestamp. This allows @@ -123,25 +125,29 @@ try { +log.warn("\nAbstractIndexCache.getIndex >>> 2a. ndx == indexCache.get("+nt+")\n"); ndx = indexCache.get(nt); if (ndx == null) { -log.warn("\nAbstractIndexCache.constructor >>> 2. ndx == NULL\n"); +log.warn("\nAbstractIndexCache.getIndex >>> 2b. ndx == NULL\n"); +log.warn("\nAbstractIndexCache.getIndex >>> 3a. ndx = newView("+nt+")\n"); if ((ndx = newView(name, timestamp)) == null) { -log.warn("\nAbstractIndexCache.constructor >>> 3. newView -- indx == NULL\n"); if (INFO) log.info("name=" + name + " @ " + timestamp + " : no such index."); +log.warn("\nAbstractIndexCache.getIndex >>> 3b. newView("+nt+") = NULL >>> RETURN\n"); return null; - } + }//(newView == null) +log.warn("\nAbstractIndexCache.getIndex >>> 3b. NOT NULL - newView("+nt+") = "+ndx+"\n"); // add to the cache. // indexCache.put(nt, ndx, false/* dirty */); indexCache.put(nt, ndx); +log.warn("\nAbstractIndexCache.getIndex >>> 3c. indexCache.put("+nt+", "+ndx+")\n"); if (INFO) log.info("name=" + name + " @ " @@ -153,8 +159,9 @@ log.info("name=" + name + " @ " + timestamp + " : cache hit."); - } + }//endif(ndx == null) +log.warn("\nAbstractIndexCache.getIndex >>> 4. FINAL RETURN - ndx = "+ndx+"\n"); return ndx; } finally { @@ -191,8 +198,11 @@ final Map.Entry<NT, WeakReference<T>> entry = itr.next(); final T ndx = entry.getValue().get(); +log.warn("\nAbstractIndexCache.dropIndexFromCache >>> 1a. entry.getValue().get() = "+ndx+"\n"); + if(ndx == null) { +log.warn("\nAbstractIndexCache.dropIndexFromCache >>> 1b. ndx = NULL >>> NEXT ndx\n"); /* * The entry under the key has been cleared so we just skip @@ -220,16 +230,21 @@ + name + " @ " + timestamp); // remove from the cache. - indexCache.remove(entry.getKey()); +//BTM indexCache.remove(entry.getKey()); +Object retVal = indexCache.remove(entry.getKey()); +log.warn("\nAbstractIndexCache.dropIndexFromCache >>> 2. indexCache.remove("+entry.getKey()+") >>> DROPPED [KEY="+entry.getKey()+", VAL="+retVal+"]\n"); - } + }//endif(timestamp == ITx.UNISOLATED || ITx.READ_COMMITTED) - } + }//endif(name.equals(nt.getName) - } + }//end loop - } +log.warn("\nAbstractIndexCache.dropIndexFromCache >>> 3a. VERIFY - getIndex("+name+", ITx.READ_COMMITTED) = "+getIndex(name, ITx.READ_COMMITTED)+"]"); +log.warn("AbstractIndexCache.dropIndexFromCache >>> 3b. VERIFY - getIndex("+name+", ITx.UNISOLATED) = "+getIndex(name, ITx.UNISOLATED)+"]\n"); + }//end sync(indexCache) + } protected void shutdown() { Modified: branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractScaleOutFederation.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractScaleOutFederation.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/service/AbstractScaleOutFederation.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -269,14 +269,14 @@ assertOpen(); -//BTM return getMetadataIndexCache().getIndex(name, timestamp); + return getMetadataIndexCache().getIndex(name, timestamp); -MetadataIndexCache cache = getMetadataIndexCache(); -IMetadataIndex index = cache.getIndex(name, timestamp); -log.warn("\n>>>>AbstractScaleOutFederation.getMetadataIndex: name="+name+", timestamp="+timestamp+", metadataIndexCache="+cache+", metadataIndex="+index+"\n"); -return index; +//BTM - PRE_CLIENT_SERVICE MetadataIndexCache cache = getMetadataIndexCache(); +//BTM - PRE_CLIENT_SERVICE IMetadataIndex index = cache.getIndex(name, timestamp); +//BTM - PRE_CLIENT_SERVICE log.warn("\n>>>>AbstractScaleOutFederation.getMetadataIndex: name="+name+", timestamp="+timestamp+", metadataIndexCache="+cache+", metadataIndex="+index+"\n"); +//BTM - PRE_CLIENT_SERVICE return index; } - + /** * Returns an iterator that will visit the {@link PartitionLocator}s for * the specified scale-out index key range. @@ -477,8 +477,7 @@ int ntries = 0; // updated each time through the loop. -//BTM IMetadataService metadataService = null; -ShardLocator metadataService = null; + ShardLocator metadataService = null; // updated each time through the loop. UUID[] dataServiceUUIDs = null; @@ -646,6 +645,20 @@ } +//BTM - FOR_CLIENT_SERVICE - BEGIN ----------------------------------------------------------- +//BTM - FOR_CLIENT_SERVICE - NOTE: this method was added to address trac issue #190 + public void dropIndex(String name) { + super.dropIndex(name); + try { + getMetadataIndexCache().dropIndexFromCache(name); + getIndexCache().dropIndexFromCache(name); + } catch (Exception e) {//maintain same logic as super.dropIndex? + throw new RuntimeException( e ); + } + } +//BTM - FOR_CLIENT_SERVICE - END ------------------------------------------------------------- + + //BTM - PRE_CLIENT_SERVICE - BEGIN - moved to standalone classes ------------------------------------------------------------------- //BTM - PRE_CLIENT_SERVICE /** //BTM - PRE_CLIENT_SERVICE //BTM - PRE_CLIENT_SERVICE * Task directs a {@link ShardService} to purge any unused resources and to Modified: branches/dev-btm/bigdata/src/java/com/bigdata/service/ClientService.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/service/ClientService.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/service/ClientService.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -37,6 +37,7 @@ import com.bigdata.Banner; //BTM - FOR_CLIENT_SERVICE +import com.bigdata.discovery.IBigdataDiscoveryManagement; import com.bigdata.journal.IIndexManager; import com.bigdata.service.jini.JiniFederation; import com.bigdata.resources.ILocalResourceManagement; @@ -184,7 +185,9 @@ String zkRoot = fed.getZooConfig().zroot; return getFederation().getExecutorService().submit ( new ClientTaskWrapper( (IIndexManager)fed, + fed.getConcurrencyManager(), (ILocalResourceManagement)fed, + (IBigdataDiscoveryManagement)fed, this,//embeddedCallableExecutor task, zkClient, zkAcl, zkRoot) ); Modified: branches/dev-btm/bigdata/src/java/com/bigdata/service/ClientTaskWrapper.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/service/ClientTaskWrapper.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/service/ClientTaskWrapper.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -24,6 +24,8 @@ package com.bigdata.service; +import com.bigdata.discovery.IBigdataDiscoveryManagement; +import com.bigdata.journal.IConcurrencyManager; import com.bigdata.journal.IIndexManager; import com.bigdata.resources.ILocalResourceManagement; @@ -37,7 +39,9 @@ public class ClientTaskWrapper<T> implements Callable<T> { private IIndexManager indexMgr; + private IConcurrencyManager concurrencyMgr; private ILocalResourceManagement localResourceMgr; + private IBigdataDiscoveryManagement discoveryMgr; private CallableExecutor embeddedCallableExecutor; private IClientServiceCallable<T> task; private ZooKeeper zkClient; @@ -45,7 +49,9 @@ private String zkRoot; public ClientTaskWrapper(IIndexManager indexManager, + IConcurrencyManager concurrencyManager, ILocalResourceManagement localResourceManager, + IBigdataDiscoveryManagement discoveryManager, CallableExecutor embeddedCallableExecutor, IClientServiceCallable<T> task, ZooKeeper zookeeperClient, @@ -53,7 +59,9 @@ String zookeeperRoot) { this.indexMgr = indexManager; + this.concurrencyMgr = concurrencyManager; this.localResourceMgr = localResourceManager; + this.discoveryMgr = discoveryManager; this.embeddedCallableExecutor = embeddedCallableExecutor; this.task = task; this.zkClient = zookeeperClient; @@ -63,7 +71,8 @@ public T call() throws Exception { return task.startClientTask - (indexMgr, localResourceMgr, + (indexMgr, concurrencyMgr, + localResourceMgr, discoveryMgr, embeddedCallableExecutor, zkClient, zkAcl, zkRoot); } Modified: branches/dev-btm/bigdata/src/java/com/bigdata/service/IClientServiceCallable.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/bigdata/service/IClientServiceCallable.java 2010-11-08 21:31:17 UTC (rev 3918) +++ branches/dev-btm/bigdata/src/java/com/bigdata/service/IClientServiceCallable.java 2010-11-08 23:56:01 UTC (rev 3919) @@ -17,6 +17,8 @@ package com.bigdata.service; +import com.bigdata.discovery.IBigdataDiscoveryManagement; +import com.bigdata.journal.IConcurrencyManager; import com.bigdata.journal.IIndexManager; import com.bigdata.resources.ILocalResourceManagement; @@ -50,7 +52,9 @@ * @throws Exception if unable to compute a result */ V startClientTask(IIndexManager indexManager, + IConcurrencyManager concurrencyManager, ILocalResourceManagement localResourceManager, + IBigdataDiscoveryManagement discoveryManager, CallableExecutor embeddedCallableExecutor, ZooKeeper zookeeperClient, List<ACL> zookeeperAcl, Modified: branches/dev-btm/bigdata/src/java/com/bigdata/service/IndexCache.java =================================================================== --- branches/dev-btm/bigdata/src/java/com/big... [truncated message content] |