Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D0E310B8A for ; Tue, 8 Dec 2015 13:17:40 +0000 (UTC) Received: (qmail 39970 invoked by uid 500); 8 Dec 2015 13:17:40 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 39882 invoked by uid 500); 8 Dec 2015 13:17:40 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 39855 invoked by uid 99); 8 Dec 2015 13:17:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2015 13:17:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AB4A1E0593; Tue, 8 Dec 2015 13:17:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Tue, 08 Dec 2015 13:17:40 -0000 Message-Id: In-Reply-To: <7c679115a90344ab8575d1ea8b819b76@git.apache.org> References: <7c679115a90344ab8575d1ea8b819b76@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/19] ignite git commit: wip wip Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e4290506 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e4290506 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e4290506 Branch: refs/heads/ignite-1694 Commit: e4290506e38a0e47077fb6aa7af6a0744340ec5c Parents: 7966a36 Author: Pavel Tupitsyn Authored: Wed Nov 11 17:49:10 2015 +0300 Committer: Pavel Tupitsyn Committed: Wed Nov 11 17:49:10 2015 +0300 ---------------------------------------------------------------------- .../Impl/Unmanaged/UnmanagedUtils.cs | 655 +++---------------- 1 file changed, 108 insertions(+), 547 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/e4290506/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs index 63ba30a..f0b3f4c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs @@ -19,10 +19,8 @@ namespace Apache.Ignite.Core.Impl.Unmanaged { using System; using System.Diagnostics.CodeAnalysis; - using System.Globalization; using System.Runtime.InteropServices; using Apache.Ignite.Core.Common; - using Apache.Ignite.Core.Impl.Common; /// /// Unmanaged utility classes. @@ -32,409 +30,119 @@ namespace Apache.Ignite.Core.Impl.Unmanaged /** Interop factory ID for .Net. */ private const int InteropFactoryId = 1; - #region PROCEDURE NAMES - - private const string ProcReallocate = "IgniteReallocate"; - - private const string ProcIgnitionStart = "IgniteIgnitionStart"; - private const string ProcIgnitionStop = "IgniteIgnitionStop"; - private const string ProcIgnitionStopAll = "IgniteIgnitionStopAll"; - - private const string ProcProcessorReleaseStart = "IgniteProcessorReleaseStart"; - private const string ProcProcessorProjection = "IgniteProcessorProjection"; - private const string ProcProcessorCache = "IgniteProcessorCache"; - private const string ProcProcessorGetOrCreateCache = "IgniteProcessorGetOrCreateCache"; - private const string ProcProcessorCreateCache = "IgniteProcessorCreateCache"; - private const string ProcProcessorAffinity = "IgniteProcessorAffinity"; - private const string ProcProcessorDataStreamer = "IgniteProcessorDataStreamer"; - private const string ProcProcessorTransactions = "IgniteProcessorTransactions"; - private const string ProcProcessorCompute = "IgniteProcessorCompute"; - private const string ProcProcessorMessage = "IgniteProcessorMessage"; - private const string ProcProcessorEvents = "IgniteProcessorEvents"; - private const string ProcProcessorServices = "IgniteProcessorServices"; - private const string ProcProcessorExtensions = "IgniteProcessorExtensions"; - private const string ProcProcessorAtomicLong = "IgniteProcessorAtomicLong"; - - private const string ProcTargetInStreamOutLong = "IgniteTargetInStreamOutLong"; - private const string ProcTargetInStreamOutStream = "IgniteTargetInStreamOutStream"; - private const string ProcTargetInStreamOutObject = "IgniteTargetInStreamOutObject"; - private const string ProcTargetInObjectStreamOutStream = "IgniteTargetInObjectStreamOutStream"; - private const string ProcTargetOutLong = "IgniteTargetOutLong"; - private const string ProcTargetOutStream = "IgniteTargetOutStream"; - private const string ProcTargetOutObject = "IgniteTargetOutObject"; - private const string ProcTargetListenFut = "IgniteTargetListenFuture"; - private const string ProcTargetListenFutForOp = "IgniteTargetListenFutureForOperation"; - - private const string ProcAffinityParts = "IgniteAffinityPartitions"; - - private const string ProcCacheWithSkipStore = "IgniteCacheWithSkipStore"; - private const string ProcCacheWithNoRetries = "IgniteCacheWithNoRetries"; - private const string ProcCacheWithExpiryPolicy = "IgniteCacheWithExpiryPolicy"; - private const string ProcCacheWithAsync = "IgniteCacheWithAsync"; - private const string ProcCacheWithKeepBinary = "IgniteCacheWithKeepPortable"; - private const string ProcCacheClear = "IgniteCacheClear"; - private const string ProcCacheRemoveAll = "IgniteCacheRemoveAll"; - private const string ProcCacheOutOpQueryCursor = "IgniteCacheOutOpQueryCursor"; - private const string ProcCacheOutOpContinuousQuery = "IgniteCacheOutOpContinuousQuery"; - private const string ProcCacheIterator = "IgniteCacheIterator"; - private const string ProcCacheLocalIterator = "IgniteCacheLocalIterator"; - private const string ProcCacheEnterLock = "IgniteCacheEnterLock"; - private const string ProcCacheExitLock = "IgniteCacheExitLock"; - private const string ProcCacheTryEnterLock = "IgniteCacheTryEnterLock"; - private const string ProcCacheCloseLock = "IgniteCacheCloseLock"; - private const string ProcCacheRebalance = "IgniteCacheRebalance"; - private const string ProcCacheSize = "IgniteCacheSize"; - - private const string ProcCacheStoreCallbackInvoke = "IgniteCacheStoreCallbackInvoke"; - - private const string ProcComputeWithNoFailover = "IgniteComputeWithNoFailover"; - private const string ProcComputeWithTimeout = "IgniteComputeWithTimeout"; - private const string ProcComputeExecuteNative = "IgniteComputeExecuteNative"; - - private const string ProcContinuousQryClose = "IgniteContinuousQueryClose"; - private const string ProcContinuousQryGetInitialQueryCursor = "IgniteContinuousQueryGetInitialQueryCursor"; - - private const string ProcDataStreamerListenTop = "IgniteDataStreamerListenTopology"; - private const string ProcDataStreamerAllowOverwriteGet = "IgniteDataStreamerAllowOverwriteGet"; - private const string ProcDataStreamerAllowOverwriteSet = "IgniteDataStreamerAllowOverwriteSet"; - private const string ProcDataStreamerSkipStoreGet = "IgniteDataStreamerSkipStoreGet"; - private const string ProcDataStreamerSkipStoreSet = "IgniteDataStreamerSkipStoreSet"; - private const string ProcDataStreamerPerNodeBufferSizeGet = "IgniteDataStreamerPerNodeBufferSizeGet"; - private const string ProcDataStreamerPerNodeBufferSizeSet = "IgniteDataStreamerPerNodeBufferSizeSet"; - private const string ProcDataStreamerPerNodeParallelOpsGet = "IgniteDataStreamerPerNodeParallelOperationsGet"; - private const string ProcDataStreamerPerNodeParallelOpsSet = "IgniteDataStreamerPerNodeParallelOperationsSet"; - - private const string ProcMessagingWithAsync = "IgniteMessagingWithAsync"; - - private const string ProcQryCursorIterator = "IgniteQueryCursorIterator"; - private const string ProcQryCursorClose = "IgniteQueryCursorClose"; - - private const string ProcProjectionForOthers = "IgniteProjectionForOthers"; - private const string ProcProjectionForRemotes = "IgniteProjectionForRemotes"; - private const string ProcProjectionForDaemons = "IgniteProjectionForDaemons"; - private const string ProcProjectionForRandom = "IgniteProjectionForRandom"; - private const string ProcProjectionForOldest = "IgniteProjectionForOldest"; - private const string ProcProjectionForYoungest = "IgniteProjectionForYoungest"; - private const string ProcProjectionResetMetrics = "IgniteProjectionResetMetrics"; - private const string ProcProjectionOutOpRet = "IgniteProjectionOutOpRet"; - - private const string ProcAcquire = "IgniteAcquire"; - private const string ProcRelease = "IgniteRelease"; - - private const string ProcTxStart = "IgniteTransactionsStart"; - private const string ProcTxCommit = "IgniteTransactionsCommit"; - private const string ProcTxCommitAsync = "IgniteTransactionsCommitAsync"; - private const string ProcTxRollback = "IgniteTransactionsRollback"; - private const string ProcTxRollbackAsync = "IgniteTransactionsRollbackAsync"; - private const string ProcTxClose = "IgniteTransactionsClose"; - private const string ProcTxState = "IgniteTransactionsState"; - private const string ProcTxSetRollbackOnly = "IgniteTransactionsSetRollbackOnly"; - private const string ProcTxResetMetrics = "IgniteTransactionsResetMetrics"; - - private const string ProcThrowToJava = "IgniteThrowToJava"; - - private const string ProcDestroyJvm = "IgniteDestroyJvm"; - - private const string ProcHandlersSize = "IgniteHandlersSize"; - - private const string ProcCreateContext = "IgniteCreateContext"; - - private const string ProcEventsWithAsync = "IgniteEventsWithAsync"; - private const string ProcEventsStopLocalListen = "IgniteEventsStopLocalListen"; - private const string ProcEventsLocalListen = "IgniteEventsLocalListen"; - private const string ProcEventsIsEnabled = "IgniteEventsIsEnabled"; - - private const string ProcDeleteContext = "IgniteDeleteContext"; - - private const string ProcServicesWithAsync = "IgniteServicesWithAsync"; - private const string ProcServicesWithServerKeepBinary = "IgniteServicesWithServerKeepPortable"; - private const string ProcServicesCancel = "IgniteServicesCancel"; - private const string ProcServicesCancelAll = "IgniteServicesCancelAll"; - private const string ProcServicesGetServiceProxy = "IgniteServicesGetServiceProxy"; - - private const string ProcAtomicLongGet = "IgniteAtomicLongGet"; - private const string ProcAtomicLongIncrementAndGet = "IgniteAtomicLongIncrementAndGet"; - private const string ProcAtomicLongAddAndGet = "IgniteAtomicLongAddAndGet"; - private const string ProcAtomicLongDecrementAndGet = "IgniteAtomicLongDecrementAndGet"; - private const string ProcAtomicLongGetAndSet = "IgniteAtomicLongGetAndSet"; - private const string ProcAtomicLongCompareAndSetAndGet = "IgniteAtomicLongCompareAndSetAndGet"; - private const string ProcAtomicLongIsClosed = "IgniteAtomicLongIsClosed"; - private const string ProcAtomicLongClose = "IgniteAtomicLongClose"; - - #endregion - - #region DELEGATE DEFINITIONS - - private delegate int ReallocateDelegate(long memPtr, int cap); - - private delegate void* IgnitionStartDelegate(void* ctx, sbyte* cfgPath, sbyte* gridName, int factoryId, long dataPtr); - private delegate bool IgnitionStopDelegate(void* ctx, sbyte* gridName, bool cancel); - private delegate void IgnitionStopAllDelegate(void* ctx, bool cancel); - - private delegate void ProcessorReleaseStartDelegate(void* ctx, void* obj); - private delegate void* ProcessorProjectionDelegate(void* ctx, void* obj); - private delegate void* ProcessorCacheDelegate(void* ctx, void* obj, sbyte* name); - private delegate void* ProcessorCreateCacheDelegate(void* ctx, void* obj, sbyte* name); - private delegate void* ProcessorGetOrCreateCacheDelegate(void* ctx, void* obj, sbyte* name); - private delegate void* ProcessorAffinityDelegate(void* ctx, void* obj, sbyte* name); - private delegate void* ProcessorDataStreamerDelegate(void* ctx, void* obj, sbyte* name, bool keepBinary); - private delegate void* ProcessorTransactionsDelegate(void* ctx, void* obj); - private delegate void* ProcessorComputeDelegate(void* ctx, void* obj, void* prj); - private delegate void* ProcessorMessageDelegate(void* ctx, void* obj, void* prj); - private delegate void* ProcessorEventsDelegate(void* ctx, void* obj, void* prj); - private delegate void* ProcessorServicesDelegate(void* ctx, void* obj, void* prj); - private delegate void* ProcessorExtensionsDelegate(void* ctx, void* obj); - private delegate void* ProcessorAtomicLongDelegate(void* ctx, void* obj, sbyte* name, long initVal, bool create); - - private delegate long TargetInStreamOutLongDelegate(void* ctx, void* target, int opType, long memPtr); - private delegate void TargetInStreamOutStreamDelegate(void* ctx, void* target, int opType, long inMemPtr, long outMemPtr); - private delegate void* TargetInStreamOutObjectDelegate(void* ctx, void* target, int opType, long memPtr); - private delegate void TargetInObjectStreamOutStreamDelegate(void* ctx, void* target, int opType, void* arg, long inMemPtr, long outMemPtr); - private delegate long TargetOutLongDelegate(void* ctx, void* target, int opType); - private delegate void TargetOutStreamDelegate(void* ctx, void* target, int opType, long memPtr); - private delegate void* TargetOutObjectDelegate(void* ctx, void* target, int opType); - private delegate void TargetListenFutureDelegate(void* ctx, void* target, long futId, int typ); - private delegate void TargetListenFutureForOpDelegate(void* ctx, void* target, long futId, int typ, int opId); - - private delegate int AffinityPartitionsDelegate(void* ctx, void* target); - - private delegate void* CacheWithSkipStoreDelegate(void* ctx, void* obj); - private delegate void* CacheNoRetriesDelegate(void* ctx, void* obj); - private delegate void* CacheWithExpiryPolicyDelegate(void* ctx, void* obj, long create, long update, long access); - private delegate void* CacheWithAsyncDelegate(void* ctx, void* obj); - private delegate void* CacheWithKeepBinaryDelegate(void* ctx, void* obj); - private delegate void CacheClearDelegate(void* ctx, void* obj); - private delegate void CacheRemoveAllDelegate(void* ctx, void* obj); - private delegate void* CacheOutOpQueryCursorDelegate(void* ctx, void* obj, int type, long memPtr); - private delegate void* CacheOutOpContinuousQueryDelegate(void* ctx, void* obj, int type, long memPtr); - private delegate void* CacheIteratorDelegate(void* ctx, void* obj); - private delegate void* CacheLocalIteratorDelegate(void* ctx, void* obj, int peekModes); - private delegate void CacheEnterLockDelegate(void* ctx, void* obj, long id); - private delegate void CacheExitLockDelegate(void* ctx, void* obj, long id); - private delegate bool CacheTryEnterLockDelegate(void* ctx, void* obj, long id, long timeout); - private delegate void CacheCloseLockDelegate(void* ctx, void* obj, long id); - private delegate void CacheRebalanceDelegate(void* ctx, void* obj, long futId); - private delegate int CacheSizeDelegate(void* ctx, void* obj, int peekModes, bool loc); - - private delegate void CacheStoreCallbackInvokeDelegate(void* ctx, void* obj, long memPtr); - - private delegate void ComputeWithNoFailoverDelegate(void* ctx, void* target); - private delegate void ComputeWithTimeoutDelegate(void* ctx, void* target, long timeout); - private delegate void ComputeExecuteNativeDelegate(void* ctx, void* target, long taskPtr, long topVer); - - private delegate void ContinuousQueryCloseDelegate(void* ctx, void* target); - private delegate void* ContinuousQueryGetInitialQueryCursorDelegate(void* ctx, void* target); - - private delegate void DataStreamerListenTopologyDelegate(void* ctx, void* obj, long ptr); - private delegate bool DataStreamerAllowOverwriteGetDelegate(void* ctx, void* obj); - private delegate void DataStreamerAllowOverwriteSetDelegate(void* ctx, void* obj, bool val); - private delegate bool DataStreamerSkipStoreGetDelegate(void* ctx, void* obj); - private delegate void DataStreamerSkipStoreSetDelegate(void* ctx, void* obj, bool val); - private delegate int DataStreamerPerNodeBufferSizeGetDelegate(void* ctx, void* obj); - private delegate void DataStreamerPerNodeBufferSizeSetDelegate(void* ctx, void* obj, int val); - private delegate int DataStreamerPerNodeParallelOperationsGetDelegate(void* ctx, void* obj); - private delegate void DataStreamerPerNodeParallelOperationsSetDelegate(void* ctx, void* obj, int val); - - private delegate void* MessagingWithAsyncDelegate(void* ctx, void* target); - - private delegate void* ProjectionForOthersDelegate(void* ctx, void* obj, void* prj); - private delegate void* ProjectionForRemotesDelegate(void* ctx, void* obj); - private delegate void* ProjectionForDaemonsDelegate(void* ctx, void* obj); - private delegate void* ProjectionForRandomDelegate(void* ctx, void* obj); - private delegate void* ProjectionForOldestDelegate(void* ctx, void* obj); - private delegate void* ProjectionForYoungestDelegate(void* ctx, void* obj); - private delegate void ProjectionResetMetricsDelegate(void* ctx, void* obj); - private delegate void* ProjectionOutOpRetDelegate(void* ctx, void* obj, int type, long memPtr); - - private delegate void QueryCursorIteratorDelegate(void* ctx, void* target); - private delegate void QueryCursorCloseDelegate(void* ctx, void* target); - - private delegate void* AcquireDelegate(void* ctx, void* target); - private delegate void ReleaseDelegate(void* target); - - private delegate long TransactionsStartDelegate(void* ctx, void* target, int concurrency, int isolation, long timeout, int txSize); - private delegate int TransactionsCommitDelegate(void* ctx, void* target, long id); - private delegate void TransactionsCommitAsyncDelegate(void* ctx, void* target, long id, long futId); - private delegate int TransactionsRollbackDelegate(void* ctx, void* target, long id); - private delegate void TransactionsRollbackAsyncDelegate(void* ctx, void* target, long id, long futId); - private delegate int TransactionsCloseDelegate(void* ctx, void* target, long id); - private delegate int TransactionsStateDelegate(void* ctx, void* target, long id); - private delegate bool TransactionsSetRollbackOnlyDelegate(void* ctx, void* target, long id); - private delegate void TransactionsResetMetricsDelegate(void* ctx, void* target); - - private delegate void ThrowToJavaDelegate(void* ctx, char* msg); - - private delegate void DestroyJvmDelegate(void* ctx); - - private delegate int HandlersSizeDelegate(); - - private delegate void* CreateContextDelegate(void* opts, int optsLen, void* cbs); - - private delegate void* EventsWithAsyncDelegate(void* ctx, void* obj); - private delegate bool EventsStopLocalListenDelegate(void* ctx, void* obj, long hnd); - private delegate void EventsLocalListenDelegate(void* ctx, void* obj, long hnd, int type); - private delegate bool EventsIsEnabledDelegate(void* ctx, void* obj, int type); - - private delegate void DeleteContextDelegate(void* ptr); - - private delegate void* ServicesWithAsyncDelegate(void* ctx, void* target); - private delegate void* ServicesWithServerKeepBinaryDelegate(void* ctx, void* target); - private delegate long ServicesCancelDelegate(void* ctx, void* target, char* name); - private delegate long ServicesCancelAllDelegate(void* ctx, void* target); - private delegate void* ServicesGetServiceProxyDelegate(void* ctx, void* target, char* name, bool sticky); - - private delegate long AtomicLongGetDelegate(void* ctx, void* target); - private delegate long AtomicLongIncrementAndGetDelegate(void* ctx, void* target); - private delegate long AtomicLongAddAndGetDelegate(void* ctx, void* target, long value); - private delegate long AtomicLongDecrementAndGetDelegate(void* ctx, void* target); - private delegate long AtomicLongGetAndSetDelegate(void* ctx, void* target, long value); - private delegate long AtomicLongCompareAndSetAndGetDelegate(void* ctx, void* target, long expVal, long newVal); - private delegate bool AtomicLongIsClosedDelegate(void* ctx, void* target); - private delegate void AtomicLongCloseDelegate(void* ctx, void* target); - - #endregion - #region DELEGATE MEMBERS // ReSharper disable InconsistentNaming - private static readonly ReallocateDelegate REALLOCATE; - - private static readonly IgnitionStartDelegate IGNITION_START; - private static readonly IgnitionStopDelegate IGNITION_STOP; - private static readonly IgnitionStopAllDelegate IGNITION_STOP_ALL; - - private static readonly ProcessorReleaseStartDelegate PROCESSOR_RELEASE_START; - private static readonly ProcessorProjectionDelegate PROCESSOR_PROJECTION; - private static readonly ProcessorCacheDelegate PROCESSOR_CACHE; - private static readonly ProcessorCreateCacheDelegate PROCESSOR_CREATE_CACHE; - private static readonly ProcessorGetOrCreateCacheDelegate PROCESSOR_GET_OR_CREATE_CACHE; - private static readonly ProcessorAffinityDelegate PROCESSOR_AFFINITY; - private static readonly ProcessorDataStreamerDelegate PROCESSOR_DATA_STREAMER; - private static readonly ProcessorTransactionsDelegate PROCESSOR_TRANSACTIONS; - private static readonly ProcessorComputeDelegate PROCESSOR_COMPUTE; - - [DllImport(IgniteUtils.FileIgniteJniDll, EntryPoint = "IgniteProcessorCompute")] - private static extern void* PROCESSOR_COMPUTE2(void* ctx, void* obj, void* prj); - - private static readonly ProcessorMessageDelegate PROCESSOR_MESSAGE; - private static readonly ProcessorEventsDelegate PROCESSOR_EVENTS; - private static readonly ProcessorServicesDelegate PROCESSOR_SERVICES; - private static readonly ProcessorExtensionsDelegate PROCESSOR_EXTENSIONS; - private static readonly ProcessorAtomicLongDelegate PROCESSOR_ATOMIC_LONG; - - private static readonly TargetInStreamOutLongDelegate TARGET_IN_STREAM_OUT_LONG; - private static readonly TargetInStreamOutStreamDelegate TARGET_IN_STREAM_OUT_STREAM; - private static readonly TargetInStreamOutObjectDelegate TARGET_IN_STREAM_OUT_OBJECT; - private static readonly TargetInObjectStreamOutStreamDelegate TARGET_IN_OBJECT_STREAM_OUT_STREAM; - private static readonly TargetOutLongDelegate TARGET_OUT_LONG; - private static readonly TargetOutStreamDelegate TARGET_OUT_STREAM; - private static readonly TargetOutObjectDelegate TARGET_OUT_OBJECT; - private static readonly TargetListenFutureDelegate TargetListenFut; - private static readonly TargetListenFutureForOpDelegate TargetListenFutForOp; - - private static readonly AffinityPartitionsDelegate AffinityParts; - - private static readonly CacheWithSkipStoreDelegate CACHE_WITH_SKIP_STORE; - private static readonly CacheNoRetriesDelegate CACHE_WITH_NO_RETRIES; - private static readonly CacheWithExpiryPolicyDelegate CACHE_WITH_EXPIRY_POLICY; - private static readonly CacheWithAsyncDelegate CACHE_WITH_ASYNC; - private static readonly CacheWithKeepBinaryDelegate CACHE_WITH_KEEP_BINARY; - private static readonly CacheClearDelegate CACHE_CLEAR; - private static readonly CacheRemoveAllDelegate CACHE_REMOVE_ALL; - private static readonly CacheOutOpQueryCursorDelegate CACHE_OUT_OP_QUERY_CURSOR; - private static readonly CacheOutOpContinuousQueryDelegate CACHE_OUT_OP_CONTINUOUS_QUERY; - private static readonly CacheIteratorDelegate CACHE_ITERATOR; - private static readonly CacheLocalIteratorDelegate CACHE_LOCAL_ITERATOR; - private static readonly CacheEnterLockDelegate CACHE_ENTER_LOCK; - private static readonly CacheExitLockDelegate CACHE_EXIT_LOCK; - private static readonly CacheTryEnterLockDelegate CACHE_TRY_ENTER_LOCK; - private static readonly CacheCloseLockDelegate CACHE_CLOSE_LOCK; - private static readonly CacheRebalanceDelegate CACHE_REBALANCE; - private static readonly CacheSizeDelegate CACHE_SIZE; - - private static readonly CacheStoreCallbackInvokeDelegate CACHE_STORE_CALLBACK_INVOKE; - - private static readonly ComputeWithNoFailoverDelegate COMPUTE_WITH_NO_FAILOVER; - private static readonly ComputeWithTimeoutDelegate COMPUTE_WITH_TIMEOUT; - private static readonly ComputeExecuteNativeDelegate COMPUTE_EXECUTE_NATIVE; - - private static readonly ContinuousQueryCloseDelegate ContinuousQryClose; - private static readonly ContinuousQueryGetInitialQueryCursorDelegate ContinuousQryGetInitialQueryCursor; - - private static readonly DataStreamerListenTopologyDelegate DataStreamerListenTop; - private static readonly DataStreamerAllowOverwriteGetDelegate DATA_STREAMER_ALLOW_OVERWRITE_GET; - private static readonly DataStreamerAllowOverwriteSetDelegate DATA_STREAMER_ALLOW_OVERWRITE_SET; - private static readonly DataStreamerSkipStoreGetDelegate DATA_STREAMER_SKIP_STORE_GET; - private static readonly DataStreamerSkipStoreSetDelegate DATA_STREAMER_SKIP_STORE_SET; - private static readonly DataStreamerPerNodeBufferSizeGetDelegate DATA_STREAMER_PER_NODE_BUFFER_SIZE_GET; - private static readonly DataStreamerPerNodeBufferSizeSetDelegate DATA_STREAMER_PER_NODE_BUFFER_SIZE_SET; - private static readonly DataStreamerPerNodeParallelOperationsGetDelegate DataStreamerPerNodeParallelOpsGet; - private static readonly DataStreamerPerNodeParallelOperationsSetDelegate DataStreamerPerNodeParallelOpsSet; - - private static readonly MessagingWithAsyncDelegate MessagingWithAsync; - - private static readonly ProjectionForOthersDelegate PROJECTION_FOR_OTHERS; - private static readonly ProjectionForRemotesDelegate PROJECTION_FOR_REMOTES; - private static readonly ProjectionForDaemonsDelegate PROJECTION_FOR_DAEMONS; - private static readonly ProjectionForRandomDelegate PROJECTION_FOR_RANDOM; - private static readonly ProjectionForOldestDelegate PROJECTION_FOR_OLDEST; - private static readonly ProjectionForYoungestDelegate PROJECTION_FOR_YOUNGEST; - private static readonly ProjectionResetMetricsDelegate PROJECTION_RESET_METRICS; - private static readonly ProjectionOutOpRetDelegate PROJECTION_OUT_OP_RET; - - private static readonly QueryCursorIteratorDelegate QryCursorIterator; - private static readonly QueryCursorCloseDelegate QryCursorClose; - - private static readonly AcquireDelegate ACQUIRE; - private static readonly ReleaseDelegate RELEASE; - - private static readonly TransactionsStartDelegate TxStart; - private static readonly TransactionsCommitDelegate TxCommit; - private static readonly TransactionsCommitAsyncDelegate TxCommitAsync; - private static readonly TransactionsRollbackDelegate TxRollback; - private static readonly TransactionsRollbackAsyncDelegate TxRollbackAsync; - private static readonly TransactionsCloseDelegate TxClose; - private static readonly TransactionsStateDelegate TxState; - private static readonly TransactionsSetRollbackOnlyDelegate TxSetRollbackOnly; - private static readonly TransactionsResetMetricsDelegate TxResetMetrics; - - private static readonly ThrowToJavaDelegate THROW_TO_JAVA; - - private static readonly DestroyJvmDelegate DESTROY_JVM; - - private static readonly HandlersSizeDelegate HANDLERS_SIZE; - - private static readonly CreateContextDelegate CREATE_CONTEXT; - - private static readonly EventsWithAsyncDelegate EVENTS_WITH_ASYNC; - private static readonly EventsStopLocalListenDelegate EVENTS_STOP_LOCAL_LISTEN; - private static readonly EventsLocalListenDelegate EVENTS_LOCAL_LISTEN; - private static readonly EventsIsEnabledDelegate EVENTS_IS_ENABLED; - - private static readonly DeleteContextDelegate DELETE_CONTEXT; - - private static readonly ServicesWithAsyncDelegate SERVICES_WITH_ASYNC; - private static readonly ServicesWithServerKeepBinaryDelegate SERVICES_WITH_SERVER_KEEP_BINARY; - private static readonly ServicesCancelDelegate SERVICES_CANCEL; - private static readonly ServicesCancelAllDelegate SERVICES_CANCEL_ALL; - private static readonly ServicesGetServiceProxyDelegate SERVICES_GET_SERVICE_PROXY; - - private static readonly AtomicLongGetDelegate ATOMIC_LONG_GET; - private static readonly AtomicLongIncrementAndGetDelegate ATOMIC_LONG_INCREMENT_AND_GET; - private static readonly AtomicLongAddAndGetDelegate ATOMIC_LONG_ADD_AND_GET; - private static readonly AtomicLongDecrementAndGetDelegate ATOMIC_LONG_DECREMENT_AND_GET; - private static readonly AtomicLongGetAndSetDelegate ATOMIC_LONG_GET_AND_SET; - private static readonly AtomicLongCompareAndSetAndGetDelegate ATOMIC_LONG_COMPARE_AND_SET_AND_GET; - private static readonly AtomicLongIsClosedDelegate ATOMIC_LONG_IS_CLOSED; - private static readonly AtomicLongCloseDelegate ATOMIC_LONG_CLOSE; + + private static extern int REALLOCATE(long memPtr, int cap); + private static extern void* IGNITION_START(void* ctx, sbyte* cfgPath, sbyte* gridName, int factoryId, long dataPtr); + private static extern bool IGNITION_STOP(void* ctx, sbyte* gridName, bool cancel); + private static extern void IGNITION_STOP_ALL(void* ctx, bool cancel); + private static extern void PROCESSOR_RELEASE_START(void* ctx, void* obj); + private static extern void* PROCESSOR_PROJECTION(void* ctx, void* obj); + private static extern void* PROCESSOR_CACHE(void* ctx, void* obj, sbyte* name); + private static extern void* PROCESSOR_CREATE_CACHE(void* ctx, void* obj, sbyte* name); + private static extern void* PROCESSOR_GET_OR_CREATE_CACHE(void* ctx, void* obj, sbyte* name); + private static extern void* PROCESSOR_AFFINITY(void* ctx, void* obj, sbyte* name); + private static extern void* PROCESSOR_DATA_STREAMER(void* ctx, void* obj, sbyte* name, bool keepBinary); + private static extern void* PROCESSOR_TRANSACTIONS(void* ctx, void* obj); + private static extern void* PROCESSOR_COMPUTE(void* ctx, void* obj, void* prj); + private static extern void* PROCESSOR_MESSAGE(void* ctx, void* obj, void* prj); + private static extern void* PROCESSOR_EVENTS(void* ctx, void* obj, void* prj); + private static extern void* PROCESSOR_SERVICES(void* ctx, void* obj, void* prj); + private static extern void* PROCESSOR_EXTENSIONS(void* ctx, void* obj); + private static extern void* PROCESSOR_ATOMIC_LONG(void* ctx, void* obj, sbyte* name, long initVal, bool create); + private static extern long TARGET_IN_STREAM_OUT_LONG(void* ctx, void* target, int opType, long memPtr); + private static extern void TARGET_IN_STREAM_OUT_STREAM(void* ctx, void* target, int opType, long inMemPtr, long outMemPtr); + private static extern void* TARGET_IN_STREAM_OUT_OBJECT(void* ctx, void* target, int opType, long memPtr); + private static extern void TARGET_IN_OBJECT_STREAM_OUT_STREAM(void* ctx, void* target, int opType, void* arg, long inMemPtr, long outMemPtr); + private static extern long TARGET_OUT_LONG(void* ctx, void* target, int opType); + private static extern void TARGET_OUT_STREAM(void* ctx, void* target, int opType, long memPtr); + private static extern void* TARGET_OUT_OBJECT(void* ctx, void* target, int opType); + private static extern void TargetListenFut(void* ctx, void* target, long futId, int typ); + private static extern void TargetListenFutForOp(void* ctx, void* target, long futId, int typ, int opId); + private static extern int AffinityParts(void* ctx, void* target); + private static extern void* CACHE_WITH_SKIP_STORE(void* ctx, void* obj); + private static extern void* CACHE_WITH_NO_RETRIES(void* ctx, void* obj); + private static extern void* CACHE_WITH_EXPIRY_POLICY(void* ctx, void* obj, long create, long update, long access); + private static extern void* CACHE_WITH_ASYNC(void* ctx, void* obj); + private static extern void* CACHE_WITH_KEEP_BINARY(void* ctx, void* obj); + private static extern void CACHE_CLEAR(void* ctx, void* obj); + private static extern void CACHE_REMOVE_ALL(void* ctx, void* obj); + private static extern void* CACHE_OUT_OP_QUERY_CURSOR(void* ctx, void* obj, int type, long memPtr); + private static extern void* CACHE_OUT_OP_CONTINUOUS_QUERY(void* ctx, void* obj, int type, long memPtr); + private static extern void* CACHE_ITERATOR(void* ctx, void* obj); + private static extern void* CACHE_LOCAL_ITERATOR(void* ctx, void* obj, int peekModes); + private static extern void CACHE_ENTER_LOCK(void* ctx, void* obj, long id); + private static extern void CACHE_EXIT_LOCK(void* ctx, void* obj, long id); + private static extern bool CACHE_TRY_ENTER_LOCK(void* ctx, void* obj, long id, long timeout); + private static extern void CACHE_CLOSE_LOCK(void* ctx, void* obj, long id); + private static extern void CACHE_REBALANCE(void* ctx, void* obj, long futId); + private static extern int CACHE_SIZE(void* ctx, void* obj, int peekModes, bool loc); + private static extern void CACHE_STORE_CALLBACK_INVOKE(void* ctx, void* obj, long memPtr); + private static extern void COMPUTE_WITH_NO_FAILOVER(void* ctx, void* target); + private static extern void COMPUTE_WITH_TIMEOUT(void* ctx, void* target, long timeout); + private static extern void COMPUTE_EXECUTE_NATIVE(void* ctx, void* target, long taskPtr, long topVer); + private static extern void ContinuousQryClose(void* ctx, void* target); + private static extern void* ContinuousQryGetInitialQueryCursor(void* ctx, void* target); + private static extern void DataStreamerListenTop(void* ctx, void* obj, long ptr); + private static extern bool DATA_STREAMER_ALLOW_OVERWRITE_GET(void* ctx, void* obj); + private static extern void DATA_STREAMER_ALLOW_OVERWRITE_SET(void* ctx, void* obj, bool val); + private static extern bool DATA_STREAMER_SKIP_STORE_GET(void* ctx, void* obj); + private static extern void DATA_STREAMER_SKIP_STORE_SET(void* ctx, void* obj, bool val); + private static extern int DATA_STREAMER_PER_NODE_BUFFER_SIZE_GET(void* ctx, void* obj); + private static extern void DATA_STREAMER_PER_NODE_BUFFER_SIZE_SET(void* ctx, void* obj, int val); + private static extern int DataStreamerPerNodeParallelOpsGet(void* ctx, void* obj); + private static extern void DataStreamerPerNodeParallelOpsSet(void* ctx, void* obj, int val); + private static extern void* MessagingWithAsync(void* ctx, void* target); + private static extern void* PROJECTION_FOR_OTHERS(void* ctx, void* obj, void* prj); + private static extern void* PROJECTION_FOR_REMOTES(void* ctx, void* obj); + private static extern void* PROJECTION_FOR_DAEMONS(void* ctx, void* obj); + private static extern void* PROJECTION_FOR_RANDOM(void* ctx, void* obj); + private static extern void* PROJECTION_FOR_OLDEST(void* ctx, void* obj); + private static extern void* PROJECTION_FOR_YOUNGEST(void* ctx, void* obj); + private static extern void PROJECTION_RESET_METRICS(void* ctx, void* obj); + private static extern void* PROJECTION_OUT_OP_RET(void* ctx, void* obj, int type, long memPtr); + private static extern void QryCursorIterator(void* ctx, void* target); + private static extern void QryCursorClose(void* ctx, void* target); + private static extern void* ACQUIRE(void* ctx, void* target); + private static extern void RELEASE(void* target); + private static extern long TxStart(void* ctx, void* target, int concurrency, int isolation, long timeout, int txSize); + private static extern int TxCommit(void* ctx, void* target, long id); + private static extern void TxCommitAsync(void* ctx, void* target, long id, long futId); + private static extern int TxRollback(void* ctx, void* target, long id); + private static extern void TxRollbackAsync(void* ctx, void* target, long id, long futId); + private static extern int TxClose(void* ctx, void* target, long id); + private static extern int TxState(void* ctx, void* target, long id); + private static extern bool TxSetRollbackOnly(void* ctx, void* target, long id); + private static extern void TxResetMetrics(void* ctx, void* target); + private static extern void THROW_TO_JAVA(void* ctx, char* msg); + private static extern int HANDLERS_SIZE(); + private static extern void* CREATE_CONTEXT(void* opts, int optsLen, void* cbs); + private static extern void DELETE_CONTEXT(void* ptr); + private static extern void DESTROY_JVM(void* ctx); + private static extern void* EVENTS_WITH_ASYNC(void* ctx, void* obj); + private static extern bool EVENTS_STOP_LOCAL_LISTEN(void* ctx, void* obj, long hnd); + private static extern void EVENTS_LOCAL_LISTEN(void* ctx, void* obj, long hnd, int type); + private static extern bool EVENTS_IS_ENABLED(void* ctx, void* obj, int type); + private static extern void* SERVICES_WITH_ASYNC(void* ctx, void* target); + private static extern void* SERVICES_WITH_SERVER_KEEP_BINARY(void* ctx, void* target); + private static extern long SERVICES_CANCEL(void* ctx, void* target, char* name); + private static extern long SERVICES_CANCEL_ALL(void* ctx, void* target); + private static extern void* SERVICES_GET_SERVICE_PROXY(void* ctx, void* target, char* name, bool sticky); + private static extern long ATOMIC_LONG_GET(void* ctx, void* target); + private static extern long ATOMIC_LONG_INCREMENT_AND_GET(void* ctx, void* target); + private static extern long ATOMIC_LONG_ADD_AND_GET(void* ctx, void* target, long value); + private static extern long ATOMIC_LONG_DECREMENT_AND_GET(void* ctx, void* target); + private static extern long ATOMIC_LONG_GET_AND_SET(void* ctx, void* target, long value); + private static extern long ATOMIC_LONG_COMPARE_AND_SET_AND_GET(void* ctx, void* target, long expVal, long newVal); + private static extern bool ATOMIC_LONG_IS_CLOSED(void* ctx, void* target); + private static extern void ATOMIC_LONG_CLOSE(void* ctx, void* target); // ReSharper restore InconsistentNaming #endregion - /** Library pointer. */ - private static readonly IntPtr Ptr; - /// /// Initializer. /// @@ -444,136 +152,11 @@ namespace Apache.Ignite.Core.Impl.Unmanaged { var path = IgniteUtils.UnpackEmbeddedResource(IgniteUtils.FileIgniteJniDll); - Ptr = NativeMethods.LoadLibrary(path); + var ptr = NativeMethods.LoadLibrary(path); - if (Ptr == IntPtr.Zero) + if (ptr == IntPtr.Zero) throw new IgniteException("Failed to load " + IgniteUtils.FileIgniteJniDll + ": " + Marshal.GetLastWin32Error()); - REALLOCATE = CreateDelegate(ProcReallocate); - - IGNITION_START = CreateDelegate(ProcIgnitionStart); - IGNITION_STOP = CreateDelegate(ProcIgnitionStop); - IGNITION_STOP_ALL = CreateDelegate(ProcIgnitionStopAll); - - PROCESSOR_RELEASE_START = CreateDelegate(ProcProcessorReleaseStart); - PROCESSOR_PROJECTION = CreateDelegate(ProcProcessorProjection); - PROCESSOR_CACHE = CreateDelegate(ProcProcessorCache); - PROCESSOR_CREATE_CACHE = CreateDelegate(ProcProcessorCreateCache); - PROCESSOR_GET_OR_CREATE_CACHE = CreateDelegate(ProcProcessorGetOrCreateCache); - PROCESSOR_AFFINITY = CreateDelegate(ProcProcessorAffinity); - PROCESSOR_DATA_STREAMER = CreateDelegate(ProcProcessorDataStreamer); - PROCESSOR_TRANSACTIONS = CreateDelegate(ProcProcessorTransactions); - PROCESSOR_COMPUTE = CreateDelegate(ProcProcessorCompute); - PROCESSOR_MESSAGE = CreateDelegate(ProcProcessorMessage); - PROCESSOR_EVENTS = CreateDelegate(ProcProcessorEvents); - PROCESSOR_SERVICES = CreateDelegate(ProcProcessorServices); - PROCESSOR_EXTENSIONS = CreateDelegate(ProcProcessorExtensions); - PROCESSOR_ATOMIC_LONG = CreateDelegate(ProcProcessorAtomicLong); - - TARGET_IN_STREAM_OUT_LONG = CreateDelegate(ProcTargetInStreamOutLong); - TARGET_IN_STREAM_OUT_STREAM = CreateDelegate(ProcTargetInStreamOutStream); - TARGET_IN_STREAM_OUT_OBJECT = CreateDelegate(ProcTargetInStreamOutObject); - TARGET_IN_OBJECT_STREAM_OUT_STREAM = CreateDelegate(ProcTargetInObjectStreamOutStream); - TARGET_OUT_LONG = CreateDelegate(ProcTargetOutLong); - TARGET_OUT_STREAM = CreateDelegate(ProcTargetOutStream); - TARGET_OUT_OBJECT = CreateDelegate(ProcTargetOutObject); - TargetListenFut = CreateDelegate(ProcTargetListenFut); - TargetListenFutForOp = CreateDelegate(ProcTargetListenFutForOp); - - AffinityParts = CreateDelegate(ProcAffinityParts); - - CACHE_WITH_SKIP_STORE = CreateDelegate(ProcCacheWithSkipStore); - CACHE_WITH_NO_RETRIES = CreateDelegate(ProcCacheWithNoRetries); - CACHE_WITH_EXPIRY_POLICY = CreateDelegate(ProcCacheWithExpiryPolicy); - CACHE_WITH_ASYNC = CreateDelegate(ProcCacheWithAsync); - CACHE_WITH_KEEP_BINARY = CreateDelegate(ProcCacheWithKeepBinary); - CACHE_CLEAR = CreateDelegate(ProcCacheClear); - CACHE_REMOVE_ALL = CreateDelegate(ProcCacheRemoveAll); - CACHE_OUT_OP_QUERY_CURSOR = CreateDelegate(ProcCacheOutOpQueryCursor); - CACHE_OUT_OP_CONTINUOUS_QUERY = CreateDelegate(ProcCacheOutOpContinuousQuery); - CACHE_ITERATOR = CreateDelegate(ProcCacheIterator); - CACHE_LOCAL_ITERATOR = CreateDelegate(ProcCacheLocalIterator); - CACHE_ENTER_LOCK = CreateDelegate(ProcCacheEnterLock); - CACHE_EXIT_LOCK = CreateDelegate(ProcCacheExitLock); - CACHE_TRY_ENTER_LOCK = CreateDelegate(ProcCacheTryEnterLock); - CACHE_CLOSE_LOCK = CreateDelegate(ProcCacheCloseLock); - CACHE_REBALANCE = CreateDelegate(ProcCacheRebalance); - CACHE_SIZE = CreateDelegate(ProcCacheSize); - - CACHE_STORE_CALLBACK_INVOKE = CreateDelegate(ProcCacheStoreCallbackInvoke); - - COMPUTE_WITH_NO_FAILOVER = CreateDelegate(ProcComputeWithNoFailover); - COMPUTE_WITH_TIMEOUT = CreateDelegate(ProcComputeWithTimeout); - COMPUTE_EXECUTE_NATIVE = CreateDelegate(ProcComputeExecuteNative); - - ContinuousQryClose = CreateDelegate(ProcContinuousQryClose); - ContinuousQryGetInitialQueryCursor = CreateDelegate(ProcContinuousQryGetInitialQueryCursor); - - DataStreamerListenTop = CreateDelegate(ProcDataStreamerListenTop); - DATA_STREAMER_ALLOW_OVERWRITE_GET = CreateDelegate(ProcDataStreamerAllowOverwriteGet); - DATA_STREAMER_ALLOW_OVERWRITE_SET = CreateDelegate(ProcDataStreamerAllowOverwriteSet); - DATA_STREAMER_SKIP_STORE_GET = CreateDelegate(ProcDataStreamerSkipStoreGet); - DATA_STREAMER_SKIP_STORE_SET = CreateDelegate(ProcDataStreamerSkipStoreSet); - DATA_STREAMER_PER_NODE_BUFFER_SIZE_GET = CreateDelegate(ProcDataStreamerPerNodeBufferSizeGet); - DATA_STREAMER_PER_NODE_BUFFER_SIZE_SET = CreateDelegate(ProcDataStreamerPerNodeBufferSizeSet); - DataStreamerPerNodeParallelOpsGet = CreateDelegate(ProcDataStreamerPerNodeParallelOpsGet); - DataStreamerPerNodeParallelOpsSet = CreateDelegate(ProcDataStreamerPerNodeParallelOpsSet); - - MessagingWithAsync = CreateDelegate(ProcMessagingWithAsync); - - PROJECTION_FOR_OTHERS = CreateDelegate(ProcProjectionForOthers); - PROJECTION_FOR_REMOTES = CreateDelegate(ProcProjectionForRemotes); - PROJECTION_FOR_DAEMONS = CreateDelegate(ProcProjectionForDaemons); - PROJECTION_FOR_RANDOM = CreateDelegate(ProcProjectionForRandom); - PROJECTION_FOR_OLDEST = CreateDelegate(ProcProjectionForOldest); - PROJECTION_FOR_YOUNGEST = CreateDelegate(ProcProjectionForYoungest); - PROJECTION_RESET_METRICS = CreateDelegate(ProcProjectionResetMetrics); - PROJECTION_OUT_OP_RET = CreateDelegate(ProcProjectionOutOpRet); - - QryCursorIterator = CreateDelegate(ProcQryCursorIterator); - QryCursorClose = CreateDelegate(ProcQryCursorClose); - - ACQUIRE = CreateDelegate(ProcAcquire); - RELEASE = CreateDelegate(ProcRelease); - - TxStart = CreateDelegate(ProcTxStart); - TxCommit = CreateDelegate(ProcTxCommit); - TxCommitAsync = CreateDelegate(ProcTxCommitAsync); - TxRollback = CreateDelegate(ProcTxRollback); - TxRollbackAsync = CreateDelegate(ProcTxRollbackAsync); - TxClose = CreateDelegate(ProcTxClose); - TxState = CreateDelegate(ProcTxState); - TxSetRollbackOnly = CreateDelegate(ProcTxSetRollbackOnly); - TxResetMetrics = CreateDelegate(ProcTxResetMetrics); - - THROW_TO_JAVA = CreateDelegate(ProcThrowToJava); - - HANDLERS_SIZE = CreateDelegate(ProcHandlersSize); - - CREATE_CONTEXT = CreateDelegate(ProcCreateContext); - DELETE_CONTEXT = CreateDelegate(ProcDeleteContext); - - DESTROY_JVM = CreateDelegate(ProcDestroyJvm); - - EVENTS_WITH_ASYNC = CreateDelegate(ProcEventsWithAsync); - EVENTS_STOP_LOCAL_LISTEN = CreateDelegate(ProcEventsStopLocalListen); - EVENTS_LOCAL_LISTEN = CreateDelegate(ProcEventsLocalListen); - EVENTS_IS_ENABLED = CreateDelegate(ProcEventsIsEnabled); - - SERVICES_WITH_ASYNC = CreateDelegate(ProcServicesWithAsync); - SERVICES_WITH_SERVER_KEEP_BINARY = CreateDelegate(ProcServicesWithServerKeepBinary); - SERVICES_CANCEL = CreateDelegate(ProcServicesCancel); - SERVICES_CANCEL_ALL = CreateDelegate(ProcServicesCancelAll); - SERVICES_GET_SERVICE_PROXY = CreateDelegate(ProcServicesGetServiceProxy); - - ATOMIC_LONG_GET = CreateDelegate(ProcAtomicLongGet); - ATOMIC_LONG_INCREMENT_AND_GET = CreateDelegate(ProcAtomicLongIncrementAndGet); - ATOMIC_LONG_ADD_AND_GET = CreateDelegate(ProcAtomicLongAddAndGet); - ATOMIC_LONG_DECREMENT_AND_GET = CreateDelegate(ProcAtomicLongDecrementAndGet); - ATOMIC_LONG_GET_AND_SET = CreateDelegate(ProcAtomicLongGetAndSet); - ATOMIC_LONG_COMPARE_AND_SET_AND_GET = CreateDelegate(ProcAtomicLongCompareAndSetAndGet); - ATOMIC_LONG_IS_CLOSED = CreateDelegate(ProcAtomicLongIsClosed); - ATOMIC_LONG_CLOSE = CreateDelegate(ProcAtomicLongClose); } #region NATIVE METHODS: PROCESSOR @@ -723,7 +306,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged internal static IUnmanagedTarget ProcessorCompute(IUnmanagedTarget target, IUnmanagedTarget prj) { - void* res = PROCESSOR_COMPUTE2(target.Context, target.Target, prj.Target); + void* res = PROCESSOR_COMPUTE(target.Context, target.Target, prj.Target); return target.ChangeTarget(res); } @@ -1349,27 +932,5 @@ namespace Apache.Ignite.Core.Impl.Unmanaged { // No-op. } - - /// - /// Create delegate for the given procedure. - /// - /// Delegate type. - /// Procedure name. - /// - private static T CreateDelegate(string procName) - { - var procPtr = NativeMethods.GetProcAddress(Ptr, procName); - - if (procPtr == IntPtr.Zero) - { - var error = Marshal.GetLastWin32Error(); - - throw new IgniteException(string.Format(CultureInfo.InvariantCulture, - "Unable to find native function: {0} (Error code: {1}). Make sure that module.def is up to date", - procName, error)); - } - - return TypeCaster.Cast(Marshal.GetDelegateForFunctionPointer(procPtr, typeof (T))); - } } }