http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheAffinity.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheAffinity.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheAffinity.cs deleted file mode 100644 index 64f34d7..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheAffinity.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache -{ - using System.Collections.Generic; - using Apache.Ignite.Core.Cluster; - - /// <summary> - /// Provides affinity information to detect which node is primary and which nodes are - /// backups for a partitioned cache. You can get an instance of this interface by calling - /// <see cref="IIgnite.GetAffinity"/> method. - /// <para /> - /// Mapping of a key to a node is a three-step operation. First step will get an affinity key for - /// given key using <c>CacheAffinityKeyMapper</c>. If mapper is not specified, the original key - /// will be used. Second step will map affinity key to partition using - /// <c>CacheAffinityFunction.partition(Object)</c> method. Third step will map obtained partition - /// to nodes for current grid topology version. - /// <para /> - /// Interface provides various <c>mapKeysToNodes(...)</c> methods which provide node affinity mapping - /// for given keys. All <c>mapKeysToNodes(...)</c> methods are not transactional and will not enlist - /// keys into ongoing transaction. - /// <para/> - /// All members are thread-safe and may be used concurrently from multiple threads. - /// </summary> - public interface ICacheAffinity - { - /// <summary> - /// Gets number of partitions in cache according to configured affinity function. - /// </summary> - /// <returns>Number of cache partitions.</returns> - int Partitions { get; } - - /// <summary> - /// Gets partition id for the given key. - /// </summary> - /// <param name="key">Key to get partition id for.</param> - /// <returns>Partition id.</returns> - int GetPartition<TK>(TK key); - - /// <summary> - /// Returns 'true' if given node is the primary node for given key. - /// </summary> - /// <param name="n">Node.</param> - /// <param name="key">Key.</param> - /// <returns>'True' if given node is the primary node for given key.</returns> - bool IsPrimary<TK>(IClusterNode n, TK key); - - /// <summary> - /// Returns 'true' if given node is the backup node for given key. - /// </summary> - /// <param name="n">Node.</param> - /// <param name="key">Key.</param> - /// <returns>'True' if given node is the backup node for given key.</returns> - bool IsBackup<TK>(IClusterNode n, TK key); - - /// <summary> - /// Returns 'true' if given node is either primary or backup node for given key. - /// </summary> - /// <param name="n">Node.</param> - /// <param name="key">Key.</param> - /// <returns>'True' if given node is either primary or backup node for given key.</returns> - bool IsPrimaryOrBackup<TK>(IClusterNode n, TK key); - - /// <summary> - /// Gets partition ids for which nodes of the given projection has primary - /// ownership. - /// </summary> - /// <param name="n">Node.</param> - /// <returns>Partition ids for which given projection has primary ownership.</returns> - int[] GetPrimaryPartitions(IClusterNode n); - - /// <summary> - /// Gets partition ids for which nodes of the given projection has backup - /// ownership. - /// </summary> - /// <param name="n">Node.</param> - /// <returns>Partition ids for which given projection has backup ownership.</returns> - int[] GetBackupPartitions(IClusterNode n); - - /// <summary> - /// Gets partition ids for which nodes of the given projection has ownership - /// (either primary or backup). - /// </summary> - /// <param name="n">Node.</param> - /// <returns>Partition ids for which given projection has ownership.</returns> - int[] GetAllPartitions(IClusterNode n); - - /// <summary> - /// Maps passed in key to a key which will be used for node affinity. - /// </summary> - /// <param name="key">Key to map.</param> - /// <returns>Key to be used for node-to-affinity mapping (may be the same key as passed in).</returns> - TR GetAffinityKey<TK, TR>(TK key); - - /// <summary> - /// This method provides ability to detect which keys are mapped to which nodes. - /// Use it to determine which nodes are storing which keys prior to sending - /// jobs that access these keys. - /// </summary> - /// <param name="keys">Keys to map to nodes.</param> - /// <returns>Map of nodes to keys or empty map if there are no alive nodes for this cache.</returns> - IDictionary<IClusterNode, IList<TK>> MapKeysToNodes<TK>(IList<TK> keys); - - /// <summary> - /// This method provides ability to detect to which primary node the given key - /// is mapped. Use it to determine which nodes are storing which keys prior to sending - /// jobs that access these keys. - /// </summary> - /// <param name="key">Keys to map to a node.</param> - /// <returns>Primary node for the key or null if there are no alive nodes for this cache.</returns> - IClusterNode MapKeyToNode<TK>(TK key); - - /// <summary> - /// Gets primary and backup nodes for the key. Note that primary node is always - /// first in the returned collection. - /// </summary> - /// <param name="key"></param> - /// <returns></returns> - IList<IClusterNode> MapKeyToPrimaryAndBackups<TK>(TK key); - - /// <summary> - /// Gets primary node for the given partition. - /// </summary> - /// <param name="part">Partition id.</param> - /// <returns>Primary node for the given partition.</returns> - IClusterNode MapPartitionToNode(int part); - - /// <summary> - /// Gets primary nodes for the given partitions. - /// </summary> - /// <param name="parts">Partition ids.</param> - /// <returns>Mapping of given partitions to their primary nodes.</returns> - IDictionary<int, IClusterNode> MapPartitionsToNodes(IList<int> parts); - - /// <summary> - /// Gets primary and backup nodes for partition. Note that primary node is always - /// first in the returned collection. - /// </summary> - /// <param name="part">Partition to get affinity nodes for.</param> - /// <returns>Collection of primary and backup nodes for partition with primary node always first</returns> - IList<IClusterNode> MapPartitionToPrimaryAndBackups(int part); - } -}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntry.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntry.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntry.cs deleted file mode 100644 index 49ebfec..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntry.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache -{ - /// <summary> - /// Cache entry interface. - /// </summary> - /// <typeparam name="TK">Key type.</typeparam> - /// <typeparam name="TV">Value type.</typeparam> - public interface ICacheEntry<out TK, out TV> - { - /// <summary> - /// Gets the key. - /// </summary> - TK Key { get; } - - /// <summary> - /// Gets the value. - /// </summary> - TV Value { get; } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryFilter.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryFilter.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryFilter.cs deleted file mode 100644 index 9c7ee88..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryFilter.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache -{ - /// <summary> - /// Cache entry predicate. - /// </summary> - /// <typeparam name="TK">Key type.</typeparam> - /// <typeparam name="TV">Value type.</typeparam> - public interface ICacheEntryFilter<in TK, in TV> - { - /// <summary> - /// Returns a value indicating whether provided cache entry satisfies this predicate. - /// </summary> - /// <param name="entry">Cache entry.</param> - /// <returns>Value indicating whether provided cache entry satisfies this predicate.</returns> - bool Invoke(ICacheEntry<TK, TV> entry); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryProcessor.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryProcessor.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryProcessor.cs deleted file mode 100644 index c8614c0..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryProcessor.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache -{ - /// <summary> - /// An invocable function that allows applications to perform compound operations - /// on a cache entry atomically, according the defined consistency of a cache. - /// <para /> - /// Any cache entry mutations will not take effect until after - /// the <see cref="Process" /> method has completedS execution. - /// <para /> - /// If an exception is thrown by an entry processor, a Caching Implementation - /// must wrap any exception thrown wrapped in an <see cref="CacheEntryProcessorException" /> - /// If this occurs no mutations will be made to the cache entry. - /// </summary> - /// <typeparam name="TK">Key type.</typeparam> - /// <typeparam name="TV">Value type.</typeparam> - /// <typeparam name="TA">The type of the processor argument.</typeparam> - /// <typeparam name="TR">The type of the processor result.</typeparam> - public interface ICacheEntryProcessor<in TK, TV, in TA, out TR> - { - /// <summary> - /// Process an entry. - /// </summary> - /// <param name="entry">The entry to process.</param> - /// <param name="arg">The argument.</param> - /// <returns>Processing result.</returns> - TR Process(IMutableCacheEntry<TK, TV> entry, TA arg); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryProcessorResult.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryProcessorResult.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryProcessorResult.cs deleted file mode 100644 index 2d0f709..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheEntryProcessorResult.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache -{ - /// <summary> - /// Represents a result of processing <see cref="ICacheEntry{K, V}"/> - /// by <see cref="ICacheEntryProcessor{K, V, A, R}"/>. - /// </summary> - /// <typeparam name="T">Processor result type.</typeparam> - public interface ICacheEntryProcessorResult<out T> - { - /// <summary> - /// Gets the result of processing an entry. - /// <para /> - /// If an exception was thrown during the processing of an entry, - /// either by the <see cref="ICacheEntryProcessor{K, V, A, R}"/> itself - /// or by the Caching implementation, the exceptions will be wrapped and re-thrown as a - /// <see cref="CacheEntryProcessorException"/> when calling this property. - /// </summary> - /// <value> - /// The result. - /// </value> - T Result { get; } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheLock.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheLock.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheLock.cs deleted file mode 100644 index a930961..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheLock.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache -{ - using System; - using System.Threading; - - /// <summary> - /// Cache locking interface. - /// <para/> - /// All members are thread-safe and may be used concurrently from multiple threads. - /// </summary> - public interface ICacheLock : IDisposable - { - /// <summary> - /// Acquires an exclusive lock. - /// </summary> - void Enter(); - - /// <summary> - /// Acquires an exclusive lock only if it is free at the time of invocation. - /// </summary> - /// <returns>True if the current thread acquires the lock; otherwise, false.</returns> - bool TryEnter(); - - /// <summary> - /// Attempts, for the specified amount of time, to acquire an exclusive lock. - /// </summary> - /// <param name="timeout"> - /// A <see cref="TimeSpan" /> representing the amount of time to wait for the lock. - /// A value of â1 millisecond specifies an infinite wait. - /// </param> - /// <returns>True if the current thread acquires the lock; otherwise, false.</returns> - bool TryEnter(TimeSpan timeout); - - /// <summary> - /// Releases an exclusive lock on the specified object. - /// <see cref="IDisposable.Dispose"/> does not call this method and will throw - /// <see cref="SynchronizationLockException"/> if this lock is acquired. - /// </summary> - void Exit(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs deleted file mode 100644 index 3405625..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs +++ /dev/null @@ -1,486 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache -{ - /// <summary> - /// Cache metrics used to obtain statistics on cache itself. - /// </summary> - public interface ICacheMetrics - { - /// <summary> - /// The number of get requests that were satisfied by the cache. - /// </summary> - /// <returns> - /// The number of hits - /// </returns> - long CacheHits { get; } - - /// <summary> - /// This is a measure of cache efficiency. - /// </summary> - /// <returns> - /// The percentage of successful hits, as a decimal e.g 75. - /// </returns> - float CacheHitPercentage { get; } - - /// <summary> - /// A miss is a get request that is not satisfied. - /// </summary> - /// <returns> - /// The number of misses - /// </returns> - long CacheMisses { get; } - - /// <summary> - /// Returns the percentage of cache accesses that did not find a requested entry in the cache. - /// </summary> - /// <returns> - /// The percentage of accesses that failed to find anything. - /// </returns> - float CacheMissPercentage { get; } - - /// <summary> - /// The total number of requests to the cache. This will be equal to the sum of the hits and misses. - /// </summary> - /// <returns> - /// The number of gets. - /// </returns> - long CacheGets { get; } - - /// <summary> - /// The total number of puts to the cache. - /// </summary> - /// <returns> - /// The number of puts. - /// </returns> - long CachePuts { get; } - - /// <summary> - /// The total number of removals from the cache. This does not include evictions, where the cache itself - /// initiates the removal to make space. - /// </summary> - /// <returns> - /// The number of removals. - /// </returns> - long CacheRemovals { get; } - - /// <summary> - /// The total number of evictions from the cache. An eviction is a removal initiated by the cache itself - /// to free up space. An eviction is not treated as a removal and does not appear in the removal counts. - /// </summary> - /// <returns> - /// The number of evictions. - /// </returns> - long CacheEvictions { get; } - - /// <summary> - /// The mean time to execute gets. - /// </summary> - /// <returns> - /// The time in �s. - /// </returns> - float AverageGetTime { get; } - - /// <summary> - /// The mean time to execute puts. - /// </summary> - /// <returns> - /// The time in �s. - /// </returns> - float AveragePutTime { get; } - - /// <summary> - /// The mean time to execute removes. - /// </summary> - /// <returns> - /// The time in �s. - /// </returns> - float AverageRemoveTime { get; } - - /// <summary> - /// The mean time to execute tx commit. - /// </summary> - /// <returns> - /// The time in �s. - /// </returns> - float AverageTxCommitTime { get; } - - /// <summary> - /// The mean time to execute tx rollbacks. - /// </summary> - /// <returns> - /// Number of transaction rollbacks. - /// </returns> - float AverageTxRollbackTime { get; } - - /// <summary> - /// Gets total number of transaction commits. - /// </summary> - /// <returns> - /// Number of transaction commits. - /// </returns> - long CacheTxCommits { get; } - - /// <summary> - /// Gets total number of transaction rollbacks. - /// </summary> - /// <returns> - /// Number of transaction rollbacks. - /// </returns> - long CacheTxRollbacks { get; } - - /// <summary> - /// Gets cache name. - /// </summary> - /// <returns> - /// Cache name. - /// </returns> - string CacheName { get; } - - /// <summary> - /// Gets number of entries that was swapped to disk. - /// </summary> - /// <returns> - /// Number of entries that was swapped to disk. - /// </returns> - long OverflowSize { get; } - - /// <summary> - /// Gets number of entries stored in off-heap memory. - /// </summary> - /// <returns> - /// Number of entries stored in off-heap memory. - /// </returns> - long OffHeapEntriesCount { get; } - - /// <summary> - /// Gets memory size allocated in off-heap. - /// </summary> - /// <returns> - /// Memory size allocated in off-heap. - /// </returns> - long OffHeapAllocatedSize { get; } - - /// <summary> - /// Gets number of non-null values in the cache. - /// </summary> - /// <returns> - /// Number of non-null values in the cache. - /// </returns> - int Size { get; } - - /// <summary> - /// Gets number of keys in the cache, possibly with null values. - /// </summary> - /// <returns> - /// Number of keys in the cache. - /// </returns> - int KeySize { get; } - - /// <summary> - /// Returns true if this cache is empty. - /// </summary> - /// <returns> - /// True if this cache is empty. - /// </returns> - bool IsEmpty { get; } - - /// <summary> - /// Gets current size of evict queue used to batch up evictions. - /// </summary> - /// <returns> - /// Current size of evict queue. - /// </returns> - int DhtEvictQueueCurrentSize { get; } - - /// <summary> - /// Gets transaction per-thread map size. - /// </summary> - /// <returns> - /// Thread map size. - /// </returns> - int TxThreadMapSize { get; } - - /// <summary> - /// Gets transaction per-Xid map size. - /// </summary> - /// <returns> - /// Transaction per-Xid map size. - /// </returns> - int TxXidMapSize { get; } - - /// <summary> - /// Gets committed transaction queue size. - /// </summary> - /// <returns> - /// Committed transaction queue size. - /// </returns> - int TxCommitQueueSize { get; } - - /// <summary> - /// Gets prepared transaction queue size. - /// </summary> - /// <returns> - /// Prepared transaction queue size. - /// </returns> - int TxPrepareQueueSize { get; } - - /// <summary> - /// Gets start version counts map size. - /// </summary> - /// <returns> - /// Start version counts map size. - /// </returns> - int TxStartVersionCountsSize { get; } - - /// <summary> - /// Gets number of cached committed transaction IDs. - /// </summary> - /// <returns> - /// Number of cached committed transaction IDs. - /// </returns> - int TxCommittedVersionsSize { get; } - - /// <summary> - /// Gets number of cached rolled back transaction IDs. - /// </summary> - /// <returns> - /// Number of cached rolled back transaction IDs. - /// </returns> - int TxRolledbackVersionsSize { get; } - - /// <summary> - /// Gets transaction DHT per-thread map size. - /// </summary> - /// <returns> - /// DHT thread map size. - /// </returns> - int TxDhtThreadMapSize { get; } - - /// <summary> - /// Gets transaction DHT per-Xid map size. - /// </summary> - /// <returns> - /// Transaction DHT per-Xid map size. - /// </returns> - int TxDhtXidMapSize { get; } - - /// <summary> - /// Gets committed DHT transaction queue size. - /// </summary> - /// <returns> - /// Committed DHT transaction queue size. - /// </returns> - int TxDhtCommitQueueSize { get; } - - /// <summary> - /// Gets prepared DHT transaction queue size. - /// </summary> - /// <returns> - /// Prepared DHT transaction queue size. - /// </returns> - int TxDhtPrepareQueueSize { get; } - - /// <summary> - /// Gets DHT start version counts map size. - /// </summary> - /// <returns> - /// DHT start version counts map size. - /// </returns> - int TxDhtStartVersionCountsSize { get; } - - /// <summary> - /// Gets number of cached committed DHT transaction IDs. - /// </summary> - /// <returns> - /// Number of cached committed DHT transaction IDs. - /// </returns> - int TxDhtCommittedVersionsSize { get; } - - /// <summary> - /// Gets number of cached rolled back DHT transaction IDs. - /// </summary> - /// <returns> - /// Number of cached rolled back DHT transaction IDs. - /// </returns> - int TxDhtRolledbackVersionsSize { get; } - - /// <summary> - /// Returns true if write-behind is enabled. - /// </summary> - /// <returns> - /// True if write-behind is enabled. - /// </returns> - bool IsWriteBehindEnabled { get; } - - /// <summary> - /// Gets the maximum size of the write-behind buffer. When the count of unique keys in write buffer exceeds - /// this value, the buffer is scheduled for write to the underlying store. - /// <para /> - /// If this value is 0, then flush is performed only on time-elapsing basis. - /// </summary> - /// <returns> - /// Buffer size that triggers flush procedure. - /// </returns> - int WriteBehindFlushSize { get; } - - /// <summary> - /// Gets the number of flush threads that will perform store update operations. - /// </summary> - /// <returns> - /// Count of worker threads. - /// </returns> - int WriteBehindFlushThreadCount { get; } - - /// <summary> - /// Gets the cache flush frequency. All pending operations on the underlying store will be performed - /// within time interval not less then this value. - /// <para /> If this value is 0, then flush is performed only when buffer size exceeds flush size. - /// </summary> - /// <returns> - /// Flush frequency in milliseconds. - /// </returns> - long WriteBehindFlushFrequency { get; } - - /// <summary> - /// Gets the maximum count of similar (put or remove) operations that can be grouped to a single batch. - /// </summary> - /// <returns> - /// Maximum size of batch. - /// </returns> - int WriteBehindStoreBatchSize { get; } - - /// <summary> - /// Gets count of write buffer overflow events since initialization. - /// Each overflow event causes the ongoing flush operation to be performed synchronously. - /// </summary> - /// <returns> - /// Count of cache overflow events since start. - /// </returns> - int WriteBehindTotalCriticalOverflowCount { get; } - - /// <summary> - /// Gets count of write buffer overflow events in progress at the moment. - /// Each overflow event causes the ongoing flush operation to be performed synchronously. - /// </summary> - /// <returns> - /// Count of cache overflow events since start. - /// </returns> - int WriteBehindCriticalOverflowCount { get; } - - /// <summary> - /// Gets count of cache entries that are in a store-retry state. - /// An entry is assigned a store-retry state when underlying store failed due some reason - /// and cache has enough space to retain this entry till the next try. - /// </summary> - /// <returns> - /// Count of entries in store-retry state. - /// </returns> - int WriteBehindErrorRetryCount { get; } - - /// <summary> - /// Gets count of entries that were processed by the write-behind store - /// and have not been flushed to the underlying store yet. - /// </summary> - /// <returns> - /// Total count of entries in cache store internal buffer. - /// </returns> - int WriteBehindBufferSize { get; } - - /// <summary> - /// Determines the required type of keys for this cache, if any. - /// </summary> - /// <returns> - /// The fully qualified class name of the key type, or "java.lang.Object" if the type is undefined. - /// </returns> - string KeyType { get; } - - /// <summary> - /// Determines the required type of values for this cache, if any. - /// </summary> - /// <returns> - /// The fully qualified class name of the value type, or "java.lang.Object" if the type is undefined. - /// </returns> - string ValueType { get; } - - /// <summary> - /// Whether storeByValue true or storeByReference false. When true, both keys and values are stored by value. - /// <para /> - /// When false, both keys and values are stored by reference. Caches stored by reference are capable of - /// mutation by any threads holding the reference. - /// The effects are: - /// - if the key is mutated, then the key may not be retrievable or removable - /// - if the value is mutated, then all threads in the JVM can potentially observe those mutations, subject - /// to the normal Java Memory Model rules. - /// Storage by reference only applies to the local heap. - /// If an entry is moved off heap it will need to be transformed into a representation. - /// Any mutations that occur after transformation may not be reflected in the cache. - /// <para /> - /// When a cache is storeByValue, any mutation to the key or value does not affect the key of value - /// stored in the cache. - /// <para /> - /// The default value is true. - /// </summary> - /// <returns> - /// True if the cache is store by value - /// </returns> - bool IsStoreByValue { get; } - - /// <summary> - /// Checks whether statistics collection is enabled in this cache. - /// <para /> - /// The default value is false. - /// </summary> - /// <returns> - /// True if statistics collection is enabled - /// </returns> - bool IsStatisticsEnabled { get; } - - /// <summary> - /// Checks whether management is enabled on this cache. - /// <para /> - /// The default value is false. - /// </summary> - /// <returns> - /// True if management is enabled - /// </returns> - bool IsManagementEnabled { get; } - - /// <summary> - /// Determines if a cache should operate in read-through mode. - /// <para /> - /// The default value is false - /// </summary> - /// <returns> - /// True when a cache is in "read-through" mode. - /// </returns> - bool IsReadThrough { get; } - - /// <summary> - /// Determines if a cache should operate in "write-through" mode. - /// <para /> - /// Will appropriately cause the configured CacheWriter to be invoked. - /// <para /> - /// The default value is false - /// </summary> - /// <returns> - /// True when a cache is in "write-through" mode. - /// </returns> - bool IsWriteThrough { get; } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/IMutableCacheEntry.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/IMutableCacheEntry.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/IMutableCacheEntry.cs deleted file mode 100644 index ae71be6..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/IMutableCacheEntry.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache -{ - /// <summary> - /// Mutable representation of <see cref="ICacheEntry{K, V}"/> - /// </summary> - /// <typeparam name="TK">Key type.</typeparam> - /// <typeparam name="TV">Value type.</typeparam> - public interface IMutableCacheEntry<out TK, TV> : ICacheEntry<TK, TV> - { - /// <summary> - /// Gets a value indicating whether cache entry exists in cache. - /// </summary> - bool Exists { get; } - - /// <summary> - /// Removes the entry from the Cache. - /// </summary> - void Remove(); - - /// <summary> - /// Gets, sets or replaces the value associated with the key. - /// <para /> - /// If <see cref="Exists"/> is false and setter is called then a mapping is added to the cache - /// visible once the EntryProcessor completes. - /// <para /> - /// After setter invocation <see cref="Exists"/> will return true. - /// </summary> - new TV Value { get; set; } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs deleted file mode 100644 index 8f297a2..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Query.Continuous -{ - using System; - using System.Diagnostics.CodeAnalysis; - using Apache.Ignite.Core.Cache.Event; - - /// <summary> - /// API for configuring continuous cache queries. - /// <para /> - /// Continuous queries allow to register a remote and a listener for cache update events. - /// If an update event passes the filter, it will be sent to the node that executed the - /// query and listener will be notified on that node. - /// <para /> - /// Continuous query can either be executed on the whole topology or only on local node. - /// <para /> - /// In case query is distributed and a new node joins, it will get the filter for the query - /// during discovery process before it actually joins topology, so no updates will be missed. - /// <para /> - /// To execute the query use method - /// <see cref="ICache{K,V}.QueryContinuous(ContinuousQuery{K,V})"/>. - /// </summary> - public class ContinuousQuery<TK, TV> - { - /// <summary> - /// Default buffer size. - /// </summary> - [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] - public const int DfltBufSize = 1; - - /// <summary> - /// Default time interval. - /// </summary> - [SuppressMessage("ReSharper", "StaticMemberInGenericType")] - [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] - public static readonly TimeSpan DfltTimeInterval = new TimeSpan(0); - - /// <summary> - /// Default auto-unsubscribe flag value. - /// </summary> - [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] - public const bool DfltAutoUnsubscribe = true; - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="lsnr">Listener.</param> - public ContinuousQuery(ICacheEntryEventListener<TK, TV> lsnr) : this(lsnr, false) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="lsnr">Listener.</param> - /// <param name="loc">Whether query should be executed locally.</param> - public ContinuousQuery(ICacheEntryEventListener<TK, TV> lsnr, bool loc) : this(lsnr, null, loc) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="lsnr">Listener.</param> - /// <param name="filter">Filter.</param> - public ContinuousQuery(ICacheEntryEventListener<TK, TV> lsnr, ICacheEntryEventFilter<TK, TV> filter) - : this(lsnr, filter, false) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="lsnr">Listener.</param> - /// <param name="filter">Filter.</param> - /// <param name="loc">Whether query should be executed locally.</param> - public ContinuousQuery(ICacheEntryEventListener<TK, TV> lsnr, ICacheEntryEventFilter<TK, TV> filter, bool loc) - { - Listener = lsnr; - Filter = filter; - Local = loc; - - BufferSize = DfltBufSize; - TimeInterval = DfltTimeInterval; - AutoUnsubscribe = DfltAutoUnsubscribe; - } - - /// <summary> - /// Cache entry event listener. Invoked on the node where continuous query execution - /// has been started. - /// </summary> - public ICacheEntryEventListener<TK, TV> Listener { get; set; } - - /// <summary> - /// Optional cache entry filter. Invoked on a node where cache event occurred. If filter - /// returns <c>false</c>, then cache entry event will not be sent to a node where - /// continuous query has been started. - /// <para /> - /// Must be either portable or serializable in case query is not local. - /// </summary> - public ICacheEntryEventFilter<TK, TV> Filter { get; set; } - - /// <summary> - /// Buffer size. When a cache update happens, entry is first put into a buffer. - /// Entries from buffer will be sent to the master node only if the buffer is - /// full or time provided via <see cref="TimeInterval"/> is exceeded. - /// <para /> - /// Defaults to <see cref="DfltBufSize"/> - /// </summary> - public int BufferSize { get; set; } - - /// <summary> - /// Time interval. When a cache update happens, entry is first put into a buffer. - /// Entries from buffer will be sent to the master node only if the buffer is full - /// (its size can be provided via <see cref="BufferSize"/> property) or time provided - /// via this method is exceeded. - /// <para /> - /// Defaults to <c>0</c> which means that time check is disabled and entries will be - /// sent only when buffer is full. - /// </summary> - public TimeSpan TimeInterval { get; set; } - - /// <summary> - /// Automatic unsubscribe flag. This flag indicates that query filters on remote nodes - /// should be automatically unregistered if master node (node that initiated the query) - /// leaves topology. If this flag is <c>false</c>, filters will be unregistered only - /// when the query is cancelled from master node, and won't ever be unregistered if - /// master node leaves grid. - /// <para /> - /// Defaults to <c>true</c>. - /// </summary> - public bool AutoUnsubscribe { get; set; } - - /// <summary> - /// Local flag. When set query will be executed only on local node, so only local - /// entries will be returned as query result. - /// <para /> - /// Defaults to <c>false</c>. - /// </summary> - public bool Local { get; set; } - - /// <summary> - /// Validate continuous query state. - /// </summary> - internal void Validate() - { - if (Listener == null) - throw new ArgumentException("Listener cannot be null."); - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs deleted file mode 100644 index 03f8e05..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/IContinuousQueryHandle.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Query.Continuous -{ - using System; - using System.Diagnostics.CodeAnalysis; - - /// <summary> - /// Represents a continuous query handle. - /// </summary> - [SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces")] - public interface IContinuousQueryHandle : IDisposable - { - // No-op. - } - - /// <summary> - /// Represents a continuous query handle. - /// </summary> - /// <typeparam name="T">Type of the initial query cursor.</typeparam> - public interface IContinuousQueryHandle<T> : IContinuousQueryHandle - { - /// <summary> - /// Gets the cursor for initial query. - /// Can be called only once, throws exception on consequent calls. - /// </summary> - /// <returns>Initial query cursor.</returns> - IQueryCursor<T> GetInitialQueryCursor(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs deleted file mode 100644 index 9745765..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/IQueryCursor.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Query -{ - using System; - using System.Collections.Generic; - - /// <summary> - /// Query result cursor. Can be processed either in iterative mode, or by taking - /// all entries using <see cref="IQueryCursor{T}.GetAll()"/> method. - /// <para /> - /// Note that you get enumerator or call <code>GetAll()</code> method only once during - /// cursor lifetime. Any further attempts to get enumerator or all entries will result - /// in exception. - /// </summary> - public interface IQueryCursor<T> : IEnumerable<T>, IDisposable - { - /// <summary> - /// Gets all query results. Use this method when you know in advance that query - /// result is relatively small and will not cause memory utilization issues. - /// </summary> - /// <returns>List containing all query results.</returns> - IList<T> GetAll(); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs deleted file mode 100644 index 3cb9e58..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Query -{ - using Apache.Ignite.Core.Impl.Cache; - using Apache.Ignite.Core.Impl.Portable; - - /// <summary> - /// Base class for all Ignite cache entry queries. - /// </summary> - public abstract class QueryBase - { - /** Default page size. */ - public const int DfltPageSize = 1024; - - /// <summary> - /// Initializes a new instance of the <see cref="QueryBase"/> class. - /// </summary> - protected internal QueryBase() - { - PageSize = DfltPageSize; - } - - /// <summary> - /// Local flag. When set query will be executed only on local node, so only local - /// entries will be returned as query result. - /// <para /> - /// Defaults to <c>false</c>. - /// </summary> - public bool Local { get; set; } - - /// <summary> - /// Optional page size. If set to <code>0</code>, then <code>CacheQueryConfiguration.pageSize</code> is used. - /// </summary> - public int PageSize { get; set; } - - /// <summary> - /// Writes this instance to a stream created with a specified delegate. - /// </summary> - /// <param name="writer">Writer.</param> - /// <param name="keepPortable">Keep portable flag.</param> - internal abstract void Write(PortableWriterImpl writer, bool keepPortable); - - /// <summary> - /// Gets the interop opcode. - /// </summary> - internal abstract CacheOp OpId { get; } - - /// <summary> - /// Write query arguments. - /// </summary> - /// <param name="writer">Writer.</param> - /// <param name="args">Arguments.</param> - internal static void WriteQueryArgs(PortableWriterImpl writer, object[] args) - { - if (args == null) - writer.WriteInt(0); - else - { - writer.WriteInt(args.Length); - - foreach (var arg in args) - writer.WriteObject(arg); - } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs deleted file mode 100644 index 44f8486..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Query -{ - using Apache.Ignite.Core.Impl.Cache; - using Apache.Ignite.Core.Impl.Portable; - - /// <summary> - /// Scan query over cache entries. Will accept all the entries if no predicate was set. - /// </summary> - public class ScanQuery<TK, TV> : QueryBase - { - /// <summary> - /// Initializes a new instance of the <see cref="ScanQuery{K, V}"/> class. - /// </summary> - /// <param name="filter">The filter.</param> - public ScanQuery(ICacheEntryFilter<TK, TV> filter = null) - { - Filter = filter; - } - - /// <summary> - /// Gets or sets the predicate. - /// </summary> - public ICacheEntryFilter<TK, TV> Filter { get; set; } - - /// <summary> - /// Gets or sets partition number over which this query should iterate. If null, query will iterate - /// over all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache. - /// </summary> - public int? Partition { get; set; } - - /** <inheritDoc /> */ - internal override void Write(PortableWriterImpl writer, bool keepPortable) - { - writer.WriteBoolean(Local); - writer.WriteInt(PageSize); - - writer.WriteBoolean(Partition.HasValue); - - if (Partition.HasValue) - writer.WriteInt(Partition.Value); - - if (Filter == null) - writer.WriteObject<CacheEntryFilterHolder>(null); - else - { - var holder = new CacheEntryFilterHolder(Filter, (key, val) => Filter.Invoke( - new CacheEntry<TK, TV>((TK) key, (TV) val)), writer.Marshaller, keepPortable); - - writer.WriteObject(holder); - writer.WriteLong(holder.Handle); - } - } - - /** <inheritDoc /> */ - internal override CacheOp OpId - { - get { return CacheOp.QryScan; } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs deleted file mode 100644 index c0d58ca..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Query -{ - using System.Diagnostics.CodeAnalysis; - - /// <summary> - /// SQL fields query. - /// </summary> - public class SqlFieldsQuery - { - /** Default page size. */ - public const int DfltPageSize = 1024; - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="sql">SQL.</param> - /// <param name="args">Arguments.</param> - public SqlFieldsQuery(string sql, params object[] args) : this(sql, false, args) - { - // No-op. - } - - /// <summary> - /// Constructor, - /// </summary> - /// <param name="sql">SQL.</param> - /// <param name="loc">Whether query should be executed locally.</param> - /// <param name="args">Arguments.</param> - public SqlFieldsQuery(string sql, bool loc, params object[] args) - { - Sql = sql; - Local = loc; - Arguments = args; - - PageSize = DfltPageSize; - } - - /// <summary> - /// SQL. - /// </summary> - public string Sql { get; set; } - - /// <summary> - /// Arguments. - /// </summary> - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public object[] Arguments { get; set; } - - /// <summary> - /// Local flag. When set query will be executed only on local node, so only local - /// entries will be returned as query result. - /// <para /> - /// Defaults to <c>false</c>. - /// </summary> - public bool Local { get; set; } - - /// <summary> - /// Optional page size. - /// <para /> - /// Defautls to <see cref="DfltPageSize"/>. - /// </summary> - public int PageSize { get; set; } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs deleted file mode 100644 index 303048b..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Query -{ - using System; - using System.Diagnostics.CodeAnalysis; - using Apache.Ignite.Core.Impl.Cache; - using Apache.Ignite.Core.Impl.Portable; - - /// <summary> - /// SQL Query. - /// </summary> - public class SqlQuery : QueryBase - { - /// <summary> - /// Constructor. - /// </summary> - /// <param name="typ">Type.</param> - /// <param name="sql">SQL.</param> - /// <param name="args">Arguments.</param> - public SqlQuery(Type typ, string sql, params object[] args) : this(typ, sql, false, args) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="typ">Type.</param> - /// <param name="sql">SQL.</param> - /// <param name="loc">Whether query should be executed locally.</param> - /// <param name="args">Arguments.</param> - public SqlQuery(Type typ, string sql, bool loc, params object[] args) : this(typ.Name, sql, loc, args) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="typ">Type.</param> - /// <param name="sql">SQL.</param> - /// <param name="args">Arguments.</param> - public SqlQuery(string typ, string sql, params object[] args) : this(typ, sql, false, args) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="typ">Type.</param> - /// <param name="sql">SQL.</param> - /// <param name="loc">Whether query should be executed locally.</param> - /// <param name="args">Arguments.</param> - public SqlQuery(string typ, string sql, bool loc, params object[] args) - { - Type = typ; - Sql = sql; - Local = loc; - Arguments = args; - } - - /// <summary> - /// Type. - /// </summary> - public string Type { get; set; } - - /// <summary> - /// SQL. - /// </summary> - public string Sql { get; set; } - - /// <summary> - /// Arguments. - /// </summary> - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - public object[] Arguments { get; set; } - - /** <inheritDoc /> */ - internal override void Write(PortableWriterImpl writer, bool keepPortable) - { - if (string.IsNullOrEmpty(Sql)) - throw new ArgumentException("Sql cannot be null or empty"); - - if (string.IsNullOrEmpty(Type)) - throw new ArgumentException("Type cannot be null or empty"); - - // 2. Prepare. - writer.WriteBoolean(Local); - writer.WriteString(Sql); - writer.WriteString(Type); - writer.WriteInt(PageSize); - - WriteQueryArgs(writer, Arguments); - } - - /** <inheritDoc /> */ - internal override CacheOp OpId - { - get { return CacheOp.QrySql; } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs deleted file mode 100644 index 835271b..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Query -{ - using System; - using Apache.Ignite.Core.Impl.Cache; - using Apache.Ignite.Core.Impl.Portable; - - /// <summary> - /// Text query. - /// </summary> - public class TextQuery : QueryBase - { - /// <summary> - /// Constructor. - /// </summary> - /// <param name="typ">Type.</param> - /// <param name="txt">Text.</param> - public TextQuery(Type typ, string txt) : this(typ, txt, false) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="typ">Type.</param> - /// <param name="txt">Text.</param> - /// <param name="loc">Whether query should be executed locally.</param> - public TextQuery(Type typ, string txt, bool loc) : this(typ.Name, txt, loc) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="typ">Type.</param> - /// <param name="txt">Text.</param> - public TextQuery(string typ, string txt) : this(typ, txt, false) - { - // No-op. - } - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="typ">Type.</param> - /// <param name="txt">Text.</param> - /// <param name="loc">Whether query should be executed locally.</param> - public TextQuery(string typ, string txt, bool loc) - { - Type = typ; - Text = txt; - Local = loc; - } - - /// <summary> - /// Type. - /// </summary> - public string Type { get; set; } - - /// <summary> - /// Text. - /// </summary> - public string Text { get; set; } - - /** <inheritDoc /> */ - internal override void Write(PortableWriterImpl writer, bool keepPortable) - { - if (string.IsNullOrEmpty(Text)) - throw new ArgumentException("Text cannot be null or empty"); - - if (string.IsNullOrEmpty(Type)) - throw new ArgumentException("Type cannot be null or empty"); - - writer.WriteBoolean(Local); - writer.WriteString(Text); - writer.WriteString(Type); - writer.WriteInt(PageSize); - } - - /** <inheritDoc /> */ - internal override CacheOp OpId - { - get { return CacheOp.QryTxt; } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs deleted file mode 100644 index cf4a77d..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheParallelLoadStoreAdapter.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Store -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - - /// <summary> - /// Cache storage adapter with parallel loading in LoadAll method. - /// </summary> - /// <remarks> - /// LoadCache calls GetInputData() and iterates over it in parallel. - /// GetInputData().GetEnumerator() result will be disposed if it implements IDisposable. - /// Any additional post-LoadCache steps can be performed by overriding LoadCache method. - /// </remarks> - public abstract class CacheParallelLoadStoreAdapter : ICacheStore - { - /// <summary> - /// Default number of working threads (equal to the number of available processors). - /// </summary> - public static readonly int DefaultThreadsCount = Environment.ProcessorCount; - - /// <summary> - /// Constructor. - /// </summary> - protected CacheParallelLoadStoreAdapter() - { - MaxDegreeOfParallelism = DefaultThreadsCount; - } - - /// <summary> - /// Loads all values from underlying persistent storage. Note that keys are - /// not passed, so it is up to implementation to figure out what to load. - /// This method is called whenever <see cref="ICache{K,V}.LocalLoadCache" /> - /// method is invoked which is usually to preload the cache from persistent storage. - /// <para /> - /// This method is optional, and cache implementation - /// does not depend on this method to do anything. - /// <para /> - /// For every loaded value method provided action should be called. - /// The action will then make sure that the loaded value is stored in cache. - /// </summary> - /// <param name="act">Action for loaded values.</param> - /// <param name="args">Optional arguemnts passed to <see cref="ICache{K,V}.LocalLoadCache" /> method.</param> - /// <exception cref="CacheStoreException" /> - public virtual void LoadCache(Action<object, object> act, params object[] args) - { - if (MaxDegreeOfParallelism == 0 || MaxDegreeOfParallelism < -1) - throw new ArgumentOutOfRangeException("MaxDegreeOfParallelism must be either positive or -1: " + - MaxDegreeOfParallelism); - - var options = new ParallelOptions {MaxDegreeOfParallelism = MaxDegreeOfParallelism}; - - Parallel.ForEach(GetInputData().OfType<object>(), options, item => - { - var cacheEntry = Parse(item, args); - - if (cacheEntry != null) - act(cacheEntry.Value.Key, cacheEntry.Value.Value); - }); - } - - /// <summary> - /// Gets the input data sequence to be used in LoadCache. - /// </summary> - protected abstract IEnumerable GetInputData(); - - /// <summary> - /// This method should transform raw data records from GetInputData - /// into valid key-value pairs to be stored into cache. - /// </summary> - protected abstract KeyValuePair<object, object>? Parse(object inputRecord, params object[] args); - - /// <summary> - /// Gets or sets the maximum degree of parallelism to use in LoadCache. - /// Must be either positive or -1 for unlimited amount of threads. - /// <para /> - /// Defaults to <see cref="DefaultThreadsCount"/>. - /// </summary> - public int MaxDegreeOfParallelism { get; set; } - - /// <summary> - /// Loads an object. Application developers should implement this method to customize the loading - /// of a value for a cache entry. - /// This method is called by a cache when a requested entry is not in the cache. - /// If the object can't be loaded <code>null</code> should be returned. - /// </summary> - /// <param name="key">The key identifying the object being loaded.</param> - /// <returns> - /// The value for the entry that is to be stored in the cache - /// or <code>null</code> if the object can't be loaded - /// </returns> - public virtual object Load(object key) - { - return null; - } - - /// <summary> - /// Loads multiple objects. Application developers should implement this method to customize - /// the loading of cache entries. This method is called when the requested object is not in the cache. - /// If an object can't be loaded, it is not returned in the resulting map. - /// </summary> - /// <param name="keys">Keys identifying the values to be loaded.</param> - /// <returns> - /// A map of key, values to be stored in the cache. - /// </returns> - public virtual IDictionary LoadAll(ICollection keys) - { - return null; - } - - /// <summary> - /// Write the specified value under the specified key to the external resource. - /// <para /> - /// This method is intended to support both key/value creation and value update. - /// </summary> - /// <param name="key">Key to write.</param> - /// <param name="val">Value to write.</param> - public virtual void Write(object key, object val) - { - // No-op. - } - - /// <summary> - /// Write the specified entries to the external resource. - /// This method is intended to support both insert and update. - /// <para /> - /// The order that individual writes occur is undefined. - /// <para /> - /// If this operation fails (by throwing an exception) after a partial success, - /// the writer must remove any successfully written entries from the entries collection - /// so that the caching implementation knows what succeeded and can mutate the cache. - /// </summary> - /// <param name="entries">a mutable collection to write. Upon invocation, it contains the entries - /// to write for write-through. Upon return the collection must only contain entries - /// that were not successfully written. (see partial success above).</param> - public virtual void WriteAll(IDictionary entries) - { - // No-op. - } - - /// <summary> - /// Delete the cache entry from the external resource. - /// <para /> - /// Expiry of a cache entry is not a delete hence will not cause this method to be invoked. - /// <para /> - /// This method is invoked even if no mapping for the key exists. - /// </summary> - /// <param name="key">The key that is used for the delete operation.</param> - public virtual void Delete(object key) - { - // No-op. - } - - /// <summary> - /// Remove data and keys from the external resource for the given collection of keys, if present. - /// <para /> - /// The order that individual deletes occur is undefined. - /// <para /> - /// If this operation fails (by throwing an exception) after a partial success, - /// the writer must remove any successfully written entries from the entries collection - /// so that the caching implementation knows what succeeded and can mutate the cache. - /// <para /> - /// Expiry of a cache entry is not a delete hence will not cause this method to be invoked. - /// <para /> - /// This method may include keys even if there is no mapping for that key, - /// in which case the data represented by that key should be removed from the underlying resource. - /// </summary> - /// <param name="keys">a mutable collection of keys for entries to delete. Upon invocation, - /// it contains the keys to delete for write-through. Upon return the collection must only contain - /// the keys that were not successfully deleted.</param> - public virtual void DeleteAll(ICollection keys) - { - // No-op. - } - - /// <summary> - /// Tells store to commit or rollback a transaction depending on the value of the - /// <c>commit</c> parameter. - /// </summary> - /// <param name="commit"><c>True</c> if transaction should commit, <c>false</c> for rollback.</param> - public virtual void SessionEnd(bool commit) - { - // No-op. - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs deleted file mode 100644 index 1930d0c..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Store -{ - using System; - using System.Collections; - using System.Linq; - - /// <summary> - /// Cache storage convenience adapter. It provides default implementation for - /// bulk operations, such as <code>LoadAll</code>, <code>PutAll</code> and - /// <code>RemoveAll</code> by sequentially calling corresponding <code>Load</code>, - /// <code>Put</code> and <code>Remove</code> operations. Use this adapter whenever - /// such behaviour is acceptable. However in many cases it maybe more preferable - /// to take advantage of database batch update functionality, and therefore default - /// adapter implementation may not be the best option. - /// <para/> - /// Note that <code>LoadCache</code> method has empty implementation because it is - /// essentially up to the user to invoke it with specific arguments. - /// </summary> - public abstract class CacheStoreAdapter : ICacheStore - { - /// <summary> - /// Loads all values from underlying persistent storage. Note that keys are - /// not passed, so it is up to implementation to figure out what to load. - /// This method is called whenever <see cref="ICache{K,V}.LocalLoadCache" /> - /// method is invoked which is usually to preload the cache from persistent storage. - /// <para /> - /// This method is optional, and cache implementation - /// does not depend on this method to do anything. - /// <para /> - /// For every loaded value method provided action should be called. - /// The action will then make sure that the loaded value is stored in cache. - /// </summary> - /// <param name="act">Action for loaded values.</param> - /// <param name="args">Optional arguemnts passed to <see cref="ICache{K,V}.LocalLoadCache" /> method.</param> - public virtual void LoadCache(Action<object, object> act, params object[] args) - { - // No-op. - } - - /// <summary> - /// Loads multiple objects. Application developers should implement this method to customize - /// the loading of cache entries. This method is called when the requested object is not in the cache. - /// If an object can't be loaded, it is not returned in the resulting map. - /// </summary> - /// <param name="keys">Keys identifying the values to be loaded.</param> - /// <returns> - /// A map of key, values to be stored in the cache. - /// </returns> - public virtual IDictionary LoadAll(ICollection keys) - { - return keys.OfType<object>().ToDictionary(key => key, Load); - } - - /// <summary> - /// Writes all. - /// </summary> - /// <param name="entries">The map.</param> - public virtual void WriteAll(IDictionary entries) - { - foreach (DictionaryEntry entry in entries) - Write(entry.Key, entry.Value); - } - - /// <summary> - /// Remove data and keys from the external resource for the given collection of keys, if present. - /// <para /> - /// The order that individual deletes occur is undefined. - /// <para /> - /// If this operation fails (by throwing an exception) after a partial success, - /// the writer must remove any successfully written entries from the entries collection - /// so that the caching implementation knows what succeeded and can mutate the cache. - /// <para /> - /// Expiry of a cache entry is not a delete hence will not cause this method to be invoked. - /// <para /> - /// This method may include keys even if there is no mapping for that key, - /// in which case the data represented by that key should be removed from the underlying resource. - /// </summary> - /// <param name="keys">a mutable collection of keys for entries to delete. Upon invocation, - /// it contains the keys to delete for write-through. Upon return the collection must only contain - /// the keys that were not successfully deleted.</param> - public virtual void DeleteAll(ICollection keys) - { - foreach (object key in keys) - Delete(key); - } - - /// <summary> - /// Tells store to commit or rollback a transaction depending on the value of the - /// <c>commit</c> parameter. - /// </summary> - /// <param name="commit"><c>True</c> if transaction should commit, <c>false</c> for rollback.</param> - public virtual void SessionEnd(bool commit) - { - // No-op. - } - - /// <summary> - /// Loads an object. Application developers should implement this method to customize the loading - /// of a value for a cache entry. - /// This method is called by a cache when a requested entry is not in the cache. - /// If the object can't be loaded <code>null</code> should be returned. - /// </summary> - /// <param name="key">The key identifying the object being loaded.</param> - /// <returns> - /// The value for the entry that is to be stored in the cache - /// or <code>null</code> if the object can't be loaded - /// </returns> - public abstract object Load(object key); - - /// <summary> - /// Write the specified value under the specified key to the external resource. - /// <para /> - /// This method is intended to support both key/value creation and value update. - /// </summary> - /// <param name="key">Key to write.</param> - /// <param name="val">Value to write.</param> - public abstract void Write(object key, object val); - - /// <summary> - /// Delete the cache entry from the external resource. - /// <para /> - /// Expiry of a cache entry is not a delete hence will not cause this method to be invoked. - /// <para /> - /// This method is invoked even if no mapping for the key exists. - /// </summary> - /// <param name="key">The key that is used for the delete operation.</param> - public abstract void Delete(object key); - } -}
