GEODE-2632: change dependencies on GemFireCacheImpl to InternalCache * misc cleanup of code where possible
Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/654d65b5 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/654d65b5 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/654d65b5 Branch: refs/heads/feature/GEODE-2632-15 Commit: 654d65b54d3c7b8423a0a9aa72f19d1c1751ee23 Parents: 48f6e11 Author: Kirk Lund <[email protected]> Authored: Mon May 1 12:48:06 2017 -0700 Committer: Kirk Lund <[email protected]> Committed: Fri May 12 14:57:31 2017 -0700 ---------------------------------------------------------------------- ...erConfigurationServiceEndToEndDUnitTest.java | 6 +- .../web/controllers/AddFreeItemToOrders.java | 38 +- .../RestAPIsAndInterOpsDUnitTest.java | 10 +- .../controllers/RestAPIsWithSSLDUnitTest.java | 13 +- .../internal/ra/spi/JCALocalTransaction.java | 87 +- .../internal/ra/spi/JCAManagedConnection.java | 225 +- .../java/org/apache/geode/DataSerializer.java | 3 +- .../apache/geode/admin/GemFireMemberStatus.java | 27 +- .../admin/internal/CacheHealthEvaluator.java | 69 +- .../admin/internal/FinishBackupRequest.java | 3 +- .../admin/internal/FlushToDiskRequest.java | 24 +- .../admin/internal/MemberHealthEvaluator.java | 102 +- .../admin/internal/PrepareBackupRequest.java | 5 +- .../apache/geode/cache/AttributesFactory.java | 279 +- .../geode/cache/CacheClosedException.java | 18 +- .../org/apache/geode/cache/CacheFactory.java | 66 +- .../geode/cache/DynamicRegionFactory.java | 291 +- .../org/apache/geode/cache/GemFireCache.java | 54 +- .../java/org/apache/geode/cache/Region.java | 1 + .../org/apache/geode/cache/RegionFactory.java | 114 +- .../TransactionDataRebalancedException.java | 8 + .../internal/AsyncEventQueueFactoryImpl.java | 45 +- .../internal/AsyncEventQueueImpl.java | 8 +- .../internal/ParallelAsyncEventQueueImpl.java | 7 +- .../internal/SerialAsyncEventQueueImpl.java | 3 +- .../geode/cache/client/ClientCacheFactory.java | 26 +- .../internal/ClientRegionFactoryImpl.java | 26 +- .../cache/client/internal/ConnectionImpl.java | 33 +- .../cache/client/internal/ExecutablePool.java | 1 - .../client/internal/ExecuteFunctionOp.java | 7 +- .../internal/ExecuteRegionFunctionOp.java | 7 +- .../ExecuteRegionFunctionSingleHopOp.java | 29 +- .../geode/cache/client/internal/GetOp.java | 3 +- .../client/internal/InternalClientCache.java | 37 + .../cache/client/internal/LiveServerPinger.java | 3 +- .../internal/PdxRegistryRecoveryListener.java | 3 +- .../geode/cache/client/internal/PoolImpl.java | 129 +- .../geode/cache/client/internal/ProxyCache.java | 73 +- .../cache/client/internal/QueueManagerImpl.java | 22 +- .../client/internal/RegisterInterestOp.java | 56 +- .../internal/FunctionServiceManager.java | 105 +- .../cache/partition/PartitionRegionHelper.java | 35 +- .../query/internal/AbstractCompiledValue.java | 2 +- .../internal/CompiledAggregateFunction.java | 2 +- .../query/internal/CompiledBindArgument.java | 2 +- .../query/internal/CompiledComparison.java | 4 +- .../cache/query/internal/CompiledFunction.java | 4 +- .../query/internal/CompiledGroupBySelect.java | 8 +- .../geode/cache/query/internal/CompiledID.java | 2 +- .../geode/cache/query/internal/CompiledIn.java | 187 +- .../query/internal/CompiledIndexOperation.java | 2 +- .../query/internal/CompiledIteratorDef.java | 87 +- .../cache/query/internal/CompiledLike.java | 70 +- .../cache/query/internal/CompiledLiteral.java | 2 +- .../cache/query/internal/CompiledNegation.java | 2 +- .../cache/query/internal/CompiledOperation.java | 2 +- .../cache/query/internal/CompiledPath.java | 2 +- .../cache/query/internal/CompiledRegion.java | 3 +- .../cache/query/internal/CompiledSelect.java | 134 +- .../query/internal/CompiledSortCriterion.java | 57 +- .../cache/query/internal/CompiledUndefined.java | 5 +- .../cache/query/internal/CompiledValue.java | 118 +- .../cache/query/internal/DefaultQuery.java | 393 +- .../cache/query/internal/ExecutionContext.java | 226 +- .../query/internal/IndexConditioningHelper.java | 245 + .../internal/IndexCutDownExpansionHelper.java | 80 + .../query/internal/QueryExecutionContext.java | 68 +- .../cache/query/internal/QueryMonitor.java | 88 +- .../geode/cache/query/internal/QueryUtils.java | 895 +--- .../cache/query/internal/RangeJunction.java | 6 +- .../cache/query/internal/RuntimeIterator.java | 2 +- .../query/internal/index/AbstractIndex.java | 973 ++-- .../query/internal/index/AbstractMapIndex.java | 14 +- .../internal/index/CompactMapRangeIndex.java | 6 +- .../query/internal/index/CompactRangeIndex.java | 217 +- .../query/internal/index/DummyQRegion.java | 24 +- .../index/FunctionalIndexCreationHelper.java | 411 +- .../cache/query/internal/index/HashIndex.java | 249 +- .../internal/index/IndexCreationHelper.java | 81 +- .../query/internal/index/IndexManager.java | 155 +- .../query/internal/index/IndexProtocol.java | 4 +- .../cache/query/internal/index/IndexStats.java | 27 +- .../cache/query/internal/index/IndexUtils.java | 40 +- .../query/internal/index/MemoryIndexStore.java | 125 +- .../query/internal/index/PartitionedIndex.java | 2 +- .../query/internal/index/PrimaryKeyIndex.java | 57 +- .../index/PrimaryKeyIndexCreationHelper.java | 21 +- .../cache/query/internal/index/RangeIndex.java | 86 +- .../geode/distributed/ServerLauncher.java | 69 +- .../internal/ClusterConfigurationService.java | 238 +- .../geode/distributed/internal/DSClock.java | 7 +- .../internal/InternalDistributedSystem.java | 25 +- .../distributed/internal/InternalLocator.java | 466 +- .../gms/mgr/GMSMembershipManager.java | 6 +- .../internal/tcpserver/TcpServer.java | 91 +- .../org/apache/geode/internal/DSFIDFactory.java | 34 +- .../org/apache/geode/internal/DeployedJar.java | 91 +- .../geode/internal/InternalDataSerializer.java | 1058 ++--- .../geode/internal/InternalInstantiator.java | 77 +- .../apache/geode/internal/MigrationClient.java | 82 +- .../apache/geode/internal/MigrationServer.java | 159 +- .../geode/internal/PdxSerializerObject.java | 2 +- .../admin/ClientHealthMonitoringRegion.java | 32 +- .../internal/admin/ClientStatsManager.java | 150 +- .../admin/remote/BridgeServerResponse.java | 40 +- .../admin/remote/CacheConfigResponse.java | 38 +- .../admin/remote/CacheInfoResponse.java | 34 +- .../internal/admin/remote/CompactRequest.java | 31 +- .../admin/remote/DurableClientInfoResponse.java | 38 +- .../remote/MissingPersistentIDsRequest.java | 32 +- .../PrepareRevokePersistentIDRequest.java | 36 +- .../remote/RefreshMemberSnapshotResponse.java | 18 +- .../remote/RegionSubRegionsSizeResponse.java | 57 +- .../internal/admin/remote/RemoteCacheInfo.java | 74 +- .../admin/remote/RevokePersistentIDRequest.java | 25 +- .../admin/remote/RootRegionResponse.java | 60 +- .../admin/remote/ShutdownAllRequest.java | 75 +- .../cache/AbstractBucketRegionQueue.java | 13 +- .../internal/cache/AbstractCacheServer.java | 8 +- .../internal/cache/AbstractDiskRegionEntry.java | 6 - .../cache/AbstractOplogDiskRegionEntry.java | 4 +- .../geode/internal/cache/AbstractRegion.java | 718 +-- .../internal/cache/AbstractRegionEntry.java | 724 ++- .../geode/internal/cache/AbstractRegionMap.java | 172 +- .../cache/AddCacheServerProfileMessage.java | 33 +- .../geode/internal/cache/BucketAdvisor.java | 40 +- .../geode/internal/cache/BucketRegion.java | 41 +- .../geode/internal/cache/BucketRegionQueue.java | 27 +- .../geode/internal/cache/CacheConfig.java | 3 +- .../cache/CacheDistributionAdvisee.java | 3 +- .../internal/cache/CacheLifecycleListener.java | 10 +- .../geode/internal/cache/CachePerfStats.java | 5 +- .../geode/internal/cache/CacheServerImpl.java | 139 +- .../internal/cache/CacheServerLauncher.java | 39 +- .../cache/CachedDeserializableFactory.java | 7 +- .../geode/internal/cache/ColocationHelper.java | 53 +- .../internal/cache/CreateRegionProcessor.java | 104 +- .../cache/DestroyPartitionedRegionMessage.java | 2 +- .../internal/cache/DestroyRegionOperation.java | 37 +- .../apache/geode/internal/cache/DiskEntry.java | 126 +- .../apache/geode/internal/cache/DiskRegion.java | 24 +- .../geode/internal/cache/DiskStoreBackup.java | 2 - .../internal/cache/DiskStoreFactoryImpl.java | 62 +- .../geode/internal/cache/DiskStoreImpl.java | 292 +- .../geode/internal/cache/DiskStoreMonitor.java | 75 +- .../internal/cache/DistTXCommitMessage.java | 23 +- .../internal/cache/DistTXPrecommitMessage.java | 18 +- .../internal/cache/DistTXRollbackMessage.java | 27 +- .../DistTXStateProxyImplOnCoordinator.java | 16 +- .../cache/DistributedCacheOperation.java | 120 +- .../geode/internal/cache/DistributedRegion.java | 994 ++-- ...stributedRegionFunctionStreamingMessage.java | 17 +- .../cache/DynamicRegionFactoryImpl.java | 10 +- .../geode/internal/cache/EntryEventImpl.java | 116 +- .../apache/geode/internal/cache/EventID.java | 25 +- .../geode/internal/cache/EventTracker.java | 51 +- .../apache/geode/internal/cache/ExpiryTask.java | 32 +- .../geode/internal/cache/FilterProfile.java | 58 +- .../geode/internal/cache/FilterRoutingInfo.java | 49 +- .../cache/FindDurableQueueProcessor.java | 25 +- .../internal/cache/FindRemoteTXMessage.java | 15 +- .../internal/cache/FindVersionTagOperation.java | 15 +- .../geode/internal/cache/GemFireCacheImpl.java | 102 +- .../geode/internal/cache/GridAdvisor.java | 48 +- .../apache/geode/internal/cache/HARegion.java | 20 +- .../internal/cache/InitialImageOperation.java | 2 +- .../geode/internal/cache/InternalCache.java | 143 +- .../cache/JtaAfterCompletionMessage.java | 27 - .../cache/JtaBeforeCompletionMessage.java | 23 +- .../geode/internal/cache/LeafRegionEntry.cpp | 4 +- .../geode/internal/cache/LocalDataSet.java | 2 +- .../geode/internal/cache/LocalRegion.java | 4423 ++++++++---------- .../cache/MemberFunctionStreamingMessage.java | 37 +- .../internal/cache/NonLocalRegionEntry.java | 7 - .../org/apache/geode/internal/cache/Oplog.java | 642 +-- .../geode/internal/cache/OverflowOplog.java | 277 +- .../internal/cache/PRHARedundancyProvider.java | 5 +- .../geode/internal/cache/PRQueryProcessor.java | 96 +- .../internal/cache/PartitionAttributesImpl.java | 119 +- .../geode/internal/cache/PartitionedRegion.java | 1740 +++---- .../internal/cache/PartitionedRegionHelper.java | 176 +- .../geode/internal/cache/PoolFactoryImpl.java | 29 +- .../geode/internal/cache/ProxyBucketRegion.java | 2 +- .../geode/internal/cache/ProxyRegionMap.java | 15 +- .../geode/internal/cache/RegionEvictorTask.java | 25 +- .../geode/internal/cache/RegionFactoryImpl.java | 20 +- .../internal/cache/RemoteOperationMessage.java | 76 +- .../geode/internal/cache/RemotePutMessage.java | 11 - .../cache/SearchLoadAndWriteProcessor.java | 209 +- .../geode/internal/cache/ServerPingMessage.java | 2 +- .../internal/cache/StateFlushOperation.java | 35 +- .../geode/internal/cache/TXCommitMessage.java | 286 +- .../geode/internal/cache/TXManagerImpl.java | 179 +- .../apache/geode/internal/cache/TXMessage.java | 17 +- .../internal/cache/TXRegionLockRequestImpl.java | 31 +- .../geode/internal/cache/TXRegionState.java | 2 +- .../internal/cache/TXRemoteCommitMessage.java | 21 +- .../internal/cache/TXRemoteRollbackMessage.java | 11 +- .../geode/internal/cache/TXStateProxyImpl.java | 339 +- .../cache/TXSynchronizationRunnable.java | 22 +- .../geode/internal/cache/TombstoneService.java | 55 +- .../VMStatsDiskLRURegionEntryHeapIntKey.java | 3 +- .../VMStatsDiskLRURegionEntryHeapLongKey.java | 3 +- .../VMStatsDiskLRURegionEntryHeapObjectKey.java | 3 +- ...VMStatsDiskLRURegionEntryHeapStringKey1.java | 3 +- ...VMStatsDiskLRURegionEntryHeapStringKey2.java | 3 +- .../VMStatsDiskLRURegionEntryHeapUUIDKey.java | 3 +- .../VMStatsDiskLRURegionEntryOffHeapIntKey.java | 3 +- ...VMStatsDiskLRURegionEntryOffHeapLongKey.java | 3 +- ...StatsDiskLRURegionEntryOffHeapObjectKey.java | 3 +- ...tatsDiskLRURegionEntryOffHeapStringKey1.java | 3 +- ...tatsDiskLRURegionEntryOffHeapStringKey2.java | 3 +- ...VMStatsDiskLRURegionEntryOffHeapUUIDKey.java | 3 +- .../internal/cache/VMStatsDiskRegionEntry.java | 3 - .../cache/VMStatsDiskRegionEntryHeapIntKey.java | 2 +- .../VMStatsDiskRegionEntryHeapLongKey.java | 2 +- .../VMStatsDiskRegionEntryHeapObjectKey.java | 2 +- .../VMStatsDiskRegionEntryHeapStringKey1.java | 2 +- .../VMStatsDiskRegionEntryHeapStringKey2.java | 2 +- .../VMStatsDiskRegionEntryHeapUUIDKey.java | 2 +- .../VMStatsDiskRegionEntryOffHeapIntKey.java | 2 +- .../VMStatsDiskRegionEntryOffHeapLongKey.java | 2 +- .../VMStatsDiskRegionEntryOffHeapObjectKey.java | 2 +- ...VMStatsDiskRegionEntryOffHeapStringKey1.java | 2 +- ...VMStatsDiskRegionEntryOffHeapStringKey2.java | 2 +- .../VMStatsDiskRegionEntryOffHeapUUIDKey.java | 2 +- .../cache/VMStatsLRURegionEntryHeapIntKey.java | 3 +- .../cache/VMStatsLRURegionEntryHeapLongKey.java | 3 +- .../VMStatsLRURegionEntryHeapObjectKey.java | 3 +- .../VMStatsLRURegionEntryHeapStringKey1.java | 3 +- .../VMStatsLRURegionEntryHeapStringKey2.java | 3 +- .../cache/VMStatsLRURegionEntryHeapUUIDKey.java | 3 +- .../VMStatsLRURegionEntryOffHeapIntKey.java | 3 +- .../VMStatsLRURegionEntryOffHeapLongKey.java | 3 +- .../VMStatsLRURegionEntryOffHeapObjectKey.java | 3 +- .../VMStatsLRURegionEntryOffHeapStringKey1.java | 3 +- .../VMStatsLRURegionEntryOffHeapStringKey2.java | 3 +- .../VMStatsLRURegionEntryOffHeapUUIDKey.java | 3 +- .../cache/VMStatsRegionEntryHeapIntKey.java | 2 +- .../cache/VMStatsRegionEntryHeapLongKey.java | 2 +- .../cache/VMStatsRegionEntryHeapObjectKey.java | 2 +- .../cache/VMStatsRegionEntryHeapStringKey1.java | 2 +- .../cache/VMStatsRegionEntryHeapStringKey2.java | 2 +- .../cache/VMStatsRegionEntryHeapUUIDKey.java | 2 +- .../cache/VMStatsRegionEntryOffHeapIntKey.java | 2 +- .../cache/VMStatsRegionEntryOffHeapLongKey.java | 2 +- .../VMStatsRegionEntryOffHeapObjectKey.java | 2 +- .../VMStatsRegionEntryOffHeapStringKey1.java | 2 +- .../VMStatsRegionEntryOffHeapStringKey2.java | 2 +- .../cache/VMStatsRegionEntryOffHeapUUIDKey.java | 2 +- .../VMThinDiskLRURegionEntryHeapIntKey.java | 2 +- .../VMThinDiskLRURegionEntryHeapLongKey.java | 2 +- .../VMThinDiskLRURegionEntryHeapObjectKey.java | 2 +- .../VMThinDiskLRURegionEntryHeapStringKey1.java | 2 +- .../VMThinDiskLRURegionEntryHeapStringKey2.java | 2 +- .../VMThinDiskLRURegionEntryHeapUUIDKey.java | 2 +- .../VMThinDiskLRURegionEntryOffHeapIntKey.java | 2 +- .../VMThinDiskLRURegionEntryOffHeapLongKey.java | 2 +- ...MThinDiskLRURegionEntryOffHeapObjectKey.java | 2 +- ...ThinDiskLRURegionEntryOffHeapStringKey1.java | 2 +- ...ThinDiskLRURegionEntryOffHeapStringKey2.java | 2 +- .../VMThinDiskLRURegionEntryOffHeapUUIDKey.java | 2 +- .../cache/VMThinDiskRegionEntryHeapIntKey.java | 2 +- .../cache/VMThinDiskRegionEntryHeapLongKey.java | 2 +- .../VMThinDiskRegionEntryHeapObjectKey.java | 2 +- .../VMThinDiskRegionEntryHeapStringKey1.java | 2 +- .../VMThinDiskRegionEntryHeapStringKey2.java | 2 +- .../cache/VMThinDiskRegionEntryHeapUUIDKey.java | 2 +- .../VMThinDiskRegionEntryOffHeapIntKey.java | 2 +- .../VMThinDiskRegionEntryOffHeapLongKey.java | 2 +- .../VMThinDiskRegionEntryOffHeapObjectKey.java | 2 +- .../VMThinDiskRegionEntryOffHeapStringKey1.java | 2 +- .../VMThinDiskRegionEntryOffHeapStringKey2.java | 2 +- .../VMThinDiskRegionEntryOffHeapUUIDKey.java | 2 +- .../cache/VMThinLRURegionEntryHeapIntKey.java | 2 +- .../cache/VMThinLRURegionEntryHeapLongKey.java | 2 +- .../VMThinLRURegionEntryHeapObjectKey.java | 2 +- .../VMThinLRURegionEntryHeapStringKey1.java | 2 +- .../VMThinLRURegionEntryHeapStringKey2.java | 2 +- .../cache/VMThinLRURegionEntryHeapUUIDKey.java | 2 +- .../VMThinLRURegionEntryOffHeapIntKey.java | 2 +- .../VMThinLRURegionEntryOffHeapLongKey.java | 2 +- .../VMThinLRURegionEntryOffHeapObjectKey.java | 2 +- .../VMThinLRURegionEntryOffHeapStringKey1.java | 2 +- .../VMThinLRURegionEntryOffHeapStringKey2.java | 2 +- .../VMThinLRURegionEntryOffHeapUUIDKey.java | 2 +- .../cache/VMThinRegionEntryHeapIntKey.java | 2 +- .../cache/VMThinRegionEntryHeapLongKey.java | 2 +- .../cache/VMThinRegionEntryHeapObjectKey.java | 2 +- .../cache/VMThinRegionEntryHeapStringKey1.java | 2 +- .../cache/VMThinRegionEntryHeapStringKey2.java | 2 +- .../cache/VMThinRegionEntryHeapUUIDKey.java | 2 +- .../cache/VMThinRegionEntryOffHeapIntKey.java | 2 +- .../cache/VMThinRegionEntryOffHeapLongKey.java | 2 +- .../VMThinRegionEntryOffHeapObjectKey.java | 2 +- .../VMThinRegionEntryOffHeapStringKey1.java | 2 +- .../VMThinRegionEntryOffHeapStringKey2.java | 2 +- .../cache/VMThinRegionEntryOffHeapUUIDKey.java | 2 +- ...sionedStatsDiskLRURegionEntryHeapIntKey.java | 3 +- ...ionedStatsDiskLRURegionEntryHeapLongKey.java | 7 +- ...nedStatsDiskLRURegionEntryHeapObjectKey.java | 3 +- ...edStatsDiskLRURegionEntryHeapStringKey1.java | 3 +- ...edStatsDiskLRURegionEntryHeapStringKey2.java | 3 +- ...ionedStatsDiskLRURegionEntryHeapUUIDKey.java | 3 +- ...nedStatsDiskLRURegionEntryOffHeapIntKey.java | 3 +- ...edStatsDiskLRURegionEntryOffHeapLongKey.java | 3 +- ...StatsDiskLRURegionEntryOffHeapObjectKey.java | 3 +- ...tatsDiskLRURegionEntryOffHeapStringKey1.java | 3 +- ...tatsDiskLRURegionEntryOffHeapStringKey2.java | 3 +- ...edStatsDiskLRURegionEntryOffHeapUUIDKey.java | 3 +- ...VersionedStatsDiskRegionEntryHeapIntKey.java | 2 +- ...ersionedStatsDiskRegionEntryHeapLongKey.java | 2 +- ...sionedStatsDiskRegionEntryHeapObjectKey.java | 2 +- ...ionedStatsDiskRegionEntryHeapStringKey1.java | 2 +- ...ionedStatsDiskRegionEntryHeapStringKey2.java | 2 +- ...ersionedStatsDiskRegionEntryHeapUUIDKey.java | 2 +- ...sionedStatsDiskRegionEntryOffHeapIntKey.java | 2 +- ...ionedStatsDiskRegionEntryOffHeapLongKey.java | 2 +- ...nedStatsDiskRegionEntryOffHeapObjectKey.java | 2 +- ...edStatsDiskRegionEntryOffHeapStringKey1.java | 2 +- ...edStatsDiskRegionEntryOffHeapStringKey2.java | 2 +- ...ionedStatsDiskRegionEntryOffHeapUUIDKey.java | 2 +- .../VersionedStatsLRURegionEntryHeapIntKey.java | 3 +- ...VersionedStatsLRURegionEntryHeapLongKey.java | 3 +- ...rsionedStatsLRURegionEntryHeapObjectKey.java | 3 +- ...sionedStatsLRURegionEntryHeapStringKey1.java | 3 +- ...sionedStatsLRURegionEntryHeapStringKey2.java | 3 +- ...VersionedStatsLRURegionEntryHeapUUIDKey.java | 3 +- ...rsionedStatsLRURegionEntryOffHeapIntKey.java | 3 +- ...sionedStatsLRURegionEntryOffHeapLongKey.java | 3 +- ...onedStatsLRURegionEntryOffHeapObjectKey.java | 3 +- ...nedStatsLRURegionEntryOffHeapStringKey1.java | 3 +- ...nedStatsLRURegionEntryOffHeapStringKey2.java | 3 +- ...sionedStatsLRURegionEntryOffHeapUUIDKey.java | 3 +- .../VersionedStatsRegionEntryHeapIntKey.java | 2 +- .../VersionedStatsRegionEntryHeapLongKey.java | 2 +- .../VersionedStatsRegionEntryHeapObjectKey.java | 2 +- ...VersionedStatsRegionEntryHeapStringKey1.java | 2 +- ...VersionedStatsRegionEntryHeapStringKey2.java | 2 +- .../VersionedStatsRegionEntryHeapUUIDKey.java | 2 +- .../VersionedStatsRegionEntryOffHeapIntKey.java | 2 +- ...VersionedStatsRegionEntryOffHeapLongKey.java | 2 +- ...rsionedStatsRegionEntryOffHeapObjectKey.java | 2 +- ...sionedStatsRegionEntryOffHeapStringKey1.java | 2 +- ...sionedStatsRegionEntryOffHeapStringKey2.java | 2 +- ...VersionedStatsRegionEntryOffHeapUUIDKey.java | 2 +- ...rsionedThinDiskLRURegionEntryHeapIntKey.java | 4 +- ...sionedThinDiskLRURegionEntryHeapLongKey.java | 4 +- ...onedThinDiskLRURegionEntryHeapObjectKey.java | 4 +- ...nedThinDiskLRURegionEntryHeapStringKey1.java | 4 +- ...nedThinDiskLRURegionEntryHeapStringKey2.java | 4 +- ...sionedThinDiskLRURegionEntryHeapUUIDKey.java | 4 +- ...onedThinDiskLRURegionEntryOffHeapIntKey.java | 4 +- ...nedThinDiskLRURegionEntryOffHeapLongKey.java | 4 +- ...dThinDiskLRURegionEntryOffHeapObjectKey.java | 4 +- ...ThinDiskLRURegionEntryOffHeapStringKey1.java | 4 +- ...ThinDiskLRURegionEntryOffHeapStringKey2.java | 4 +- ...nedThinDiskLRURegionEntryOffHeapUUIDKey.java | 4 +- .../VersionedThinDiskRegionEntryHeapIntKey.java | 2 +- ...VersionedThinDiskRegionEntryHeapLongKey.java | 2 +- ...rsionedThinDiskRegionEntryHeapObjectKey.java | 2 +- ...sionedThinDiskRegionEntryHeapStringKey1.java | 2 +- ...sionedThinDiskRegionEntryHeapStringKey2.java | 2 +- ...VersionedThinDiskRegionEntryHeapUUIDKey.java | 2 +- ...rsionedThinDiskRegionEntryOffHeapIntKey.java | 2 +- ...sionedThinDiskRegionEntryOffHeapLongKey.java | 2 +- ...onedThinDiskRegionEntryOffHeapObjectKey.java | 2 +- ...nedThinDiskRegionEntryOffHeapStringKey1.java | 2 +- ...nedThinDiskRegionEntryOffHeapStringKey2.java | 2 +- ...sionedThinDiskRegionEntryOffHeapUUIDKey.java | 2 +- .../VersionedThinLRURegionEntryHeapIntKey.java | 4 +- .../VersionedThinLRURegionEntryHeapLongKey.java | 4 +- ...ersionedThinLRURegionEntryHeapObjectKey.java | 4 +- ...rsionedThinLRURegionEntryHeapStringKey1.java | 4 +- ...rsionedThinLRURegionEntryHeapStringKey2.java | 4 +- .../VersionedThinLRURegionEntryHeapUUIDKey.java | 4 +- ...ersionedThinLRURegionEntryOffHeapIntKey.java | 4 +- ...rsionedThinLRURegionEntryOffHeapLongKey.java | 4 +- ...ionedThinLRURegionEntryOffHeapObjectKey.java | 4 +- ...onedThinLRURegionEntryOffHeapStringKey1.java | 4 +- ...onedThinLRURegionEntryOffHeapStringKey2.java | 4 +- ...rsionedThinLRURegionEntryOffHeapUUIDKey.java | 4 +- .../VersionedThinRegionEntryHeapIntKey.java | 2 +- .../VersionedThinRegionEntryHeapLongKey.java | 2 +- .../VersionedThinRegionEntryHeapObjectKey.java | 2 +- .../VersionedThinRegionEntryHeapStringKey1.java | 2 +- .../VersionedThinRegionEntryHeapStringKey2.java | 2 +- .../VersionedThinRegionEntryHeapUUIDKey.java | 2 +- .../VersionedThinRegionEntryOffHeapIntKey.java | 2 +- .../VersionedThinRegionEntryOffHeapLongKey.java | 2 +- ...ersionedThinRegionEntryOffHeapObjectKey.java | 2 +- ...rsionedThinRegionEntryOffHeapStringKey1.java | 2 +- ...rsionedThinRegionEntryOffHeapStringKey2.java | 2 +- .../VersionedThinRegionEntryOffHeapUUIDKey.java | 2 +- .../cache/control/HeapMemoryMonitor.java | 71 +- .../cache/control/InternalResourceManager.java | 47 +- .../cache/control/OffHeapMemoryMonitor.java | 10 +- .../cache/control/RebalanceOperationImpl.java | 35 +- .../internal/cache/control/ResourceAdvisor.java | 22 +- .../DistributedRegionFunctionExecutor.java | 10 +- .../DistributedRegionFunctionResultSender.java | 7 +- .../execute/FunctionExecutionNodePruner.java | 2 +- .../cache/execute/LocalResultCollectorImpl.java | 3 +- .../cache/execute/MemberFunctionExecutor.java | 11 +- .../execute/MultiRegionFunctionExecutor.java | 29 +- .../PartitionedRegionFunctionExecutor.java | 19 +- .../execute/ServerRegionFunctionExecutor.java | 35 +- .../util/FindRestEnabledServersFunction.java | 13 +- .../geode/internal/cache/ha/HARegionQueue.java | 676 +-- .../internal/cache/ha/QueueRemovalMessage.java | 51 +- .../geode/internal/cache/lru/HeapEvictor.java | 8 +- .../cache/lru/HeapLRUCapacityController.java | 20 +- .../internal/cache/lru/OffHeapEvictor.java | 7 +- .../partitioned/BecomePrimaryBucketMessage.java | 2 +- .../cache/partitioned/BucketSizeMessage.java | 2 +- .../partitioned/ContainsKeyValueMessage.java | 2 +- .../cache/partitioned/CreateBucketMessage.java | 3 +- .../partitioned/DeposePrimaryBucketMessage.java | 2 +- .../cache/partitioned/DestroyMessage.java | 3 +- .../cache/partitioned/DumpB2NRegion.java | 2 +- .../partitioned/EndBucketCreationMessage.java | 2 +- .../partitioned/FetchBulkEntriesMessage.java | 3 +- .../cache/partitioned/FetchEntriesMessage.java | 2 +- .../cache/partitioned/FetchEntryMessage.java | 2 +- .../cache/partitioned/FetchKeysMessage.java | 2 +- .../FetchPartitionDetailsMessage.java | 2 +- .../internal/cache/partitioned/GetMessage.java | 2 +- .../cache/partitioned/InterestEventMessage.java | 2 +- .../partitioned/ManageBackupBucketMessage.java | 3 +- .../cache/partitioned/ManageBucketMessage.java | 3 +- .../cache/partitioned/MoveBucketMessage.java | 2 +- .../cache/partitioned/PRSanityCheckMessage.java | 2 +- .../cache/partitioned/PRTombstoneMessage.java | 3 +- .../PRUpdateEntryVersionMessage.java | 3 +- .../cache/partitioned/PartitionMessage.java | 42 +- .../PartitionMessageWithDirectReply.java | 2 +- ...rtitionedRegionFunctionStreamingMessage.java | 2 +- .../PartitionedRegionRebalanceOp.java | 35 +- .../cache/partitioned/PutAllPRMessage.java | 60 +- .../internal/cache/partitioned/PutMessage.java | 5 +- .../cache/partitioned/QueryMessage.java | 122 +- .../cache/partitioned/RemoveAllPRMessage.java | 3 +- .../cache/partitioned/RemoveBucketMessage.java | 2 +- .../internal/cache/partitioned/SizeMessage.java | 2 +- .../rebalance/PartitionedRegionLoadModel.java | 19 - .../cache/persistence/BackupManager.java | 88 +- .../snapshot/CacheSnapshotServiceImpl.java | 7 +- .../internal/cache/snapshot/GFSnapshot.java | 10 +- .../internal/cache/tier/CachedRegionHelper.java | 1 - .../cache/tier/InternalClientMembership.java | 4 +- .../cache/tier/sockets/AcceptorImpl.java | 26 +- .../cache/tier/sockets/BaseCommand.java | 60 +- .../cache/tier/sockets/CacheClientNotifier.java | 385 +- .../cache/tier/sockets/CacheClientProxy.java | 24 +- .../cache/tier/sockets/CacheClientUpdater.java | 209 +- .../cache/tier/sockets/ClientHealthMonitor.java | 94 +- .../cache/tier/sockets/ServerConnection.java | 7 +- .../cache/tier/sockets/command/AddPdxEnum.java | 8 +- .../cache/tier/sockets/command/AddPdxType.java | 9 +- .../tier/sockets/command/ExecuteFunction.java | 5 +- .../tier/sockets/command/ExecuteFunction65.java | 5 +- .../tier/sockets/command/ExecuteFunction66.java | 11 +- .../command/ExecuteRegionFunction66.java | 4 +- .../command/ExecuteRegionFunctionSingleHop.java | 4 +- .../sockets/command/GatewayReceiverCommand.java | 18 +- .../tier/sockets/command/GetPDXEnumById.java | 8 +- .../tier/sockets/command/GetPDXIdForEnum.java | 8 +- .../tier/sockets/command/GetPDXIdForType.java | 8 +- .../tier/sockets/command/GetPDXTypeById.java | 8 +- .../tier/sockets/command/GetPdxEnums70.java | 4 +- .../tier/sockets/command/GetPdxTypes70.java | 4 +- .../cache/tier/sockets/command/Query.java | 7 +- .../cache/tier/sockets/command/Query651.java | 28 +- .../tier/sockets/command/RequestEventValue.java | 2 - .../tier/sockets/command/TXFailoverCommand.java | 13 +- .../internal/cache/tx/ClientTXStateStub.java | 39 +- .../internal/cache/tx/DistTxEntryEvent.java | 7 +- .../cache/wan/AbstractGatewaySender.java | 32 +- .../AbstractGatewaySenderEventProcessor.java | 56 +- .../cache/wan/GatewaySenderAdvisor.java | 35 +- ...rentParallelGatewaySenderEventProcessor.java | 46 +- .../ParallelGatewaySenderEventProcessor.java | 39 +- .../parallel/ParallelGatewaySenderQueue.java | 130 +- .../parallel/ParallelQueueRemovalMessage.java | 4 +- .../wan/serial/SerialGatewaySenderQueue.java | 76 +- .../internal/cache/xmlcache/CacheCreation.java | 876 ++-- .../cache/xmlcache/CacheXmlGenerator.java | 130 +- .../internal/cache/xmlcache/CacheXmlParser.java | 9 +- .../cache/xmlcache/ClientCacheCreation.java | 132 +- .../xmlcache/DiskStoreAttributesCreation.java | 2 +- .../xmlcache/RegionAttributesCreation.java | 44 +- .../internal/cache/xmlcache/RegionCreation.java | 43 +- .../apache/geode/internal/lang/SystemUtils.java | 41 +- .../apache/geode/internal/offheap/DataType.java | 7 +- .../internal/offheap/MemoryAllocatorImpl.java | 23 +- .../geode/management/ManagementService.java | 9 +- .../internal/BaseManagementService.java | 20 +- .../management/internal/FederatingManager.java | 76 +- .../management/internal/JmxManagerAdvisee.java | 13 +- .../management/internal/JmxManagerAdvisor.java | 21 +- .../management/internal/JmxManagerLocator.java | 29 +- .../geode/management/internal/LocalManager.java | 47 +- .../management/internal/ManagementAgent.java | 78 +- .../management/internal/ManagementFunction.java | 12 +- .../geode/management/internal/Manager.java | 28 +- .../geode/management/internal/RestAgent.java | 14 +- .../internal/SystemManagementService.java | 48 +- .../internal/beans/BeanUtilFuncs.java | 17 +- .../internal/beans/CacheServerBridge.java | 35 +- .../internal/beans/DistributedSystemBridge.java | 105 +- .../internal/beans/LocatorMBeanBridge.java | 19 +- .../internal/beans/ManagementAdapter.java | 128 +- .../internal/beans/ManagementListener.java | 17 +- .../internal/beans/MemberMBeanBridge.java | 263 +- .../internal/beans/QueryDataFunction.java | 23 +- .../internal/beans/RegionMBeanBridge.java | 33 +- .../geode/management/internal/cli/CliUtil.java | 114 +- .../cli/commands/AbstractCommandsSupport.java | 29 +- .../internal/cli/commands/ClientCommands.java | 22 +- .../CreateAlterDestroyRegionCommands.java | 103 +- .../internal/cli/commands/DataCommands.java | 124 +- .../cli/commands/DiskStoreCommands.java | 85 +- ...xportImportClusterConfigurationCommands.java | 42 +- .../cli/commands/ExportLogsCommand.java | 48 +- .../internal/cli/commands/FunctionCommands.java | 59 +- .../internal/cli/commands/IndexCommands.java | 3 +- .../internal/cli/commands/MemberCommands.java | 38 +- .../cli/commands/MiscellaneousCommands.java | 242 +- .../internal/cli/commands/RegionCommands.java | 17 +- .../internal/cli/commands/StatusCommands.java | 12 +- .../internal/cli/commands/WanCommands.java | 175 +- .../functions/AlterRuntimeConfigFunction.java | 24 +- .../cli/functions/ContunuousQueryFunction.java | 23 +- .../CreateAsyncEventQueueFunction.java | 24 +- .../cli/functions/CreateDiskStoreFunction.java | 10 +- .../cli/functions/DataCommandFunction.java | 49 +- .../internal/cli/functions/DeployFunction.java | 18 +- .../cli/functions/DestroyDiskStoreFunction.java | 9 +- .../cli/functions/ExportLogsFunction.java | 45 +- .../FetchSharedConfigurationStatusFunction.java | 3 +- .../cli/functions/ListDeployedFunction.java | 9 +- .../ShowMissingDiskStoresFunction.java | 5 +- .../cli/functions/SizeExportLogsFunction.java | 22 +- .../cli/functions/UndeployFunction.java | 9 +- .../domain/SharedConfigurationStatus.java | 4 - .../functions/GetRegionNamesFunction.java | 3 +- .../functions/RecreateCacheFunction.java | 4 +- .../handlers/ConfigurationRequestHandler.java | 2 +- .../internal/messages/CompactRequest.java | 12 +- .../controllers/AbstractCommandsController.java | 38 +- .../apache/geode/pdx/PdxInstanceFactory.java | 96 +- .../pdx/internal/CheckTypeRegistryState.java | 4 +- .../pdx/internal/ClientTypeRegistration.java | 6 +- .../pdx/internal/LonerTypeRegistration.java | 12 +- .../pdx/internal/PdxInstanceFactoryImpl.java | 111 +- .../geode/pdx/internal/PdxInstanceImpl.java | 49 +- .../geode/pdx/internal/PdxReaderImpl.java | 19 +- .../geode/pdx/internal/PdxUnreadData.java | 11 +- .../geode/pdx/internal/PdxWriterImpl.java | 32 +- .../pdx/internal/PeerTypeRegistration.java | 61 +- .../apache/geode/pdx/internal/TypeRegistry.java | 176 +- .../pdx/internal/WritablePdxInstanceImpl.java | 5 +- .../pdx/internal/json/PdxInstanceHelper.java | 14 +- .../internal/json/PdxInstanceSortedHelper.java | 127 +- .../geode/pdx/internal/json/PdxListHelper.java | 10 +- .../apache/geode/redis/GeodeRedisServer.java | 66 +- .../geode/redis/internal/RegionProvider.java | 2 - .../internal/executor/list/ListExecutor.java | 9 +- .../apache/geode/security/AuthInitialize.java | 11 +- .../apache/geode/cache/query/CacheUtils.java | 181 +- .../query/functional/FunctionJUnitTest.java | 4 +- .../CompiledAggregateFunctionJUnitTest.java | 21 +- .../CompiledJunctionInternalsJUnitTest.java | 28 +- .../internal/ExecutionContextJUnitTest.java | 10 +- .../query/internal/IndexManagerJUnitTest.java | 16 +- ...ueryFromClauseCanonicalizationJUnitTest.java | 14 +- .../query/internal/QueryUtilsJUnitTest.java | 4 +- .../internal/index/RangeIndexAPIJUnitTest.java | 13 +- .../geode/cache30/CacheXml66DUnitTest.java | 602 +-- .../geode/cache30/CacheXml70DUnitTest.java | 32 +- .../geode/cache30/CacheXml80DUnitTest.java | 70 +- .../geode/cache30/CacheXml81DUnitTest.java | 24 +- .../geode/cache30/CacheXmlGeode10DUnitTest.java | 226 +- .../apache/geode/cache30/CacheXmlTestCase.java | 61 +- .../gms/mgr/GMSMembershipManagerJUnitTest.java | 50 +- .../internal/cache/AbstractRegionEntryTest.java | 2 +- .../internal/cache/AbstractRegionJUnitTest.java | 5 +- .../geode/internal/cache/BackupJUnitTest.java | 55 +- .../cache/CacheLifecycleListenerJUnitTest.java | 90 +- .../internal/cache/DiskInitFileJUnitTest.java | 2 + .../internal/cache/DiskRegionTestingBase.java | 19 +- .../cache/IncrementalBackupDUnitTest.java | 183 +- .../geode/internal/cache/OplogRVVJUnitTest.java | 2 + .../PartitionedRegionCacheCloseDUnitTest.java | 2 +- .../PartitionedRegionCreationDUnitTest.java | 2 +- .../PartitionedRegionDestroyDUnitTest.java | 2 +- ...onedRegionHAFailureAndRecoveryDUnitTest.java | 10 +- ...onedRegionQueryEvaluatorIntegrationTest.java | 2 +- .../cache/PartitionedRegionTestHelper.java | 10 +- .../geode/internal/cache/TXManagerImplTest.java | 2 +- .../cache/execute/Bug51193DUnitTest.java | 1 - .../cache/execute/PRColocationDUnitTest.java | 76 +- .../extension/mock/MockExtensionCommands.java | 19 +- .../cache/ha/BlockingHARegionJUnitTest.java | 5 +- .../internal/cache/ha/HAExpiryDUnitTest.java | 39 +- .../internal/cache/ha/HAGIIBugDUnitTest.java | 5 +- .../geode/internal/cache/ha/HAHelper.java | 4 +- .../cache/ha/HARQAddOperationJUnitTest.java | 8 +- .../internal/cache/ha/HARegionDUnitTest.java | 9 +- .../cache/ha/HARegionQueueDUnitTest.java | 11 +- .../cache/ha/HARegionQueueJUnitTest.java | 11 +- .../ha/HARegionQueueStartStopJUnitTest.java | 114 +- .../cache/ha/HARegionQueueStatsJUnitTest.java | 7 +- .../cache/ha/TestBlockingHARegionQueue.java | 3 +- .../cache/partitioned/PartitionMessageTest.java | 4 +- ...tentColocatedPartitionedRegionDUnitTest.java | 3 - .../cache/partitioned/ShutdownAllDUnitTest.java | 36 +- .../fixed/FixedPartitioningTestBase.java | 5 +- .../tier/sockets/command/CommitCommandTest.java | 4 +- .../tier/sockets/command/ContainsKey66Test.java | 10 +- .../tier/sockets/command/ContainsKeyTest.java | 7 +- .../tier/sockets/command/CreateRegionTest.java | 6 +- .../tier/sockets/command/Destroy65Test.java | 10 +- .../tier/sockets/command/DestroyRegionTest.java | 8 +- .../cache/tier/sockets/command/DestroyTest.java | 11 +- .../cache/tier/sockets/command/Get70Test.java | 14 +- .../tier/sockets/command/GetAll651Test.java | 13 +- .../tier/sockets/command/GetAll70Test.java | 13 +- .../cache/tier/sockets/command/GetAllTest.java | 6 +- .../sockets/command/GetAllWithCallbackTest.java | 16 +- ...tClientPartitionAttributesCommand66Test.java | 7 +- ...GetClientPartitionAttributesCommandTest.java | 4 +- .../tier/sockets/command/InvalidateTest.java | 14 +- .../cache/tier/sockets/command/KeySetTest.java | 12 +- .../cache/tier/sockets/command/Put61Test.java | 12 +- .../cache/tier/sockets/command/Put65Test.java | 12 +- .../cache/tier/sockets/command/PutTest.java | 10 +- .../sockets/command/RegisterInterest61Test.java | 9 +- .../command/RegisterInterestList61Test.java | 13 +- .../command/RegisterInterestList66Test.java | 7 +- .../command/RegisterInterestListTest.java | 13 +- .../sockets/command/RegisterInterestTest.java | 21 +- .../tier/sockets/command/RemoveAllTest.java | 15 +- .../cache/tier/sockets/command/RequestTest.java | 5 +- .../sockets/command/UnregisterInterestTest.java | 12 +- .../ParallelQueueRemovalMessageJUnitTest.java | 29 +- .../cache/xmlcache/CacheCreationJUnitTest.java | 142 +- .../io/CompositeOutputStreamJUnitTest.java | 2 + .../internal/lang/InitializerJUnitTest.java | 2 + .../internal/net/SocketUtilsJUnitTest.java | 2 + .../internal/process/PidFileJUnitTest.java | 2 + ...tractSignalNotificationHandlerJUnitTest.java | 2 + .../statistics/ValueMonitorIntegrationTest.java | 2 + .../geode/internal/util/IOUtilsJUnitTest.java | 2 + .../internal/cli/CliUtilDUnitTest.java | 81 +- .../AbstractCommandsSupportJUnitTest.java | 33 +- .../commands/DiskStoreCommandsDUnitTest.java | 19 +- .../commands/DiskStoreCommandsJUnitTest.java | 38 +- .../commands/GemfireDataCommandsDUnitTest.java | 87 +- .../cli/commands/IndexCommandsJUnitTest.java | 23 +- .../RegionPathConverterJUnitTest.java | 2 + .../DescribeDiskStoreFunctionJUnitTest.java | 27 +- .../ListDiskStoresFunctionJUnitTest.java | 15 +- .../functions/ListIndexFunctionJUnitTest.java | 2 + .../cache/internal/JUnit3CacheTestCase.java | 16 +- .../cache/internal/JUnit4CacheTestCase.java | 38 +- .../test/dunit/standalone/RemoteDUnitVM.java | 53 +- .../test/dunit/standalone/RemoteDUnitVMIF.java | 6 +- .../sanctionedDataSerializables.txt | 80 +- .../cache/query/internal/cq/CqQueryImpl.java | 3 +- .../cache/query/internal/cq/ServerCQImpl.java | 7 +- .../internal/DestroyLuceneIndexMessage.java | 31 +- .../internal/cli/LuceneIndexCommands.java | 13 +- .../cli/LuceneIndexCommandsJUnitTest.java | 60 +- .../apache/geode/cache/util/AutoBalancer.java | 4 +- .../cache/wan/GatewayReceiverFactoryImpl.java | 13 +- .../internal/cache/wan/GatewayReceiverImpl.java | 22 +- .../wan/GatewaySenderEventRemoteDispatcher.java | 23 +- .../cache/wan/GatewaySenderFactoryImpl.java | 21 +- .../wan/parallel/ParallelGatewaySenderImpl.java | 14 +- .../wan/serial/SerialGatewaySenderImpl.java | 13 +- .../geode/cache/CacheXml70GatewayDUnitTest.java | 25 +- .../geode/cache/CacheXml80GatewayDUnitTest.java | 46 +- ...ersistenceEnabledGatewaySenderDUnitTest.java | 5 + .../ClusterConfigurationDUnitTest.java | 7 +- .../LoginHandlerInterceptorJUnitTest.java | 25 +- .../web/http/ClientHttpRequestJUnitTest.java | 2 + ...ableObjectHttpMessageConverterJUnitTest.java | 2 + 688 files changed, 15100 insertions(+), 20453 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java index 1a97cb6..791f2ce 100644 --- a/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java +++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java @@ -47,7 +47,7 @@ import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.InternalLocator; import org.apache.geode.internal.ClassBuilder; import org.apache.geode.internal.admin.remote.ShutdownAllRequest; -import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.management.cli.Result.Status; import org.apache.geode.management.internal.cli.HeadlessGfsh; import org.apache.geode.management.internal.cli.commands.CliCommandTestBase; @@ -402,7 +402,7 @@ public class ClusterConfigurationServiceEndToEndDUnitTest extends CliCommandTest localProps.setProperty(LOCATORS, "localhost[" + locator1Port + "]"); localProps.setProperty(NAME, "DataMember"); getSystem(localProps); - Cache cache = getCache(); + InternalCache cache = getCache(); assertNotNull(cache); return getAllNormalMembers(cache); } @@ -415,7 +415,7 @@ public class ClusterConfigurationServiceEndToEndDUnitTest extends CliCommandTest locatorAndMgr.invoke(new SerializableCallable() { @Override public Object call() throws Exception { - GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance(); + InternalCache cache = (InternalCache) CacheFactory.getAnyInstance(); ShutdownAllRequest.send(cache.getInternalDistributedSystem().getDistributionManager(), -1); return null; } http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java index 67714ec..35d52c0 100644 --- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java +++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java @@ -20,7 +20,6 @@ import java.util.Collection; import java.util.List; import java.util.Vector; -import org.apache.geode.cache.Cache; import org.apache.geode.cache.CacheClosedException; import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.Region; @@ -32,20 +31,17 @@ import org.apache.geode.cache.query.Query; import org.apache.geode.cache.query.QueryInvocationTargetException; import org.apache.geode.cache.query.SelectResults; import org.apache.geode.cache.query.TypeMismatchException; -import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.pdx.PdxInstance; /** * Gemfire function to add free items in the existing order if the total price for that order is * greater then the argument */ - public class AddFreeItemToOrders implements Function { public void execute(FunctionContext context) { - - Cache c = null; - Region r = null; + Region region = null; List<Object> vals = new ArrayList<Object>(); List<Object> keys = new ArrayList<Object>(); List<Object> argsList = new ArrayList<Object>(); @@ -64,10 +60,11 @@ public class AddFreeItemToOrders implements Function { System.out.println("AddFreeItemToOrders : Invalid Arguments"); } + InternalCache cache = null; try { - c = CacheFactory.getAnyInstance(); - ((GemFireCacheImpl) c).getCacheConfig().setPdxReadSerialized(true); - r = c.getRegion("orders"); + cache = (InternalCache) CacheFactory.getAnyInstance(); + cache.getCacheConfig().setPdxReadSerialized(true); + region = cache.getRegion("orders"); } catch (CacheClosedException ex) { vals.add("NoCacheFoundResult"); context.getResultSender().lastResult(vals); @@ -78,7 +75,7 @@ public class AddFreeItemToOrders implements Function { Object queryArgs[] = new Object[1]; queryArgs[0] = argsList.get(0); - final Query query = c.getQueryService().newQuery(oql); + final Query query = cache.getQueryService().newQuery(oql); SelectResults result = null; try { @@ -90,24 +87,24 @@ public class AddFreeItemToOrders implements Function { keys.add(item); } } catch (FunctionDomainException e) { - if (c != null) - c.getLogger() + if (cache != null) + cache.getLogger() .info("Caught FunctionDomainException while executing function AddFreeItemToOrders: " + e.getMessage()); } catch (TypeMismatchException e) { - if (c != null) - c.getLogger() + if (cache != null) + cache.getLogger() .info("Caught TypeMismatchException while executing function AddFreeItemToOrders: " + e.getMessage()); } catch (NameResolutionException e) { - if (c != null) - c.getLogger() + if (cache != null) + cache.getLogger() .info("Caught NameResolutionException while executing function AddFreeItemToOrders: " + e.getMessage()); } catch (QueryInvocationTargetException e) { - if (c != null) - c.getLogger().info( + if (cache != null) + cache.getLogger().info( "Caught QueryInvocationTargetException while executing function AddFreeItemToOrders" + e.getMessage()); } @@ -116,13 +113,13 @@ public class AddFreeItemToOrders implements Function { try { Item it = (Item) (argsList.get(1)); for (Object key : keys) { - Object obj = r.get(key); + Object obj = region.get(key); if (obj instanceof PdxInstance) { PdxInstance pi = (PdxInstance) obj; Order receivedOrder = (Order) pi.getObject(); receivedOrder.addItem(it); - r.put(key, receivedOrder); + region.put(key, receivedOrder); } } @@ -134,7 +131,6 @@ public class AddFreeItemToOrders implements Function { } catch (Exception e) { context.getResultSender().lastResult("failure"); } - } public String getId() { http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java index 1802140..45e7a61 100644 --- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java +++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java @@ -65,6 +65,7 @@ import org.apache.geode.distributed.DistributedSystem; import org.apache.geode.internal.AvailablePort; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.pdx.PdxInstance; import org.apache.geode.test.dunit.Host; import org.apache.geode.test.dunit.NetworkUtils; @@ -176,8 +177,8 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase { props.setProperty(HTTP_SERVICE_PORT, String.valueOf(restServicerPort)); DistributedSystem ds = getSystem(props); - Cache cache = CacheFactory.create(ds); - ((GemFireCacheImpl) cache).setReadSerialized(true); + InternalCache cache = (InternalCache) CacheFactory.create(ds); + cache.setReadSerialized(true); AttributesFactory factory = new AttributesFactory(); factory.setEnableBridgeConflation(true); @@ -475,7 +476,7 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase { * ResponseEntity<String> result = RestTestUtils.getRestTemplate().exchange( restEndpoint + * "/People/1?op=cas", HttpMethod.PUT, entity, String.class); } } catch * (HttpClientErrorException e) { - * + * * fail("Caught HttpClientErrorException while doing put with op=cas"); }catch * (HttpServerErrorException se) { * fail("Caught HttpServerErrorException while doing put with op=cas"); } @@ -747,10 +748,7 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase { /** * InterOps Test between REST-client, Peer Cache Client and Client Cache - * - * @throws Exception */ - @Test public void testInterOpsWithReplicatedRegion() throws Exception { http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java index bb13966..6df3663 100644 --- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java +++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java @@ -67,6 +67,7 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.internal.AvailablePort; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.security.SecurableCommunicationChannel; import org.apache.geode.management.ManagementException; import org.apache.geode.test.dunit.Host; @@ -152,8 +153,8 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase { props = configureSSL(props, sslProperties, clusterLevel); DistributedSystem ds = getSystem(props); - Cache cache = CacheFactory.create(ds); - ((GemFireCacheImpl) cache).setReadSerialized(true); + InternalCache cache = (InternalCache) CacheFactory.create(ds); + cache.setReadSerialized(true); AttributesFactory factory = new AttributesFactory(); factory.setEnableBridgeConflation(true); @@ -276,7 +277,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase { } private void closeCache() { - GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); + InternalCache cache = GemFireCacheImpl.getInstance(); if (cache != null && !cache.isClosed()) { cache.close(); cache.getDistributedSystem().disconnect(); @@ -293,9 +294,9 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase { } /** - * @Deprecated once the legacy SSL properties have been removed we need to remove this logic. + * @deprecated once the legacy SSL properties have been removed we need to remove this logic. */ - @Deprecated() + @Deprecated private Properties configureSSL(Properties props, Properties sslProperties, boolean clusterLevel) { @@ -368,7 +369,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase { if ((ex.getCause() instanceof BindException) || (ex.getCause() != null && ex.getCause().getCause() instanceof BindException)) { // close cache and disconnect - GemFireCacheImpl existingInstance = GemFireCacheImpl.getInstance(); + InternalCache existingInstance = GemFireCacheImpl.getInstance(); if (existingInstance != null) { existingInstance.close(); } http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCALocalTransaction.java ---------------------------------------------------------------------- diff --git a/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCALocalTransaction.java b/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCALocalTransaction.java index 112f2fa..a4ae25e 100644 --- a/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCALocalTransaction.java +++ b/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCALocalTransaction.java @@ -23,62 +23,43 @@ import javax.transaction.TransactionManager; import org.apache.geode.LogWriter; import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.TransactionId; -import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.TXStateProxy; - import org.apache.geode.internal.cache.TXManagerImpl; import org.apache.geode.internal.i18n.LocalizedStrings; -/** - * - * - */ public class JCALocalTransaction implements LocalTransaction { - private volatile GemFireCacheImpl cache; + private volatile InternalCache cache; private volatile TXManagerImpl gfTxMgr; private volatile TransactionId tid; - private static final boolean DEBUG = false; - private volatile boolean initDone = false; - JCALocalTransaction(GemFireCacheImpl cache, TXManagerImpl tm) { + JCALocalTransaction(InternalCache cache, TXManagerImpl tm) { this.cache = cache; this.gfTxMgr = tm; this.initDone = true; - // System.out.println("Asif:JCALocalTransaction:Param contrcutr for tx ="+ - // this ); } JCALocalTransaction() { this.cache = null; this.gfTxMgr = null; this.initDone = false; - // System.out.println("Asif:JCALocalTransaction:Empty constructor for tx ="+ - // this ); } + @Override public void begin() throws ResourceException { - if (DEBUG) { - try { - throw new NullPointerException("Asif:JCALocalTransaction:begin"); - } catch (NullPointerException npe) { - npe.printStackTrace(); - } - } try { - if (!initDone || this.cache.isClosed()) { + if (!this.initDone || this.cache.isClosed()) { this.init(); } - // System.out.println("JCALocalTransaction:Asif: cache is ="+cache + - // " for tx ="+this); - LogWriter logger = cache.getLogger(); + LogWriter logger = this.cache.getLogger(); if (logger.fineEnabled()) { logger.fine("JCALocalTransaction::begin:"); } - TransactionManager tm = cache.getJTATransactionManager(); + TransactionManager tm = this.cache.getJTATransactionManager(); if (this.tid != null) { throw new LocalTransactionException(" A transaction is already in progress"); } @@ -106,28 +87,13 @@ public class JCALocalTransaction implements LocalTransaction { } } } catch (SystemException e) { - // this.onError(); throw new ResourceException(e); } - // Not to be invoked for local transactions managed by the container - // Iterator<ConnectionEventListener> itr = this.listeners.iterator(); - // ConnectionEvent ce = new ConnectionEvent(this, - // ConnectionEvent.LOCAL_TRANSACTION_STARTED); - // while (itr.hasNext()) { - // itr.next().localTransactionStarted(ce); - // } - } + @Override public void commit() throws ResourceException { - if (DEBUG) { - try { - throw new NullPointerException("Asif:JCALocalTransaction:commit"); - } catch (NullPointerException npe) { - npe.printStackTrace(); - } - } - LogWriter logger = cache.getLogger(); + LogWriter logger = this.cache.getLogger(); if (logger.fineEnabled()) { logger.fine("JCALocalTransaction:invoked commit"); } @@ -140,31 +106,19 @@ public class JCALocalTransaction implements LocalTransaction { this.gfTxMgr.commit(); this.tid = null; } catch (Exception e) { + // TODO: consider wrapping the cause throw new LocalTransactionException(e.toString()); } - // Iterator<ConnectionEventListener> itr = this.listeners.iterator(); - // ConnectionEvent ce = new - // ConnectionEvent(this,ConnectionEvent.LOCAL_TRANSACTION_COMMITTED); - // while( itr.hasNext()) { - // itr.next().localTransactionCommitted(ce); - // } - } + @Override public void rollback() throws ResourceException { - if (DEBUG) { - try { - throw new NullPointerException("Asif:JJCALocalTransaction:rollback"); - } catch (NullPointerException npe) { - npe.printStackTrace(); - } - } TXStateProxy tsp = this.gfTxMgr.getTXState(); if (tsp != null && this.tid != tsp.getTransactionId()) { throw new IllegalStateException("Local Transaction associated with Tid = " + this.tid + " attempting to commit a different transaction"); } - LogWriter logger = cache.getLogger(); + LogWriter logger = this.cache.getLogger(); if (logger.fineEnabled()) { logger.fine("JCALocalTransaction:invoked rollback"); } @@ -175,31 +129,24 @@ public class JCALocalTransaction implements LocalTransaction { if (ise.getMessage() .equals(LocalizedStrings.TXManagerImpl_THREAD_DOES_NOT_HAVE_AN_ACTIVE_TRANSACTION .toLocalizedString())) { - // /ignore; + // ignore } else { throw new ResourceException(ise); } - } catch (Exception e) { + } catch (RuntimeException e) { throw new ResourceException(e); } finally { this.tid = null; } - // Iterator<ConnectionEventListener> itr = this.listeners.iterator(); - // ConnectionEvent ce = new ConnectionEvent(this, - // ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK); - // while (itr.hasNext()) { - // itr.next().localTransactionRolledback(ce); - // } - } - private void init() throws SystemException { - this.cache = (GemFireCacheImpl) CacheFactory.getAnyInstance(); + private void init() { + this.cache = (InternalCache) CacheFactory.getAnyInstance(); LogWriter logger = this.cache.getLogger(); if (logger.fineEnabled()) { logger.fine("JCAManagedConnection:init. Inside init"); } - gfTxMgr = cache.getTxManager(); + this.gfTxMgr = this.cache.getTxManager(); this.initDone = true; } http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCAManagedConnection.java ---------------------------------------------------------------------- diff --git a/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCAManagedConnection.java b/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCAManagedConnection.java index 520f7e2..c654e64 100644 --- a/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCAManagedConnection.java +++ b/geode-core/src/jca/java/org/apache/geode/internal/ra/spi/JCAManagedConnection.java @@ -31,239 +31,196 @@ import javax.resource.spi.LocalTransaction; import javax.resource.spi.ManagedConnection; import javax.resource.spi.ManagedConnectionMetaData; import javax.security.auth.Subject; -import javax.transaction.SystemException; import javax.transaction.xa.XAResource; import org.apache.geode.LogWriter; import org.apache.geode.cache.CacheFactory; -import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.TXManagerImpl; import org.apache.geode.internal.ra.GFConnectionImpl; -/** - * - * - */ -public class JCAManagedConnection implements ManagedConnection +public class JCAManagedConnection implements ManagedConnection { -{ private final List<ConnectionEventListener> listeners; - private volatile TXManagerImpl gfTxMgr; + private volatile TXManagerImpl transactionManager; - // private volatile TransactionId currentTxID; - private volatile GemFireCacheImpl cache; + private volatile InternalCache cache; - private volatile boolean initDone = false; + private volatile boolean initialized = false; - private volatile PrintWriter logger; + private volatile PrintWriter logWriter; - private JCAManagedConnectionFactory factory; + private final JCAManagedConnectionFactory connectionFactory; - private volatile Set<GFConnectionImpl> connections; + private final Set<GFConnectionImpl> connections; - private volatile JCALocalTransaction localTran; + private volatile JCALocalTransaction localTransaction; - private final static boolean DEBUG = false; - - public JCAManagedConnection(JCAManagedConnectionFactory fact) { - this.factory = fact; - this.listeners = Collections - .<ConnectionEventListener>synchronizedList(new ArrayList<ConnectionEventListener>()); - this.localTran = new JCALocalTransaction(); - this.connections = - Collections.<GFConnectionImpl>synchronizedSet(new HashSet<GFConnectionImpl>()); + JCAManagedConnection(JCAManagedConnectionFactory connectionFactory) { + this.connectionFactory = connectionFactory; + this.listeners = Collections.synchronizedList(new ArrayList<>()); + this.localTransaction = new JCALocalTransaction(); + this.connections = Collections.synchronizedSet(new HashSet<>()); } + @Override public void addConnectionEventListener(ConnectionEventListener listener) { this.listeners.add(listener); - } - public void associateConnection(Object conn) throws ResourceException { - if (!(conn instanceof GFConnectionImpl)) { + @Override + public void associateConnection(Object connection) throws ResourceException { + if (!(connection instanceof GFConnectionImpl)) { throw new ResourceException("Connection is not of type GFConnection"); } - ((GFConnectionImpl) conn).resetManagedConnection(this); - this.connections.add((GFConnectionImpl) conn); + ((GFConnectionImpl) connection).resetManagedConnection(this); + this.connections.add((GFConnectionImpl) connection); } + @Override public void cleanup() throws ResourceException { - if (DEBUG) { - try { - throw new NullPointerException("Asif:JCAManagedConnection:cleanup"); - } catch (NullPointerException npe) { - npe.printStackTrace(); - } - } synchronized (this.connections) { - Iterator<GFConnectionImpl> connsItr = this.connections.iterator(); - while (connsItr.hasNext()) { - GFConnectionImpl conn = connsItr.next(); - conn.invalidate(); - connsItr.remove(); + Iterator<GFConnectionImpl> iterator = this.connections.iterator(); + while (iterator.hasNext()) { + GFConnectionImpl connection = iterator.next(); + connection.invalidate(); + iterator.remove(); } } - if (this.localTran == null || this.localTran.transactionInProgress()) { - if (this.initDone && !this.cache.isClosed()) { - this.localTran = new JCALocalTransaction(cache, gfTxMgr); + if (this.localTransaction == null || this.localTransaction.transactionInProgress()) { + if (this.initialized && !this.cache.isClosed()) { + this.localTransaction = new JCALocalTransaction(this.cache, this.transactionManager); } else { - this.localTran = new JCALocalTransaction(); + this.localTransaction = new JCALocalTransaction(); } } - } + @Override public void destroy() throws ResourceException { - if (DEBUG) { - try { - throw new NullPointerException("Asif:JCAManagedConnection:destroy"); - } catch (NullPointerException npe) { - npe.printStackTrace(); - } - } synchronized (this.connections) { - Iterator<GFConnectionImpl> connsItr = this.connections.iterator(); - while (connsItr.hasNext()) { - GFConnectionImpl conn = connsItr.next(); - conn.invalidate(); - connsItr.remove(); + Iterator<GFConnectionImpl> iterator = this.connections.iterator(); + while (iterator.hasNext()) { + GFConnectionImpl connection = iterator.next(); + connection.invalidate(); + iterator.remove(); } } - this.gfTxMgr = null; + this.transactionManager = null; this.cache = null; - this.localTran = null; + this.localTransaction = null; this.listeners.clear(); } + @Override public Object getConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException { - if (DEBUG) { - try { - throw new NullPointerException("Asif:JCAManagedConnection:getConnection"); - } catch (NullPointerException npe) { - npe.printStackTrace(); - } + if (!this.initialized || this.cache.isClosed()) { + init(); } - try { - if (!this.initDone || this.cache.isClosed()) { - init(); - } - LogWriter logger = this.cache.getLogger(); - if (logger.fineEnabled()) { - logger.fine("JCAManagedConnection:getConnection. Returning new Connection"); - } - - GFConnectionImpl conn = new GFConnectionImpl(this); - this.connections.add(conn); - return conn; - } catch (SystemException e) { - this.onError(e); - throw new ResourceException("GemFire Resource unavailable", e); + LogWriter logger = this.cache.getLogger(); + if (logger.fineEnabled()) { + logger.fine("JCAManagedConnection:getConnection. Returning new Connection"); } + + GFConnectionImpl connection = new GFConnectionImpl(this); + this.connections.add(connection); + return connection; } - private void init() throws SystemException { - this.cache = (GemFireCacheImpl) CacheFactory.getAnyInstance(); + private void init() { + this.cache = (InternalCache) CacheFactory.getAnyInstance(); LogWriter logger = this.cache.getLogger(); if (logger.fineEnabled()) { logger.fine("JCAManagedConnection:init. Inside init"); } - gfTxMgr = cache.getTxManager(); - this.initDone = true; + this.transactionManager = this.cache.getTxManager(); + this.initialized = true; } + @Override public LocalTransaction getLocalTransaction() throws ResourceException { - if (DEBUG) { - try { - throw new NullPointerException("Asif:JCAManagedConnection:getLocalTransaction"); - } catch (NullPointerException npe) { - npe.printStackTrace(); - } - } - - return this.localTran; + return this.localTransaction; } + @Override public PrintWriter getLogWriter() throws ResourceException { - return this.logger; + return this.logWriter; } + @Override public ManagedConnectionMetaData getMetaData() throws ResourceException { - if (DEBUG) { - try { - throw new NullPointerException("Asif:JCAManagedConnection:getMetaData"); - } catch (NullPointerException npe) { - npe.printStackTrace(); - } - } - if (this.initDone && !this.cache.isClosed()) { + if (this.initialized && !this.cache.isClosed()) { LogWriter logger = this.cache.getLogger(); if (logger.fineEnabled()) { logger.fine("JCAManagedConnection:getMetaData"); } } - return new JCAManagedConnectionMetaData(this.factory.getProductName(), - this.factory.getVersion(), this.factory.getUserName()); + return new JCAManagedConnectionMetaData(this.connectionFactory.getProductName(), + this.connectionFactory.getVersion(), this.connectionFactory.getUserName()); } + @Override public XAResource getXAResource() throws ResourceException { throw new NotSupportedException("XA Transaction not supported"); } + @Override public void removeConnectionEventListener(ConnectionEventListener arg0) { this.listeners.remove(arg0); } + @Override public void setLogWriter(PrintWriter logger) throws ResourceException { - this.logger = logger; + this.logWriter = logger; } - private void onError(Exception e) { - - this.localTran = null; + private void onError(Exception e) { // TODO: currently unused + this.localTransaction = null; synchronized (this.connections) { - Iterator<GFConnectionImpl> connsItr = this.connections.iterator(); - while (connsItr.hasNext()) { - GFConnectionImpl conn = connsItr.next(); - conn.invalidate(); + Iterator<GFConnectionImpl> iterator = this.connections.iterator(); + while (iterator.hasNext()) { + GFConnectionImpl connection = iterator.next(); + connection.invalidate(); + synchronized (this.listeners) { - Iterator<ConnectionEventListener> itr = this.listeners.iterator(); - ConnectionEvent ce = + ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e); - ce.setConnectionHandle(conn); - while (itr.hasNext()) { - itr.next().connectionErrorOccurred(ce); + event.setConnectionHandle(connection); + for (ConnectionEventListener listener : this.listeners) { + listener.connectionErrorOccurred(event); } } - connsItr.remove(); + + iterator.remove(); } } - } - public void onClose(GFConnectionImpl conn) throws ResourceException { - conn.invalidate(); - this.connections.remove(conn); + public void onClose(GFConnectionImpl connection) { + connection.invalidate(); + this.connections.remove(connection); + synchronized (this.listeners) { - Iterator<ConnectionEventListener> itr = this.listeners.iterator(); - ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED); - ce.setConnectionHandle(conn); - while (itr.hasNext()) { - itr.next().connectionClosed(ce); + Iterator<ConnectionEventListener> iterator = this.listeners.iterator(); + ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED); + event.setConnectionHandle(connection); + while (iterator.hasNext()) { + iterator.next().connectionClosed(event); } } + if (this.connections.isEmpty()) { - // safe to dissociate this managedconnection so that it can go to pool - if (this.initDone && !this.cache.isClosed()) { - this.localTran = new JCALocalTransaction(this.cache, this.gfTxMgr); + // safe to dissociate this managed connection so that it can go to pool + if (this.initialized && !this.cache.isClosed()) { + this.localTransaction = new JCALocalTransaction(this.cache, this.transactionManager); } else { - this.localTran = new JCALocalTransaction(); + this.localTransaction = new JCALocalTransaction(); } } - } } http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-core/src/main/java/org/apache/geode/DataSerializer.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/DataSerializer.java b/geode-core/src/main/java/org/apache/geode/DataSerializer.java index c85bc88..34501f8 100644 --- a/geode-core/src/main/java/org/apache/geode/DataSerializer.java +++ b/geode-core/src/main/java/org/apache/geode/DataSerializer.java @@ -59,6 +59,7 @@ import org.apache.geode.internal.Version; import org.apache.geode.internal.cache.CachedDeserializable; import org.apache.geode.internal.cache.EventID; import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.logging.LogService; @@ -1837,7 +1838,7 @@ public abstract class DataSerializer { typeString = readString(in); } - GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); + InternalCache cache = GemFireCacheImpl.getInstance(); boolean lookForPdxInstance = false; ClassNotFoundException cnfEx = null; if (typeCode == DSCODE.CLASS && cache != null http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java b/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java index 5b4e59e..9dda7c1 100755 --- a/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java +++ b/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java @@ -14,6 +14,16 @@ */ package org.apache.geode.admin; +import java.io.IOException; +import java.io.Serializable; +import java.net.InetAddress; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + import org.apache.geode.cache.Cache; import org.apache.geode.cache.Region; import org.apache.geode.cache.client.PoolManager; @@ -24,17 +34,18 @@ import org.apache.geode.distributed.internal.DM; import org.apache.geode.distributed.internal.DistributionConfig; import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.internal.net.SocketCreator; import org.apache.geode.internal.admin.ClientHealthMonitoringRegion; import org.apache.geode.internal.admin.remote.ClientHealthStats; -import org.apache.geode.internal.cache.*; +import org.apache.geode.internal.cache.CacheClientStatus; +import org.apache.geode.internal.cache.HARegion; +import org.apache.geode.internal.cache.InternalCache; +import org.apache.geode.internal.cache.LocalRegion; +import org.apache.geode.internal.cache.PartitionedRegion; +import org.apache.geode.internal.cache.PartitionedRegionStatus; +import org.apache.geode.internal.cache.RegionStatus; import org.apache.geode.internal.cache.tier.InternalClientMembership; import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; - -import java.io.IOException; -import java.io.Serializable; -import java.net.InetAddress; -import java.util.*; +import org.apache.geode.internal.net.SocketCreator; /** * Class <code>GemFireMemberStatus</code> provides the status of a specific GemFire member VM. This @@ -528,7 +539,7 @@ public class GemFireMemberStatus implements Serializable { // Get Client Health Stats // Assert.assertTrue(cache != null); (cannot be null) Region clientHealthMonitoringRegion = - ClientHealthMonitoringRegion.getInstance((GemFireCacheImpl) cache); + ClientHealthMonitoringRegion.getInstance((InternalCache) cache); if (clientHealthMonitoringRegion != null) { String[] clients = (String[]) clientHealthMonitoringRegion.keySet().toArray(new String[0]); for (int i = 0; i < clients.length; i++) { http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java index f7ff9ed..c93d0f4 100644 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java +++ b/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java @@ -28,13 +28,13 @@ import org.apache.geode.internal.OSProcess; import org.apache.geode.internal.cache.CacheLifecycleListener; import org.apache.geode.internal.cache.CachePerfStats; import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.logging.LogService; /** - * Contains the logic for evaluating the health of a GemFire <code>Cache</code> instance according - * to the thresholds provided in a {@link CacheHealthConfig}. - * + * Contains the logic for evaluating the health of a GemFire {@code Cache} instance according to the + * thresholds provided in a {@link CacheHealthConfig}. * * @since GemFire 3.5 */ @@ -42,15 +42,15 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec private static final Logger logger = LogService.getLogger(); - /** The config from which we get the evaulation criteria */ - private CacheHealthConfig config; + /** The config from which we get the evaluation criteria */ + private final CacheHealthConfig config; /** The description of the cache being evaluated */ private String description; /** - * Statistics about the <code>Cache</code> instance. If no cache has been created in this VM, this - * field will be <code>null</code> + * Statistics about the {@code Cache} instance. If no cache has been created in this VM, this + * field will be {@code null} */ private CachePerfStats cacheStats; @@ -69,21 +69,18 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec /** The previous value of the gets stat */ private long prevGets; - ////////////////////// Constructors ////////////////////// - /** - * Creates a new <code>CacheHealthEvaluator</code> + * Creates a new {@code CacheHealthEvaluator} */ CacheHealthEvaluator(GemFireHealthConfig config, DM dm) { super(config, dm); this.config = config; InternalDistributedSystem system = dm.getSystem(); - GemFireCacheImpl cache; + InternalCache cache; try { - cache = (GemFireCacheImpl) CacheFactory.getInstance(system); - - } catch (CancelException ex) { + cache = (InternalCache) CacheFactory.getInstance(system); + } catch (CancelException ignore) { // No cache in this VM cache = null; } @@ -92,8 +89,6 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec GemFireCacheImpl.addCacheLifecycleListener(this); } - //////////////////// Instance Methods //////////////////// - @Override protected String getDescription() { return this.description; @@ -102,14 +97,14 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec /** * Initializes the state of this evaluator based on the given cache instance. */ - private void initialize(GemFireCacheImpl cache, DM dm) { - StringBuffer sb = new StringBuffer(); + private void initialize(InternalCache cache, DM dm) { + StringBuilder sb = new StringBuilder(); if (cache != null) { this.cacheStats = cache.getCachePerfStats(); sb.append("Cache \""); sb.append(cache.getName()); - sb.append("\""); + sb.append('"'); } else { sb.append("No Cache"); @@ -125,21 +120,22 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec this.description = sb.toString(); } - public void cacheCreated(GemFireCacheImpl cache) { + @Override + public void cacheCreated(InternalCache cache) { InternalDistributedSystem system = (InternalDistributedSystem) cache.getDistributedSystem(); DM dm = system.getDistributionManager(); initialize(cache, dm); } /** - * Checks to make sure that the average <code>netSearch</code> time during the previous health - * check interval is less than the {@linkplain CacheHealthConfig#getMaxNetSearchTime threshold}. - * If not, the status is "okay" health. + * Checks to make sure that the average {@code netSearch} time during the previous health check + * interval is less than the {@linkplain CacheHealthConfig#getMaxNetSearchTime threshold}. If not, + * the status is "okay" health. * * @see CachePerfStats#getNetsearchTime * @see CachePerfStats#getNetsearchesCompleted */ - void checkNetSearchTime(List status) { + private void checkNetSearchTime(List status) { if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) { return; } @@ -156,21 +152,21 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec if (ratio > threshold) { String s = LocalizedStrings.CacheHealthEvaluator_THE_AVERAGE_DURATION_OF_A_CACHE_NETSEARCH_0_MS_EXCEEDS_THE_THRESHOLD_1_MS - .toLocalizedString(new Object[] {ratio, threshold}); + .toLocalizedString(ratio, threshold); status.add(okayHealth(s)); } } } /** - * Checks to make sure that the average <code>load</code> time during the previous health check + * Checks to make sure that the average {@code load} time during the previous health check * interval is less than the {@linkplain CacheHealthConfig#getMaxLoadTime threshold}. If not, the * status is "okay" health. * * @see CachePerfStats#getLoadTime * @see CachePerfStats#getLoadsCompleted */ - void checkLoadTime(List status) { + private void checkLoadTime(List<HealthStatus> status) { if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) { return; } @@ -180,7 +176,7 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec long deltaLoadsCompleted = this.cacheStats.getLoadsCompleted() - this.prevLoadsCompleted; if (logger.isDebugEnabled()) { - logger.debug("Completed {} loads in {} ms", deltaLoadsCompleted, (deltaLoadTime / 1000000)); + logger.debug("Completed {} loads in {} ms", deltaLoadsCompleted, deltaLoadTime / 1000000); } if (deltaLoadsCompleted != 0) { @@ -191,7 +187,7 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec if (ratio > threshold) { String s = LocalizedStrings.CacheHealthEvaluator_THE_AVERAGE_DURATION_OF_A_CACHE_LOAD_0_MS_EXCEEDS_THE_THRESHOLD_1_MS - .toLocalizedString(new Object[] {ratio, threshold}); + .toLocalizedString(ratio, threshold); if (logger.isDebugEnabled()) { logger.debug(s); } @@ -219,7 +215,7 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec * @see CachePerfStats#getLoadsCompleted * @see CachePerfStats#getNetsearchesCompleted */ - void checkHitRatio(List status) { + private void checkHitRatio(List<HealthStatus> status) { if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) { return; } @@ -230,12 +226,12 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec long deltaNetsearchesCompleted = this.cacheStats.getNetsearchesCompleted() - this.prevNetsearchesCompleted; - double hits = (deltaGets - (deltaLoadsCompleted + deltaNetsearchesCompleted)); + double hits = deltaGets - (deltaLoadsCompleted + deltaNetsearchesCompleted); double hitRatio = hits / deltaGets; double threshold = this.config.getMinHitRatio(); if (hitRatio < threshold) { String s = "The hit ratio of this Cache (" + hitRatio + ") is below the threshold (" - + threshold + ")"; + + threshold + ')'; status.add(okayHealth(s)); } } @@ -246,7 +242,7 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec * size} does not exceed the {@linkplain CacheHealthConfig#getMaxEventQueueSize threshold}. If it * does, the status is "okay" health. */ - void checkEventQueueSize(List status) { + private void checkEventQueueSize(List<HealthStatus> status) { if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) { return; } @@ -256,13 +252,11 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec if (eventQueueSize > threshold) { String s = LocalizedStrings.CacheHealthEvaluator_THE_SIZE_OF_THE_CACHE_EVENT_QUEUE_0_MS_EXCEEDS_THE_THRESHOLD_1_MS - .toLocalizedString( - new Object[] {Long.valueOf(eventQueueSize), Long.valueOf(threshold)}); + .toLocalizedString(eventQueueSize, threshold); status.add(okayHealth(s)); } } - /** * Updates the previous values of statistics */ @@ -285,7 +279,6 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec @Override protected void check(List status) { - checkNetSearchTime(status); checkLoadTime(status); checkHitRatio(status); @@ -300,7 +293,7 @@ class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifec } @Override - public void cacheClosed(GemFireCacheImpl cache) { + public void cacheClosed(InternalCache cache) { // do nothing } } http://git-wip-us.apache.org/repos/asf/geode/blob/654d65b5/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java b/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java index 25abd7e..f01666d 100644 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java +++ b/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java @@ -40,6 +40,7 @@ import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor; import org.apache.geode.internal.admin.remote.AdminResponse; import org.apache.geode.internal.admin.remote.CliLegacyMessage; import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.logging.LogService; import org.apache.geode.internal.logging.log4j.LocalizedMessage; @@ -92,7 +93,7 @@ public class FinishBackupRequest extends CliLegacyMessage { @Override protected AdminResponse createResponse(DistributionManager dm) { - GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); + InternalCache cache = GemFireCacheImpl.getInstance(); HashSet<PersistentID> persistentIds; if (cache == null || cache.getBackupManager() == null) { persistentIds = new HashSet<PersistentID>();
