diff --git a/assembly/dependencies-apache-ignite-lgpl.xml b/assembly/dependencies-apache-ignite-lgpl.xml index 7d7e016459bb1..ac3d35c972a66 100644 --- a/assembly/dependencies-apache-ignite-lgpl.xml +++ b/assembly/dependencies-apache-ignite-lgpl.xml @@ -118,6 +118,7 @@ ${project.groupId}:ignite-commons ${project.groupId}:ignite-binary-api ${project.groupId}:ignite-binary-impl + ${project.groupId}:ignite-thin-client-api ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/assembly/dependencies-apache-ignite-slim.xml b/assembly/dependencies-apache-ignite-slim.xml index 53676f307378b..f113444139b1a 100644 --- a/assembly/dependencies-apache-ignite-slim.xml +++ b/assembly/dependencies-apache-ignite-slim.xml @@ -118,6 +118,7 @@ ${project.groupId}:ignite-commons ${project.groupId}:ignite-binary-api ${project.groupId}:ignite-binary-impl + ${project.groupId}:ignite-thin-client-api ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/assembly/dependencies-apache-ignite.xml b/assembly/dependencies-apache-ignite.xml index 2ed7861597401..5952320cba9b2 100644 --- a/assembly/dependencies-apache-ignite.xml +++ b/assembly/dependencies-apache-ignite.xml @@ -119,6 +119,7 @@ ${project.groupId}:ignite-commons ${project.groupId}:ignite-binary-api ${project.groupId}:ignite-binary-impl + ${project.groupId}:ignite-thin-client-api ${project.groupId}:ignite-clients ${project.groupId}:ignite-spring ${project.groupId}:ignite-tools diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java b/modules/binary/api/src/main/java/org/apache/ignite/IgniteBinary.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/IgniteBinary.java rename to modules/binary/api/src/main/java/org/apache/ignite/IgniteBinary.java diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java b/modules/binary/api/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java rename to modules/binary/api/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java diff --git a/modules/bom/pom.xml b/modules/bom/pom.xml index 25f8124d03fc0..e14c89f779b55 100644 --- a/modules/bom/pom.xml +++ b/modules/bom/pom.xml @@ -181,6 +181,11 @@ ignite-commons ${revision} + + ${project.groupId} + ignite-thin-client-api + ${revision} + ${project.groupId} ignite-codegen diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java b/modules/commons/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java similarity index 90% rename from modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java rename to modules/commons/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java index f83dcdd6d9525..78da32a183fd2 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/CacheAtomicityMode.java @@ -18,8 +18,6 @@ package org.apache.ignite.cache; import javax.cache.processor.EntryProcessor; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.transactions.Transaction; import org.jetbrains.annotations.Nullable; /** @@ -28,14 +26,14 @@ * used whenever transactions and explicit locking are not needed. Note that in {@link #ATOMIC} * mode cache will still maintain full data consistency across all cache nodes. *

- * Cache atomicity may be set via {@link org.apache.ignite.configuration.CacheConfiguration#getAtomicityMode()} + * Cache atomicity may be set via {@ignitelink org.apache.ignite.configuration.CacheConfiguration#getAtomicityMode()} * configuration property. */ public enum CacheAtomicityMode { /** * Enables fully {@code ACID}-compliant transactional cache behavior for the key-value API. *

- * See {@link Transaction} for more information about transactions. + * See {@ignitelink org.apache.ignite.transactions.Transaction} for more information about transactions. */ TRANSACTIONAL, @@ -47,7 +45,7 @@ public enum CacheAtomicityMode { * In addition to transactions and locking, one of the main differences in {@code ATOMIC} mode * is that bulk writes, such as {@code putAll(...)}, {@code removeAll(...)}, and {@code transformAll(...)} * methods, become simple batch operations which can partially fail. In case of partial - * failure {@link CachePartialUpdateException} will be thrown + * failure {@ignitelink org.apache.ignite.cache.CachePartialUpdateException} will be thrown * which will contain a list of keys for which the update failed. It is recommended that bulk writes are used * whenever multiple keys need to be inserted or updated in cache, as they reduce number of network trips and * provide better performance. @@ -77,7 +75,7 @@ public enum CacheAtomicityMode { *

  • * For operations {@code putIfAbsent(K, V)}, {@code replace(K, V, V)} and {@code remove(K, V)} return * value on primary node crash may be incorrect because of the automatic retries. It is recommended - * to disable retries with {@link IgniteCache#withNoRetries()} and manually restore primary-backup + * to disable retries with {@ignitelink org.apache.ignite.IgniteCache#withNoRetries()} and manually restore primary-backup * consistency in case of update failure. *
  • * @@ -87,7 +85,7 @@ public enum CacheAtomicityMode { *

    * Note! Consistency behavior of atomic cache will be improved in future releases. * - * @see IgniteCache#withNoRetries() + * @see {@ignitelink org.apache.ignite.IgniteCache#withNoRetries()} */ ATOMIC; diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheEntryEventSerializableFilter.java b/modules/commons/src/main/java/org/apache/ignite/cache/CacheEntryEventSerializableFilter.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cache/CacheEntryEventSerializableFilter.java rename to modules/commons/src/main/java/org/apache/ignite/cache/CacheEntryEventSerializableFilter.java diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java b/modules/commons/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java rename to modules/commons/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheMode.java b/modules/commons/src/main/java/org/apache/ignite/cache/CacheMode.java similarity index 86% rename from modules/core/src/main/java/org/apache/ignite/cache/CacheMode.java rename to modules/commons/src/main/java/org/apache/ignite/cache/CacheMode.java index 392bb615dfe81..178b43d6db3f2 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/CacheMode.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/CacheMode.java @@ -18,19 +18,17 @@ package org.apache.ignite.cache; import java.util.stream.Stream; -import org.apache.ignite.cache.affinity.AffinityFunction; -import org.apache.ignite.configuration.NearCacheConfiguration; import org.jetbrains.annotations.Nullable; /** - * Enumeration of all supported caching modes. Cache mode is specified in {@link org.apache.ignite.configuration.CacheConfiguration} + * Enumeration of all supported caching modes. Cache mode is specified in {@ignitelink org.apache.ignite.configuration.CacheConfiguration} * and cannot be changed after cache has started. */ public enum CacheMode { /** * Specifies fully replicated cache behavior. In this mode all the keys are distributed * to all participating nodes. User still has affinity control - * over subset of nodes for any given key via {@link AffinityFunction} + * over subset of nodes for any given key via {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction} * configuration. */ REPLICATED((byte)1), @@ -39,12 +37,13 @@ public enum CacheMode { * Specifies partitioned cache behaviour. In this mode the overall * key set will be divided into partitions and all partitions will be split * equally between participating nodes. User has affinity - * control over key assignment via {@link AffinityFunction} + * control over key assignment via {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction} * configuration. *

    * Note that partitioned cache is always fronted by local * {@code 'near'} cache which stores most recent data. You - * can configure the size of near cache via {@link NearCacheConfiguration#getNearEvictionPolicyFactory()} + * can configure the size of near cache via + * {@ignitelink org.apache.ignite.configuration.NearCacheConfiguration#getNearEvictionPolicyFactory()} * configuration property. */ PARTITIONED((byte)2); diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CachePeekMode.java b/modules/commons/src/main/java/org/apache/ignite/cache/CachePeekMode.java similarity index 87% rename from modules/core/src/main/java/org/apache/ignite/cache/CachePeekMode.java rename to modules/commons/src/main/java/org/apache/ignite/cache/CachePeekMode.java index 108021c6eead0..18ec76ca70650 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/CachePeekMode.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/CachePeekMode.java @@ -17,15 +17,14 @@ package org.apache.ignite.cache; -import org.apache.ignite.IgniteCache; import org.jetbrains.annotations.Nullable; /** * Enumeration of all supported cache peek modes. Peek modes can be passed - * into {@link IgniteCache#localPeek(Object, CachePeekMode...)}, - * {@link IgniteCache#localEntries(CachePeekMode...)}, - * {@link IgniteCache#localSize(CachePeekMode...)} and - * {@link IgniteCache#size(CachePeekMode...)} methods. + * into {@ignitelink org.apache.ignite.IgniteCache#localPeek(Object, CachePeekMode...)}, + * {@ignitelink org.apache.ignite.IgniteCache#localEntries(CachePeekMode...)}, + * {@ignitelink org.apache.ignite.IgniteCache#localSize(CachePeekMode...)} and + * {@ignitelink org.apache.ignite.IgniteCache#size(CachePeekMode...)} methods. *

    * The following modes are supported: *

    * When set to {@code -1}, Ignite will try to detect inline size automatically. It will be no more than - * {@link CacheConfiguration#getSqlIndexMaxInlineSize()}. Index inline will be enabled for all fixed-length types, - * but will not be enabled for {@code String}. + * {@ignitelink org.apache.ignite.configuration.CacheConfiguration#getSqlIndexMaxInlineSize()}. + * Index inline will be enabled for all fixed-length types, but will not be enabled for {@code String}. * * @return Index inline size in bytes. */ @@ -282,8 +281,8 @@ public int getInlineSize() { *
  • positive value - fixed index inline
  • * * When set to {@code -1}, Ignite will try to detect inline size automatically. It will be no more than - * {@link CacheConfiguration#getSqlIndexMaxInlineSize()}. Index inline will be enabled for all fixed-length types, - * but will not be enabled for {@code String}. + * {@ignitelink org.apache.ignite.configuration.CacheConfiguration#getSqlIndexMaxInlineSize()}. + * Index inline will be enabled for all fixed-length types, but will not be enabled for {@code String}. * * @param inlineSize Inline size. * @return {@code this} for chaining. diff --git a/modules/core/src/main/java/org/apache/ignite/cache/QueryIndexType.java b/modules/commons/src/main/java/org/apache/ignite/cache/QueryIndexType.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cache/QueryIndexType.java rename to modules/commons/src/main/java/org/apache/ignite/cache/QueryIndexType.java diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityKeyMapped.java b/modules/commons/src/main/java/org/apache/ignite/cache/affinity/AffinityKeyMapped.java similarity index 83% rename from modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityKeyMapped.java rename to modules/commons/src/main/java/org/apache/ignite/cache/affinity/AffinityKeyMapped.java index 0e4dfb1f0f2ca..3b628a57abc97 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityKeyMapped.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/affinity/AffinityKeyMapped.java @@ -37,7 +37,7 @@ * otherwise known as {@code Collocation Of Computations And Data}. *

    *

    Mapping Cache Keys

    - * The default implementation of {@link AffinityKeyMapper}, which will be used + * The default implementation of {@ignitelink org.apache.ignite.cache.affinity.AffinityKeyMapper}, which will be used * if no explicit affinity mapper is specified in cache configuration, will first look * for any field annotated with {@code @AffinityKeyMapped} annotation. * If such field is not found, then the cache key itself will be used for @@ -74,8 +74,8 @@ * *

    *

    AffinityKey

    - * For convenience, you can also optionally use {@link AffinityKey} class. Here is how a - * {@code PersonKey} defined above would look using {@link AffinityKey}: + * For convenience, you can also optionally use {@ignitelink org.apache.ignite.cache.affinity.AffinityKey} class. Here is how a + * {@code PersonKey} defined above would look using {@ignitelink org.apache.ignite.cache.affinity.AffinityKey}: *
      * Object personKey1 = new AffinityKey("myPersonId1", "myCompanyId");
      * Object personKey2 = new AffinityKey("myPersonId2", "myCompanyId");
    @@ -90,21 +90,21 @@
      * It is also possible to route computations to the nodes where the data is cached. This concept
      * is otherwise known as {@code Collocation Of Computations And Data}. In this case,
      * {@code @AffinityKeyMapped} annotation allows to specify a routing affinity key for a
    - * {@link org.apache.ignite.compute.ComputeJob} or any other grid computation, such as {@link Runnable},
    + * {@ignitelink org.apache.ignite.compute.ComputeJob} or any other grid computation, such as {@link Runnable},
      * {@link Callable}, or {@link org.apache.ignite.lang.IgniteClosure}. It should be attached to a field
      * that provides affinity key for the computation. Only one annotation per class is allowed.
    - * Whenever such annotation is detected, then {@link org.apache.ignite.spi.loadbalancing.LoadBalancingSpi}
    + * Whenever such annotation is detected, then {@ignitelink org.apache.ignite.spi.loadbalancing.LoadBalancingSpi}
      * will be bypassed, and computation will be routed to the grid node where the specified affinity key is cached.
      * 

    - * For more information about cache affinity also see {@link AffinityKeyMapper} and - * {@link AffinityFunction} documentation. + * For more information about cache affinity also see {@ignitelink org.apache.ignite.cache.affinity.AffinityKeyMapper} and + * {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction} documentation. * Affinity for a key can be found from any node, regardless of whether it has cache started * or not. If cache is not started, affinity function will be fetched from the remote node * which does have the cache running. * - * @see AffinityFunction - * @see AffinityKeyMapper - * @see AffinityKey + * @see {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction} + * @see {@ignitelink org.apache.ignite.cache.affinity.AffinityKeyMapper} + * @see {@ignitelink org.apache.ignite.cache.affinity.AffinityKey} */ @Documented @Retention(RetentionPolicy.RUNTIME) diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/AbstractContinuousQuery.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/AbstractContinuousQuery.java similarity index 92% rename from modules/core/src/main/java/org/apache/ignite/cache/query/AbstractContinuousQuery.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/AbstractContinuousQuery.java index a9391e4a98c2e..034be1fc27d4c 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/AbstractContinuousQuery.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/AbstractContinuousQuery.java @@ -21,14 +21,12 @@ import javax.cache.configuration.Factory; import javax.cache.event.CacheEntryEventFilter; import javax.cache.event.EventType; -import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.lang.IgniteAsyncCallback; /** * Base class for continuous query. * * @see ContinuousQuery - * @see ContinuousQueryWithTransformer + * @see {@ignitelink org.apache.ignite.cache.query.ContinuousQueryWithTransformer} */ public abstract class AbstractContinuousQuery extends Query> { /** @@ -94,13 +92,14 @@ public Query> getInitialQuery() { * (e.g., synchronization or transactional cache operations), should be executed asynchronously * without blocking the thread that called the filter. Otherwise, you can get deadlocks. *

    - * If remote filter are annotated with {@link IgniteAsyncCallback} then it is executed in async callback - * pool (see {@link IgniteConfiguration#getAsyncCallbackPoolSize()}) that allow to perform a cache operations. + * If remote filter are annotated with {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} then it is executed in async callback + * pool (see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getAsyncCallbackPoolSize()}) + * that allow to perform a cache operations. * * @param rmtFilterFactory Key-value filter factory. * @return {@code this} for chaining. - * @see IgniteAsyncCallback - * @see IgniteConfiguration#getAsyncCallbackPoolSize() + * @see {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} + * @see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getAsyncCallbackPoolSize()} */ public AbstractContinuousQuery setRemoteFilterFactory( Factory> rmtFilterFactory) { diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java similarity index 82% rename from modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java index ef76a8c2bf940..c8eea75e86cce 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java @@ -21,11 +21,7 @@ import javax.cache.configuration.Factory; import javax.cache.event.CacheEntryEventFilter; import javax.cache.event.CacheEntryUpdatedListener; -import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheEntryEventSerializableFilter; -import org.apache.ignite.cache.query.ContinuousQueryWithTransformer.EventListener; -import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.lang.IgniteAsyncCallback; /** * API for configuring continuous cache queries. @@ -38,7 +34,7 @@ * Query can be of any type (SQL, TEXT or SCAN) and can be set via {@link #setInitialQuery(Query)} * method. *

    - * Query can be executed either on all nodes in topology using {@link IgniteCache#query(Query)} + * Query can be executed either on all nodes in topology using {@ignitelink org.apache.ignite.IgniteCache#query(Query)} * method, or only on the local node, if {@link Query#setLocal(boolean)} parameter is set to {@code true}. * Note that if the query is distributed and a new node joins, it will get the remote * filter for the query during discovery process before it actually joins a topology, @@ -96,16 +92,16 @@ * be empty in this case, but it will still unregister listeners when {@link QueryCursor#close()} * is called. *

    - * {@link IgniteAsyncCallback} annotation is supported for {@link CacheEntryEventFilter} + * {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} annotation is supported for {@link CacheEntryEventFilter} * (see {@link #setRemoteFilterFactory(Factory)}) and {@link CacheEntryUpdatedListener} * (see {@link #setLocalListener(CacheEntryUpdatedListener)}). - * If a filter and/or listener are annotated with {@link IgniteAsyncCallback} then the annotated callback - * is executed in an async callback pool (see {@link IgniteConfiguration#getAsyncCallbackPoolSize()}) + * If a filter and/or listener are annotated with {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} then the annotated callback + * is executed in an async callback pool (see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getAsyncCallbackPoolSize()}) * and a notification order is kept the same as an update order for a given cache key. * - * @see ContinuousQueryWithTransformer - * @see IgniteAsyncCallback - * @see IgniteConfiguration#getAsyncCallbackPoolSize() + * @see {@ignitelink org.apache.ignite.cache.query.ContinuousQueryWithTransformer} + * @see {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} + * @see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getAsyncCallbackPoolSize()} */ public final class ContinuousQuery extends AbstractContinuousQuery { /** */ @@ -141,14 +137,16 @@ public ContinuousQuery() { * synchronization or transactional cache operations), should be executed asynchronously without * blocking the thread that called the callback. Otherwise, you can get deadlocks. *

    - * If local listener are annotated with {@link IgniteAsyncCallback} then it is executed in an async callback pool - * (see {@link IgniteConfiguration#getAsyncCallbackPoolSize()}) that allow to perform a cache operations. + * If local listener are annotated with {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} then + * it is executed in an async callback pool + * (see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getAsyncCallbackPoolSize()} + * that allow to perform a cache operations. * * @param locLsnr Local callback. * @return {@code this} for chaining. - * @see IgniteAsyncCallback - * @see IgniteConfiguration#getAsyncCallbackPoolSize() - * @see ContinuousQueryWithTransformer#setLocalListener(EventListener) + * @see {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} + * @see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getAsyncCallbackPoolSize()} + * @see {@ignitelink org.apache.ignite.cache.query.ContinuousQueryWithTransformer#setLocalListener(EventListener)} */ public ContinuousQuery setLocalListener(CacheEntryUpdatedListener locLsnr) { this.locLsnr = locLsnr; @@ -170,15 +168,17 @@ public CacheEntryUpdatedListener getLocalListener() { * (e.g., synchronization or transactional cache operations), should be executed asynchronously * without blocking the thread that called the filter. Otherwise, you can get deadlocks. *

    - * If remote filter are annotated with {@link IgniteAsyncCallback} then it is executed in async callback - * pool (see {@link IgniteConfiguration#getAsyncCallbackPoolSize()}) that allow to perform a cache operations. + * If remote filter are annotated with {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} + * then it is executed in async callback + * pool (see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getAsyncCallbackPoolSize()}) + * that allow to perform a cache operations. * * @param rmtFilter Key-value filter. * @return {@code this} for chaining. * * @deprecated Use {@link #setRemoteFilterFactory(Factory)} instead. - * @see IgniteAsyncCallback - * @see IgniteConfiguration#getAsyncCallbackPoolSize() + * @see {@ignitelink org.apache.ignite.lang.IgniteAsyncCallback} + * @see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getAsyncCallbackPoolSize()} */ @Deprecated public ContinuousQuery setRemoteFilter(CacheEntryEventSerializableFilter rmtFilter) { diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/FieldsQueryCursor.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/FieldsQueryCursor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cache/query/FieldsQueryCursor.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/FieldsQueryCursor.java diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/Query.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/Query.java similarity index 94% rename from modules/core/src/main/java/org/apache/ignite/cache/query/Query.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/Query.java index cfd58d298cd91..9138f79008f21 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/Query.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/Query.java @@ -19,8 +19,7 @@ import java.io.Serializable; import java.util.Arrays; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.CacheConfigurationDefaults; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.S; @@ -32,14 +31,14 @@ *

  • SQL Fields query.Provides SQL way with full syntax to access cache data. * See {@link SqlFieldsQuery} for details.
  • *
  • Full-text query. Uses full-text search engine based on Apache Lucene engine. - * See {@link TextQuery} for details.
  • + * See {@ignitelink org.apache.ignite.cache.query.TextQuery} for details. *
  • Scan query. Provides effective and flexible way to full cache\partition scan. * See {@link ScanQuery} for details.
  • *
  • Continuous query. Provides flexible way to process all existed cache data and all future cache updates as well. * See {@link ContinuousQuery} for details.
  • * * - * @see IgniteCache#query(Query) + * @see {@ignitelink org.apache.ignite.IgniteCache#query(Query)} */ public abstract class Query implements Serializable { /** */ @@ -127,7 +126,7 @@ protected int[] prepare(int[] parts) { else if (sorted) validateDups(parts[i], parts[i + 1]); - A.ensure(0 <= parts[i] && parts[i] < CacheConfiguration.MAX_PARTITIONS_COUNT, "Illegal partition"); + A.ensure(0 <= parts[i] && parts[i] < CacheConfigurationDefaults.MAX_PARTITIONS_COUNT, "Illegal partition"); } // Sort and validate again. diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/QueryCursor.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/QueryCursor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cache/query/QueryCursor.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/QueryCursor.java diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/ScanQuery.java similarity index 98% rename from modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/ScanQuery.java index abf89e158a4c3..952dce46f4989 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/ScanQuery.java @@ -18,7 +18,6 @@ package org.apache.ignite.cache.query; import javax.cache.Cache; -import org.apache.ignite.IgniteCache; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.lang.IgniteBiPredicate; import org.jetbrains.annotations.Nullable; @@ -26,7 +25,7 @@ /** * Scan query over cache entries. Will accept all the entries if no predicate was set. * - * @see IgniteCache#query(Query) + * @see {@ignitelink org.apache.ignite.IgniteCache#query(Query)} */ public final class ScanQuery extends Query> { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java similarity index 98% rename from modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java index af4ef81fa38aa..c2882242bcd6e 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java @@ -19,8 +19,7 @@ import java.util.List; import java.util.concurrent.TimeUnit; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.internal.processors.query.QueryUtils; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.S; @@ -42,7 +41,7 @@ * the remote nodes and bring back only the small data set specified within the 'limit' clause, * instead of the whole query result as would happen in a non-collocated execution. * - * @see IgniteCache#query(Query) + * @see {@ignitelink org.apache.ignite.IgniteCache#query(Query)} */ public class SqlFieldsQuery extends Query> { /** */ @@ -196,7 +195,7 @@ public int getTimeout() { * @return {@code this} For chaining. */ public SqlFieldsQuery setTimeout(int timeout, TimeUnit timeUnit) { - this.timeout = QueryUtils.validateTimeout(timeout, timeUnit); + this.timeout = CommonUtils.validateTimeout(timeout, timeUnit); return this; } diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QueryGroupIndex.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QueryGroupIndex.java similarity index 90% rename from modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QueryGroupIndex.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QueryGroupIndex.java index 797fbe453a827..303b1d0d5a8d6 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QueryGroupIndex.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QueryGroupIndex.java @@ -22,7 +22,6 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.apache.ignite.cache.QueryIndex; -import org.apache.ignite.configuration.CacheConfiguration; /** * Describes group index. @@ -48,8 +47,8 @@ *
  • positive value - fixed index inline
  • * * When set to {@code -1}, Ignite will try to detect inline size automatically. It will be no more than - * {@link CacheConfiguration#getSqlIndexMaxInlineSize()}. Index inline will be enabled for all fixed-length types, - * but will not be enabled for {@code String}. + * {@ignitelink org.apache.ignite.configuration.CacheConfiguration#getSqlIndexMaxInlineSize()}. + * Index inline will be enabled for all fixed-length types, but will not be enabled for {@code String}. * * @return Index inline size in bytes. */ diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QuerySqlField.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QuerySqlField.java similarity index 92% rename from modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QuerySqlField.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QuerySqlField.java index 1593018cb2ac2..2c9c5e27685ab 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QuerySqlField.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QuerySqlField.java @@ -23,13 +23,11 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.apache.ignite.cache.QueryIndex; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.internal.processors.cache.query.CacheQuery; /** - * Annotates fields for SQL queries. All fields that will be involved in SQL clauses must have - * this annotation. For more information about cache queries see {@link CacheQuery} documentation. - * @see CacheQuery + * Annotates fields for SQL queries. All fields that will be involved in SQL clauses must have this annotation. + * For more information about cache queries see {@ignitelink org.apache.ignite.internal.processors.cache.query.CacheQuery} documentation. + * @see {@ignitelink org.apache.ignite.internal.processors.cache.query.CacheQuery} */ @Documented @Retention(RetentionPolicy.RUNTIME) @@ -120,9 +118,9 @@ *
  • {@code 0} - index inline is disabled (not recommended)
  • *
  • positive value - fixed index inline
  • * - * When set to {@code -1}, Ignite will try to detect inline size automatically. It will be no more than - * {@link CacheConfiguration#getSqlIndexMaxInlineSize()}. Index inline will be enabled for all fixed-length types, - * but will not be enabled for {@code String}. + * When set to {@code -1}, Ignite will try to detect inline size automatically. + * It will be no more than {@ignitelink org.apache.ignite.configuration.CacheConfiguration#getSqlIndexMaxInlineSize()}. + * Index inline will be enabled for all fixed-length types, but will not be enabled for {@code String}. *

    * When index group is used, inline size must be defined in {@link QueryGroupIndex#inlineSize()}. Any value * except of {@code -1} defined on a specific column will lead to exception. diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QueryTextField.java b/modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QueryTextField.java similarity index 87% rename from modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QueryTextField.java rename to modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QueryTextField.java index 9e90e9247d5d5..5d819fe94ebd3 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QueryTextField.java +++ b/modules/commons/src/main/java/org/apache/ignite/cache/query/annotations/QueryTextField.java @@ -22,13 +22,12 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.apache.ignite.internal.processors.cache.query.CacheQuery; /** * Annotation for fields to be indexed for full text * search using Lucene. For more information - * refer to {@link CacheQuery} documentation. - * @see CacheQuery + * refer to {@ignitelink org.apache.ignite.internal.processors.cache.query.CacheQuery} documentation. + * @see {@ignitelink org.apache.ignite.internal.processors.cache.query.CacheQuery} */ @Documented @Retention(RetentionPolicy.RUNTIME) diff --git a/modules/core/src/main/java/org/apache/ignite/cluster/BaselineNode.java b/modules/commons/src/main/java/org/apache/ignite/cluster/BaselineNode.java similarity index 92% rename from modules/core/src/main/java/org/apache/ignite/cluster/BaselineNode.java rename to modules/commons/src/main/java/org/apache/ignite/cluster/BaselineNode.java index 9564aa01a55af..25d9550c593e7 100644 --- a/modules/core/src/main/java/org/apache/ignite/cluster/BaselineNode.java +++ b/modules/commons/src/main/java/org/apache/ignite/cluster/BaselineNode.java @@ -18,7 +18,6 @@ package org.apache.ignite.cluster; import java.util.Map; -import org.apache.ignite.configuration.IgniteConfiguration; import org.jetbrains.annotations.Nullable; /** @@ -35,7 +34,7 @@ public interface BaselineNode { /** * Gets a node attribute. Attributes are assigned to nodes at startup - * via {@link IgniteConfiguration#getUserAttributes()} method. + * via {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} method. *

    * The system adds the following attributes automatically: *

      @@ -56,7 +55,7 @@ public interface BaselineNode { /** * Gets all node attributes. Attributes are assigned to nodes at startup - * via {@link IgniteConfiguration#getUserAttributes()} method. + * via {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} method. *

      * The system adds the following attributes automatically: *

        diff --git a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterMetrics.java b/modules/commons/src/main/java/org/apache/ignite/cluster/ClusterMetrics.java similarity index 89% rename from modules/core/src/main/java/org/apache/ignite/cluster/ClusterMetrics.java rename to modules/commons/src/main/java/org/apache/ignite/cluster/ClusterMetrics.java index 326e725c0f186..7ef30f98f3b4b 100644 --- a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterMetrics.java +++ b/modules/commons/src/main/java/org/apache/ignite/cluster/ClusterMetrics.java @@ -17,9 +17,6 @@ package org.apache.ignite.cluster; -import org.apache.ignite.IgniteCluster; -import org.apache.ignite.configuration.IgniteConfiguration; - /** * This class represents runtime information on a cluster. Apart from obvious * statistical value, this information is used for implementation of @@ -30,7 +27,7 @@ * Node metrics for any node can be accessed via {@link ClusterNode#metrics()} * method. Keep in mind that there will be a certain network delay (usually * equal to metrics update delay) for the accuracy of node metrics. However, when accessing - * metrics on local node {@link IgniteCluster#localNode() IgniteCluster.localNode().getMetrics()} + * metrics on local node {@ignitelink org.apache.ignite.IgniteCluster#localNode() IgniteCluster.localNode().getMetrics()} * the metrics are always accurate and up to date. *

        * Local node metrics are registered as {@code MBean} and can be accessed from @@ -55,8 +52,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *

          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Maximum number of jobs that ever ran concurrently on this node. @@ -77,8 +74,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Average number of active jobs. @@ -92,8 +89,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Maximum number of waiting jobs. @@ -114,8 +111,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Average number of waiting jobs. @@ -130,8 +127,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Maximum number of jobs rejected at once. @@ -152,8 +149,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of grid configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Average number of jobs this node rejects during collision resolution operations. @@ -196,8 +193,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Average number of cancelled jobs. @@ -241,8 +238,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Maximum waiting time. @@ -263,8 +260,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Average job wait time. @@ -278,8 +275,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Time it took to execute the longest job on the node. @@ -300,8 +297,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Average job execution time. @@ -315,8 +312,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Total number of jobs handled by the node. @@ -395,8 +392,8 @@ public interface ClusterMetrics { * calculated over all the metrics kept in history. The * history size is set via either one or both of configuration settings: *
          - *
        • {@link IgniteConfiguration#getMetricsExpireTime()}
        • - *
        • {@link IgniteConfiguration#getMetricsHistorySize()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsExpireTime()}
        • + *
        • {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsHistorySize()}
        • *
        * * @return Average of CPU load value in {@code [0, 1]} range over all metrics kept diff --git a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java b/modules/commons/src/main/java/org/apache/ignite/cluster/ClusterNode.java similarity index 82% rename from modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java rename to modules/commons/src/main/java/org/apache/ignite/cluster/ClusterNode.java index bc698c38889ea..87bb03630be3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java +++ b/modules/commons/src/main/java/org/apache/ignite/cluster/ClusterNode.java @@ -18,11 +18,8 @@ package org.apache.ignite.cluster; import java.util.Collection; -import java.util.List; import java.util.Map; import java.util.UUID; -import org.apache.ignite.Ignite; -import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteNodeAttributes; import org.apache.ignite.lang.IgniteExperimental; import org.apache.ignite.lang.IgniteProductVersion; @@ -32,13 +29,13 @@ * Interface representing a single cluster node. Use {@link #attribute(String)} or * {@link #metrics()} to get static and dynamic information about cluster nodes. * {@code ClusterNode} list, which includes all nodes within task topology, is provided - * to {@link org.apache.ignite.compute.ComputeTask#map(List, Object)} method. + * to {@ignitelink org.apache.ignite.compute.ComputeTask#map(List, Object)} method. *

        *

        Cluster Node Attributes

        * You can use cluster node attributes to provide static information about a node. * This information is initialized once within a cluster, during the node startup, and * remains the same throughout the lifetime of a node. Use - * {@link IgniteConfiguration#getUserAttributes()} method to initialize your custom + * {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} method to initialize your custom * node attributes at startup. Here is an example of how to assign an attribute to a node at startup: *
          * <bean class="org.apache.ignite.configuration.IgniteConfiguration">
        @@ -60,14 +57,14 @@
          * 
      • {@code org.apache.ignite.jit.name} - Name of JIT compiler used.
      • *
      • {@code org.apache.ignite.net.itf.name} - Name of network interface.
      • *
      • {@code org.apache.ignite.user.name} - Operating system user name.
      • - *
      • {@code org.apache.ignite.ignite.name} - Ignite name (see {@link Ignite#name()}).
      • + *
      • {@code org.apache.ignite.ignite.name} - Ignite name (see {@ignitelink org.apache.ignite.Ignite#name()}).
      • *
      • * {@code spiName.org.apache.ignite.spi.class} - SPI implementation class for every SPI, - * where {@code spiName} is the name of the SPI (see {@link org.apache.ignite.spi.IgniteSpi#getName()}. + * where {@code spiName} is the name of the SPI (see {@ignitelink org.apache.ignite.spi.IgniteSpi#getName()}. *
      • *
      • * {@code spiName.org.apache.ignite.spi.ver} - SPI version for every SPI, - * where {@code spiName} is the name of the SPI (see {@link org.apache.ignite.spi.IgniteSpi#getName()}. + * where {@code spiName} is the name of the SPI (see {@ignitelink org.apache.ignite.spi.IgniteSpi#getName()}. *
      • *
      *

      @@ -86,13 +83,13 @@ *

      Cluster Node Metrics

      * Cluster node metrics (see {@link #metrics()}) are updated frequently for all nodes * and can be used to get dynamic information about a node. The frequency of update - * is controlled by {@link org.apache.ignite.configuration.IgniteConfiguration#getMetricsUpdateFrequency()} parameter. + * is controlled by {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsUpdateFrequency()} parameter. * The metrics data will be updated every {@code 2} seconds by default. *

      * Grid node metrics provide information that can frequently change, * such as Heap and Non-Heap memory utilization, CPU load, number of active and waiting * grid jobs, etc... This information can become useful during job collision resolution or - * {@link org.apache.ignite.compute.ComputeTask#map(List, Object)} operation when jobs are + * {@ignitelink org.apache.ignite.compute.ComputeTask#map(List, Object)} operation when jobs are * assigned to remote nodes for execution. *

      * Local node metrics are registered as {@code MBean} and can be accessed from @@ -118,7 +115,7 @@ public interface ClusterNode extends BaselineNode { /** * Gets a node attribute. Attributes are assigned to nodes at startup - * via {@link IgniteConfiguration#getUserAttributes()} method. + * via {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} method. *

      * The system adds the following attributes automatically: *

        @@ -140,12 +137,12 @@ public interface ClusterNode extends BaselineNode { * Gets metrics snapshot for this node. Note that node metrics are constantly updated * and provide up to date information about nodes. For example, you can get * an idea about CPU load on remote node via {@link ClusterMetrics#getCurrentCpuLoad()} - * method and use it during {@link org.apache.ignite.compute.ComputeTask#map(List, Object)} or during collision + * method and use it during {@ignitelink org.apache.ignite.compute.ComputeTask#map(List, Object)} or during collision * resolution. *

        * Node metrics are updated with some delay which is controlled by - * {@link org.apache.ignite.configuration.IgniteConfiguration#getMetricsUpdateFrequency()} parameter. - * By default the update will happen every {@code 2} seconds. + * {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getMetricsUpdateFrequency()} parameter. + * By default, the update will happen every {@code 2} seconds. * * @return Runtime metrics snapshot for this node. */ @@ -153,7 +150,7 @@ public interface ClusterNode extends BaselineNode { /** * Gets all node attributes. Attributes are assigned to nodes at startup - * via {@link IgniteConfiguration#getUserAttributes()} method. + * via {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} method. *

        * The system adds the following attributes automatically: *

          @@ -190,8 +187,8 @@ public interface ClusterNode extends BaselineNode { /** * Gets collection of addresses this node is known by. *

          - * If {@link IgniteConfiguration#getLocalHost()} value isn't {@code null} node will try to use that - * address for all communications and returned collection will contain only that address. + * If {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getLocalHost()} value isn't {@code null} + * node will try to use that address for all communications and returned collection will contain only that address. * If it is {@code null} then local wildcard address will be used, and Ignite * will make the best effort to supply all addresses of that node in returned collection. * @@ -202,13 +199,13 @@ public interface ClusterNode extends BaselineNode { /** * Gets collection of host names this node is known by. *

          - * If {@link IgniteConfiguration#getLocalHost()} value isn't {@code null} node will try to use + * If {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getLocalHost()} value isn't {@code null} node will try to use * the host name of that resolved address for all communications and * returned collection will contain only that host name. * If that host name can not be resolved then ip address returned by method {@link #addresses()} is used. *

          - * If {@link IgniteConfiguration#getLocalHost()} value is {@code null} then local wildcard address will be used, - * and this method returns host names of all addresses of that node. + * If {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getLocalHost()} value is {@code null} + * then local wildcard address will be used, and this method returns host names of all addresses of that node. *

          * Note: the loopback address will be omitted in results. * @@ -245,11 +242,11 @@ public interface ClusterNode extends BaselineNode { public boolean isLocal(); /** - * Whether this node is cache client (see {@link IgniteConfiguration#isClientMode()}). + * Whether this node is cache client (see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#isClientMode()}). * * @return {@code True if client}. * - * @see IgniteConfiguration#isClientMode() + * @see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#isClientMode()} */ public boolean isClient(); } diff --git a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterState.java b/modules/commons/src/main/java/org/apache/ignite/cluster/ClusterState.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/cluster/ClusterState.java rename to modules/commons/src/main/java/org/apache/ignite/cluster/ClusterState.java diff --git a/modules/commons/src/main/java/org/apache/ignite/configuration/CacheConfigurationDefaults.java b/modules/commons/src/main/java/org/apache/ignite/configuration/CacheConfigurationDefaults.java new file mode 100644 index 0000000000000..ef940114c3e12 --- /dev/null +++ b/modules/commons/src/main/java/org/apache/ignite/configuration/CacheConfigurationDefaults.java @@ -0,0 +1,75 @@ +/* + * 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.configuration; + +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cache.CacheRebalanceMode; +import org.apache.ignite.cache.PartitionLossPolicy; + +/** */ +public interface CacheConfigurationDefaults { + /** Default atomicity mode. */ + public static final CacheAtomicityMode DFLT_CACHE_ATOMICITY_MODE = CacheAtomicityMode.ATOMIC; + + /** Default number of backups. */ + public static final int DFLT_BACKUPS = 0; + + /** Default caching mode. */ + public static final CacheMode DFLT_CACHE_MODE = CacheMode.PARTITIONED; + + /** Default value for eager ttl flag. */ + public static final boolean DFLT_EAGER_TTL = true; + + /** + * Default lock timeout. + * @deprecated Default lock timeout configuration property has no effect. + */ + @Deprecated + public static final long DFLT_LOCK_TIMEOUT = 0; + + /** Default partition loss policy. */ + public static final PartitionLossPolicy DFLT_PARTITION_LOSS_POLICY = PartitionLossPolicy.IGNORE; + + /** Default value for 'readFromBackup' flag. */ + public static final boolean DFLT_READ_FROM_BACKUP = true; + + /** Default rebalance mode for distributed cache. */ + public static final CacheRebalanceMode DFLT_REBALANCE_MODE = CacheRebalanceMode.ASYNC; + + /** Default value for 'copyOnRead' flag. */ + public static final boolean DFLT_COPY_ON_READ = true; + + /** Default value for 'maxConcurrentAsyncOps'. */ + public static final int DFLT_MAX_CONCURRENT_ASYNC_OPS = 500; + + /** Default maximum number of query iterators that can be stored. */ + public static final int DFLT_MAX_QUERY_ITERATOR_CNT = 1024; + + /** Default number of queries detail metrics to collect. */ + public static final int DFLT_QRY_DETAIL_METRICS_SIZE = 0; + + /** Default query parallelism. */ + public static final int DFLT_QUERY_PARALLELISM = 1; + + /** Default maximum inline size for sql indexes. */ + public static final int DFLT_SQL_INDEX_MAX_INLINE_SIZE = -1; + + /** Maximum number of partitions. */ + public static final int MAX_PARTITIONS_COUNT = 65000; +} diff --git a/modules/commons/src/main/java/org/apache/ignite/configuration/IgniteConfigurationDefaults.java b/modules/commons/src/main/java/org/apache/ignite/configuration/IgniteConfigurationDefaults.java new file mode 100644 index 0000000000000..25b8e7ced9418 --- /dev/null +++ b/modules/commons/src/main/java/org/apache/ignite/configuration/IgniteConfigurationDefaults.java @@ -0,0 +1,33 @@ +/* + * 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.configuration; + +/** */ +public interface IgniteConfigurationDefaults { + /** Default rebalance batch size in bytes (value is {@code 512Kb}). */ + public static final int DFLT_REBALANCE_BATCH_SIZE = 512 * 1024; // 512K + + /** Default rebalance batches prefetch count (value is {@code 3}). */ + public static final long DFLT_REBALANCE_BATCHES_PREFETCH_COUNT = 3; + + /** Time to wait between rebalance messages in milliseconds to avoid overloading CPU (value is {@code 0}). */ + public static final long DFLT_REBALANCE_THROTTLE = 0; + + /** Default rebalance message timeout in milliseconds (value is {@code 10000}). */ + public static final long DFLT_REBALANCE_TIMEOUT = 10000; +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/commons/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java rename to modules/commons/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteProperties.java b/modules/commons/src/main/java/org/apache/ignite/internal/IgniteProperties.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/IgniteProperties.java rename to modules/commons/src/main/java/org/apache/ignite/internal/IgniteProperties.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteVersionUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/IgniteVersionUtils.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/IgniteVersionUtils.java rename to modules/commons/src/main/java/org/apache/ignite/internal/IgniteVersionUtils.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityClassProperty.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityClassProperty.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityClassProperty.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityClassProperty.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityIndexDescriptor.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityTypeDescriptor.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityTypeDescriptor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityTypeDescriptor.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryEntityTypeDescriptor.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexDescriptor.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexDescriptor.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexDescriptor.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexDescriptor.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceCallContextImpl.java b/modules/commons/src/main/java/org/apache/ignite/internal/processors/service/ServiceCallContextImpl.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceCallContextImpl.java rename to modules/commons/src/main/java/org/apache/ignite/internal/processors/service/ServiceCallContextImpl.java diff --git a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java index 46ebe48608ce0..e87513b9b0aae 100644 --- a/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java +++ b/modules/commons/src/main/java/org/apache/ignite/internal/util/CommonUtils.java @@ -29,6 +29,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.math.BigDecimal; import java.net.DatagramSocket; import java.net.Socket; import java.net.SocketException; @@ -44,18 +45,25 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.security.ProtectionDomain; +import java.sql.Time; +import java.sql.Timestamp; import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.ServiceLoader; +import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -82,6 +90,7 @@ import org.apache.ignite.lang.IgniteFutureTimeoutException; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.thread.IgniteThread; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import static java.util.Objects.isNull; @@ -223,6 +232,21 @@ public abstract class CommonUtils { /** */ private static final Class GEOMETRY_CLASS = classForName("org.locationtech.jts.geom.Geometry", null); + /** Boxed class map. */ + private static final Map, Class> boxedClsMap = new HashMap<>(16, .5f); + + /** Field name for key. */ + public static final String KEY_FIELD_NAME = "_KEY"; + + /** Field name for value. */ + public static final String VAL_FIELD_NAME = "_VAL"; + + /** Byte bit-mask. */ + private static final int MASK = 0xf; + + /** */ + private static final Set> SQL_TYPES = createSqlTypes(); + static { primitiveMap.put("byte", byte.class); primitiveMap.put("short", short.class); @@ -234,6 +258,16 @@ public abstract class CommonUtils { primitiveMap.put("boolean", boolean.class); primitiveMap.put("void", void.class); + boxedClsMap.put(byte.class, Byte.class); + boxedClsMap.put(short.class, Short.class); + boxedClsMap.put(int.class, Integer.class); + boxedClsMap.put(long.class, Long.class); + boxedClsMap.put(float.class, Float.class); + boxedClsMap.put(double.class, Double.class); + boxedClsMap.put(char.class, Character.class); + boxedClsMap.put(boolean.class, Boolean.class); + boxedClsMap.put(void.class, Void.class); + try { OBJECT_CTOR = Object.class.getConstructor(); } @@ -1661,6 +1695,43 @@ else if (utfBytes == 3) { return strBuilder.toString(); } + /** + * Writes byte array to output stream accounting for null values. + * + * @param out Output stream to write to. + * @param arr Array to write, possibly null. + * @throws java.io.IOException If write failed. + */ + public static void writeByteArray(DataOutput out, @Nullable byte[] arr) throws IOException { + if (arr == null) + out.writeInt(-1); + else { + out.writeInt(arr.length); + + out.write(arr); + } + } + + /** + * Reads byte array from input stream accounting for null values. + * + * @param in Stream to read from. + * @return Read byte array, possibly null. + * @throws java.io.IOException If read failed. + */ + @Nullable public static byte[] readByteArray(DataInput in) throws IOException { + int len = in.readInt(); + + if (len == -1) + return null; // Value "-1" indicates null. + + byte[] res = new byte[len]; + + in.readFully(res); + + return res; + } + /** * Get number of bytes for {@link DataOutput#writeUTF}, * depending on character:
          @@ -2122,4 +2193,165 @@ public static IgniteException convertException(IgniteCheckedException e) { public static boolean isGeometryClass(Class cls) { return GEOMETRY_CLASS != null && GEOMETRY_CLASS.isAssignableFrom(cls); } + + /** + * Gets wrapper class for a primitive type. + * + * @param cls Class. If {@code null}, method is no-op. + * @return Wrapper class or original class if it is non-primitive. + */ + @Nullable public static Class box(@Nullable Class cls) { + if (cls == null) + return null; + + if (!cls.isPrimitive()) + return cls; + + return boxedClsMap.get(cls); + } + + /** + * Checks if the given class can be mapped to a simple SQL type. + * + * @param cls Class. + * @return {@code true} If can. + */ + public static boolean isSqlType(Class cls) { + cls = box(cls); + + return SQL_TYPES.contains(cls) || isGeometryClass(cls); + } + + /** + * @param timeout Timeout. + * @param timeUnit Time unit. + * @return Converted time. + */ + public static int validateTimeout(int timeout, TimeUnit timeUnit) { + A.ensure(timeUnit != TimeUnit.MICROSECONDS && timeUnit != TimeUnit.NANOSECONDS, + "timeUnit minimal resolution is millisecond."); + + A.ensure(timeout >= 0, "timeout value should be non-negative."); + + long tmp = TimeUnit.MILLISECONDS.convert(timeout, timeUnit); + + return (int)tmp; + } + + /** + * Converts byte array to hex string. + * + * @param arr Array of bytes. + * @return Hex string. + */ + public static String byteArray2HexString(byte[] arr) { + return byteArray2HexString(arr, true); + } + + /** + * Converts byte array to hex string. + * + * @param arr Array of bytes. + * @param toUpper If {@code true} returns upper cased result. + * @return Hex string. + */ + public static String byteArray2HexString(byte[] arr, boolean toUpper) { + StringBuilder sb = new StringBuilder(arr.length << 1); + + for (byte b : arr) + addByteAsHex(sb, b); + + return toUpper ? sb.toString().toUpperCase() : sb.toString(); + } + + /** + * @param sb String builder. + * @param b Byte to add in hexadecimal format. + */ + protected static void addByteAsHex(StringBuilder sb, byte b) { + sb.append(Integer.toHexString(MASK & b >>> 4)).append(Integer.toHexString(MASK & b)); + } + + /** + * Converts an array of characters representing hexidecimal values into an + * array of bytes of those same values. The returned array will be half the + * length of the passed array, as it takes two characters to represent any + * given byte. An exception is thrown if the passed char array has an odd + * number of elements. + * + * @param data An array of characters containing hexidecimal digits + * @return A byte array containing binary data decoded from + * the supplied char array. + * @throws IgniteCheckedException Thrown if an odd number or illegal of characters is supplied. + */ + public static byte[] decodeHex(char[] data) throws IgniteCheckedException { + int len = data.length; + + if ((len & 0x01) != 0) + throw new IgniteCheckedException("Odd number of characters."); + + byte[] out = new byte[len >> 1]; + + // Two characters form the hex value. + for (int i = 0, j = 0; j < len; i++) { + int f = toDigit(data[j], j) << 4; + + j++; + + f |= toDigit(data[j], j); + + j++; + + out[i] = (byte)(f & 0xFF); + } + + return out; + } + + /** + * Converts a hexadecimal character to an integer. + * + * @param ch A character to convert to an integer digit + * @param idx The index of the character in the source + * @return An integer + * @throws IgniteCheckedException Thrown if ch is an illegal hex character + */ + public static int toDigit(char ch, int idx) throws IgniteCheckedException { + int digit = Character.digit(ch, 16); + + if (digit == -1) + throw new IgniteCheckedException("Illegal hexadecimal character " + ch + " at index " + idx); + + return digit; + } + + /** + * Creates SQL types set. + * + * @return SQL types set. + */ + @NotNull private static Set> createSqlTypes() { + Set> sqlClasses = new HashSet<>(Arrays.>asList( + Integer.class, + Boolean.class, + Byte.class, + Short.class, + Long.class, + BigDecimal.class, + Double.class, + Float.class, + Time.class, + Timestamp.class, + Date.class, + java.sql.Date.class, + LocalTime.class, + LocalDate.class, + LocalDateTime.class, + String.class, + UUID.class, + byte[].class + )); + + return sqlClasses; + } } diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteExperimental.java b/modules/commons/src/main/java/org/apache/ignite/lang/IgniteExperimental.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/lang/IgniteExperimental.java rename to modules/commons/src/main/java/org/apache/ignite/lang/IgniteExperimental.java diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java b/modules/commons/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java similarity index 96% rename from modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java rename to modules/commons/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java index 8feac017ab891..3bd6a10980587 100644 --- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java +++ b/modules/commons/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java @@ -25,9 +25,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.internal.CoreMessagesProvider; import org.apache.ignite.internal.IgniteVersionUtils; -import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.internal.util.CommonUtils; import org.jetbrains.annotations.NotNull; /** @@ -71,7 +70,7 @@ public class IgniteProductVersion implements Comparable, E protected byte[] revHash; /** - * Empty constructor required by {@link Externalizable} and {@link CoreMessagesProvider}. + * Empty constructor required by {@link Externalizable} and {@ignitelink org.apache.ignite.internal.CoreMessagesProvider}. */ public IgniteProductVersion() { // No-op. @@ -254,7 +253,7 @@ public int compareToIgnoreTimestamp(@NotNull IgniteProductVersion o) { out.writeByte(minor); out.writeByte(maintenance); out.writeLong(revTs); - U.writeByteArray(out, revHash); + CommonUtils.writeByteArray(out, revHash); } /** {@inheritDoc} */ @@ -263,14 +262,14 @@ public int compareToIgnoreTimestamp(@NotNull IgniteProductVersion o) { minor = in.readByte(); maintenance = in.readByte(); revTs = in.readLong(); - revHash = U.readByteArray(in); + revHash = CommonUtils.readByteArray(in); } /** {@inheritDoc} */ @Override public String toString() { String revTsStr = IgniteVersionUtils.formatBuildTimeStamp(revTs * 1000); - String hash = U.byteArray2HexString(revHash).toLowerCase(); + String hash = CommonUtils.byteArray2HexString(revHash).toLowerCase(); hash = hash.length() > 8 ? hash.substring(0, 8) : hash; @@ -310,7 +309,7 @@ public static IgniteProductVersion fromString(String verStr) { byte[] revHash = null; if (match.group(9) != null) - revHash = U.decodeHex(match.group(10).toCharArray()); + revHash = CommonUtils.decodeHex(match.group(10).toCharArray()); return new IgniteProductVersion(major, minor, maintenance, stage, revTs, revHash); } diff --git a/modules/core/src/main/java/org/apache/ignite/services/ServiceCallContext.java b/modules/commons/src/main/java/org/apache/ignite/services/ServiceCallContext.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/services/ServiceCallContext.java rename to modules/commons/src/main/java/org/apache/ignite/services/ServiceCallContext.java diff --git a/modules/core/src/main/java/org/apache/ignite/services/ServiceCallContextBuilder.java b/modules/commons/src/main/java/org/apache/ignite/services/ServiceCallContextBuilder.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/services/ServiceCallContextBuilder.java rename to modules/commons/src/main/java/org/apache/ignite/services/ServiceCallContextBuilder.java diff --git a/modules/core/src/main/java/org/apache/ignite/transactions/TransactionConcurrency.java b/modules/commons/src/main/java/org/apache/ignite/transactions/TransactionConcurrency.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/transactions/TransactionConcurrency.java rename to modules/commons/src/main/java/org/apache/ignite/transactions/TransactionConcurrency.java diff --git a/modules/core/src/main/java/org/apache/ignite/transactions/TransactionIsolation.java b/modules/commons/src/main/java/org/apache/ignite/transactions/TransactionIsolation.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/transactions/TransactionIsolation.java rename to modules/commons/src/main/java/org/apache/ignite/transactions/TransactionIsolation.java diff --git a/modules/compatibility/pom.xml b/modules/compatibility/pom.xml index cd6bdf794dec6..232cd0b635f2b 100644 --- a/modules/compatibility/pom.xml +++ b/modules/compatibility/pom.xml @@ -70,6 +70,12 @@ test + + ${project.groupId} + ignite-commons + test + + ${project.groupId} ignite-tools diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java index 6266ea6f9899d..b5bf5d91595b1 100644 --- a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java +++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java @@ -289,10 +289,23 @@ protected Set getExcluded(String ver, Collection dependencie // Exclude all modules necessary to compile the current version of core module to avoid conflicts with previous versions. // When building with TeamCity, JAR files named according to their artifact IDs are added to the classpath. - excluded.addAll(Set.of("ignite-binary-api", "ignite-binary-impl", "ignite-commons", "ignite-grid-unsafe")); + excluded.addAll(Set.of( + "ignite-binary-api", + "ignite-binary-impl", + "ignite-commons", + "ignite-grid-unsafe", + "ignite-thin-client-api" + )); // During local development, classes from the target directory (for example, ignite/modules/commons/target/classes) // are included in the classpath. - excluded.addAll(Set.of("modules/core", "modules/binary/api", "modules/binary/impl", "modules/commons", "modules/unsafe")); + excluded.addAll(Set.of( + "modules/core", + "modules/binary/api", + "modules/binary/impl", + "modules/commons", + "modules/unsafe", + "modules/thin-client/api" + )); return excluded; } diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 9f80f623aa498..959a706488e3c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -75,6 +75,12 @@ compile + + ${project.groupId} + ignite-thin-client-api + compile + + ${project.groupId} ignite-codegen @@ -353,6 +359,7 @@ ${project.groupId}:ignite-binary-api ${project.groupId}:ignite-binary-impl ${project.groupId}:ignite-grid-unsafe + ${project.groupId}:ignite-thin-client-api diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlQuery.java b/modules/core/src/main/java/org/apache/ignite/cache/query/SqlQuery.java index b5d0fcf15f719..64864b3510406 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlQuery.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/query/SqlQuery.java @@ -21,6 +21,7 @@ import javax.cache.Cache; import org.apache.ignite.IgniteCache; import org.apache.ignite.internal.processors.query.QueryUtils; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.tostring.GridToStringInclude; import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.S; @@ -188,7 +189,7 @@ public int getTimeout() { * @return {@code this} For chaining. */ public SqlQuery setTimeout(int timeout, TimeUnit timeUnit) { - this.timeout = QueryUtils.validateTimeout(timeout, timeUnit); + this.timeout = CommonUtils.validateTimeout(timeout, timeUnit); return this; } diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java index 7140c603e5cd8..4a8d52e81e770 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java @@ -79,13 +79,10 @@ * can be configured from Spring XML files (or other DI frameworks).

          Note that absolutely all configuration * properties are optional, so users should only change what they need. */ -public class CacheConfiguration extends MutableConfiguration { +public class CacheConfiguration extends MutableConfiguration implements CacheConfigurationDefaults { /** */ private static final long serialVersionUID = 0L; - /** Maximum number of partitions. */ - public static final int MAX_PARTITIONS_COUNT = 65000; - /** * Default size of rebalance thread pool. * @deprecated Use {@link IgniteConfiguration#DFLT_REBALANCE_THREAD_POOL_SIZE} instead. @@ -114,37 +111,15 @@ public class CacheConfiguration extends MutableConfiguration { @Deprecated public static final long DFLT_REBALANCE_THROTTLE = IgniteConfiguration.DFLT_REBALANCE_THROTTLE; - /** Default number of backups. */ - public static final int DFLT_BACKUPS = 0; - - /** Default caching mode. */ - public static final CacheMode DFLT_CACHE_MODE = CacheMode.PARTITIONED; - - /** Default atomicity mode. */ - public static final CacheAtomicityMode DFLT_CACHE_ATOMICITY_MODE = CacheAtomicityMode.ATOMIC; - - /** - * Default lock timeout. - * @deprecated Default lock timeout configuration property has no effect. - */ - @Deprecated - public static final long DFLT_LOCK_TIMEOUT = 0; - /** Default cache size to use with eviction policy. */ public static final int DFLT_CACHE_SIZE = 100000; - /** Default maximum inline size for sql indexes. */ - public static final int DFLT_SQL_INDEX_MAX_INLINE_SIZE = -1; - /** Initial default near cache size. */ public static final int DFLT_NEAR_START_SIZE = 1500000 / 4; /** Default value for 'invalidate' flag that indicates if this is invalidation-based cache. */ public static final boolean DFLT_INVALIDATE = false; - /** Default rebalance mode for distributed cache. */ - public static final CacheRebalanceMode DFLT_REBALANCE_MODE = CacheRebalanceMode.ASYNC; - /** * Default rebalance batch size in bytes. * @deprecated Use {@link IgniteConfiguration#DFLT_REBALANCE_BATCH_SIZE} instead. @@ -152,12 +127,6 @@ public class CacheConfiguration extends MutableConfiguration { @Deprecated public static final int DFLT_REBALANCE_BATCH_SIZE = IgniteConfiguration.DFLT_REBALANCE_BATCH_SIZE; - /** Default value for eager ttl flag. */ - public static final boolean DFLT_EAGER_TTL = true; - - /** Default value for 'maxConcurrentAsyncOps'. */ - public static final int DFLT_MAX_CONCURRENT_ASYNC_OPS = 500; - /** Default value for 'writeBehindEnabled' flag. */ public static final boolean DFLT_WRITE_BEHIND_ENABLED = false; @@ -179,15 +148,9 @@ public class CacheConfiguration extends MutableConfiguration { /** Default write coalescing for write-behind cache store. */ public static final boolean DFLT_WRITE_BEHIND_COALESCING = true; - /** Default maximum number of query iterators that can be stored. */ - public static final int DFLT_MAX_QUERY_ITERATOR_CNT = 1024; - /** Default value for load previous value flag. */ public static final boolean DFLT_LOAD_PREV_VAL = false; - /** Default value for 'readFromBackup' flag. */ - public static final boolean DFLT_READ_FROM_BACKUP = true; - /** Filter that accepts all nodes. */ public static final IgnitePredicate ALL_NODES = new IgniteAllNodesPredicate(); @@ -195,9 +158,6 @@ public class CacheConfiguration extends MutableConfiguration { @Deprecated public static final long DFLT_LONG_QRY_WARN_TIMEOUT = 3000; - /** Default number of queries detail metrics to collect. */ - public static final int DFLT_QRY_DETAIL_METRICS_SIZE = 0; - /** Default value for keep binary in store behavior . */ @SuppressWarnings({"UnnecessaryBoxing", "BooleanConstructorCall"}) public static final Boolean DFLT_STORE_KEEP_BINARY = new Boolean(false); @@ -205,12 +165,6 @@ public class CacheConfiguration extends MutableConfiguration { /** Default threshold for concurrent loading of keys from {@link CacheStore}. */ public static final int DFLT_CONCURRENT_LOAD_ALL_THRESHOLD = 5; - /** Default partition loss policy. */ - public static final PartitionLossPolicy DFLT_PARTITION_LOSS_POLICY = PartitionLossPolicy.IGNORE; - - /** Default query parallelism. */ - public static final int DFLT_QUERY_PARALLELISM = 1; - /** Default value for events disabled flag. */ public static final boolean DFLT_EVENTS_DISABLED = false; @@ -274,9 +228,6 @@ public class CacheConfiguration extends MutableConfiguration { /** Platform cache configuration. Enables native cache in platforms (.NET, ...). */ private PlatformCacheConfiguration platformCfg; - /** Default value for 'copyOnRead' flag. */ - public static final boolean DFLT_COPY_ON_READ = true; - /** Write synchronization mode. */ private CacheWriteSynchronizationMode writeSync; diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java index 16d0bac76cf53..481bbdeae118a 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java @@ -105,7 +105,7 @@ * For more information about grid configuration and startup refer to {@link Ignition} * documentation. */ -public class IgniteConfiguration { +public class IgniteConfiguration implements IgniteConfigurationDefaults { /** Courtesy notice log category. */ public static final String COURTESY_LOGGER_NAME = "org.apache.ignite.CourtesyConfigNotice"; @@ -166,18 +166,6 @@ public class IgniteConfiguration { /** Default limit of threads used for rebalance. */ public static final int DFLT_REBALANCE_THREAD_POOL_SIZE = min(4, max(1, AVAILABLE_PROC_CNT / 4)); - /** Default rebalance message timeout in milliseconds (value is {@code 10000}). */ - public static final long DFLT_REBALANCE_TIMEOUT = 10000; - - /** Default rebalance batches prefetch count (value is {@code 3}). */ - public static final long DFLT_REBALANCE_BATCHES_PREFETCH_COUNT = 3; - - /** Time to wait between rebalance messages in milliseconds to avoid overloading CPU (value is {@code 0}). */ - public static final long DFLT_REBALANCE_THROTTLE = 0; - - /** Default rebalance batch size in bytes (value is {@code 512Kb}). */ - public static final int DFLT_REBALANCE_BATCH_SIZE = 512 * 1024; // 512K - /** Default size of system thread pool. */ public static final int DFLT_SYSTEM_CORE_THREAD_CNT = DFLT_PUBLIC_THREAD_CNT; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java index 782012cc9da2a..332a7d1ab2780 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java @@ -20,15 +20,8 @@ import java.lang.reflect.Method; import java.math.BigDecimal; import java.sql.SQLException; -import java.sql.Time; -import java.sql.Timestamp; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; -import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; @@ -68,9 +61,9 @@ import org.apache.ignite.internal.processors.query.property.QueryPropertyAccessor; import org.apache.ignite.internal.processors.query.property.QueryReadOnlyMethodsAccessor; import org.apache.ignite.internal.processors.query.schema.SchemaOperationException; +import org.apache.ignite.internal.util.CommonUtils; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.X; -import org.apache.ignite.internal.util.typedef.internal.A; import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -113,10 +106,10 @@ public class QueryUtils { public static final String SCHEMA_INFORMATION = "INFORMATION_SCHEMA"; /** Field name for key. */ - public static final String KEY_FIELD_NAME = "_KEY"; + public static final String KEY_FIELD_NAME = CommonUtils.KEY_FIELD_NAME; /** Field name for value. */ - public static final String VAL_FIELD_NAME = "_VAL"; + public static final String VAL_FIELD_NAME = CommonUtils.VAL_FIELD_NAME; /** Well-known template name for PARTITIONED cache. */ public static final String TEMPLATE_PARTITIONED = "PARTITIONED"; @@ -131,9 +124,6 @@ public class QueryUtils { private static final int DISCO_HIST_SIZE = getInteger(IGNITE_INDEXING_DISCOVERY_HISTORY_SIZE, DFLT_INDEXING_DISCOVERY_HISTORY_SIZE); - /** */ - private static final Set> SQL_TYPES = createSqlTypes(); - /** Default SQL delimeter. */ public static final char DEFAULT_DELIM = '\n'; @@ -157,36 +147,6 @@ public class QueryUtils { public static final ThreadLocal INCLUDE_SENSITIVE_TL = ThreadLocal.withInitial(() -> DFLT_TO_STRING_INCLUDE_SENSITIVE); - /** - * Creates SQL types set. - * - * @return SQL types set. - */ - @NotNull private static Set> createSqlTypes() { - Set> sqlClasses = new HashSet<>(Arrays.>asList( - Integer.class, - Boolean.class, - Byte.class, - Short.class, - Long.class, - BigDecimal.class, - Double.class, - Float.class, - Time.class, - Timestamp.class, - Date.class, - java.sql.Date.class, - LocalTime.class, - LocalDate.class, - LocalDateTime.class, - String.class, - UUID.class, - byte[].class - )); - - return sqlClasses; - } - /** * Get table name for entity. * @@ -1168,9 +1128,7 @@ private static boolean mustDeserializeBinary(GridKernalContext ctx, Class cls) { * @return {@code true} If can. */ public static boolean isSqlType(Class cls) { - cls = U.box(cls); - - return SQL_TYPES.contains(cls) || U.isGeometryClass(cls); + return CommonUtils.isSqlType(cls); } /** @@ -1231,22 +1189,6 @@ public static String typeName(Class cls) { return typeName; } - /** - * @param timeout Timeout. - * @param timeUnit Time unit. - * @return Converted time. - */ - public static int validateTimeout(int timeout, TimeUnit timeUnit) { - A.ensure(timeUnit != TimeUnit.MICROSECONDS && timeUnit != TimeUnit.NANOSECONDS, - "timeUnit minimal resolution is millisecond."); - - A.ensure(timeout >= 0, "timeout value should be non-negative."); - - long tmp = TimeUnit.MILLISECONDS.convert(timeout, timeUnit); - - return (int)tmp; - } - /** * @param ccfg Cache configuration. * @return {@code true} If query index must be enabled for this cache. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index c8ea0134a6ad5..1513346138589 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -356,9 +356,6 @@ public abstract class IgniteUtils extends CommonUtils { /** Default buffer size = 4K. */ private static final int BUF_SIZE = 4096; - /** Byte bit-mask. */ - private static final int MASK = 0xf; - /** Long date format pattern for log messages. */ public static final DateTimeFormatter LONG_DATE_FMT = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss").withZone(ZoneId.systemDefault()); @@ -377,9 +374,6 @@ public abstract class IgniteUtils extends CommonUtils { /** Supplier of network interfaces. Could be used for tests purposes, must not be changed in production code. */ public static InterfaceSupplier INTERFACE_SUPPLIER = NetworkInterface::getNetworkInterfaces; - /** Boxed class map. */ - private static final Map, Class> boxedClsMap = new HashMap<>(16, .5f); - /** MAC OS invalid argument socket error message. */ public static final String MAC_INVALID_ARG_MSG = "On MAC OS you may have too many file descriptors open " + "(simple restart usually solves the issue)"; @@ -486,16 +480,6 @@ public abstract class IgniteUtils extends CommonUtils { jvm32Bit = "32".equals(jvmArchDataModel); - boxedClsMap.put(byte.class, Byte.class); - boxedClsMap.put(short.class, Short.class); - boxedClsMap.put(int.class, Integer.class); - boxedClsMap.put(long.class, Long.class); - boxedClsMap.put(float.class, Float.class); - boxedClsMap.put(double.class, Double.class); - boxedClsMap.put(char.class, Character.class); - boxedClsMap.put(boolean.class, Boolean.class); - boxedClsMap.put(void.class, Void.class); - // Disable hostname SSL verification for development and testing with self-signed certificates. if (Boolean.parseBoolean(System.getProperty(IGNITE_DISABLE_HOSTNAME_VERIFIER))) { HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { @@ -1802,23 +1786,6 @@ public static boolean hasParent(@Nullable ClassLoader parent, ClassLoader ldr) { return true; } - /** - * Writes byte array to output stream accounting for null values. - * - * @param out Output stream to write to. - * @param arr Array to write, possibly null. - * @throws java.io.IOException If write failed. - */ - public static void writeByteArray(DataOutput out, @Nullable byte[] arr) throws IOException { - if (arr == null) - out.writeInt(-1); - else { - out.writeInt(arr.length); - - out.write(arr); - } - } - /** * Writes byte array to output stream accounting for null values. * @@ -1838,26 +1805,6 @@ public static void writeByteArray(DataOutput out, @Nullable byte[] arr, int maxL } } - /** - * Reads byte array from input stream accounting for null values. - * - * @param in Stream to read from. - * @return Read byte array, possibly null. - * @throws java.io.IOException If read failed. - */ - @Nullable public static byte[] readByteArray(DataInput in) throws IOException { - int len = in.readInt(); - - if (len == -1) - return null; // Value "-1" indicates null. - - byte[] res = new byte[len]; - - in.readFully(res); - - return res; - } - /** * Join byte arrays into single one. * @@ -2205,42 +2152,6 @@ public static boolean bytesEqual(byte[] a, int aOff, byte[] b, int bOff, int len } } - /** - * Converts an array of characters representing hexidecimal values into an - * array of bytes of those same values. The returned array will be half the - * length of the passed array, as it takes two characters to represent any - * given byte. An exception is thrown if the passed char array has an odd - * number of elements. - * - * @param data An array of characters containing hexidecimal digits - * @return A byte array containing binary data decoded from - * the supplied char array. - * @throws IgniteCheckedException Thrown if an odd number or illegal of characters is supplied. - */ - public static byte[] decodeHex(char[] data) throws IgniteCheckedException { - int len = data.length; - - if ((len & 0x01) != 0) - throw new IgniteCheckedException("Odd number of characters."); - - byte[] out = new byte[len >> 1]; - - // Two characters form the hex value. - for (int i = 0, j = 0; j < len; i++) { - int f = toDigit(data[j], j) << 4; - - j++; - - f |= toDigit(data[j], j); - - j++; - - out[i] = (byte)(f & 0xFF); - } - - return out; - } - /** * @param bytes Number of bytes to display. * @param si If {@code true}, then unit base is 1000, otherwise unit base is 1024. @@ -2757,40 +2668,6 @@ public static URL resolveSpringUrl(String springCfgPath) throws IgniteCheckedExc return null; } - /** - * Converts byte array to hex string. - * - * @param arr Array of bytes. - * @return Hex string. - */ - public static String byteArray2HexString(byte[] arr) { - return byteArray2HexString(arr, true); - } - - /** - * Converts byte array to hex string. - * - * @param arr Array of bytes. - * @param toUpper If {@code true} returns upper cased result. - * @return Hex string. - */ - public static String byteArray2HexString(byte[] arr, boolean toUpper) { - StringBuilder sb = new StringBuilder(arr.length << 1); - - for (byte b : arr) - addByteAsHex(sb, b); - - return toUpper ? sb.toString().toUpperCase() : sb.toString(); - } - - /** - * @param sb String builder. - * @param b Byte to add in hexadecimal format. - */ - private static void addByteAsHex(StringBuilder sb, byte b) { - sb.append(Integer.toHexString(MASK & b >>> 4)).append(Integer.toHexString(MASK & b)); - } - /** * Checks for containment of the value in the array. * Both array cells and value may be {@code null}. Two {@code null}s are considered equal. @@ -5806,22 +5683,6 @@ public static long ensurePositive(long i, long dflt) { return i <= 0 ? dflt : i; } - /** - * Gets wrapper class for a primitive type. - * - * @param cls Class. If {@code null}, method is no-op. - * @return Wrapper class or original class if it is non-primitive. - */ - @Nullable public static Class box(@Nullable Class cls) { - if (cls == null) - return null; - - if (!cls.isPrimitive()) - return cls; - - return boxedClsMap.get(cls); - } - /** * Gets class for provided name. Accepts primitive types names. * @@ -6432,23 +6293,6 @@ public static IgniteCheckedException exceptionWithSuppressed(String msg, @Nullab return e; } - /** - * Converts a hexadecimal character to an integer. - * - * @param ch A character to convert to an integer digit - * @param idx The index of the character in the source - * @return An integer - * @throws IgniteCheckedException Thrown if ch is an illegal hex character - */ - public static int toDigit(char ch, int idx) throws IgniteCheckedException { - int digit = Character.digit(ch, 16); - - if (digit == -1) - throw new IgniteCheckedException("Illegal hexadecimal character " + ch + " at index " + idx); - - return digit; - } - /** * Gets oldest node out of collection of nodes. * diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Classpath.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Classpath.cs index a869e8e25ae44..68ccbc5e957d4 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Classpath.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Classpath.cs @@ -98,6 +98,7 @@ private static void AppendHomeClasspath(string ggHome, bool forceTestClasspath, AppendTestClasses(Path.Combine(ggHome, "examples"), cpStr); AppendTestClasses(Path.Combine(ggHome, "modules"), cpStr); AppendTestClasses(Path.Combine(ggHome, "modules", "binary"), cpStr); + AppendTestClasses(Path.Combine(ggHome, "modules", "thin-client"), cpStr); AppendTestClasses(Path.Combine(ggHome, "modules", "extdata", "platform"), cpStr); } diff --git a/modules/thin-client/api/README.txt b/modules/thin-client/api/README.txt new file mode 100644 index 0000000000000..33ccb7b94612e --- /dev/null +++ b/modules/thin-client/api/README.txt @@ -0,0 +1,9 @@ +Apache Ignite Thin Client API Module +------------------------ + +ignite-thin-client-api module is internal module to separate thin-client API and implementation. +Other modules like ignite-core must depend on ignite-thin-client-api, only. +Implementation of API in ignite-thin-client-impl, it added in runtime. + +Note, class files of this module are copied in ignite-core.jar during project assembly +to ensure compatibility with previous Ignite releases. diff --git a/modules/thin-client/api/pom.xml b/modules/thin-client/api/pom.xml new file mode 100644 index 0000000000000..d329d6d7522be --- /dev/null +++ b/modules/thin-client/api/pom.xml @@ -0,0 +1,69 @@ + + + + + + + 4.0.0 + + + org.apache.ignite + ignite-parent-internal + ${revision} + ../../../parent-internal/pom.xml + + + ignite-thin-client-api + + http://ignite.apache.org + + + + ${project.groupId} + ignite-commons + provided + + + + ${project.groupId} + ignite-binary-api + provided + + + + org.jetbrains + annotations + ${jetbrains.annotations.version} + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + false + + + + + diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAddressFinder.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAddressFinder.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientAddressFinder.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAddressFinder.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAffinityConfiguration.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAffinityConfiguration.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientAffinityConfiguration.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAffinityConfiguration.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAtomicConfiguration.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAtomicConfiguration.java similarity index 93% rename from modules/core/src/main/java/org/apache/ignite/client/ClientAtomicConfiguration.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAtomicConfiguration.java index 248265fdd7240..2129a174bb5cc 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientAtomicConfiguration.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAtomicConfiguration.java @@ -17,7 +17,6 @@ package org.apache.ignite.client; -import org.apache.ignite.IgniteAtomicSequence; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.internal.util.typedef.internal.S; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -90,7 +89,7 @@ public ClientAtomicConfiguration setCacheMode(CacheMode cacheMode) { } /** - * Gets default number of sequence values reserved for {@link IgniteAtomicSequence} instances. After + * Gets default number of sequence values reserved for {@ignitelink org.apache.ignite.IgniteAtomicSequence} instances. After * a certain number has been reserved, consequent increments of sequence will happen locally, * without communication with other nodes, until the next reservation has to be made. *

          @@ -103,7 +102,7 @@ public int getAtomicSequenceReserveSize() { } /** - * Sets default number of sequence values reserved for {@link IgniteAtomicSequence} instances. After a certain + * Sets default number of sequence values reserved for {@ignitelink org.apache.ignite.IgniteAtomicSequence} instances. After a certain * number has been reserved, consequent increments of sequence will happen locally, without communication with other * nodes, until the next reservation has to be made. * diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAtomicLong.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAtomicLong.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientAtomicLong.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAtomicLong.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAuthenticationException.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAuthorizationException.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAuthorizationException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientAuthorizationException.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAuthorizationException.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientAutoCloseableIterator.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAutoCloseableIterator.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientAutoCloseableIterator.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientAutoCloseableIterator.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientCache.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCache.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientCache.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCache.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java similarity index 88% rename from modules/core/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java index 693832b30add7..bfe3edd4ee577 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java @@ -26,9 +26,8 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.QueryEntity; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.DataStorageConfiguration; -import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.configuration.CacheConfigurationDefaults; +import org.apache.ignite.configuration.IgniteConfigurationDefaults; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.lang.IgniteExperimental; import org.jetbrains.annotations.Nullable; @@ -42,55 +41,55 @@ public final class ClientCacheConfiguration implements Serializable { private String name; /** @serial Atomicity mode. */ - private CacheAtomicityMode atomicityMode = CacheConfiguration.DFLT_CACHE_ATOMICITY_MODE; + private CacheAtomicityMode atomicityMode = CacheConfigurationDefaults.DFLT_CACHE_ATOMICITY_MODE; /** @serial Backups. */ - private int backups = CacheConfiguration.DFLT_BACKUPS; + private int backups = CacheConfigurationDefaults.DFLT_BACKUPS; /** @serial Cache mode. */ - private CacheMode cacheMode = CacheConfiguration.DFLT_CACHE_MODE; + private CacheMode cacheMode = CacheConfigurationDefaults.DFLT_CACHE_MODE; /** @serial Eager TTL flag. */ - private boolean eagerTtl = CacheConfiguration.DFLT_EAGER_TTL; + private boolean eagerTtl = CacheConfigurationDefaults.DFLT_EAGER_TTL; /** @serial Group name. */ private String grpName = null; /** @serial Default lock timeout. */ - private long dfltLockTimeout = CacheConfiguration.DFLT_LOCK_TIMEOUT; + private long dfltLockTimeout = CacheConfigurationDefaults.DFLT_LOCK_TIMEOUT; /** @serial Partition loss policy. */ - private PartitionLossPolicy partLossPlc = CacheConfiguration.DFLT_PARTITION_LOSS_POLICY; + private PartitionLossPolicy partLossPlc = CacheConfigurationDefaults.DFLT_PARTITION_LOSS_POLICY; /** @serial Read from backup. */ - private boolean readFromBackup = CacheConfiguration.DFLT_READ_FROM_BACKUP; + private boolean readFromBackup = CacheConfigurationDefaults.DFLT_READ_FROM_BACKUP; /** @serial Rebalance batch size. */ - private int rebalanceBatchSize = IgniteConfiguration.DFLT_REBALANCE_BATCH_SIZE; + private int rebalanceBatchSize = IgniteConfigurationDefaults.DFLT_REBALANCE_BATCH_SIZE; /** @serial Rebalance batches prefetch count. */ - private long rebalanceBatchesPrefetchCnt = IgniteConfiguration.DFLT_REBALANCE_BATCHES_PREFETCH_COUNT; + private long rebalanceBatchesPrefetchCnt = IgniteConfigurationDefaults.DFLT_REBALANCE_BATCHES_PREFETCH_COUNT; /** @serial Rebalance delay. */ private long rebalanceDelay = 0; /** @serial Rebalance mode. */ - private CacheRebalanceMode rebalanceMode = CacheConfiguration.DFLT_REBALANCE_MODE; + private CacheRebalanceMode rebalanceMode = CacheConfigurationDefaults.DFLT_REBALANCE_MODE; /** @serial Rebalance order. */ private int rebalanceOrder = 0; /** @serial Rebalance throttle. */ - private long rebalanceThrottle = IgniteConfiguration.DFLT_REBALANCE_THROTTLE; + private long rebalanceThrottle = IgniteConfigurationDefaults.DFLT_REBALANCE_THROTTLE; /** @serial Rebalance timeout. */ - private long rebalanceTimeout = IgniteConfiguration.DFLT_REBALANCE_TIMEOUT; + private long rebalanceTimeout = IgniteConfigurationDefaults.DFLT_REBALANCE_TIMEOUT; /** @serial Write synchronization mode. */ private CacheWriteSynchronizationMode writeSynchronizationMode = CacheWriteSynchronizationMode.PRIMARY_SYNC; /** @serial Copy on read. */ - private boolean cpOnRead = CacheConfiguration.DFLT_COPY_ON_READ; + private boolean cpOnRead = CacheConfigurationDefaults.DFLT_COPY_ON_READ; /** @serial Data region name. */ private String dataRegionName = null; @@ -99,25 +98,25 @@ public final class ClientCacheConfiguration implements Serializable { private boolean statisticsEnabled = false; /** @serial Max concurrent async operations. */ - private int maxConcurrentAsyncOperations = CacheConfiguration.DFLT_MAX_CONCURRENT_ASYNC_OPS; + private int maxConcurrentAsyncOperations = CacheConfigurationDefaults.DFLT_MAX_CONCURRENT_ASYNC_OPS; /** @serial Max query iterators count. */ - private int maxQryIteratorsCnt = CacheConfiguration.DFLT_MAX_QUERY_ITERATOR_CNT; + private int maxQryIteratorsCnt = CacheConfigurationDefaults.DFLT_MAX_QUERY_ITERATOR_CNT; /** @serial Onheap cache enabled. */ private boolean onheapCacheEnabled = false; /** @serial Query detail metrics size. */ - private int qryDetailMetricsSize = CacheConfiguration.DFLT_QRY_DETAIL_METRICS_SIZE; + private int qryDetailMetricsSize = CacheConfigurationDefaults.DFLT_QRY_DETAIL_METRICS_SIZE; /** @serial Query parallelism. */ - private int qryParallelism = CacheConfiguration.DFLT_QUERY_PARALLELISM; + private int qryParallelism = CacheConfigurationDefaults.DFLT_QUERY_PARALLELISM; /** @serial Sql escape all. */ private boolean sqlEscapeAll = false; /** @serial Sql index max inline size. */ - private int sqlIdxMaxInlineSize = CacheConfiguration.DFLT_SQL_INDEX_MAX_INLINE_SIZE; + private int sqlIdxMaxInlineSize = CacheConfigurationDefaults.DFLT_SQL_INDEX_MAX_INLINE_SIZE; /** @serial Sql schema. */ private String sqlSchema = null; @@ -136,18 +135,18 @@ public final class ClientCacheConfiguration implements Serializable { /** * Root directories where partition files are stored. - * @see DataStorageConfiguration#setStoragePath(String) - * @see DataStorageConfiguration#setExtraStoragePaths(String[]) - * @see CacheConfiguration#setStoragePaths(String...) + * @see {@ignitelink org.apache.ignite.configuration.DataStorageConfiguration#setStoragePath(String)} + * @see {@ignitelink org.apache.ignite.configuration.DataStorageConfiguration#setExtraStoragePaths(String[])} + * @see {@ignitelink org.apache.ignite.configuration.CacheConfiguration#setStoragePaths(String...)} */ @IgniteExperimental @Nullable private String[] storagePaths; /** * Root directory where index file are stored. - * @see DataStorageConfiguration#setStoragePath(String) - * @see DataStorageConfiguration#setExtraStoragePaths(String[]) - * @see CacheConfiguration#setIndexPath(String) + * @see {@ignitelink org.apache.ignite.configuration.DataStorageConfiguration#setStoragePath(String)} + * @see {@ignitelink org.apache.ignite.configuration.DataStorageConfiguration#setExtraStoragePaths(String[])} + * @see {@ignitelink org.apache.ignite.configuration.CacheConfiguration#setIndexPath(String)} */ @IgniteExperimental @Nullable private String idxPath; @@ -373,7 +372,7 @@ public ClientCacheConfiguration setReadFromBackup(boolean readFromBackup) { * @return Size (in number bytes) to be loaded within a single rebalance message. * Rebalancing algorithm will split total data set on every node into multiple * batches prior to sending data. - * @deprecated Use {@link IgniteConfiguration#getRebalanceBatchSize()} instead. + * @deprecated Use {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getRebalanceBatchSize()} instead. */ @Deprecated public int getRebalanceBatchSize() { @@ -383,7 +382,7 @@ public int getRebalanceBatchSize() { /** * @param rebalanceBatchSize Rebalance batch size. * @return {@code this} for chaining. - * @deprecated Use {@link IgniteConfiguration#setRebalanceBatchSize(int)} instead. + * @deprecated Use {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#setRebalanceBatchSize(int)} instead. */ @Deprecated public ClientCacheConfiguration setRebalanceBatchSize(int rebalanceBatchSize) { @@ -398,7 +397,7 @@ public ClientCacheConfiguration setRebalanceBatchSize(int rebalanceBatchSize) { * * @return Number of batches generated by supply node at rebalancing start. * Minimum is 1. - * @deprecated Use {@link IgniteConfiguration#getRebalanceBatchesPrefetchCount()} instead + * @deprecated Use {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getRebalanceBatchesPrefetchCount()} instead */ @Deprecated public long getRebalanceBatchesPrefetchCount() { @@ -408,7 +407,7 @@ public long getRebalanceBatchesPrefetchCount() { /** * @param rebalanceBatchesPrefetchCnt Rebalance batches prefetch count. * @return {@code this} for chaining. - * @deprecated Use {@link IgniteConfiguration#getRebalanceBatchesPrefetchCount()} instead + * @deprecated Use {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getRebalanceBatchesPrefetchCount()} instead */ @Deprecated public ClientCacheConfiguration setRebalanceBatchesPrefetchCount(long rebalanceBatchesPrefetchCnt) { @@ -501,7 +500,7 @@ public ClientCacheConfiguration setRebalanceOrder(int rebalanceOrder) { *

          * Default value of {@code 0} means that throttling is disabled. *

          - * @deprecated Use {@link IgniteConfiguration#getRebalanceThrottle()} instead. + * @deprecated Use {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getRebalanceThrottle()} instead. */ @Deprecated public long getRebalanceThrottle() { @@ -511,7 +510,7 @@ public long getRebalanceThrottle() { /** * @param newVal Rebalance throttle. * @return {@code this} for chaining. - * @deprecated Use {@link IgniteConfiguration#setRebalanceThrottle(long)} instead. + * @deprecated Use {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#setRebalanceThrottle(long)} instead. */ @Deprecated public ClientCacheConfiguration setRebalanceThrottle(long newVal) { @@ -522,7 +521,7 @@ public ClientCacheConfiguration setRebalanceThrottle(long newVal) { /** * @return Rebalance timeout (ms). - * @deprecated Use {@link IgniteConfiguration#getRebalanceTimeout()} instead. + * @deprecated Use {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getRebalanceTimeout()} instead. */ @Deprecated public long getRebalanceTimeout() { @@ -532,7 +531,7 @@ public long getRebalanceTimeout() { /** * @param newVal Rebalance timeout. * @return {@code this} for chaining. - * @deprecated Use {@link IgniteConfiguration#getRebalanceTimeout()} instead. + * @deprecated Use {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getRebalanceTimeout()} instead. */ @Deprecated public ClientCacheConfiguration setRebalanceTimeout(long newVal) { @@ -828,7 +827,8 @@ public ClientCacheConfiguration setAffinityConfiguration(ClientAffinityConfigura /** * Sets a path to the root directory where the Persistent Store will persist data. - * By default, the Persistent Store's files are located under {@link DataStorageConfiguration#getStoragePath()}. + * By default, the Persistent Store's files are located under + * {@ignitelink org.apache.ignite.configuration.DataStorageConfiguration#getStoragePath()}. * * @param storagePaths Persistence store path. * @return {@code this} for chaining. @@ -850,7 +850,8 @@ public ClientCacheConfiguration setStoragePaths(String... storagePaths) { /** * Sets a path to the root directory where the Persistent Store will persist index partition. - * By default, the Persistent Store's files are located under {@link DataStorageConfiguration#getStoragePath()}. + * By default, the Persistent Store's files are located under + * {@ignitelink org.apache.ignite.configuration.DataStorageConfiguration#getStoragePath()}. * * @param idxPath Index path. * @return {@code this} for chaining. diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientCluster.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCluster.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientCluster.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCluster.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientClusterGroup.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientClusterGroup.java similarity index 93% rename from modules/core/src/main/java/org/apache/ignite/client/ClientClusterGroup.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientClusterGroup.java index 01f8d31ebb2cc..69db615c0c9c5 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientClusterGroup.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientClusterGroup.java @@ -20,9 +20,7 @@ import java.util.Collection; import java.util.UUID; import java.util.function.Predicate; -import org.apache.ignite.Ignition; import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.configuration.IgniteConfiguration; import org.jetbrains.annotations.Nullable; /** @@ -94,7 +92,7 @@ public interface ClientClusterGroup { * specified in user attributes. *

          * User attributes for every node are optional and can be specified in - * grid node configuration. See {@link IgniteConfiguration#getUserAttributes()} + * grid node configuration. See {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#getUserAttributes()} * for more information. * * @param name Name of the attribute. @@ -106,8 +104,8 @@ public interface ClientClusterGroup { /** * Creates a cluster group of nodes started in server mode. * - * @see Ignition#setClientMode(boolean) - * @see IgniteConfiguration#setClientMode(boolean) + * @see {@ignitelink org.apache.ignite.Ignition#setClientMode(boolean)} + * @see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#setClientMode(boolean)} * @return Cluster group of nodes started in server mode. */ public ClientClusterGroup forServers(); @@ -115,8 +113,8 @@ public interface ClientClusterGroup { /** * Creates a cluster group of nodes started in client mode. - * @see Ignition#setClientMode(boolean) - * @see IgniteConfiguration#setClientMode(boolean) + * @see {@ignitelink org.apache.ignite.Ignition#setClientMode(boolean)} + * @see {@ignitelink org.apache.ignite.configuration.IgniteConfiguration#setClientMode(boolean)} * @return Cluster group of nodes started in client mode. */ public ClientClusterGroup forClients(); diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientCollectionConfiguration.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCollectionConfiguration.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientCollectionConfiguration.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCollectionConfiguration.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientCompute.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCompute.java similarity index 83% rename from modules/core/src/main/java/org/apache/ignite/client/ClientCompute.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCompute.java index d97b99197efdf..8f294ef0923e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientCompute.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientCompute.java @@ -18,7 +18,6 @@ package org.apache.ignite.client; import java.util.concurrent.Future; -import org.apache.ignite.compute.ComputeTask; import org.jetbrains.annotations.Nullable; /** @@ -35,7 +34,7 @@ public interface ClientCompute { /** * Executes given task within the cluster group. For step-by-step explanation of task execution process - * refer to {@link ComputeTask} documentation. + * refer to {@ignitelink org.apache.ignite.compute.ComputeTask} documentation. * * @param taskName Name of the task to execute. * @param arg Optional argument of task execution, can be {@code null}. @@ -44,13 +43,13 @@ public interface ClientCompute { * @return Task result. * @throws ClientException If task failed. * @throws InterruptedException If the wait for task completion was interrupted. - * @see ComputeTask for information about task execution. + * @see {@ignitelink org.apache.ignite.compute.ComputeTask} for information about task execution. */ public R execute(String taskName, @Nullable T arg) throws ClientException, InterruptedException; /** * Executes given task asynchronously within the cluster group. For step-by-step explanation of task execution - * process refer to {@link ComputeTask} documentation. + * process refer to {@ignitelink org.apache.ignite.compute.ComputeTask} documentation. * * @param taskName Name of the task to execute. * @param arg Optional argument of task execution, can be {@code null}. @@ -58,7 +57,7 @@ public interface ClientCompute { * @param Type of the task result. * @return A Future representing pending completion of the task. * @throws ClientException If task failed. - * @see ComputeTask for information about task execution. + * @see {@ignitelink org.apache.ignite.compute.ComputeTask} for information about task execution. * @deprecated Use {@link #executeAsync2(String, Object)} instead. * This method calls {@link #executeAsync2(String, Object)} internally, but returns a more limited * Future interface. @@ -68,7 +67,7 @@ public interface ClientCompute { /** * Executes given task asynchronously within the cluster group. For step-by-step explanation of task execution - * process refer to {@link ComputeTask} documentation. + * process refer to {@ignitelink org.apache.ignite.compute.ComputeTask} documentation. * * @param taskName Name of the task to execute. * @param arg Optional argument of task execution, can be {@code null}. @@ -76,7 +75,7 @@ public interface ClientCompute { * @param Type of the task result. * @return A Future representing pending completion of the task. * @throws ClientException If task failed. - * @see ComputeTask for information about task execution. + * @see {@ignitelink org.apache.ignite.compute.ComputeTask} for information about task execution. */ public IgniteClientFuture executeAsync2(String taskName, @Nullable T arg) throws ClientException; @@ -91,7 +90,7 @@ public interface ClientCompute { /** * Sets no-failover flag for tasks executed by returned {@code ClientCompute} instance. * If flag is set, job will be never failed over even if remote node crashes or rejects execution. - * See {@link ComputeTask} documentation for more information about jobs failover. + * See {@ignitelink org.apache.ignite.compute.ComputeTask} documentation for more information about jobs failover. * * @return {@code ClientCompute} instance with no-failover flag. */ @@ -99,7 +98,7 @@ public interface ClientCompute { /** * Disables result caching for tasks executed by returned {@code ClientCompute} instance. - * See {@link ComputeTask} documentation for more information tasks result caching. + * See {@ignitelink org.apache.ignite.compute.ComputeTask} documentation for more information tasks result caching. * * @return {@code ClientCompute} instance with "no result cache" flag. */ diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientConnectionException.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientConnectionException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientConnectionException.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientConnectionException.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientDisconnectListener.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientDisconnectListener.java similarity index 80% rename from modules/core/src/main/java/org/apache/ignite/client/ClientDisconnectListener.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientDisconnectListener.java index e2c76b86be49a..ccacdf97fd422 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientDisconnectListener.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientDisconnectListener.java @@ -18,12 +18,12 @@ package org.apache.ignite.client; import javax.cache.configuration.CacheEntryListenerConfiguration; -import org.apache.ignite.cache.query.ContinuousQuery; /** - * Client disconnected event listener. Such listeners can be used in {@link ClientCache#query(ContinuousQuery, - * ClientDisconnectListener)} or {@link ClientCache#registerCacheEntryListener(CacheEntryListenerConfiguration, - * ClientDisconnectListener)} methods to handle client channel failure. + * Client disconnected event listener. Such listeners can be used in + * {@link ClientCache#query(org.apache.ignite.cache.query.ContinuousQuery, ClientDisconnectListener)} or + * {@link ClientCache#registerCacheEntryListener(CacheEntryListenerConfiguration, ClientDisconnectListener)} + * methods to handle client channel failure. */ public interface ClientDisconnectListener { /** diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientException.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientException.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientException.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientFeatureNotSupportedByServerException.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientFeatureNotSupportedByServerException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientFeatureNotSupportedByServerException.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientFeatureNotSupportedByServerException.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientIgniteSet.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientIgniteSet.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientIgniteSet.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientIgniteSet.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientOperationType.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientOperationType.java similarity index 97% rename from modules/core/src/main/java/org/apache/ignite/client/ClientOperationType.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientOperationType.java index 913ec88107d52..bb8e318c08932 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientOperationType.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientOperationType.java @@ -20,10 +20,6 @@ import java.util.Collection; import java.util.Set; import javax.cache.processor.EntryProcessor; -import org.apache.ignite.cache.query.ContinuousQuery; -import org.apache.ignite.cache.query.Query; -import org.apache.ignite.cache.query.SqlFieldsQuery; -import org.apache.ignite.cluster.ClusterState; /** * Client operation type. diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapper.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapper.java similarity index 65% rename from modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapper.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapper.java index 64ea78b928211..6c65d1945edf8 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapper.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapper.java @@ -17,24 +17,22 @@ package org.apache.ignite.client; -import org.apache.ignite.cache.affinity.AffinityFunction; -import org.apache.ignite.cache.affinity.AffinityKeyMapper; -import org.apache.ignite.configuration.ClientConfiguration; - /** * This function calculates the cache key to a partition mapping for each cache key. It is used only for local calculation on a client side. *

          - * When the {@link ClientConfiguration#isPartitionAwarenessEnabled()} and the cache was created with a custom {@link AffinityFunction} - * or a {@link AffinityKeyMapper} this function will be used to calculate mappings. Be sure that a key maps to the same partition - * produced by the {@link AffinityFunction#partition(Object)} method. + * When the {@ignitelink org.apache.ignite.configuration.ClientConfiguration#isPartitionAwarenessEnabled()} + * and the cache was created with a custom {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction} + * or a {@ignitelink org.apache.ignite.cache.affinity.AffinityKeyMapper} this function will be used to calculate mappings. + * Be sure that a key maps to the same partition + * produced by the {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction#partition(Object)} method. * - * @see AffinityFunction#partition(Object) + * @see {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction#partition(Object)} * @since 2.14 */ public interface ClientPartitionAwarenessMapper { /** * Gets a partition number for a given key starting from {@code 0}. Be sure that a key maps to the same partition - * produced by the {@link AffinityFunction#partition(Object)} method. + * produced by the {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction#partition(Object)} method. * * @param key Key to get partition for. * @return Partition number for a given key. diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapperFactory.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapperFactory.java similarity index 85% rename from modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapperFactory.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapperFactory.java index c26421dda8454..bafab678a300c 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapperFactory.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapperFactory.java @@ -17,17 +17,15 @@ package org.apache.ignite.client; -import org.apache.ignite.cache.affinity.AffinityFunction; -import org.apache.ignite.cache.affinity.AffinityKeyMapper; - /** * This factory is used on the client side and only when the partition awareness thin client feature is enabled. By default, * on a new cache the RendezvousAffinityFunction will be used for calculating mappings 'key-to-partition' and 'partition-to-node'. * The thin client will update all 'partitions-to-node' mappings on every cluster topology change and the 'key-to-partition' * mapping will be calculated on the client side. *

          - * The case described above will not be possible (and in turn partition awareness won't work) when a custom {@link AffinityFunction} or - * a {@link AffinityKeyMapper} was previously used for a cache creation. The partition awareness mapper factory is used to solve this + * The case described above will not be possible (and in turn partition awareness won't work) when a custom + * {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction} or a {@ignitelink org.apache.ignite.cache.affinity.AffinityKeyMapper} + * was previously used for a cache creation. The partition awareness mapper factory is used to solve this * issue. All 'partition-to-node' mappings will still be requested and received from a server node, however, if a custom AffinityFunction * or a custom AffinityKeyMapper was used a ClientPartitionAwarenessMapper produced by this factory will calculate mapping a key to * a partition. @@ -35,7 +33,7 @@ * These key to partition mapping functions produced by the factory are used only for local calculations, they will not be passed * to a server node. * - * @see AffinityFunction + * @see {@ignitelink org.apache.ignite.cache.affinity.AffinityFunction} * @since 2.14 */ public interface ClientPartitionAwarenessMapperFactory { diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientReconnectedException.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientReconnectedException.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientReconnectedException.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientReconnectedException.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientRetryAllPolicy.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryAllPolicy.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientRetryAllPolicy.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryAllPolicy.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientRetryNonePolicy.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryNonePolicy.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientRetryNonePolicy.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryNonePolicy.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientRetryPolicy.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryPolicy.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientRetryPolicy.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryPolicy.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientRetryPolicyContext.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryPolicyContext.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientRetryPolicyContext.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryPolicyContext.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientRetryReadPolicy.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryReadPolicy.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientRetryReadPolicy.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientRetryReadPolicy.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientServiceDescriptor.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientServiceDescriptor.java similarity index 96% rename from modules/core/src/main/java/org/apache/ignite/client/ClientServiceDescriptor.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientServiceDescriptor.java index 1feba70a92ee8..6b90ac04e8081 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientServiceDescriptor.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientServiceDescriptor.java @@ -19,11 +19,10 @@ import java.util.UUID; import org.apache.ignite.platform.PlatformType; -import org.apache.ignite.services.Service; import org.jetbrains.annotations.Nullable; /** - * Descriptor of {@link Service}. + * Descriptor of {@ignitelink org.apache.ignite.services.Service}. */ public interface ClientServiceDescriptor { /** diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientServices.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientServices.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientServices.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientServices.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientTransaction.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientTransaction.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/ClientTransaction.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientTransaction.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientTransactions.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientTransactions.java similarity index 92% rename from modules/core/src/main/java/org/apache/ignite/client/ClientTransactions.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientTransactions.java index c6db25b35775d..7b7eea5a1f5ca 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientTransactions.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/client/ClientTransactions.java @@ -17,8 +17,6 @@ package org.apache.ignite.client; -import org.apache.ignite.configuration.ClientConfiguration; -import org.apache.ignite.configuration.ClientTransactionConfiguration; import org.apache.ignite.internal.client.thin.ClientServerError; import org.apache.ignite.transactions.TransactionConcurrency; import org.apache.ignite.transactions.TransactionIsolation; @@ -32,9 +30,9 @@ * Transactions are {@link AutoCloseable}, so they will automatically rollback unless explicitly committed. *

          * Default values for transaction isolation level, concurrency and timeout can be configured via - * {@link ClientConfiguration#setTransactionConfiguration(ClientTransactionConfiguration)} property. + * {@ignitelink org.apache.ignite.configuration.ClientConfiguration#setTransactionConfiguration(ClientTransactionConfiguration)} property. * - * @see ClientTransactionConfiguration + * @see {@ignitelink org.apache.ignite.configuration.ClientConfiguration} */ public interface ClientTransactions { /** diff --git a/modules/core/src/main/java/org/apache/ignite/client/IgniteClient.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/IgniteClient.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/IgniteClient.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/IgniteClient.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/IgniteClientFuture.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/IgniteClientFuture.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/IgniteClientFuture.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/IgniteClientFuture.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/SslMode.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/SslMode.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/SslMode.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/SslMode.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/SslProtocol.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/SslProtocol.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/SslProtocol.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/SslProtocol.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ClientFailEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientFailEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ClientFailEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientFailEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ClientLifecycleEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientLifecycleEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ClientLifecycleEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientLifecycleEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ClientLifecycleEventListener.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientLifecycleEventListener.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ClientLifecycleEventListener.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientLifecycleEventListener.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ClientStartEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientStartEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ClientStartEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientStartEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ClientStopEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientStopEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ClientStopEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ClientStopEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ConnectionClosedEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ConnectionClosedEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ConnectionClosedEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ConnectionClosedEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ConnectionDescription.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ConnectionDescription.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ConnectionDescription.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ConnectionDescription.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ConnectionEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ConnectionEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ConnectionEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ConnectionEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/ConnectionEventListener.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ConnectionEventListener.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/ConnectionEventListener.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/ConnectionEventListener.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/HandshakeFailEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/HandshakeFailEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/HandshakeFailEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/HandshakeFailEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/HandshakeStartEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/HandshakeStartEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/HandshakeStartEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/HandshakeStartEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/HandshakeSuccessEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/HandshakeSuccessEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/HandshakeSuccessEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/HandshakeSuccessEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/RequestEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/RequestEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/RequestEventListener.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestEventListener.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/RequestEventListener.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestEventListener.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/RequestFailEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestFailEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/RequestFailEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestFailEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/RequestStartEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestStartEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/RequestStartEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestStartEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/events/RequestSuccessEvent.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestSuccessEvent.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/events/RequestSuccessEvent.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/events/RequestSuccessEvent.java diff --git a/modules/core/src/main/java/org/apache/ignite/client/package-info.java b/modules/thin-client/api/src/main/java/org/apache/ignite/client/package-info.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/client/package-info.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/client/package-info.java diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java b/modules/thin-client/api/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java similarity index 96% rename from modules/core/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java index 8badaa9fd93a8..e63fe4dbe7161 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java @@ -27,7 +27,6 @@ import javax.net.ssl.SSLContext; import org.apache.ignite.IgniteLogger; -import org.apache.ignite.cache.query.IndexQuery; import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.client.ClientAddressFinder; import org.apache.ignite.client.ClientPartitionAwarenessMapper; @@ -37,12 +36,11 @@ import org.apache.ignite.client.ClientTransactions; import org.apache.ignite.client.SslMode; import org.apache.ignite.client.SslProtocol; -import org.apache.ignite.internal.client.thin.TcpIgniteClient; import org.apache.ignite.internal.util.typedef.internal.LT; import org.apache.ignite.internal.util.typedef.internal.S; /** - * {@link TcpIgniteClient} configuration. + * {@ignitelink org.apache.ignite.internal.client.thin.TcpIgniteClient} configuration. */ @SuppressWarnings("AssignmentOrReturnOfFieldWithMutableType") public final class ClientConfiguration implements Serializable { @@ -190,7 +188,8 @@ public String[] getAddresses() { /** * Set addresses of Ignite server nodes within a cluster. An address can be IPv4 address or hostname, with or * without port. If port is not set then Ignite will generate multiple addresses for default port range. See - * {@link ClientConnectorConfiguration#DFLT_PORT}, {@link ClientConnectorConfiguration#DFLT_PORT_RANGE}. + * {@ignitelink org.apache.ignite.internal.client.thin.ClientConnectorConfiguration#DFLT_PORT}, + * {@ignitelink org.apache.ignite.internal.client.thin.ClientConnectorConfiguration#DFLT_PORT_RANGE}. * * @param addrs Host addresses. * @return {@code this} for chaining. @@ -606,7 +605,8 @@ public ClientConfiguration setTransactionConfiguration(ClientTransactionConfigur *

            *
          • 1. Single-key operations API, like put(), get(), etc. However, the functionality has no effect on those * operations within explicit transactions {@link ClientTransactions#txStart()}.
          • - *
          • 2. {@link ScanQuery#setPartition(Integer)} and {@link IndexQuery#setPartition(Integer)} accept a + *
          • 2. {@link ScanQuery#setPartition(Integer)} and + * {@ignitelink org.apache.ignite.cache.query.IndexQuery#setPartition(Integer)} accept a * partition number as a parameter with which the query is routed to a particular server node that stores * the requested data.
          • *
          @@ -627,7 +627,8 @@ public boolean isPartitionAwarenessEnabled() { *
            *
          • 1. Single-key operations API, like put(), get(), etc. However, the functionality has no effect on * those operations within explicit transactions {@link ClientTransactions#txStart()}.
          • - *
          • 2. {@link ScanQuery#setPartition(Integer)} and {@link IndexQuery#setPartition(Integer)} accept + *
          • 2. {@link ScanQuery#setPartition(Integer)} and + * {@ignitelink org.apache.ignite.cache.query.IndexQuery#setPartition(Integer)} accept * a partition number as a parameter with which the query is routed to a particular server node that stores * the requested data.
          • *
          @@ -773,8 +774,8 @@ public Map getUserAttributes() { * Sets user attributes which can be used to send additional info to the server nodes. * * Sent attributes can be accessed on server nodes from - * {@link org.apache.ignite.internal.processors.rest.request.GridRestRequest GridRestRequest} or - * {@link org.apache.ignite.internal.processors.odbc.ClientListenerAbstractConnectionContext + * {@ignitelink org.apache.ignite.internal.processors.rest.request.GridRestRequest GridRestRequest} or + * {@ignitelink org.apache.ignite.internal.processors.odbc.ClientListenerAbstractConnectionContext * ClientListenerAbstractConnectionContext} (depends on client type). * * @param userAttrs User attributes. @@ -855,8 +856,8 @@ public ClientConfiguration setHeartbeatEnabled(boolean heartbeatEnabled) { /** * Gets the heartbeat message interval, in milliseconds. Default is 30_000. *

          - * When server-side {@link ClientConnectorConfiguration#getIdleTimeout()} is not zero, effective heartbeat - * interval is set to min(heartbeatInterval, idleTimeout / 3). + * When server-side {@ignitelink org.apache.ignite.configuration.ClientConnectorConfiguration#getIdleTimeout()} is not zero, + * effective heartbeat interval is set to min(heartbeatInterval, idleTimeout / 3). *

          * When thin client connection is idle (no operations are performed), heartbeat messages are sent periodically * to keep the connection alive and detect potential half-open state. * @@ -870,8 +871,8 @@ public long getHeartbeatInterval() { /** * Sets the heartbeat message interval, in milliseconds. Default is 30_000. *

          - * When server-side {@link ClientConnectorConfiguration#getIdleTimeout()} is not zero, effective heartbeat - * interval is set to min(heartbeatInterval, idleTimeout / 3). + * When server-side {@ignitelink org.apache.ignite.configuration.ClientConnectorConfiguration#getIdleTimeout()} is not zero, + * effective heartbeat interval is set to min(heartbeatInterval, idleTimeout / 3). *

          * When thin client connection is idle (no operations are performed), heartbeat messages are sent periodically * to keep the connection alive and detect potential half-open state. * diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ClientTransactionConfiguration.java b/modules/thin-client/api/src/main/java/org/apache/ignite/configuration/ClientTransactionConfiguration.java similarity index 98% rename from modules/core/src/main/java/org/apache/ignite/configuration/ClientTransactionConfiguration.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/configuration/ClientTransactionConfiguration.java index fd1d50f8008a9..3927de539e94f 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/ClientTransactionConfiguration.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/configuration/ClientTransactionConfiguration.java @@ -19,7 +19,6 @@ import java.io.Serializable; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.transactions.Transaction; import org.apache.ignite.transactions.TransactionConcurrency; import org.apache.ignite.transactions.TransactionIsolation; @@ -91,7 +90,7 @@ public ClientTransactionConfiguration setDefaultTxConcurrency(TransactionConcurr * Default value is defined by {@link #DFLT_TX_ISOLATION}. * * @return Default transaction isolation. - * @see Transaction + * @see {@ignitelink org.apache.ignite.transactions.Transaction} */ public TransactionIsolation getDefaultTxIsolation() { return dfltIsolation; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientError.java b/modules/thin-client/api/src/main/java/org/apache/ignite/internal/client/thin/ClientError.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientError.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/internal/client/thin/ClientError.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServerError.java b/modules/thin-client/api/src/main/java/org/apache/ignite/internal/client/thin/ClientServerError.java similarity index 100% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServerError.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/internal/client/thin/ClientServerError.java diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolBitmaskFeature.java b/modules/thin-client/api/src/main/java/org/apache/ignite/internal/client/thin/ProtocolBitmaskFeature.java similarity index 93% rename from modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolBitmaskFeature.java rename to modules/thin-client/api/src/main/java/org/apache/ignite/internal/client/thin/ProtocolBitmaskFeature.java index 6c4a3fa676c0f..b3287169a2e3c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ProtocolBitmaskFeature.java +++ b/modules/thin-client/api/src/main/java/org/apache/ignite/internal/client/thin/ProtocolBitmaskFeature.java @@ -20,12 +20,6 @@ import java.util.BitSet; import java.util.Collection; import java.util.EnumSet; -import org.apache.ignite.client.ClientCacheConfiguration; -import org.apache.ignite.client.ClientServices; -import org.apache.ignite.cluster.ClusterState; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.NearCacheConfiguration; -import org.apache.ignite.internal.processors.cache.GridCacheProcessor; /** * Defines supported bitmask features for thin client. diff --git a/pom.xml b/pom.xml index 97f40222cc8b1..5b4ef9e6f5516 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ modules/commons modules/binary/api modules/binary/impl + modules/thin-client/api modules/unsafe modules/core modules/compress