ignite-1462: hid portable API in 1.4 release
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/71379a80 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/71379a80 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/71379a80 Branch: refs/heads/master Commit: 71379a8061f50f336adc31fa20cd593b659b050f Parents: b4c515e Author: Denis Magda <dma...@gridgain.com> Authored: Mon Sep 14 17:24:27 2015 +0300 Committer: Denis Magda <dma...@gridgain.com> Committed: Mon Sep 14 17:24:29 2015 +0300 ---------------------------------------------------------------------- examples/config/example-default.xml | 76 - examples/config/example-ignite.xml | 56 +- .../config/portable/example-ignite-portable.xml | 44 - .../ignite/examples/portable/Address.java | 72 - .../ignite/examples/portable/Employee.java | 93 - .../ignite/examples/portable/EmployeeKey.java | 90 - .../portable/ExamplePortableNodeStartup.java | 36 - .../ignite/examples/portable/Organization.java | 93 - .../examples/portable/OrganizationType.java | 32 - ...mputeClientPortableTaskExecutionExample.java | 154 - .../portable/computegrid/ComputeClientTask.java | 116 - .../portable/computegrid/package-info.java | 21 - .../CacheClientPortablePutGetExample.java | 230 -- .../CacheClientPortableQueryExample.java | 325 -- .../portable/datagrid/package-info.java | 21 - .../ignite/examples/portable/package-info.java | 21 - .../CacheClientPortableExampleTest.java | 46 - .../ComputeClientPortableExampleTest.java | 37 - .../testsuites/IgniteExamplesSelfTestSuite.java | 6 - modules/core/pom.xml | 21 - .../src/main/java/org/apache/ignite/Ignite.java | 7 - .../java/org/apache/ignite/IgniteCache.java | 44 +- .../java/org/apache/ignite/IgnitePortables.java | 370 -- .../configuration/CacheConfiguration.java | 70 +- .../org/apache/ignite/internal/IgniteEx.java | 9 + .../apache/ignite/internal/IgniteKernal.java | 8 +- .../ignite/internal/IgniteNodeAttributes.java | 5 +- .../discovery/GridDiscoveryManager.java | 10 - .../portable/GridPortableMarshaller.java | 2 +- .../portable/PortableClassDescriptor.java | 10 +- .../internal/portable/PortableContext.java | 14 +- .../portable/PortableMetaDataCollector.java | 6 +- .../portable/PortableMetaDataHandler.java | 4 +- .../internal/portable/PortableMetaDataImpl.java | 14 +- .../internal/portable/PortableObjectEx.java | 6 +- .../internal/portable/PortableObjectImpl.java | 6 +- .../portable/PortableObjectOffheapImpl.java | 6 +- .../internal/portable/PortableRawReaderEx.java | 4 +- .../internal/portable/PortableRawWriterEx.java | 4 +- .../portable/PortableReaderContext.java | 2 +- .../internal/portable/PortableReaderExImpl.java | 10 +- .../ignite/internal/portable/PortableUtils.java | 2 +- .../internal/portable/PortableWriterExImpl.java | 11 +- .../internal/portable/api/IgnitePortables.java | 362 ++ .../internal/portable/api/PortableBuilder.java | 136 + .../portable/api/PortableException.java | 57 + .../internal/portable/api/PortableIdMapper.java | 54 + .../api/PortableInvalidClassException.java | 58 + .../portable/api/PortableMarshalAware.java | 48 + .../portable/api/PortableMarshaller.java | 358 ++ .../internal/portable/api/PortableMetadata.java | 60 + .../internal/portable/api/PortableObject.java | 152 + .../portable/api/PortableProtocolVersion.java | 41 + .../portable/api/PortableRawReader.java | 234 ++ .../portable/api/PortableRawWriter.java | 219 + .../internal/portable/api/PortableReader.java | 284 ++ .../portable/api/PortableSerializer.java | 47 + .../portable/api/PortableTypeConfiguration.java | 195 + .../internal/portable/api/PortableWriter.java | 266 ++ .../portable/builder/PortableBuilderEnum.java | 2 +- .../portable/builder/PortableBuilderImpl.java | 14 +- .../portable/builder/PortableBuilderReader.java | 2 +- .../builder/PortableBuilderSerializer.java | 2 +- .../builder/PortableEnumArrayLazyValue.java | 4 +- .../builder/PortableObjectArrayLazyValue.java | 2 +- .../builder/PortablePlainPortableObject.java | 2 +- .../streams/PortableAbstractInputStream.java | 2 +- .../processors/cache/GridCacheProcessor.java | 8 +- .../processors/cache/IgniteCacheProxy.java | 5 - .../CacheDefaultPortableAffinityKeyMapper.java | 2 +- .../portable/CacheObjectPortableContext.java | 2 +- .../portable/CacheObjectPortableProcessor.java | 8 +- .../CacheObjectPortableProcessorImpl.java | 12 +- .../cache/portable/IgnitePortablesImpl.java | 10 +- .../cache/store/CacheOsStoreManager.java | 4 +- .../dotnet/PlatformDotNetConfiguration.java | 12 +- .../PlatformDotNetPortableConfiguration.java | 12 +- ...PlatformDotNetPortableTypeConfiguration.java | 12 +- .../marshaller/portable/PortableMarshaller.java | 358 -- .../marshaller/portable/package-info.java | 22 - .../apache/ignite/portable/PortableBuilder.java | 137 - .../ignite/portable/PortableException.java | 57 - .../ignite/portable/PortableIdMapper.java | 56 - .../portable/PortableInvalidClassException.java | 58 - .../ignite/portable/PortableMarshalAware.java | 48 - .../ignite/portable/PortableMetadata.java | 61 - .../apache/ignite/portable/PortableObject.java | 154 - .../portable/PortableProtocolVersion.java | 41 - .../ignite/portable/PortableRawReader.java | 234 -- .../ignite/portable/PortableRawWriter.java | 219 - .../apache/ignite/portable/PortableReader.java | 284 -- .../ignite/portable/PortableSerializer.java | 49 - .../portable/PortableTypeConfiguration.java | 196 - .../apache/ignite/portable/PortableWriter.java | 266 -- .../apache/ignite/portable/package-info.java | 22 - .../resources/META-INF/classnames.properties | 8 +- .../GridDiscoveryManagerAttributesSelfTest.java | 45 - .../GridPortableAffinityKeySelfTest.java | 218 - .../GridPortableBuilderAdditionalSelfTest.java | 1226 ------ .../portable/GridPortableBuilderSelfTest.java | 1021 ----- ...eBuilderStringAsCharsAdditionalSelfTest.java | 28 - ...ridPortableBuilderStringAsCharsSelfTest.java | 28 - ...idPortableMarshallerCtxDisabledSelfTest.java | 256 -- .../GridPortableMarshallerSelfTest.java | 3807 ------------------ .../GridPortableMetaDataDisabledSelfTest.java | 238 -- .../portable/GridPortableMetaDataSelfTest.java | 371 -- .../portable/GridPortableWildcardsSelfTest.java | 482 --- .../GridPortableMarshalerAwareTestClass.java | 67 - .../mutabletest/GridPortableTestClasses.java | 434 -- .../portable/mutabletest/package-info.java | 22 - .../ignite/internal/portable/package-info.java | 22 - .../portable/test/GridPortableTestClass1.java | 28 - .../portable/test/GridPortableTestClass2.java | 24 - .../internal/portable/test/package-info.java | 22 - .../test/subpackage/GridPortableTestClass3.java | 24 - .../portable/test/subpackage/package-info.java | 22 - ...ClientNodePortableMetadataMultinodeTest.java | 295 -- ...GridCacheClientNodePortableMetadataTest.java | 286 -- ...ableObjectsAbstractDataStreamerSelfTest.java | 190 - ...bleObjectsAbstractMultiThreadedSelfTest.java | 231 -- ...ridCachePortableObjectsAbstractSelfTest.java | 978 ----- .../GridCachePortableStoreAbstractSelfTest.java | 297 -- .../GridCachePortableStoreObjectsSelfTest.java | 55 - ...GridCachePortableStorePortablesSelfTest.java | 66 - ...ridPortableCacheEntryMemorySizeSelfTest.java | 55 - ...leDuplicateIndexObjectsAbstractSelfTest.java | 158 - .../DataStreamProcessorPortableSelfTest.java | 66 - .../GridDataStreamerImplSelfTest.java | 345 -- ...ridCacheAffinityRoutingPortableSelfTest.java | 47 - ...lyPortableDataStreamerMultiNodeSelfTest.java | 29 - ...rtableDataStreamerMultithreadedSelfTest.java | 47 - ...artitionedOnlyPortableMultiNodeSelfTest.java | 28 - ...tionedOnlyPortableMultithreadedSelfTest.java | 47 - .../GridCacheMemoryModePortableSelfTest.java | 36 - ...acheOffHeapTieredAtomicPortableSelfTest.java | 47 - ...eapTieredEvictionAtomicPortableSelfTest.java | 95 - ...heOffHeapTieredEvictionPortableSelfTest.java | 95 - .../GridCacheOffHeapTieredPortableSelfTest.java | 47 - ...ateIndexObjectPartitionedAtomicSelfTest.java | 38 - ...xObjectPartitionedTransactionalSelfTest.java | 41 - ...AtomicNearDisabledOffheapTieredSelfTest.java | 29 - ...rtableObjectsAtomicNearDisabledSelfTest.java | 51 - ...tableObjectsAtomicOffheapTieredSelfTest.java | 29 - .../GridCachePortableObjectsAtomicSelfTest.java | 51 - ...tionedNearDisabledOffheapTieredSelfTest.java | 30 - ...eObjectsPartitionedNearDisabledSelfTest.java | 51 - ...ObjectsPartitionedOffheapTieredSelfTest.java | 30 - ...CachePortableObjectsPartitionedSelfTest.java | 51 - ...sNearPartitionedByteArrayValuesSelfTest.java | 41 - ...sPartitionedOnlyByteArrayValuesSelfTest.java | 42 - ...dCachePortableObjectsReplicatedSelfTest.java | 51 - ...CachePortableObjectsAtomicLocalSelfTest.java | 32 - ...rtableObjectsLocalOffheapTieredSelfTest.java | 29 - .../GridCachePortableObjectsLocalSelfTest.java | 51 - .../ignite/testframework/junits/IgniteMock.java | 8 +- .../multijvm/IgniteCacheProcessProxy.java | 5 - .../junits/multijvm/IgniteProcessProxy.java | 2 +- .../IgnitePortableCacheFullApiTestSuite.java | 37 - .../IgnitePortableCacheTestSuite.java | 103 - .../IgnitePortableObjectsTestSuite.java | 92 - .../ignite/portable/test1/1.1/test1-1.1.jar | Bin 2548 -> 0 bytes .../ignite/portable/test1/1.1/test1-1.1.pom | 9 - .../portable/test1/maven-metadata-local.xml | 12 - .../ignite/portable/test2/1.1/test2-1.1.jar | Bin 1361 -> 0 bytes .../ignite/portable/test2/1.1/test2-1.1.pom | 9 - .../portable/test2/maven-metadata-local.xml | 12 - .../HadoopDefaultMapReducePlannerSelfTest.java | 6 + .../IgnitePortableCacheQueryTestSuite.java | 117 - .../platform/PlatformContextImpl.java | 4 +- .../platform/compute/PlatformCompute.java | 2 +- .../cpp/PlatformCppConfigurationClosure.java | 2 +- .../PlatformDotNetConfigurationClosure.java | 6 +- .../Config/Compute/compute-grid1.xml | 8 +- .../PlatformComputePortableArgTask.java | 8 +- .../org/apache/ignite/IgniteSpringBean.java | 7 - parent/pom.xml | 10 - 176 files changed, 2778 insertions(+), 17425 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/config/example-default.xml ---------------------------------------------------------------------- diff --git a/examples/config/example-default.xml b/examples/config/example-default.xml deleted file mode 100644 index e6c359d..0000000 --- a/examples/config/example-default.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?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. ---> - -<!-- - Ignite configuration with all defaults and enabled p2p deployment and enabled events. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:util="http://www.springframework.org/schema/util" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/util - http://www.springframework.org/schema/util/spring-util.xsd"> - <bean abstract="true" id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> - <!-- Set to true to enable distributed class loading for examples, default is false. --> - <property name="peerClassLoadingEnabled" value="true"/> - - <!-- Enable task execution events for examples. --> - <property name="includeEventTypes"> - <list> - <!--Task execution events--> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/> - - <!--Cache events--> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT"/> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ"/> - <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED"/> - </list> - </property> - - <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. --> - <property name="discoverySpi"> - <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> - <property name="ipFinder"> - <!-- - Ignite provides several options for automatic discovery that can be used - instead os static IP based discovery. For information on all options refer - to our documentation: http://apacheignite.readme.io/docs/cluster-config - --> - <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. --> - <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">--> - <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder"> - <property name="addresses"> - <list> - <!-- In distributed environment, replace with actual host IP address. --> - <value>127.0.0.1:47500..47509</value> - </list> - </property> - </bean> - </property> - </bean> - </property> - </bean> -</beans> http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/config/example-ignite.xml ---------------------------------------------------------------------- diff --git a/examples/config/example-ignite.xml b/examples/config/example-ignite.xml index d842a6d..e7adb54 100644 --- a/examples/config/example-ignite.xml +++ b/examples/config/example-ignite.xml @@ -22,18 +22,62 @@ --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd"> - <!-- Imports default Ignite configuration --> - <import resource="example-default.xml"/> + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util.xsd"> + <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> + <!-- Set to true to enable distributed class loading for examples, default is false. --> + <property name="peerClassLoadingEnabled" value="true"/> - <bean parent="ignite.cfg"> - <!-- Enabled optimized marshaller --> <property name="marshaller"> <bean class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller"> <!-- Set to false to allow non-serializable objects in examples, default is true. --> <property name="requireSerializable" value="false"/> </bean> </property> + + <!-- Enable task execution events for examples. --> + <property name="includeEventTypes"> + <list> + <!--Task execution events--> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/> + + <!--Cache events--> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT"/> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ"/> + <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED"/> + </list> + </property> + + <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. --> + <property name="discoverySpi"> + <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> + <property name="ipFinder"> + <!-- + Ignite provides several options for automatic discovery that can be used + instead os static IP based discovery. For information on all options refer + to our documentation: http://apacheignite.readme.io/docs/cluster-config + --> + <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. --> + <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">--> + <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder"> + <property name="addresses"> + <list> + <!-- In distributed environment, replace with actual host IP address. --> + <value>127.0.0.1:47500..47509</value> + </list> + </property> + </bean> + </property> + </bean> + </property> </bean> </beans> http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/config/portable/example-ignite-portable.xml ---------------------------------------------------------------------- diff --git a/examples/config/portable/example-ignite-portable.xml b/examples/config/portable/example-ignite-portable.xml deleted file mode 100644 index cde15ea..0000000 --- a/examples/config/portable/example-ignite-portable.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?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. ---> - -<!-- - Ignite configuration with all defaults and enabled p2p deployment, events and portable marshaller. - - Use this configuration file when running HTTP REST examples (see 'examples/rest' folder). - - When starting a standalone node, you need to execute the following command: - {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/portable/example-ignite-portable.xml - - When starting Ignite from Java IDE, pass path to this file to Ignition: - Ignition.start("examples/config/portable/example-ignite-portable.xml"); ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd"> - <!-- Imports default Ignite configuration --> - <import resource="../example-default.xml"/> - - <bean parent="ignite.cfg"> - <!-- Enables portable marshaller --> - <property name="marshaller"> - <bean class="org.apache.ignite.marshaller.portable.PortableMarshaller"/> - </property> - </bean> -</beans> http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/Address.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/Address.java b/examples/src/main/java/org/apache/ignite/examples/portable/Address.java deleted file mode 100644 index cb08b25..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/Address.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable; - -import org.apache.ignite.portable.PortableException; -import org.apache.ignite.portable.PortableMarshalAware; -import org.apache.ignite.portable.PortableReader; -import org.apache.ignite.portable.PortableWriter; - -/** - * Employee address. - * <p> - * This class implements {@link PortableMarshalAware} only for example purposes, - * in order to show how to customize serialization and deserialization of - * portable objects. - */ -public class Address implements PortableMarshalAware { - /** Street. */ - private String street; - - /** ZIP code. */ - private int zip; - - /** - * Required for portable deserialization. - */ - public Address() { - // No-op. - } - - /** - * @param street Street. - * @param zip ZIP code. - */ - public Address(String street, int zip) { - this.street = street; - this.zip = zip; - } - - /** {@inheritDoc} */ - @Override public void writePortable(PortableWriter writer) throws PortableException { - writer.writeString("street", street); - writer.writeInt("zip", zip); - } - - /** {@inheritDoc} */ - @Override public void readPortable(PortableReader reader) throws PortableException { - street = reader.readString("street"); - zip = reader.readInt("zip"); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return "Address [street=" + street + - ", zip=" + zip + ']'; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/Employee.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/Employee.java b/examples/src/main/java/org/apache/ignite/examples/portable/Employee.java deleted file mode 100644 index 9614168..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/Employee.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable; - -import java.util.Collection; - -/** - * This class represents employee object. - */ -public class Employee { - /** Name. */ - private String name; - - /** Salary. */ - private long salary; - - /** Address. */ - private Address address; - - /** Departments. */ - private Collection<String> departments; - - /** - * Required for portable deserialization. - */ - public Employee() { - // No-op. - } - - /** - * @param name Name. - * @param salary Salary. - * @param address Address. - * @param departments Departments. - */ - public Employee(String name, long salary, Address address, Collection<String> departments) { - this.name = name; - this.salary = salary; - this.address = address; - this.departments = departments; - } - - /** - * @return Name. - */ - public String name() { - return name; - } - - /** - * @return Salary. - */ - public long salary() { - return salary; - } - - /** - * @return Address. - */ - public Address address() { - return address; - } - - /** - * @return Departments. - */ - public Collection<String> departments() { - return departments; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return "Employee [name=" + name + - ", salary=" + salary + - ", address=" + address + - ", departments=" + departments + ']'; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/EmployeeKey.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/EmployeeKey.java b/examples/src/main/java/org/apache/ignite/examples/portable/EmployeeKey.java deleted file mode 100644 index f322167..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/EmployeeKey.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable; - -/** - * This class represents key for employee object. - * <p> - * Used in query example to collocate employees - * with their organizations. - */ -public class EmployeeKey { - /** ID. */ - private int id; - - /** Organization ID. */ - private int organizationId; - - /** - * Required for portable deserialization. - */ - public EmployeeKey() { - // No-op. - } - - /** - * @param id ID. - * @param organizationId Organization ID. - */ - public EmployeeKey(int id, int organizationId) { - this.id = id; - this.organizationId = organizationId; - } - - /** - * @return ID. - */ - public int id() { - return id; - } - - /** - * @return Organization ID. - */ - public int organizationId() { - return organizationId; - } - - /** {@inheritDoc} */ - @Override public boolean equals(Object o) { - if (this == o) - return true; - - if (o == null || getClass() != o.getClass()) - return false; - - EmployeeKey key = (EmployeeKey)o; - - return id == key.id && organizationId == key.organizationId; - } - - /** {@inheritDoc} */ - @Override public int hashCode() { - int res = id; - - res = 31 * res + organizationId; - - return res; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return "EmployeeKey [id=" + id + - ", organizationId=" + organizationId + ']'; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/ExamplePortableNodeStartup.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/ExamplePortableNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/portable/ExamplePortableNodeStartup.java deleted file mode 100644 index 87a41f7..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/ExamplePortableNodeStartup.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable; - -import org.apache.ignite.IgniteException; -import org.apache.ignite.Ignition; - -/** - * Starts up an empty node with example configuration and portable marshaller enabled. - */ -public class ExamplePortableNodeStartup { - /** - * Start up an empty node with example configuration and portable marshaller enabled. - * - * @param args Command line arguments, none required. - * @throws IgniteException If failed. - */ - public static void main(String[] args) throws IgniteException { - Ignition.start("examples/config/portable/example-ignite-portable.xml"); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/Organization.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/Organization.java b/examples/src/main/java/org/apache/ignite/examples/portable/Organization.java deleted file mode 100644 index f52cac1..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/Organization.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable; - -import java.sql.Timestamp; - -/** - * This class represents organization object. - */ -public class Organization { - /** Name. */ - private String name; - - /** Address. */ - private Address address; - - /** Type. */ - private OrganizationType type; - - /** Last update time. */ - private Timestamp lastUpdated; - - /** - * Required for portable deserialization. - */ - public Organization() { - // No-op. - } - - /** - * @param name Name. - * @param address Address. - * @param type Type. - * @param lastUpdated Last update time. - */ - public Organization(String name, Address address, OrganizationType type, Timestamp lastUpdated) { - this.name = name; - this.address = address; - this.type = type; - this.lastUpdated = lastUpdated; - } - - /** - * @return Name. - */ - public String name() { - return name; - } - - /** - * @return Address. - */ - public Address address() { - return address; - } - - /** - * @return Type. - */ - public OrganizationType type() { - return type; - } - - /** - * @return Last update time. - */ - public Timestamp lastUpdated() { - return lastUpdated; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return "Organization [name=" + name + - ", address=" + address + - ", type=" + type + - ", lastUpdated=" + lastUpdated + ']'; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/OrganizationType.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/OrganizationType.java b/examples/src/main/java/org/apache/ignite/examples/portable/OrganizationType.java deleted file mode 100644 index c753e2d..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/OrganizationType.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable; - -/** - * Organization type enum. - */ -public enum OrganizationType { - /** Non-profit organization. */ - NON_PROFIT, - - /** Private organization. */ - PRIVATE, - - /** Government organization. */ - GOVERNMENT -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java b/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java deleted file mode 100644 index 34d9cde..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable.computegrid; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import org.apache.ignite.Ignite; -import org.apache.ignite.Ignition; -import org.apache.ignite.examples.portable.Address; -import org.apache.ignite.examples.portable.Employee; -import org.apache.ignite.examples.portable.ExamplePortableNodeStartup; -import org.apache.ignite.portable.PortableObject; - -/** - * This example demonstrates use of portable objects with task execution. - * Specifically it shows that portable objects are simple Java POJOs and do not require any special treatment. - * <p> - * The example executes map-reduce task that accepts collection of portable objects as an argument. - * Since these objects are never deserialized on remote nodes, classes are not required on classpath - * of these nodes. - * <p> - * Remote nodes should always be started with special configuration file which - * enables the portable marshaller: {@code 'ignite.{sh|bat} examples/config/portable/example-ignite-portable.xml'}. - * <p> - * Alternatively you can run {@link ExamplePortableNodeStartup} in another JVM which will - * start node with {@code examples/config/portable/example-ignite-portable.xml} configuration. - */ -public class ComputeClientPortableTaskExecutionExample { - /** - * Executes example. - * - * @param args Command line arguments, none required. - */ - public static void main(String[] args) { - try (Ignite ignite = Ignition.start("examples/config/portable/example-ignite-portable.xml")) { - System.out.println(); - System.out.println(">>> Portable objects task execution example started."); - - if (ignite.cluster().forRemotes().nodes().isEmpty()) { - System.out.println(); - System.out.println(">>> This example requires remote nodes to be started."); - System.out.println(">>> Please start at least 1 remote node."); - System.out.println(">>> Refer to example's javadoc for details on configuration."); - System.out.println(); - - return; - } - - // Generate employees to calculate average salary for. - Collection<Employee> employees = employees(); - - System.out.println(); - System.out.println(">>> Calculating average salary for employees:"); - - for (Employee employee : employees) - System.out.println(">>> " + employee); - - // Convert collection of employees to collection of portable objects. - // This allows to send objects across nodes without requiring to have - // Employee class on classpath of these nodes. - Collection<PortableObject> portables = ignite.portables().toPortable(employees); - - // Execute task and get average salary. - Long avgSalary = ignite.compute(ignite.cluster().forRemotes()).execute(new ComputeClientTask(), portables); - - System.out.println(); - System.out.println(">>> Average salary for all employees: " + avgSalary); - System.out.println(); - } - } - - /** - * Creates collection of employees. - * - * @return Collection of employees. - */ - private static Collection<Employee> employees() { - Collection<Employee> employees = new ArrayList<>(); - - employees.add(new Employee( - "James Wilson", - 12500, - new Address("1096 Eddy Street, San Francisco, CA", 94109), - Arrays.asList("Human Resources", "Customer Service") - )); - - employees.add(new Employee( - "Daniel Adams", - 11000, - new Address("184 Fidler Drive, San Antonio, TX", 78205), - Arrays.asList("Development", "QA") - )); - - employees.add(new Employee( - "Cristian Moss", - 12500, - new Address("667 Jerry Dove Drive, Florence, SC", 29501), - Arrays.asList("Logistics") - )); - - employees.add(new Employee( - "Allison Mathis", - 25300, - new Address("2702 Freedom Lane, Hornitos, CA", 95325), - Arrays.asList("Development") - )); - - employees.add(new Employee( - "Breana Robbin", - 6500, - new Address("3960 Sundown Lane, Austin, TX", 78758), - Arrays.asList("Sales") - )); - - employees.add(new Employee( - "Philip Horsley", - 19800, - new Address("2803 Elsie Drive, Sioux Falls, SD", 57104), - Arrays.asList("Sales") - )); - - employees.add(new Employee( - "Brian Peters", - 10600, - new Address("1407 Pearlman Avenue, Boston, MA", 12110), - Arrays.asList("Development", "QA") - )); - - employees.add(new Employee( - "Jack Yang", - 12900, - new Address("4425 Parrish Avenue Smithsons Valley, TX", 78130), - Arrays.asList("Sales") - )); - - return employees; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientTask.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientTask.java b/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientTask.java deleted file mode 100644 index 0eee8c6..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientTask.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable.computegrid; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.apache.ignite.compute.ComputeJob; -import org.apache.ignite.compute.ComputeJobAdapter; -import org.apache.ignite.compute.ComputeJobResult; -import org.apache.ignite.compute.ComputeTaskSplitAdapter; -import org.apache.ignite.lang.IgniteBiTuple; -import org.apache.ignite.portable.PortableObject; -import org.jetbrains.annotations.Nullable; - -/** - * Task that is used for {@link ComputeClientPortableTaskExecutionExample} and - * similar examples in .NET and C++. - * <p> - * This task calculates average salary for provided collection of employees. - * It splits the collection into batches of size {@code 3} and creates a job - * for each batch. After all jobs are executed, there results are reduced to - * get the average salary. - */ -public class ComputeClientTask extends ComputeTaskSplitAdapter<Collection<PortableObject>, Long> { - /** {@inheritDoc} */ - @Override protected Collection<? extends ComputeJob> split( - int gridSize, - Collection<PortableObject> arg - ) { - Collection<ComputeClientJob> jobs = new ArrayList<>(); - - Collection<PortableObject> employees = new ArrayList<>(); - - // Split provided collection into batches and - // create a job for each batch. - for (PortableObject employee : arg) { - employees.add(employee); - - if (employees.size() == 3) { - jobs.add(new ComputeClientJob(employees)); - - employees = new ArrayList<>(3); - } - } - - if (!employees.isEmpty()) - jobs.add(new ComputeClientJob(employees)); - - return jobs; - } - - /** {@inheritDoc} */ - @Nullable @Override public Long reduce(List<ComputeJobResult> results) { - long sum = 0; - int cnt = 0; - - for (ComputeJobResult res : results) { - IgniteBiTuple<Long, Integer> t = res.getData(); - - sum += t.get1(); - cnt += t.get2(); - } - - return sum / cnt; - } - - /** - * Remote job for {@link ComputeClientTask}. - */ - private static class ComputeClientJob extends ComputeJobAdapter { - /** Collection of employees. */ - private final Collection<PortableObject> employees; - - /** - * @param employees Collection of employees. - */ - private ComputeClientJob(Collection<PortableObject> employees) { - this.employees = employees; - } - - /** {@inheritDoc} */ - @Nullable @Override public Object execute() { - long sum = 0; - int cnt = 0; - - for (PortableObject employee : employees) { - System.out.println(">>> Processing employee: " + employee.field("name")); - - // Get salary from portable object. Note that object - // doesn't need to be fully deserialized. - long salary = employee.field("salary"); - - sum += salary; - cnt++; - } - - return new IgniteBiTuple<>(sum, cnt); - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/package-info.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/package-info.java b/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/package-info.java deleted file mode 100644 index 469128c..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -/** - * Demonstrates the usage of portable objects with task execution. - */ -package org.apache.ignite.examples.portable.computegrid; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/CacheClientPortablePutGetExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/CacheClientPortablePutGetExample.java b/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/CacheClientPortablePutGetExample.java deleted file mode 100644 index 77c5d95..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/CacheClientPortablePutGetExample.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable.datagrid; - -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.Ignition; -import org.apache.ignite.cache.CacheAtomicityMode; -import org.apache.ignite.cache.CacheMode; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.examples.portable.Address; -import org.apache.ignite.examples.portable.ExamplePortableNodeStartup; -import org.apache.ignite.examples.portable.Organization; -import org.apache.ignite.examples.portable.OrganizationType; -import org.apache.ignite.portable.PortableObject; - -/** - * This example demonstrates use of portable objects with Ignite cache. - * Specifically it shows that portable objects are simple Java POJOs and do not require any special treatment. - * <p> - * The example executes several put-get operations on Ignite cache with portable values. Note that - * it demonstrates how portable object can be retrieved in fully-deserialized form or in portable object - * format using special cache projection. - * <p> - * Remote nodes should always be started with special configuration file which - * enables the portable marshaller: {@code 'ignite.{sh|bat} examples/config/portable/example-ignite-portable.xml'}. - * <p> - * Alternatively you can run {@link ExamplePortableNodeStartup} in another JVM which will - * start node with {@code examples/config/portable/example-ignite-portable.xml} configuration. - */ -public class CacheClientPortablePutGetExample { - /** Cache name. */ - private static final String CACHE_NAME = CacheClientPortablePutGetExample.class.getSimpleName(); - - /** - * Executes example. - * - * @param args Command line arguments, none required. - */ - public static void main(String[] args) { - try (Ignite ignite = Ignition.start("examples/config/portable/example-ignite-portable.xml")) { - System.out.println(); - System.out.println(">>> Portable objects cache put-get example started."); - - CacheConfiguration<Integer, Organization> cfg = new CacheConfiguration<>(); - - cfg.setCacheMode(CacheMode.PARTITIONED); - cfg.setName(CACHE_NAME); - cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); - - try (IgniteCache<Integer, Organization> cache = ignite.createCache(cfg)) { - if (ignite.cluster().forDataNodes(cache.getName()).nodes().isEmpty()) { - System.out.println(); - System.out.println(">>> This example requires remote cache node nodes to be started."); - System.out.println(">>> Please start at least 1 remote cache node."); - System.out.println(">>> Refer to example's javadoc for details on configuration."); - System.out.println(); - - return; - } - - putGet(cache); - putGetPortable(cache); - putGetAll(cache); - putGetAllPortable(cache); - - System.out.println(); - } - finally { - // Delete cache with its content completely. - ignite.destroyCache(CACHE_NAME); - } - } - } - - /** - * Execute individual put and get. - * - * @param cache Cache. - */ - private static void putGet(IgniteCache<Integer, Organization> cache) { - // Create new Organization portable object to store in cache. - Organization org = new Organization( - "Microsoft", // Name. - new Address("1096 Eddy Street, San Francisco, CA", 94109), // Address. - OrganizationType.PRIVATE, // Type. - new Timestamp(System.currentTimeMillis())); // Last update time. - - // Put created data entry to cache. - cache.put(1, org); - - // Get recently created organization as a strongly-typed fully de-serialized instance. - Organization orgFromCache = cache.get(1); - - System.out.println(); - System.out.println(">>> Retrieved organization instance from cache: " + orgFromCache); - } - - /** - * Execute individual put and get, getting value in portable format, without de-serializing it. - * - * @param cache Cache. - */ - private static void putGetPortable(IgniteCache<Integer, Organization> cache) { - // Create new Organization portable object to store in cache. - Organization org = new Organization( - "Microsoft", // Name. - new Address("1096 Eddy Street, San Francisco, CA", 94109), // Address. - OrganizationType.PRIVATE, // Type. - new Timestamp(System.currentTimeMillis())); // Last update time. - - // Put created data entry to cache. - cache.put(1, org); - - // Get cache that will get values as portable objects. - IgniteCache<Integer, PortableObject> portableCache = cache.withKeepPortable(); - - // Get recently created organization as a portable object. - PortableObject po = portableCache.get(1); - - // Get organization's name from portable object (note that - // object doesn't need to be fully deserialized). - String name = po.field("name"); - - System.out.println(); - System.out.println(">>> Retrieved organization name from portable object: " + name); - } - - /** - * Execute bulk {@code putAll(...)} and {@code getAll(...)} operations. - * - * @param cache Cache. - */ - private static void putGetAll(IgniteCache<Integer, Organization> cache) { - // Create new Organization portable objects to store in cache. - Organization org1 = new Organization( - "Microsoft", // Name. - new Address("1096 Eddy Street, San Francisco, CA", 94109), // Address. - OrganizationType.PRIVATE, // Type. - new Timestamp(System.currentTimeMillis())); // Last update time. - - Organization org2 = new Organization( - "Red Cross", // Name. - new Address("184 Fidler Drive, San Antonio, TX", 78205), // Address. - OrganizationType.NON_PROFIT, // Type. - new Timestamp(System.currentTimeMillis())); // Last update time. - - Map<Integer, Organization> map = new HashMap<>(); - - map.put(1, org1); - map.put(2, org2); - - // Put created data entries to cache. - cache.putAll(map); - - // Get recently created organizations as a strongly-typed fully de-serialized instances. - Map<Integer, Organization> mapFromCache = cache.getAll(map.keySet()); - - System.out.println(); - System.out.println(">>> Retrieved organization instances from cache:"); - - for (Organization org : mapFromCache.values()) - System.out.println(">>> " + org); - } - - /** - * Execute bulk {@code putAll(...)} and {@code getAll(...)} operations, - * getting values in portable format, without de-serializing it. - * - * @param cache Cache. - */ - private static void putGetAllPortable(IgniteCache<Integer, Organization> cache) { - // Create new Organization portable objects to store in cache. - Organization org1 = new Organization( - "Microsoft", // Name. - new Address("1096 Eddy Street, San Francisco, CA", 94109), // Address. - OrganizationType.PRIVATE, // Type. - new Timestamp(System.currentTimeMillis())); // Last update time. - - Organization org2 = new Organization( - "Red Cross", // Name. - new Address("184 Fidler Drive, San Antonio, TX", 78205), // Address. - OrganizationType.NON_PROFIT, // Type. - new Timestamp(System.currentTimeMillis())); // Last update time. - - Map<Integer, Organization> map = new HashMap<>(); - - map.put(1, org1); - map.put(2, org2); - - // Put created data entries to cache. - cache.putAll(map); - - // Get cache that will get values as portable objects. - IgniteCache<Integer, PortableObject> portableCache = cache.withKeepPortable(); - - // Get recently created organizations as portable objects. - Map<Integer, PortableObject> poMap = portableCache.getAll(map.keySet()); - - Collection<String> names = new ArrayList<>(); - - // Get organizations' names from portable objects (note that - // objects don't need to be fully deserialized). - for (PortableObject po : poMap.values()) - names.add(po.<String>field("name")); - - System.out.println(); - System.out.println(">>> Retrieved organization names from portable objects: " + names); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/CacheClientPortableQueryExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/CacheClientPortableQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/CacheClientPortableQueryExample.java deleted file mode 100644 index 3170864..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/CacheClientPortableQueryExample.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples.portable.datagrid; - -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.cache.Cache; -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.Ignition; -import org.apache.ignite.cache.CacheMode; -import org.apache.ignite.cache.CacheTypeMetadata; -import org.apache.ignite.cache.query.QueryCursor; -import org.apache.ignite.cache.query.SqlFieldsQuery; -import org.apache.ignite.cache.query.SqlQuery; -import org.apache.ignite.cache.query.TextQuery; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.examples.portable.Address; -import org.apache.ignite.examples.portable.Employee; -import org.apache.ignite.examples.portable.EmployeeKey; -import org.apache.ignite.examples.portable.ExamplePortableNodeStartup; -import org.apache.ignite.examples.portable.Organization; -import org.apache.ignite.examples.portable.OrganizationType; -import org.apache.ignite.portable.PortableObject; - -/** - * This example demonstrates use of portable objects with cache queries. - * The example populates cache with sample data and runs several SQL and full text queries over this data. - * <p> - * Remote nodes should always be started with {@link ExamplePortableNodeStartup} which starts a node with - * {@code examples/config/portable/example-ignite-portable.xml} configuration. - */ -public class CacheClientPortableQueryExample { - /** Organization cache name. */ - private static final String ORGANIZATION_CACHE_NAME = CacheClientPortableQueryExample.class.getSimpleName() - + "Organizations"; - - /** Employee cache name. */ - private static final String EMPLOYEE_CACHE_NAME = CacheClientPortableQueryExample.class.getSimpleName() - + "Employees"; - - /** - * Executes example. - * - * @param args Command line arguments, none required. - */ - public static void main(String[] args) { - try (Ignite ignite = Ignition.start("examples/config/portable/example-ignite-portable.xml")) { - System.out.println(); - System.out.println(">>> Portable objects cache query example started."); - - CacheConfiguration<Integer, Organization> orgCacheCfg = new CacheConfiguration<>(); - - orgCacheCfg.setCacheMode(CacheMode.PARTITIONED); - orgCacheCfg.setName(ORGANIZATION_CACHE_NAME); - - orgCacheCfg.setTypeMetadata(Arrays.asList(createOrganizationTypeMetadata())); - - CacheConfiguration<EmployeeKey, Employee> employeeCacheCfg = new CacheConfiguration<>(); - - employeeCacheCfg.setCacheMode(CacheMode.PARTITIONED); - employeeCacheCfg.setName(EMPLOYEE_CACHE_NAME); - - employeeCacheCfg.setTypeMetadata(Arrays.asList(createEmployeeTypeMetadata())); - - try (IgniteCache<Integer, Organization> orgCache = ignite.createCache(orgCacheCfg); - IgniteCache<EmployeeKey, Employee> employeeCache = ignite.createCache(employeeCacheCfg) - ) { - if (ignite.cluster().forDataNodes(orgCache.getName()).nodes().isEmpty()) { - System.out.println(); - System.out.println(">>> This example requires remote cache nodes to be started."); - System.out.println(">>> Please start at least 1 remote cache node."); - System.out.println(">>> Refer to example's javadoc for details on configuration."); - System.out.println(); - - return; - } - - // Populate cache with sample data entries. - populateCache(orgCache, employeeCache); - - // Get cache that will work with portable objects. - IgniteCache<PortableObject, PortableObject> portableCache = employeeCache.withKeepPortable(); - - // Run SQL query example. - sqlQuery(portableCache); - - // Run SQL query with join example. - sqlJoinQuery(portableCache); - - // Run SQL fields query example. - sqlFieldsQuery(portableCache); - - // Run full text query example. - textQuery(portableCache); - - System.out.println(); - } - finally { - // Delete caches with their content completely. - ignite.destroyCache(ORGANIZATION_CACHE_NAME); - ignite.destroyCache(EMPLOYEE_CACHE_NAME); - } - } - } - - /** - * Create cache type metadata for {@link Employee}. - * - * @return Cache type metadata. - */ - private static CacheTypeMetadata createEmployeeTypeMetadata() { - CacheTypeMetadata employeeTypeMeta = new CacheTypeMetadata(); - - employeeTypeMeta.setValueType(Employee.class); - - employeeTypeMeta.setKeyType(EmployeeKey.class); - - Map<String, Class<?>> ascFields = new HashMap<>(); - - ascFields.put("name", String.class); - ascFields.put("salary", Long.class); - ascFields.put("address.zip", Integer.class); - ascFields.put("organizationId", Integer.class); - - employeeTypeMeta.setAscendingFields(ascFields); - - employeeTypeMeta.setTextFields(Arrays.asList("address.street")); - - return employeeTypeMeta; - } - - /** - * Create cache type metadata for {@link Organization}. - * - * @return Cache type metadata. - */ - private static CacheTypeMetadata createOrganizationTypeMetadata() { - CacheTypeMetadata organizationTypeMeta = new CacheTypeMetadata(); - - organizationTypeMeta.setValueType(Organization.class); - - organizationTypeMeta.setKeyType(Integer.class); - - Map<String, Class<?>> ascFields = new HashMap<>(); - - ascFields.put("name", String.class); - - Map<String, Class<?>> queryFields = new HashMap<>(); - - queryFields.put("address.street", String.class); - - organizationTypeMeta.setAscendingFields(ascFields); - - organizationTypeMeta.setQueryFields(queryFields); - - return organizationTypeMeta; - } - - /** - * Queries employees that have provided ZIP code in address. - * - * @param cache Ignite cache. - */ - private static void sqlQuery(IgniteCache<PortableObject, PortableObject> cache) { - SqlQuery<PortableObject, PortableObject> query = new SqlQuery<>(Employee.class, "zip = ?"); - - int zip = 94109; - - QueryCursor<Cache.Entry<PortableObject, PortableObject>> employees = cache.query(query.setArgs(zip)); - - System.out.println(); - System.out.println(">>> Employees with zip " + zip + ':'); - - for (Cache.Entry<PortableObject, PortableObject> e : employees.getAll()) - System.out.println(">>> " + e.getValue().deserialize()); - } - - /** - * Queries employees that work for organization with provided name. - * - * @param cache Ignite cache. - */ - private static void sqlJoinQuery(IgniteCache<PortableObject, PortableObject> cache) { - SqlQuery<PortableObject, PortableObject> query = new SqlQuery<>(Employee.class, - "from Employee, \"" + ORGANIZATION_CACHE_NAME + "\".Organization as org " + - "where Employee.organizationId = org._key and org.name = ?"); - - String organizationName = "GridGain"; - - QueryCursor<Cache.Entry<PortableObject, PortableObject>> employees = - cache.query(query.setArgs(organizationName)); - - System.out.println(); - System.out.println(">>> Employees working for " + organizationName + ':'); - - for (Cache.Entry<PortableObject, PortableObject> e : employees.getAll()) - System.out.println(">>> " + e.getValue()); - } - - /** - * Queries names and salaries for all employees. - * - * @param cache Ignite cache. - */ - private static void sqlFieldsQuery(IgniteCache<PortableObject, PortableObject> cache) { - SqlFieldsQuery query = new SqlFieldsQuery("select name, salary from Employee"); - - QueryCursor<List<?>> employees = cache.query(query); - - System.out.println(); - System.out.println(">>> Employee names and their salaries:"); - - for (List<?> row : employees.getAll()) - System.out.println(">>> [Name=" + row.get(0) + ", salary=" + row.get(1) + ']'); - } - - /** - * Queries employees that live in Texas using full-text query API. - * - * @param cache Ignite cache. - */ - private static void textQuery(IgniteCache<PortableObject, PortableObject> cache) { - TextQuery<PortableObject, PortableObject> query = new TextQuery<>(Employee.class, "TX"); - - QueryCursor<Cache.Entry<PortableObject, PortableObject>> employees = cache.query(query); - - System.out.println(); - System.out.println(">>> Employees living in Texas:"); - - for (Cache.Entry<PortableObject, PortableObject> e : employees.getAll()) - System.out.println(">>> " + e.getValue().deserialize()); - } - - /** - * Populates cache with data. - * - * @param orgCache Organization cache. - * @param employeeCache Employee cache. - */ - private static void populateCache(IgniteCache<Integer, Organization> orgCache, - IgniteCache<EmployeeKey, Employee> employeeCache) { - orgCache.put(1, new Organization( - "GridGain", - new Address("1065 East Hillsdale Blvd, Foster City, CA", 94404), - OrganizationType.PRIVATE, - new Timestamp(System.currentTimeMillis()) - )); - - orgCache.put(2, new Organization( - "Microsoft", - new Address("1096 Eddy Street, San Francisco, CA", 94109), - OrganizationType.PRIVATE, - new Timestamp(System.currentTimeMillis()) - )); - - employeeCache.put(new EmployeeKey(1, 1), new Employee( - "James Wilson", - 12500, - new Address("1096 Eddy Street, San Francisco, CA", 94109), - Arrays.asList("Human Resources", "Customer Service") - )); - - employeeCache.put(new EmployeeKey(2, 1), new Employee( - "Daniel Adams", - 11000, - new Address("184 Fidler Drive, San Antonio, TX", 78130), - Arrays.asList("Development", "QA") - )); - - employeeCache.put(new EmployeeKey(3, 1), new Employee( - "Cristian Moss", - 12500, - new Address("667 Jerry Dove Drive, Florence, SC", 29501), - Arrays.asList("Logistics") - )); - - employeeCache.put(new EmployeeKey(4, 2), new Employee( - "Allison Mathis", - 25300, - new Address("2702 Freedom Lane, San Francisco, CA", 94109), - Arrays.asList("Development") - )); - - employeeCache.put(new EmployeeKey(5, 2), new Employee( - "Breana Robbin", - 6500, - new Address("3960 Sundown Lane, Austin, TX", 78130), - Arrays.asList("Sales") - )); - - employeeCache.put(new EmployeeKey(6, 2), new Employee( - "Philip Horsley", - 19800, - new Address("2803 Elsie Drive, Sioux Falls, SD", 57104), - Arrays.asList("Sales") - )); - - employeeCache.put(new EmployeeKey(7, 2), new Employee( - "Brian Peters", - 10600, - new Address("1407 Pearlman Avenue, Boston, MA", 12110), - Arrays.asList("Development", "QA") - )); - } -} - http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/package-info.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/package-info.java b/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/package-info.java deleted file mode 100644 index b24f233..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/datagrid/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -/** - * Demonstrates the usage of portable objects with cache. - */ -package org.apache.ignite.examples.portable.datagrid; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/main/java/org/apache/ignite/examples/portable/package-info.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/package-info.java b/examples/src/main/java/org/apache/ignite/examples/portable/package-info.java deleted file mode 100644 index 4301027..0000000 --- a/examples/src/main/java/org/apache/ignite/examples/portable/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -/** - * Contains portable classes and examples. - */ -package org.apache.ignite.examples.portable; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/test/java/org/apache/ignite/examples/CacheClientPortableExampleTest.java ---------------------------------------------------------------------- diff --git a/examples/src/test/java/org/apache/ignite/examples/CacheClientPortableExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/CacheClientPortableExampleTest.java deleted file mode 100644 index 6ea1484..0000000 --- a/examples/src/test/java/org/apache/ignite/examples/CacheClientPortableExampleTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.examples; - -import org.apache.ignite.examples.portable.datagrid.CacheClientPortablePutGetExample; -import org.apache.ignite.examples.portable.datagrid.CacheClientPortableQueryExample; -import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest; - -/** - * - */ -public class CacheClientPortableExampleTest extends GridAbstractExamplesTest { - /** {@inheritDoc} */ - @Override protected String defaultConfig() { - return "examples/config/portable/example-ignite-portable.xml"; - } - - /** - * @throws Exception If failed. - */ - public void testPortablePutGetExample() throws Exception { - CacheClientPortablePutGetExample.main(new String[] {}); - } - - /** - * @throws Exception If failed. - */ - public void testPortableQueryExample() throws Exception { - CacheClientPortableQueryExample.main(new String[] {}); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/test/java/org/apache/ignite/examples/ComputeClientPortableExampleTest.java ---------------------------------------------------------------------- diff --git a/examples/src/test/java/org/apache/ignite/examples/ComputeClientPortableExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/ComputeClientPortableExampleTest.java deleted file mode 100644 index 2223aec..0000000 --- a/examples/src/test/java/org/apache/ignite/examples/ComputeClientPortableExampleTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ -package org.apache.ignite.examples; - -import org.apache.ignite.examples.portable.computegrid.ComputeClientPortableTaskExecutionExample; -import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest; - -/** - * - */ -public class ComputeClientPortableExampleTest extends GridAbstractExamplesTest { - /** {@inheritDoc} */ - @Override protected String defaultConfig() { - return "examples/config/portable/example-ignite-portable.xml"; - } - - /** - * @throws Exception If failed. - */ - public void testPortableTaskExecutionExample() throws Exception { - ComputeClientPortableTaskExecutionExample.main(new String[] {}); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java ---------------------------------------------------------------------- diff --git a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java index baa23fc..4669ae4 100644 --- a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java +++ b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java @@ -20,12 +20,10 @@ package org.apache.ignite.testsuites; import junit.framework.TestSuite; import org.apache.ignite.examples.BasicExamplesMultiNodeSelfTest; import org.apache.ignite.examples.BasicExamplesSelfTest; -import org.apache.ignite.examples.CacheClientPortableExampleTest; import org.apache.ignite.examples.CacheExamplesMultiNodeSelfTest; import org.apache.ignite.examples.CacheExamplesSelfTest; import org.apache.ignite.examples.CheckpointExamplesSelfTest; import org.apache.ignite.examples.ClusterGroupExampleSelfTest; -import org.apache.ignite.examples.ComputeClientPortableExampleTest; import org.apache.ignite.examples.ContinuationExamplesMultiNodeSelfTest; import org.apache.ignite.examples.ContinuationExamplesSelfTest; import org.apache.ignite.examples.ContinuousMapperExamplesMultiNodeSelfTest; @@ -95,10 +93,6 @@ public class IgniteExamplesSelfTestSuite extends TestSuite { suite.addTest(new TestSuite(MonteCarloExamplesMultiNodeSelfTest.class)); suite.addTest(new TestSuite(HibernateL2CacheExampleMultiNodeSelfTest.class)); - // Portable. - suite.addTest(new TestSuite(CacheClientPortableExampleTest.class)); - suite.addTest(new TestSuite(ComputeClientPortableExampleTest.class)); - return suite; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/modules/core/pom.xml ---------------------------------------------------------------------- diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 2f0dde7..9162afe 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -34,13 +34,6 @@ <version>1.4.0-SNAPSHOT</version> <url>http://ignite.apache.org</url> - <repositories> - <repository> - <id>ignite-portables-test-repo</id> - <url>file://${basedir}/src/test/portables/repo</url> - </repository> - </repositories> - <properties> <ignite.update.notifier.product>apache-ignite</ignite.update.notifier.product> </properties> @@ -176,20 +169,6 @@ <version>2.4</version> <scope>test</scope> </dependency> - - <dependency> - <groupId>org.apache.ignite.portable</groupId> - <artifactId>test1</artifactId> - <version>1.1</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.ignite.portable</groupId> - <artifactId>test2</artifactId> - <version>1.1</version> - <scope>test</scope> - </dependency> </dependencies> <build> http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/modules/core/src/main/java/org/apache/ignite/Ignite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/Ignite.java b/modules/core/src/main/java/org/apache/ignite/Ignite.java index 62fd020..0afccd0 100644 --- a/modules/core/src/main/java/org/apache/ignite/Ignite.java +++ b/modules/core/src/main/java/org/apache/ignite/Ignite.java @@ -459,13 +459,6 @@ public interface Ignite extends AutoCloseable { public <T extends IgnitePlugin> T plugin(String name) throws PluginNotFoundException; /** - * Gets an instance of {@link IgnitePortables} interface. - * - * @return Instance of {@link IgnitePortables} interface. - */ - public IgnitePortables portables(); - - /** * Closes {@code this} instance of grid. This method is identical to calling * {@link G#stop(String, boolean) G.stop(gridName, true)}. * <p> http://git-wip-us.apache.org/repos/asf/ignite/blob/71379a80/modules/core/src/main/java/org/apache/ignite/IgniteCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java index e0f9f55..5558a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java @@ -18,12 +18,9 @@ package org.apache.ignite; import java.io.Serializable; -import java.sql.Timestamp; import java.util.Collection; -import java.util.Date; import java.util.Map; import java.util.Set; -import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import javax.cache.Cache; @@ -55,7 +52,6 @@ import org.apache.ignite.lang.IgniteAsyncSupported; import org.apache.ignite.lang.IgniteBiInClosure; import org.apache.ignite.lang.IgniteBiPredicate; import org.apache.ignite.lang.IgniteFuture; -import org.apache.ignite.marshaller.portable.PortableMarshaller; import org.apache.ignite.mxbean.CacheMetricsMXBean; import org.jetbrains.annotations.Nullable; @@ -132,44 +128,6 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS public IgniteCache<K, V> withNoRetries(); /** - * Returns cache that will operate with portable objects. - * <p> - * Cache returned by this method will not be forced to deserialize portable objects, - * so keys and values will be returned from cache API methods without changes. Therefore, - * signature of the cache can contain only following types: - * <ul> - * <li><code>org.apache.ignite.portable.PortableObject</code> for portable classes</li> - * <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li> - * <li>Arrays of primitives (byte[], int[], ...)</li> - * <li>{@link String} and array of {@link String}s</li> - * <li>{@link UUID} and array of {@link UUID}s</li> - * <li>{@link Date} and array of {@link Date}s</li> - * <li>{@link Timestamp} and array of {@link Timestamp}s</li> - * <li>Enums and array of enums</li> - * <li> - * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) - * </li> - * </ul> - * <p> - * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection - * to avoid deserialization: - * <pre> - * IgniteCache<Integer, PortableObject> prj = cache.withKeepPortable(); - * - * // Value is not deserialized and returned in portable format. - * PortableObject po = prj.get(1); - * </pre> - * <p> - * Note that this method makes sense only if cache is working in portable mode ({@link PortableMarshaller} is used). - * If not, this method is no-op and will return current cache. - * - * @return New cache instance for portable objects. - */ - public <K1, V1> IgniteCache<K1, V1> withKeepPortable(); - - /** * Executes {@link #localLoadCache(IgniteBiPredicate, Object...)} on all cache nodes. * * @param p Optional predicate (may be {@code null}). If provided, will be used to @@ -661,4 +619,4 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS * @return MxBean. */ public CacheMetricsMXBean mxBean(); -} \ No newline at end of file +}