ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [27/40] ignite git commit: IGNITE-4034 Get rid of specialized methods in platform targets
Date Mon, 17 Oct 2016 17:59:24 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/eaf8ae24/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 a0abfaa..4722d0b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
@@ -365,6 +365,11 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
 
         #region NATIVE METHODS: TARGET
 
+        internal static long TargetInLongOutLong(IUnmanagedTarget target, int opType, long
memPtr)
+        {
+            return JNI.TargetInLongOutLong(target.Context, target.Target, opType, memPtr);
+        }
+
         internal static long TargetInStreamOutLong(IUnmanagedTarget target, int opType, long
memPtr)
         {
             return JNI.TargetInStreamOutLong(target.Context, target.Target, opType, memPtr);
@@ -387,6 +392,16 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             JNI.TargetInObjectStreamOutStream(target.Context, target.Target, opType, arg,
inMemPtr, outMemPtr);
         }
 
+        internal static IUnmanagedTarget TargetInObjectStreamOutObjectStream(IUnmanagedTarget
target, int opType, void* arg, long inMemPtr, long outMemPtr)
+        {
+            void* res = JNI.TargetInObjectStreamOutObjectStream(target.Context, target.Target,
opType, arg, inMemPtr, outMemPtr);
+
+            if (res == null)
+                return null;
+
+            return target.ChangeTarget(res);
+        }
+
         internal static long TargetOutLong(IUnmanagedTarget target, int opType)
         {
             return JNI.TargetOutLong(target.Context, target.Target, opType);
@@ -431,345 +446,6 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
 
         #endregion
 
-        #region NATIVE METHODS: AFFINITY
-
-        internal static int AffinityPartitions(IUnmanagedTarget target)
-        {
-            return JNI.AffinityParts(target.Context, target.Target);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: CACHE
-
-        internal static IUnmanagedTarget CacheWithSkipStore(IUnmanagedTarget target)
-        {
-            void* res = JNI.CacheWithSkipStore(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget CacheWithNoRetries(IUnmanagedTarget target)
-        {
-            void* res = JNI.CacheWithNoRetries(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget CacheWithExpiryPolicy(IUnmanagedTarget target, long
create, long update, long access)
-        {
-            void* res = JNI.CacheWithExpiryPolicy(target.Context, target.Target, create,
update, access);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget CacheWithAsync(IUnmanagedTarget target)
-        {
-            void* res = JNI.CacheWithAsync(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget CacheWithKeepBinary(IUnmanagedTarget target)
-        {
-            void* res = JNI.CacheWithKeepBinary(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static void CacheClear(IUnmanagedTarget target)
-        {
-            JNI.CacheClear(target.Context, target.Target);
-        }
-
-        internal static void CacheRemoveAll(IUnmanagedTarget target)
-        {
-            JNI.CacheRemoveAll(target.Context, target.Target);
-        }
-
-        internal static IUnmanagedTarget CacheOutOpQueryCursor(IUnmanagedTarget target, int
type, long memPtr)
-        {
-            void* res = JNI.CacheOutOpQueryCursor(target.Context, target.Target, type, memPtr);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget CacheOutOpContinuousQuery(IUnmanagedTarget target,
int type, long memPtr)
-        {
-            void* res = JNI.CacheOutOpContinuousQuery(target.Context, target.Target, type,
memPtr);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget CacheIterator(IUnmanagedTarget target)
-        {
-            void* res = JNI.CacheIterator(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget CacheLocalIterator(IUnmanagedTarget target, int
peekModes)
-        {
-            void* res = JNI.CacheLocalIterator(target.Context, target.Target, peekModes);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static void CacheEnterLock(IUnmanagedTarget target, long id)
-        {
-            JNI.CacheEnterLock(target.Context, target.Target, id);
-        }
-
-        internal static void CacheExitLock(IUnmanagedTarget target, long id)
-        {
-            JNI.CacheExitLock(target.Context, target.Target, id);
-        }
-
-        internal static bool CacheTryEnterLock(IUnmanagedTarget target, long id, long timeout)
-        {
-            return JNI.CacheTryEnterLock(target.Context, target.Target, id, timeout);
-        }
-
-        internal static void CacheCloseLock(IUnmanagedTarget target, long id)
-        {
-            JNI.CacheCloseLock(target.Context, target.Target, id);
-        }
-
-        internal static void CacheRebalance(IUnmanagedTarget target, long futId)
-        {
-            JNI.CacheRebalance(target.Context, target.Target, futId);
-        }
-
-        internal static void CacheStoreCallbackInvoke(IUnmanagedTarget target, long memPtr)
-        {
-            JNI.CacheStoreCallbackInvoke(target.Context, target.Target, memPtr);
-        }
-
-        internal static int CacheSize(IUnmanagedTarget target, int modes, bool loc)
-        {
-            return JNI.CacheSize(target.Context, target.Target, modes, loc);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: COMPUTE
-
-        internal static void ComputeWithNoFailover(IUnmanagedTarget target)
-        {
-            JNI.ComputeWithNoFailover(target.Context, target.Target);
-        }
-
-        internal static void ComputeWithTimeout(IUnmanagedTarget target, long timeout)
-        {
-            JNI.ComputeWithTimeout(target.Context, target.Target, timeout);
-        }
-
-        internal static IUnmanagedTarget ComputeExecuteNative(IUnmanagedTarget target, long
taskPtr, long topVer)
-        {
-            void* res = JNI.ComputeExecuteNative(target.Context, target.Target, taskPtr,
topVer);
-
-            return target.ChangeTarget(res);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: CONTINUOUS QUERY
-
-        internal static void ContinuousQueryClose(IUnmanagedTarget target)
-        {
-            JNI.ContinuousQryClose(target.Context, target.Target);
-        }
-
-        internal static IUnmanagedTarget ContinuousQueryGetInitialQueryCursor(IUnmanagedTarget
target)
-        {
-            void* res = JNI.ContinuousQryGetInitialQueryCursor(target.Context, target.Target);
-
-            return res == null ? null : target.ChangeTarget(res);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: DATA STREAMER
-
-        internal static void DataStreamerListenTopology(IUnmanagedTarget target, long ptr)
-        {
-            JNI.DataStreamerListenTop(target.Context, target.Target, ptr);
-        }
-
-        internal static bool DataStreamerAllowOverwriteGet(IUnmanagedTarget target)
-        {
-            return JNI.DataStreamerAllowOverwriteGet(target.Context, target.Target);
-        }
-
-        internal static void DataStreamerAllowOverwriteSet(IUnmanagedTarget target, bool
val)
-        {
-            JNI.DataStreamerAllowOverwriteSet(target.Context, target.Target, val);
-        }
-
-        internal static bool DataStreamerSkipStoreGet(IUnmanagedTarget target)
-        {
-            return JNI.DataStreamerSkipStoreGet(target.Context, target.Target);
-        }
-
-        internal static void DataStreamerSkipStoreSet(IUnmanagedTarget target, bool val)
-        {
-            JNI.DataStreamerSkipStoreSet(target.Context, target.Target, val);
-        }
-
-        internal static int DataStreamerPerNodeBufferSizeGet(IUnmanagedTarget target)
-        {
-            return JNI.DataStreamerPerNodeBufferSizeGet(target.Context, target.Target);
-        }
-
-        internal static void DataStreamerPerNodeBufferSizeSet(IUnmanagedTarget target, int
val)
-        {
-            JNI.DataStreamerPerNodeBufferSizeSet(target.Context, target.Target, val);
-        }
-
-        internal static int DataStreamerPerNodeParallelOperationsGet(IUnmanagedTarget target)
-        {
-            return JNI.DataStreamerPerNodeParallelOpsGet(target.Context, target.Target);
-        }
-
-        internal static void DataStreamerPerNodeParallelOperationsSet(IUnmanagedTarget target,
int val)
-        {
-            JNI.DataStreamerPerNodeParallelOpsSet(target.Context, target.Target, val);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: MESSAGING
-
-        internal static IUnmanagedTarget MessagingWithASync(IUnmanagedTarget target)
-        {
-            void* res = JNI.MessagingWithAsync(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: PROJECTION
-
-        internal static IUnmanagedTarget ProjectionForOthers(IUnmanagedTarget target, IUnmanagedTarget
prj)
-        {
-            void* res = JNI.ProjectionForOthers(target.Context, target.Target, prj.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget ProjectionForRemotes(IUnmanagedTarget target)
-        {
-            void* res = JNI.ProjectionForRemotes(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget ProjectionForDaemons(IUnmanagedTarget target)
-        {
-            void* res = JNI.ProjectionForDaemons(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget ProjectionForRandom(IUnmanagedTarget target)
-        {
-            void* res = JNI.ProjectionForRandom(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget ProjectionForOldest(IUnmanagedTarget target)
-        {
-            void* res = JNI.ProjectionForOldest(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-
-        internal static IUnmanagedTarget ProjectionForYoungest(IUnmanagedTarget target)
-        {
-            void* res = JNI.ProjectionForYoungest(target.Context, target.Target);
-
-            return target.ChangeTarget(res);
-        }
-        
-        internal static void ProjectionResetMetrics(IUnmanagedTarget target)
-        {
-            JNI.ProjectionResetMetrics(target.Context, target.Target);
-        }
-
-        internal static IUnmanagedTarget ProjectionOutOpRet(IUnmanagedTarget target, int
type, long memPtr)
-        {
-            void* res = JNI.ProjectionOutOpRet(target.Context, target.Target, type, memPtr);
-
-            return target.ChangeTarget(res);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: QUERY CURSOR
-
-        internal static void QueryCursorIterator(IUnmanagedTarget target)
-        {
-            JNI.QryCursorIterator(target.Context, target.Target);
-        }
-
-        internal static void QueryCursorClose(IUnmanagedTarget target)
-        {
-            JNI.QryCursorClose(target.Context, target.Target);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: TRANSACTIONS
-
-        internal static long TransactionsStart(IUnmanagedTarget target, int concurrency,
int isolation, long timeout, int txSize)
-        {
-            return JNI.TxStart(target.Context, target.Target, concurrency, isolation, timeout,
txSize);
-        }
-
-        internal static int TransactionsCommit(IUnmanagedTarget target, long id)
-        {
-            return JNI.TxCommit(target.Context, target.Target, id);
-        }
-
-        internal static void TransactionsCommitAsync(IUnmanagedTarget target, long id, long
futId)
-        {
-            JNI.TxCommitAsync(target.Context, target.Target, id, futId);
-        }
-
-        internal static int TransactionsRollback(IUnmanagedTarget target, long id)
-        {
-            return JNI.TxRollback(target.Context, target.Target, id);
-        }
-
-        internal static void TransactionsRollbackAsync(IUnmanagedTarget target, long id,
long futId)
-        {
-            JNI.TxRollbackAsync(target.Context, target.Target, id, futId);
-        }
-
-        internal static int TransactionsClose(IUnmanagedTarget target, long id)
-        {
-            return JNI.TxClose(target.Context, target.Target, id);
-        }
-
-        internal static int TransactionsState(IUnmanagedTarget target, long id)
-        {
-            return JNI.TxState(target.Context, target.Target, id);
-        }
-
-        internal static bool TransactionsSetRollbackOnly(IUnmanagedTarget target, long id)
-        {
-            return JNI.TxSetRollbackOnly(target.Context, target.Target, id);
-        }
-
-        internal static void TransactionsResetMetrics(IUnmanagedTarget target)
-        {
-            JNI.TxResetMetrics(target.Context, target.Target);
-        }
-
-        #endregion
-
         #region NATIVE METHODS: MISCELANNEOUS
 
         internal static void Reallocate(long memPtr, int cap)
@@ -827,176 +503,11 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
             JNI.DestroyJvm(ctx);
         }
 
-        #endregion
-
-        #region NATIVE METHODS: EVENTS
-
-        internal static IUnmanagedTarget EventsWithAsync(IUnmanagedTarget target)
-        {
-            return target.ChangeTarget(JNI.EventsWithAsync(target.Context, target.Target));
-        }
-
-        internal static bool EventsStopLocalListen(IUnmanagedTarget target, long handle)
-        {
-            return JNI.EventsStopLocalListen(target.Context, target.Target, handle);
-        }
-
-        internal static bool EventsIsEnabled(IUnmanagedTarget target, int type)
-        {
-            return JNI.EventsIsEnabled(target.Context, target.Target, type);
-        }
-
-        internal static void EventsLocalListen(IUnmanagedTarget target, long handle, int
type)
-        {
-            JNI.EventsLocalListen(target.Context, target.Target, handle, type);
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: SERVICES
-
-        internal static IUnmanagedTarget ServicesWithAsync(IUnmanagedTarget target)
-        {
-            return target.ChangeTarget(JNI.ServicesWithAsync(target.Context, target.Target));
-        }
-
-        internal static IUnmanagedTarget ServicesWithServerKeepBinary(IUnmanagedTarget target)
-        {
-            return target.ChangeTarget(JNI.ServicesWithServerKeepBinary(target.Context, target.Target));
-        }
-
-        internal static void ServicesCancel(IUnmanagedTarget target, string name)
-        {
-            var nameChars = (char*)IgniteUtils.StringToUtf8Unmanaged(name);
-
-            try
-            {
-                JNI.ServicesCancel(target.Context, target.Target, nameChars);
-            }
-            finally
-            {
-                Marshal.FreeHGlobal(new IntPtr(nameChars));
-            }
-        }
-
-        internal static void ServicesCancelAll(IUnmanagedTarget target)
-        {
-            JNI.ServicesCancelAll(target.Context, target.Target);
-        }
-
-        internal static IUnmanagedTarget ServicesGetServiceProxy(IUnmanagedTarget target,
string name, bool sticky)
-        {
-            var nameChars = (char*)IgniteUtils.StringToUtf8Unmanaged(name);
-
-            try
-            {
-                return target.ChangeTarget(JNI.ServicesGetServiceProxy(target.Context, target.Target,
nameChars, sticky));
-            }
-            finally
-            {
-                Marshal.FreeHGlobal(new IntPtr(nameChars));
-            }
-        }
-
-        #endregion
-
-        #region NATIVE METHODS: DATA STRUCTURES
-
-        internal static long AtomicLongGet(IUnmanagedTarget target)
-        {
-            return JNI.AtomicLongGet(target.Context, target.Target);
-        }
-
-        internal static long AtomicLongIncrementAndGet(IUnmanagedTarget target)
-        {
-            return JNI.AtomicLongIncrementAndGet(target.Context, target.Target);
-        }
-
-        internal static long AtomicLongAddAndGet(IUnmanagedTarget target, long value)
-        {
-            return JNI.AtomicLongAddAndGet(target.Context, target.Target, value);
-        }
-
-        internal static long AtomicLongDecrementAndGet(IUnmanagedTarget target)
-        {
-            return JNI.AtomicLongDecrementAndGet(target.Context, target.Target);
-        }
-
-        internal static long AtomicLongGetAndSet(IUnmanagedTarget target, long value)
-        {
-            return JNI.AtomicLongGetAndSet(target.Context, target.Target, value);
-        }
-
-        internal static long AtomicLongCompareAndSetAndGet(IUnmanagedTarget target, long
expVal, long newVal)
-        {
-            return JNI.AtomicLongCompareAndSetAndGet(target.Context, target.Target, expVal,
newVal);
-        }
-
-        internal static bool AtomicLongIsClosed(IUnmanagedTarget target)
-        {
-            return JNI.AtomicLongIsClosed(target.Context, target.Target);
-        }
-
-        internal static void AtomicLongClose(IUnmanagedTarget target)
-        {
-            JNI.AtomicLongClose(target.Context, target.Target);
-        }
-
-        internal static long AtomicSequenceGet(IUnmanagedTarget target)
-        {
-            return JNI.AtomicSequenceGet(target.Context, target.Target);
-        }
-
-        internal static long AtomicSequenceIncrementAndGet(IUnmanagedTarget target)
-        {
-            return JNI.AtomicSequenceIncrementAndGet(target.Context, target.Target);
-        }
-
-        internal static long AtomicSequenceAddAndGet(IUnmanagedTarget target, long value)
-        {
-            return JNI.AtomicSequenceAddAndGet(target.Context, target.Target, value);
-        }
-
-        internal static int AtomicSequenceGetBatchSize(IUnmanagedTarget target)
-        {
-            return JNI.AtomicSequenceGetBatchSize(target.Context, target.Target);
-        }
-
-        internal static void AtomicSequenceSetBatchSize(IUnmanagedTarget target, int size)
-        {
-            JNI.AtomicSequenceSetBatchSize(target.Context, target.Target, size);
-        }
-
-        internal static bool AtomicSequenceIsClosed(IUnmanagedTarget target)
-        {
-            return JNI.AtomicSequenceIsClosed(target.Context, target.Target);
-        }
-
-        internal static void AtomicSequenceClose(IUnmanagedTarget target)
-        {
-            JNI.AtomicSequenceClose(target.Context, target.Target);
-        }
-
-        internal static bool AtomicReferenceIsClosed(IUnmanagedTarget target)
-        {
-            return JNI.AtomicReferenceIsClosed(target.Context, target.Target);
-        }
-
-        internal static void AtomicReferenceClose(IUnmanagedTarget target)
-        {
-            JNI.AtomicReferenceClose(target.Context, target.Target);
-        }
-
         internal static bool ListenableCancel(IUnmanagedTarget target)
         {
             return JNI.ListenableCancel(target.Context, target.Target);
         }
 
-        internal static bool ListenableIsCancelled(IUnmanagedTarget target)
-        {
-            return JNI.ListenableIsCancelled(target.Context, target.Target);
-        }
-
         #endregion
     }
 }


Mime
View raw message