Merge branches 'ignite-1.5' and 'ignite-843-rc2'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4b2dd7c8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4b2dd7c8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4b2dd7c8 Branch: refs/heads/ignite-843-rc2 Commit: 4b2dd7c8d8ec88686e6d0ed2c083598965517636 Parents: 26b093c 3ba7e54 Author: Alexey Kuznetsov <[email protected]> Authored: Wed Dec 9 18:23:36 2015 +0700 Committer: Alexey Kuznetsov <[email protected]> Committed: Wed Dec 9 18:24:01 2015 +0700 ---------------------------------------------------------------------- RELEASE_NOTES.txt | 1 + bin/ignite.bat | 5 +- bin/include/parseargs.bat | 2 +- examples/config/example-default.xml | 7 + examples/pom.xml | 4 +- examples/schema-import/pom.xml | 4 +- .../java/org/apache/ignite/schema/Demo.java | 6 +- .../store/auto/CacheBinaryAutoStoreExample.java | 158 ++++ .../datagrid/store/auto/package-info.java | 22 + .../store/auto/CacheAutoStoreExample.java | 94 ++- .../auto/CacheAutoStoreLoadDataExample.java | 85 -- .../datagrid/store/auto/CacheConfig.java | 81 -- .../datagrid/store/auto/DbH2ServerStartup.java | 79 -- .../messaging/MessagingPingPongExample.java | 4 - .../ignite/examples/util/DbH2ServerStartup.java | 79 ++ .../ignite/examples/util/package-info.java | 22 + .../examples/MessagingExamplesSelfTest.java | 2 - modules/aop/pom.xml | 14 +- modules/apache-license-gen/pom.xml | 2 +- modules/aws/pom.xml | 20 +- modules/camel/pom.xml | 13 +- modules/clients/pom.xml | 2 +- modules/cloud/pom.xml | 2 +- modules/codegen/pom.xml | 2 +- .../ignite/codegen/MessageCodeGenerator.java | 6 +- modules/control-center-agent/pom.xml | 2 +- modules/control-center-web/pom.xml | 2 +- modules/core/pom.xml | 30 +- .../main/java/org/apache/ignite/Ignition.java | 16 + .../store/jdbc/CacheAbstractJdbcStore.java | 17 +- .../cache/store/jdbc/CacheJdbcPojoStore.java | 9 + .../configuration/CacheConfiguration.java | 39 +- .../configuration/IgniteConfiguration.java | 6 +- .../configuration/TransactionConfiguration.java | 47 +- .../apache/ignite/internal/GridComponent.java | 3 +- .../ignite/internal/GridPluginComponent.java | 4 +- .../apache/ignite/internal/IgniteKernal.java | 20 +- .../org/apache/ignite/internal/IgnitionEx.java | 39 +- .../ignite/internal/MarshallerContextImpl.java | 30 +- .../internal/managers/GridManagerAdapter.java | 5 +- .../managers/communication/GridIoManager.java | 3 +- .../communication/GridIoMessageFactory.java | 8 +- .../deployment/GridDeploymentManager.java | 5 +- .../internal/portable/BinaryFieldAccessor.java | 9 +- .../internal/portable/BinaryReaderExImpl.java | 21 +- .../internal/portable/BinaryWriterExImpl.java | 24 +- .../portable/PortableClassDescriptor.java | 46 +- .../internal/portable/PortableContext.java | 46 +- .../processors/GridProcessorAdapter.java | 5 +- .../CacheDefaultBinaryAffinityKeyMapper.java | 2 +- .../processors/cache/GridCacheAdapter.java | 65 +- .../cache/GridCacheConcurrentMap.java | 734 +++++------------ .../processors/cache/GridCacheContext.java | 36 +- .../processors/cache/GridCacheIoManager.java | 2 +- .../processors/cache/GridCacheMapEntry.java | 44 +- .../cache/GridCacheMapEntryFactory.java | 13 +- .../GridCachePartitionExchangeManager.java | 17 +- .../processors/cache/GridCachePreloader.java | 11 +- .../processors/cache/GridCacheProcessor.java | 28 +- .../CacheDataStructuresManager.java | 31 +- .../distributed/GridDistributedCacheEntry.java | 14 +- .../dht/GridDhtAffinityAssignmentResponse.java | 2 +- .../distributed/dht/GridDhtCacheAdapter.java | 13 +- .../distributed/dht/GridDhtCacheEntry.java | 14 +- .../dht/GridDhtOffHeapCacheEntry.java | 15 +- .../distributed/dht/GridDhtTxPrepareFuture.java | 51 +- .../distributed/dht/GridNoStorageCacheMap.java | 4 +- .../dht/atomic/GridDhtAtomicCache.java | 43 +- .../dht/atomic/GridDhtAtomicCacheEntry.java | 16 +- .../atomic/GridDhtAtomicOffHeapCacheEntry.java | 15 +- .../dht/colocated/GridDhtColocatedCache.java | 13 +- .../colocated/GridDhtColocatedCacheEntry.java | 14 +- .../GridDhtColocatedOffHeapCacheEntry.java | 15 +- .../colocated/GridDhtDetachedCacheEntry.java | 4 +- .../dht/preloader/GridDhtPartitionDemander.java | 41 +- .../GridDhtPartitionsExchangeFuture.java | 9 +- .../dht/preloader/GridDhtPreloader.java | 4 +- .../preloader/GridDhtPreloaderAssignments.java | 19 +- .../distributed/near/GridNearCacheAdapter.java | 8 +- .../distributed/near/GridNearCacheEntry.java | 16 +- .../near/GridNearOffHeapCacheEntry.java | 15 +- .../cache/jta/CacheJtaManagerAdapter.java | 4 +- .../processors/cache/local/GridLocalCache.java | 8 +- .../cache/local/GridLocalCacheEntry.java | 15 +- .../local/atomic/GridLocalAtomicCache.java | 8 +- .../CacheObjectBinaryProcessorImpl.java | 49 +- .../cache/query/GridCacheQueryManager.java | 58 +- .../cache/transactions/IgniteTxAdapter.java | 5 + .../cache/transactions/IgniteTxEntry.java | 8 +- .../transactions/IgniteTxLocalAdapter.java | 11 +- .../datastructures/CollocatedQueueItemKey.java | 75 ++ .../datastructures/CollocatedSetItemKey.java | 87 ++ .../datastructures/DataStructuresProcessor.java | 11 +- .../GridAtomicCacheQueueImpl.java | 8 +- .../datastructures/GridCacheQueueAdapter.java | 30 +- .../datastructures/GridCacheQueueItemKey.java | 9 +- .../datastructures/GridCacheSetImpl.java | 37 +- .../datastructures/GridCacheSetItemKey.java | 21 +- .../GridTransactionalCacheQueueImpl.java | 2 +- .../processors/datastructures/QueueItemKey.java | 27 + .../processors/datastructures/SetItemKey.java | 36 + .../handlers/query/QueryCommandHandler.java | 6 +- .../internal/util/GridMessageCollection.java | 160 ++++ .../ignite/internal/util/IgniteUtils.java | 18 +- .../internal/util/UUIDCollectionMessage.java | 42 +- .../util/nio/GridNioBackPressureControl.java | 14 +- .../optimized/OptimizedMarshallerUtils.java | 16 +- .../org/apache/ignite/spi/IgniteSpiThread.java | 10 +- .../communication/tcp/TcpCommunicationSpi.java | 6 +- .../org/apache/ignite/thread/IgniteThread.java | 43 +- .../ignite/thread/IgniteThreadPoolExecutor.java | 37 +- .../core/src/main/resources/ignite.properties | 2 +- .../IgniteClientReconnectAbstractTest.java | 95 ++- .../IgniteClientReconnectAtomicsTest.java | 57 ++ .../IgniteClientReconnectCacheTest.java | 5 +- .../IgniteClientReconnectCollectionsTest.java | 51 ++ .../portable/BinaryMarshallerSelfTest.java | 16 +- ...cheAbstractFullApiMultithreadedSelfTest.java | 2 +- .../cache/GridCacheAbstractFullApiSelfTest.java | 4 +- .../cache/GridCacheAlwaysEvictionPolicy.java | 2 +- ...eAtomicEntryProcessorDeploymentSelfTest.java | 6 +- .../cache/GridCacheConcurrentMapSelfTest.java | 11 - .../GridCacheConditionalDeploymentSelfTest.java | 20 +- .../cache/GridCacheDeploymentSelfTest.java | 11 +- ...CacheMultinodeUpdateNearEnabledSelfTest.java | 5 + .../IgniteCacheEntryProcessorCallTest.java | 497 ++++++++++++ .../cache/IgniteCacheInvokeAbstractTest.java | 369 ++++++--- ...eAbstractDataStructuresFailoverSelfTest.java | 9 +- .../GridCacheQueueApiSelfAbstractTest.java | 18 +- .../GridCacheSetFailoverAbstractSelfTest.java | 6 +- .../GridCachePartitionedQueueApiSelfTest.java | 5 + ...dCachePartitionedQueueEntryMoveSelfTest.java | 2 +- .../IgnitePartitionedQueueNoBackupsTest.java | 92 +++ .../GridCacheReplicatedQueueApiSelfTest.java | 5 + .../CacheLockReleaseNodeLeaveTest.java | 161 ++++ .../dht/GridCacheDhtPreloadDelayedSelfTest.java | 37 +- .../dht/GridCacheTxNodeFailureSelfTest.java | 2 + .../dht/GridNearCacheTxNodeFailureSelfTest.java | 4 - ...idCachePartitionedHitsAndMissesSelfTest.java | 4 +- ...cingDelayedPartitionMapExchangeSelfTest.java | 9 +- .../GridCacheRebalancingAsyncSelfTest.java | 3 +- .../GridCacheRebalancingSyncCheckDataTest.java | 98 +++ .../GridCacheRebalancingSyncSelfTest.java | 55 +- ...eRebalancingUnmarshallingFailedSelfTest.java | 6 +- .../GridCacheWriteBehindStoreAbstractTest.java | 2 +- .../DataStreamProcessorSelfTest.java | 25 +- .../loadtests/hashmap/GridHashMapLoadTest.java | 4 +- .../marshaller/GridMarshallerAbstractTest.java | 32 +- .../config/GridTestProperties.java | 6 + .../testframework/junits/GridAbstractTest.java | 31 +- .../junits/IgniteTestResources.java | 2 +- .../IgniteBinaryObjectsCacheTestSuite3.java | 2 + .../IgniteCacheDataStructuresSelfTestSuite.java | 3 + .../ignite/testsuites/IgniteCacheTestSuite.java | 6 +- .../testsuites/IgniteCacheTestSuite2.java | 2 + .../testsuites/IgniteCacheTestSuite3.java | 2 + .../IgnitePortableCacheTestSuite.java | 3 +- .../testsuites/IgniteUtilSelfTestSuite.java | 2 + .../ignite/util/GridMessageCollectionTest.java | 105 +++ modules/extdata/p2p/pom.xml | 2 +- .../extdata/uri/modules/uri-dependency/pom.xml | 2 +- modules/extdata/uri/pom.xml | 2 +- modules/flume/pom.xml | 18 +- modules/gce/pom.xml | 2 +- modules/geospatial/pom.xml | 22 +- modules/hadoop/pom.xml | 4 +- modules/hibernate/pom.xml | 12 +- .../HibernateTransactionalDataRegion.java | 18 +- .../HibernateL2CacheTransactionalSelfTest.java | 23 +- modules/indexing/pom.xml | 24 +- ...cheDuplicateEntityConfigurationSelfTest.java | 126 +++ .../IgniteCacheQuerySelfTestSuite.java | 4 + modules/jcl/pom.xml | 13 +- modules/jms11/pom.xml | 22 +- modules/jta/pom.xml | 26 +- .../cache/jta/jndi/CacheJndiTmFactory.java | 132 ++++ .../processors/cache/jta/CacheJtaManager.java | 41 +- .../cache/AbstarctCacheJtaSelfTest.java | 183 +++++ .../cache/CacheJndiTmFactorySelfTest.java | 166 ++++ ...CacheJtaConfigurationValidationSelfTest.java | 4 +- ...CacheJtaFactoryConfigValidationSelfTest.java | 142 ++++ .../processors/cache/GridCacheJtaSelfTest.java | 221 ------ .../cache/GridCacheReplicatedJtaSelfTest.java | 32 - .../cache/GridJtaLifecycleAwareSelfTest.java | 191 +++++ .../GridPartitionedCacheJtaFactorySelfTest.java | 41 + ...titionedCacheJtaLookupClassNameSelfTest.java | 83 ++ .../GridReplicatedCacheJtaFactorySelfTest.java | 32 + ...plicatedCacheJtaLookupClassNameSelfTest.java | 32 + .../GridTmLookupLifecycleAwareSelfTest.java | 122 --- .../ignite/testsuites/IgniteJtaTestSuite.java | 26 +- modules/kafka/pom.xml | 18 +- modules/log4j/pom.xml | 12 +- modules/log4j2/pom.xml | 13 +- modules/mesos/pom.xml | 2 +- modules/mqtt/pom.xml | 26 +- modules/osgi-karaf/README.txt | 18 + modules/osgi-karaf/licenses/apache-2.0.txt | 202 +++++ modules/osgi-karaf/pom.xml | 83 ++ .../osgi-karaf/src/main/resources/features.xml | 327 ++++++++ modules/osgi-paxlogging/README.txt | 12 + modules/osgi-paxlogging/licenses/apache-2.0.txt | 202 +++++ modules/osgi-paxlogging/pom.xml | 67 ++ modules/osgi/README.txt | 65 ++ modules/osgi/licenses/apache-2.0.txt | 202 +++++ modules/osgi/pom.xml | 170 ++++ .../IgniteAbstractOsgiContextActivator.java | 238 ++++++ .../org/apache/ignite/osgi/IgniteOsgiUtils.java | 69 ++ .../BundleDelegatingClassLoader.java | 147 ++++ .../classloaders/ContainerSweepClassLoader.java | 134 ++++ .../OsgiClassLoadingStrategyType.java | 29 + .../ignite/osgi/AbstractIgniteKarafTest.java | 107 +++ .../IgniteKarafFeaturesInstallationTest.java | 100 +++ .../ignite/osgi/IgniteOsgiServiceTest.java | 131 +++ .../apache/ignite/osgi/IgniteOsgiTestSuite.java | 32 + .../activators/BasicIgniteTestActivator.java | 76 ++ .../ignite/osgi/activators/TestOsgiFlags.java | 53 ++ .../osgi/activators/TestOsgiFlagsImpl.java | 83 ++ modules/platforms/cpp/common/configure.ac | 2 +- modules/platforms/cpp/core-test/configure.ac | 2 +- modules/platforms/cpp/core/configure.ac | 2 +- modules/platforms/cpp/examples/configure.ac | 2 +- modules/platforms/cpp/ignite/configure.ac | 2 +- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- .../Binary/BinarySelfTest.cs | 67 ++ .../Apache.Ignite.Core.Tests/EventsTest.cs | 3 +- .../Properties/AssemblyInfo.cs | 4 +- .../Apache.Ignite.Core.csproj | 1 + .../Impl/Binary/BinaryReflectiveActions.cs | 4 +- .../Impl/Common/DelegateConverter.cs | 15 +- .../Apache.Ignite.Core/Impl/NativeMethods.cs | 10 - .../Impl/Unmanaged/IgniteJniNativeMethods.cs | 358 +++++++++ .../Impl/Unmanaged/UnmanagedUtils.cs | 788 +++---------------- .../Properties/AssemblyInfo.cs | 4 +- modules/platforms/dotnet/Apache.Ignite.FxCop | 322 +++++++- .../Apache.Ignite/Properties/AssemblyInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- modules/rest-http/pom.xml | 36 +- modules/scalar-2.10/pom.xml | 11 +- modules/scalar/pom.xml | 11 +- modules/schedule/pom.xml | 27 +- modules/schema-import-db/pom.xml | 2 +- modules/schema-import/pom.xml | 4 +- .../ignite/schema/ui/SchemaImportApp.java | 78 +- modules/slf4j/pom.xml | 14 +- modules/spark-2.10/pom.xml | 4 +- modules/spark/pom.xml | 2 +- modules/spring/pom.xml | 32 +- .../ignite/internal/GridFactorySelfTest.java | 29 + .../GridSpringBeanSerializationSelfTest.java | 2 + modules/ssh/pom.xml | 21 +- modules/tools/pom.xml | 2 +- modules/twitter/pom.xml | 14 +- modules/urideploy/pom.xml | 19 +- modules/visor-console-2.10/pom.xml | 6 +- modules/visor-console/pom.xml | 4 +- modules/visor-plugins/pom.xml | 6 +- modules/web/pom.xml | 15 +- .../config/benchmark-failover.properties | 2 +- modules/yardstick/pom.xml | 2 +- .../yardstick/cache/IgnitePutTxBenchmark.java | 26 +- ...IgniteTransactionalInvokeRetryBenchmark.java | 4 +- ...IgniteTransactionalWriteInvokeBenchmark.java | 34 +- modules/yarn/pom.xml | 2 +- .../apache/ignite/yarn/utils/package-info.java | 22 + modules/zookeeper/pom.xml | 16 +- parent/pom.xml | 140 +++- pom.xml | 46 +- 269 files changed, 8941 insertions(+), 2921 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/4b2dd7c8/modules/control-center-agent/pom.xml ---------------------------------------------------------------------- diff --cc modules/control-center-agent/pom.xml index 4cde704,0000000..00916d5 mode 100644,000000..100644 --- a/modules/control-center-agent/pom.xml +++ b/modules/control-center-agent/pom.xml @@@ -1,152 -1,0 +1,152 @@@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + POM file. +--> +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-parent</artifactId> + <version>1</version> + <relativePath>../../parent</relativePath> + </parent> + + <artifactId>ignite-control-center-agent</artifactId> - <version>1.5.0-b1-SNAPSHOT</version> ++ <version>1.5.0-b2-SNAPSHOT</version> + + <properties> + <jetty.version>9.2.12.v20150709</jetty.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-schema-import-db</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.eclipse.jetty.websocket</groupId> + <artifactId>websocket-client</artifactId> + <version>${jetty.version}</version> + </dependency> + + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <version>2.4</version> + </dependency> + + <dependency> + <groupId>com.beust</groupId> + <artifactId>jcommander</artifactId> + <version>1.48</version> + </dependency> + + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>4.5</version> + </dependency> + + <dependency> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-indexing</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-rest-http</artifactId> + <version>${project.version}</version> + <exclusions> + <exclusion> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + + <build> + <finalName>ignite-web-agent-${project.version}</finalName> + + <plugins> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <version>2.5</version> + + <configuration> + <archive> + <manifest> + <mainClass>org.apache.ignite.agent.AgentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>2.4</version> + + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + + <configuration> + <createDependencyReducedPom>false</createDependencyReducedPom> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.4</version> + <inherited>false</inherited> + + <executions> + <execution> + <id>release-control-center-agent</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>assembly/release-control-center-agent.xml</descriptor> + </descriptors> + <finalName>ignite-web-agent-${project.version}</finalName> + <outputDirectory>target</outputDirectory> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> http://git-wip-us.apache.org/repos/asf/ignite/blob/4b2dd7c8/modules/control-center-web/pom.xml ---------------------------------------------------------------------- diff --cc modules/control-center-web/pom.xml index 1744805,0000000..c155b25 mode 100644,000000..100644 --- a/modules/control-center-web/pom.xml +++ b/modules/control-center-web/pom.xml @@@ -1,69 -1,0 +1,69 @@@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + POM file. +--> +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-parent</artifactId> + <version>1</version> + <relativePath>../../parent</relativePath> + </parent> + + <artifactId>ignite-control-center-web</artifactId> - <version>1.5.0-SNAPSHOT</version> ++ <version>1.5.0-b2-SNAPSHOT</version> + + <build> + <plugins> + <plugin> + <groupId>com.github.eirslett</groupId> + <artifactId>frontend-maven-plugin</artifactId> + <version>0.0.23</version> + + <configuration> + <workingDirectory>src/main/js</workingDirectory> + </configuration> + + <executions> + <execution> + <id>install node and npm</id> + <goals> + <goal>install-node-and-npm</goal> + </goals> + <configuration> + <nodeVersion>v0.12.7</nodeVersion> + <npmVersion>2.13.2</npmVersion> + </configuration> + </execution> + + <execution> + <id>npm install</id> + <goals> + <goal>npm</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> http://git-wip-us.apache.org/repos/asf/ignite/blob/4b2dd7c8/modules/schema-import-db/pom.xml ---------------------------------------------------------------------- diff --cc modules/schema-import-db/pom.xml index 8c544b2,0000000..7717472 mode 100644,000000..100644 --- a/modules/schema-import-db/pom.xml +++ b/modules/schema-import-db/pom.xml @@@ -1,44 -1,0 +1,44 @@@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + POM file. +--> +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-parent</artifactId> + <version>1</version> + <relativePath>../../parent</relativePath> + </parent> + + <artifactId>ignite-schema-import-db</artifactId> - <version>1.5.0-b1-SNAPSHOT</version> ++ <version>1.5.0-b2-SNAPSHOT</version> + + <dependencies> + <dependency> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-core</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/ignite/blob/4b2dd7c8/modules/schema-import/pom.xml ---------------------------------------------------------------------- diff --cc modules/schema-import/pom.xml index 9eb8b02,3fe9ad3..a5ea828 --- a/modules/schema-import/pom.xml +++ b/modules/schema-import/pom.xml @@@ -42,15 -42,9 +42,15 @@@ </dependency> <dependency> + <groupId>org.apache.ignite</groupId> + <artifactId>ignite-schema-import-db</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> - <version>1.3.175</version> + <version>${h2.version}</version> <scope>test</scope> </dependency> </dependencies> http://git-wip-us.apache.org/repos/asf/ignite/blob/4b2dd7c8/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java ---------------------------------------------------------------------- diff --cc modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java index 124b623,6f9e05b..ceb965b --- a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java +++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java @@@ -22,11 -22,17 +22,13 @@@ import java.io.File import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; + import java.lang.reflect.Field; -import java.net.URL; -import java.net.URLClassLoader; import java.sql.Connection; -import java.sql.Driver; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.List; -import java.util.Map; ++import java.util.HashMap; import java.util.Properties; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@@ -86,172 -118,233 +88,242 @@@ import org.apache.ignite.schema.parser. public class SchemaImportApp extends Application { /** Logger. */ private static final Logger log = Logger.getLogger(SchemaImportApp.class.getName()); + - /** Presets for database settings. */ - private static class Preset { - /** Name in preferences. */ - private String pref; - - /** RDBMS name to show on screen. */ - private String name; - - /** Path to JDBC driver jar. */ - private String jar; - - /** JDBC driver class name. */ - private String drv; - - /** JDBC URL. */ - private String url; - - /** User name. */ - private String user; - - /** - * Preset constructor. - * - * @param pref Name in preferences. - * @param name RDBMS name to show on screen. - * @param jar Path to JDBC driver jar.. - * @param drv JDBC driver class name. - * @param url JDBC URL. - * @param user User name. - */ - Preset(String pref, String name, String jar, String drv, String url, String user) { - this.pref = pref; - this.name = name; - this.jar = jar; - this.drv = drv; - this.url = url; - this.user = user; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return name; - } - } - - /** Default presets for popular databases. */ - private final Preset[] presets = { - new Preset("h2", "H2 Database", "h2.jar", "org.h2.Driver", "jdbc:h2:[database]", "sa"), - new Preset("db2", "DB2", "db2jcc4.jar", "com.ibm.db2.jcc.DB2Driver", "jdbc:db2://[host]:[port]/[database]", - "db2admin"), - new Preset("oracle", "Oracle", "ojdbc6.jar", "oracle.jdbc.OracleDriver", - "jdbc:oracle:thin:@[host]:[port]:[database]", "system"), - new Preset("mysql", "MySQL", "mysql-connector-java-5-bin.jar", "com.mysql.jdbc.Driver", - "jdbc:mysql://[host]:[port]/[database]", "root"), - new Preset("mssql", "Microsoft SQL Server", "sqljdbc41.jar", "com.microsoft.sqlserver.jdbc.SQLServerDriver", - "jdbc:sqlserver://[host]:[port][;databaseName=database]", "sa"), - new Preset("postgresql", "PostgreSQL", "postgresql-9.3.jdbc4.jar", "org.postgresql.Driver", - "jdbc:postgresql://[host]:[port]/[database]", "sa"), - new Preset("custom", "Custom server...", "custom-jdbc.jar", "org.custom.Driver", "jdbc:custom", "sa") - }; - /** */ private static final String PREF_WINDOW_X = "window.x"; ++ /** */ private static final String PREF_WINDOW_Y = "window.y"; ++ /** */ private static final String PREF_WINDOW_WIDTH = "window.width"; ++ /** */ private static final String PREF_WINDOW_HEIGHT = "window.height"; + /** */ private static final String PREF_JDBC_DB_PRESET = "jdbc.db.preset"; ++ /** */ private static final String PREF_JDBC_DRIVER_JAR = "jdbc.driver.jar"; ++ /** */ private static final String PREF_JDBC_DRIVER_CLASS = "jdbc.driver.class"; ++ /** */ private static final String PREF_JDBC_URL = "jdbc.url"; ++ /** */ private static final String PREF_JDBC_USER = "jdbc.user"; + /** */ private static final String PREF_OUT_FOLDER = "out.folder"; + /** */ private static final String PREF_POJO_PACKAGE = "pojo.package"; ++ /** */ private static final String PREF_POJO_INCLUDE = "pojo.include"; ++ /** */ private static final String PREF_POJO_CONSTRUCTOR = "pojo.constructor"; + /** */ private static final String PREF_XML_SINGLE = "xml.single"; + /** */ private static final String PREF_NAMING_PATTERN = "naming.pattern"; ++ /** */ private static final String PREF_NAMING_REPLACE = "naming.replace"; + + /** Empty POJO fields model. */ + private static final ObservableList<PojoField> NO_FIELDS = FXCollections.emptyObservableList(); ++ + /** Default presets for popular databases. */ + private final Preset[] presets = { + new Preset("h2", "H2 Database", "h2.jar", "org.h2.Driver", "jdbc:h2:[database]", "sa"), + new Preset("db2", "DB2", "db2jcc4.jar", "com.ibm.db2.jcc.DB2Driver", "jdbc:db2://[host]:[port]/[database]", + "db2admin"), + new Preset("oracle", "Oracle", "ojdbc6.jar", "oracle.jdbc.OracleDriver", + "jdbc:oracle:thin:@[host]:[port]:[database]", "system"), + new Preset("mysql", "MySQL", "mysql-connector-java-5-bin.jar", "com.mysql.jdbc.Driver", + "jdbc:mysql://[host]:[port]/[database]", "root"), + new Preset("mssql", "Microsoft SQL Server", "sqljdbc41.jar", "com.microsoft.sqlserver.jdbc.SQLServerDriver", + "jdbc:sqlserver://[host]:[port][;databaseName=database]", "sa"), + new Preset("postgresql", "PostgreSQL", "postgresql-9.3.jdbc4.jar", "org.postgresql.Driver", + "jdbc:postgresql://[host]:[port]/[database]", "sa"), + new Preset("custom", "Custom server...", "custom-jdbc.jar", "org.custom.Driver", "jdbc:custom", "sa") + }; ++ + /** Application preferences. */ + private final Properties prefs = new Properties(); ++ + /** File path for storing on local file system. */ + private final File prefsFile = new File(System.getProperty("user.home"), ".ignite-schema-import"); ++ + /** */ + private final ExecutorService exec = Executors.newSingleThreadExecutor(new ThreadFactory() { ++ /** {@inheritDoc} */ + @Override public Thread newThread(Runnable r) { + Thread t = new Thread(r, "ignite-schema-import-worker"); + + t.setDaemon(true); + + return t; + } + }); ++ /** */ private Stage owner; + /** */ private BorderPane rootPane; + /** Header pane. */ private BorderPane hdrPane; + /** */ private HBox dbIcon; + /** */ private HBox genIcon; + /** */ private Label titleLb; + /** */ private Label subTitleLb; + /** */ private Button prevBtn; + /** */ private Button nextBtn; + /** */ private ComboBox<Preset> rdbmsCb; + /** */ private TextField jdbcDrvJarTf; + /** */ private TextField jdbcDrvClsTf; + /** */ private TextField jdbcUrlTf; + /** */ private TextField userTf; + /** */ private PasswordField pwdTf; + /** */ private ComboBox<String> parseCb; + /** */ private ListView<SchemaDescriptor> schemaLst; + /** */ private GridPaneEx connPnl; + /** */ private StackPane connLayerPnl; + /** */ private TableView<PojoDescriptor> pojosTbl; + /** */ private TableView<PojoField> fieldsTbl; + /** */ private Node curTbl; + /** */ private TextField outFolderTf; + /** */ private TextField pkgTf; + /** */ private CheckBox pojoConstructorCh; + /** */ private CheckBox pojoIncludeKeysCh; + /** */ private CheckBox xmlSingleFileCh; + /** */ private TextField regexTf; + /** */ private TextField replaceTf; + /** */ private GridPaneEx genPnl; + /** */ private StackPane genLayerPnl; + /** */ private ProgressIndicator pi; + /** */ private ObservableList<SchemaDescriptor> schemas = FXCollections.emptyObservableList(); + /** List with POJOs descriptors. */ private ObservableList<PojoDescriptor> pojos = FXCollections.emptyObservableList(); + /** Currently selected POJO. */ private PojoDescriptor curPojo; - /** */ - private final Map<String, Driver> drivers = new HashMap<>(); + /** + * Schema Import utility launcher. + * + * @param args Command line arguments passed to the application. + */ + public static void main(String[] args) { + // Workaround for JavaFX ugly text AA. + System.setProperty("prism.lcdtext", "false"); + System.setProperty("prism.text", "t2k"); - /** Application preferences. */ - private final Properties prefs = new Properties(); + // Workaround for AWT + JavaFX: we should initialize AWT before JavaFX. + java.awt.Toolkit.getDefaultToolkit(); - /** File path for storing on local file system. */ - private final File prefsFile = new File(System.getProperty("user.home"), ".ignite-schema-import"); + // Workaround for JavaFX + Mac OS dock icon. + if (System.getProperty("os.name").toLowerCase().contains("mac os")) { + System.setProperty("javafx.macosx.embedded", "true"); - /** Empty POJO fields model. */ - private static final ObservableList<PojoField> NO_FIELDS = FXCollections.emptyObservableList(); + try { + Class<?> appCls = Class.forName("com.apple.eawt.Application"); - /** */ - private final ExecutorService exec = Executors.newSingleThreadExecutor(new ThreadFactory() { - @Override public Thread newThread(Runnable r) { - Thread t = new Thread(r, "ignite-schema-import-worker"); + Object osxApp = appCls.getDeclaredMethod("getApplication").invoke(null); - t.setDaemon(true); + appCls.getDeclaredMethod("setDockIconImage", java.awt.Image.class) - .invoke(osxApp, SwingFXUtils.fromFXImage(Controls.image("ignite", 128), null)); ++ .invoke(osxApp, SwingFXUtils.fromFXImage(Controls.image("ignite", 128), null)); ++ } ++ catch (Exception ignore) { ++ // No-op. ++ } + - return t; ++ // Workaround for JDK 7/JavaFX 2 application on Mac OSX El Capitan. ++ try { ++ Class<?> fontFinderCls = Class.forName("com.sun.t2k.MacFontFinder"); ++ ++ Field psNameToPathMap = fontFinderCls.getDeclaredField("psNameToPathMap"); ++ ++ psNameToPathMap.setAccessible(true); ++ psNameToPathMap.set(null, new HashMap<String, String>()); + } + catch (Exception ignore) { + // No-op. + } } - }); + + launch(args); + } /** * Lock UI before start long task. @@@ -921,26 -1058,26 +993,26 @@@ } }); - pojosTbl = tableView("Tables not found in database", useCol, keyClsCol, valClsCol); + pojosTbl = Controls.tableView("Tables not found in database", useCol, keyClsCol, valClsCol); - TableColumn<PojoField, Boolean> useFldCol = customColumn("Use", "use", + TableColumn<PojoField, Boolean> useFldCol = Controls.customColumn("Use", "use", "Check to use this field for XML and POJO generation\n" + - "Note that NOT NULL columns cannot be unchecked", PojoFieldUseCell.cellFactory()); + "Note that NOT NULL columns cannot be unchecked", PojoFieldUseCell.cellFactory()); useFldCol.setMinWidth(50); useFldCol.setMaxWidth(50); - TableColumn<PojoField, Boolean> keyCol = booleanColumn("Key", "key", + TableColumn<PojoField, Boolean> keyCol = Controls.booleanColumn("Key", "key", "Check to include this field into key object"); - TableColumn<PojoField, Boolean> akCol = booleanColumn("AK", "affinityKey", + TableColumn<PojoField, Boolean> akCol = Controls.booleanColumn("AK", "affinityKey", "Check to annotate key filed with @AffinityKeyMapped annotation in generated POJO class\n" + - "Note that a class can have only ONE key field annotated with @AffinityKeyMapped annotation"); + "Note that a class can have only ONE key field annotated with @AffinityKeyMapped annotation"); - TableColumn<PojoField, String> dbNameCol = tableColumn("DB Name", "dbName", "Field name in database"); + TableColumn<PojoField, String> dbNameCol = Controls.tableColumn("DB Name", "dbName", "Field name in database"); - TableColumn<PojoField, String> dbTypeNameCol = tableColumn("DB Type", "dbTypeName", "Field type in database"); + TableColumn<PojoField, String> dbTypeNameCol = Controls.tableColumn("DB Type", "dbTypeName", "Field type in database"); - TableColumn<PojoField, String> javaNameCol = textColumn("Java Name", "javaName", "Field name in POJO class", + TableColumn<PojoField, String> javaNameCol = Controls.textColumn("Java Name", "javaName", "Field name in POJO class", new TextColumnValidator<PojoField>() { @Override public boolean valid(PojoField rowVal, String newVal) { if (newVal.trim().isEmpty()) { http://git-wip-us.apache.org/repos/asf/ignite/blob/4b2dd7c8/parent/pom.xml ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/4b2dd7c8/pom.xml ----------------------------------------------------------------------
