ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [15/15] ignite git commit: Merge branch 'master' into ignite-1786
Date Wed, 13 Apr 2016 14:07:18 GMT
Merge branch 'master' into ignite-1786


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5a75eb42
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5a75eb42
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5a75eb42

Branch: refs/heads/ignite-1786
Commit: 5a75eb42d43db3af6d728c687b74ec47bd06c444
Parents: 59c9aa6 322e61c
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Apr 13 17:06:49 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Apr 13 17:06:49 2016 +0300

----------------------------------------------------------------------
 .../affinity/GridAffinityProcessor.java         |   6 +-
 .../processors/cache/GridCacheAdapter.java      |   7 +-
 .../processors/cache/GridCacheEntryEx.java      |  10 +-
 .../processors/cache/GridCacheMapEntry.java     |  65 +--
 .../processors/cache/GridCacheProcessor.java    |  35 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |   4 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |   1 +
 .../dht/GridPartitionedGetFuture.java           |   5 +-
 .../dht/GridPartitionedSingleGetFuture.java     |   5 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  55 +--
 .../dht/colocated/GridDhtColocatedCache.java    |   5 +-
 .../distributed/near/GridNearGetFuture.java     |  10 +-
 .../local/atomic/GridLocalAtomicCache.java      |  17 +-
 .../cache/transactions/IgniteTxAdapter.java     |   4 +-
 .../transactions/IgniteTxLocalAdapter.java      |  34 +-
 .../processors/hadoop/HadoopNoopProcessor.java  |  24 +-
 .../processors/igfs/IgfsDeleteWorker.java       |  16 +-
 .../processors/igfs/IgfsIpcHandler.java         |  12 +-
 .../processors/igfs/IgfsMetaManager.java        |  26 +-
 .../internal/processors/igfs/IgfsUtils.java     |  34 ++
 ...IgfsMetaDirectoryListingRemoveProcessor.java |   2 -
 .../platform/PlatformNoopProcessor.java         |   4 +-
 .../platform/PlatformProcessorImpl.java         |   9 +
 .../service/GridServiceProcessor.java           |   2 +-
 .../processors/service/GridServiceProxy.java    |   5 +-
 .../local/LocalAffinityFunctionTest.java        |  80 ++++
 .../ignite/igfs/IgfsEventsAbstractSelfTest.java |  26 +-
 .../EntryVersionConsistencyReadThroughTest.java | 265 ++++++++++++
 .../processors/cache/GridCacheTestEntryEx.java  |   5 +-
 ...GridServiceProxyClientReconnectSelfTest.java | 124 ++++++
 .../GridServiceProxyNodeStopSelfTest.java       |   2 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   2 +
 .../testsuites/IgniteCacheTestSuite5.java       |   4 +-
 .../testsuites/IgniteKernalSelfTestSuite.java   |   2 +
 .../hadoop/igfs/HadoopIgfsWrapper.java          |  11 +-
 .../ignite/igfs/Hadoop1DualAbstractTest.java    |   2 +-
 .../apache/ignite/igfs/IgfsEventsTestSuite.java |   6 +
 ...IgniteHadoopFileSystemHandshakeSelfTest.java | 121 ++++--
 .../hadoop/HadoopAbstractMapReduceTest.java     | 405 +++++++++++++++++++
 .../processors/hadoop/HadoopErrorSimulator.java | 326 +++++++++++++++
 .../HadoopMapReduceErrorResilienceTest.java     | 154 +++++++
 .../processors/hadoop/HadoopMapReduceTest.java  | 380 +----------------
 .../hadoop/HadoopNoHadoopMapReduceTest.java     |  47 +++
 .../hadoop/HadoopSnappyFullMapReduceTest.java   |   8 +
 .../hadoop/examples/HadoopWordCount1Map.java    |  12 +
 .../hadoop/examples/HadoopWordCount1Reduce.java |   5 +
 .../hadoop/examples/HadoopWordCount2.java       |   2 +-
 .../examples/HadoopWordCount2Combiner.java      |  45 +++
 .../hadoop/examples/HadoopWordCount2Mapper.java |  19 +-
 .../examples/HadoopWordCount2Reducer.java       |  43 +-
 .../testsuites/IgniteHadoopTestSuite.java       |  10 +-
 .../common/include/ignite/common/ignite_error.h |   9 +-
 .../os/linux/include/ignite/common/common.h     |  20 +-
 .../os/win/include/ignite/common/common.h       |   8 +-
 .../platforms/cpp/common/src/ignite_error.cpp   |  27 +-
 .../cpp/core-test/src/ignite_error_test.cpp     |   2 +-
 .../Cache/Query/CacheQueriesTest.cs             |  13 +-
 .../Compute/MixedClusterTest.cs                 | 122 ++++--
 .../Config/cache-query.xml                      |   2 +
 .../ignite/schema/generator/CodeGenerator.java  |  20 +-
 .../ignite/schema/generator/GeneratorUtils.java |  53 +++
 .../ignite/schema/generator/XmlGenerator.java   |  62 ++-
 .../schema/test/model/ignite-type-metadata.xml  |  44 +-
 63 files changed, 2231 insertions(+), 654 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5a75eb42/modules/platforms/cpp/common/include/ignite/common/ignite_error.h
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/common/include/ignite/common/ignite_error.h
index 4097a62,0000000..4a0e281
mode 100644,000000..100644
--- a/modules/platforms/cpp/common/include/ignite/common/ignite_error.h
+++ b/modules/platforms/cpp/common/include/ignite/common/ignite_error.h
@@@ -1,274 -1,0 +1,275 @@@
 +/*
 + * 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.
 + */
 +
 +/**
 + * @file
 + * Declares ignite::IgniteError class.
 + */
 +
 +#ifndef _IGNITE_ERROR
 +#define _IGNITE_ERROR
 +
 +#include <stdint.h>
 +
 +#include <exception>
 +#include <sstream>
 +
 +#include <ignite/common/common.h>
 +
 +#define IGNITE_ERROR_1(code, part1) { \
 +    std::stringstream stream; \
 +    stream << (part1); \
 +    throw ignite::IgniteError(code, stream.str().c_str()); \
 +}
 +
 +#define IGNITE_ERROR_2(code, part1, part2) { \
 +    std::stringstream stream; \
 +    stream << (part1) << (part2); \
 +    throw ignite::IgniteError(code, stream.str().c_str()); \
 +}
 +
 +#define IGNITE_ERROR_3(code, part1, part2, part3) { \
 +    std::stringstream stream; \
 +    stream << (part1) << (part2) << (part3); \
 +    throw ignite::IgniteError(code, stream.str().c_str()); \
 +}
 +
 +#define IGNITE_ERROR_FORMATTED_1(code, msg, key1, val1) { \
 +    std::stringstream stream; \
 +    stream << msg << " [" << key1 << "=" << (val1) <<
"]"; \
 +    throw ignite::IgniteError(code, stream.str().c_str()); \
 +}
 +
 +#define IGNITE_ERROR_FORMATTED_2(code, msg, key1, val1, key2, val2) { \
 +    std::stringstream stream; \
 +    stream << msg << " [" << key1 << "=" << (val1) <<
", " << key2 << "=" << (val2) << "]"; \
 +    throw ignite::IgniteError(code, stream.str().c_str()); \
 +}
 +
 +#define IGNITE_ERROR_FORMATTED_3(code, msg, key1, val1, key2, val2, key3, val3) { \
 +    std::stringstream stream; \
 +    stream << msg << " [" << key1 << "=" << (val1) <<
", " << key2 << "=" << (val2) << ", " << key3 << "=" <<
(val3) << "]"; \
 +    throw ignite::IgniteError(code, stream.str().c_str()); \
 +}
 +
 +#define IGNITE_ERROR_FORMATTED_4(code, msg, key1, val1, key2, val2, key3, val3, key4, val4)
{ \
 +    std::stringstream stream; \
 +    stream << msg << " [" << key1 << "=" << (val1) <<
", " << key2 << "=" << (val2) << ", " << key3 << "=" <<
(val3) << ", " << key4 << "=" << (val4) << "]"; \
 +    throw ignite::IgniteError(code, stream.str().c_str()); \
 +}
 +
 +namespace ignite
 +{
 +    /**
 +     * Ignite error information.
 +     */
 +    class IGNITE_IMPORT_EXPORT IgniteError : public std::exception
 +    {
 +    public:
 +        /** Success. */
 +        static const int IGNITE_SUCCESS = 0;
 +
 +        /** Failed to initialize JVM. */
 +        static const int IGNITE_ERR_JVM_INIT = 1;
 +
 +        /** Failed to attach to JVM. */
 +        static const int IGNITE_ERR_JVM_ATTACH = 2;
 +        
 +        /** JVM library is not found. */
 +        static const int IGNITE_ERR_JVM_LIB_NOT_FOUND = 3;
 +
 +        /** Failed to load JVM library. */
 +        static const int IGNITE_ERR_JVM_LIB_LOAD_FAILED = 4;
 +        
 +        /** JVM classpath is not provided. */
 +        static const int IGNITE_ERR_JVM_NO_CLASSPATH = 5;
 +
 +        /** JVM error: no class definition found. */
 +        static const int IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND = 6;
 +
 +        /** JVM error: no such method. */
 +        static const int IGNITE_ERR_JVM_NO_SUCH_METHOD = 7;
 +
 +        /** Memory operation error. */
 +        static const int IGNITE_ERR_MEMORY = 1001;
 +
 +        /** Binary error. */
 +        static const int IGNITE_ERR_BINARY = 1002;
 +
 +        /** Generic Ignite error. */
 +        static const int IGNITE_ERR_GENERIC = 2000;
 +
 +        /** Illegal argument passed. */
 +        static const int IGNITE_ERR_ILLEGAL_ARGUMENT = 2001;
 +
 +        /** Illegal state. */
 +        static const int IGNITE_ERR_ILLEGAL_STATE = 2002;
 +
 +        /** Unsupported operation. */
 +        static const int IGNITE_ERR_UNSUPPORTED_OPERATION = 2003;
 +
 +        /** Thread has been interrup. */
 +        static const int IGNITE_ERR_INTERRUPTED = 2004;
 +
 +        /** Cluster group is empty. */
 +        static const int IGNITE_ERR_CLUSTER_GROUP_EMPTY = 2005;
 +
 +        /** Cluster topology problem. */
 +        static const int IGNITE_ERR_CLUSTER_TOPOLOGY = 2006;
 +
 +        /** Compute execution rejected. */
 +        static const int IGNITE_ERR_COMPUTE_EXECUTION_REJECTED = 2007;
 +
 +        /** Compute job failover. */
 +        static const int IGNITE_ERR_COMPUTE_JOB_FAILOVER = 2008;
 +
 +        /** Compute task cancelled. */
 +        static const int IGNITE_ERR_COMPUTE_TASK_CANCELLED = 2009;
 +
 +        /** Compute task timeout. */
 +        static const int IGNITE_ERR_COMPUTE_TASK_TIMEOUT = 2010;
 +
 +        /** Compute user undeclared exception. */
 +        static const int IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION = 2011;
 +
 +        /** Generic cache error. */
 +        static const int IGNITE_ERR_CACHE = 2012;
 +
 +        /** Generic cache loader error. */
 +        static const int IGNITE_ERR_CACHE_LOADER = 2013;
 +
 +        /** Generic cache writer error. */
 +        static const int IGNITE_ERR_CACHE_WRITER = 2014;
 +        
 +        /** Generic cache entry processor error. */
 +        static const int IGNITE_ERR_ENTRY_PROCESSOR = 2015;
 +
 +        /** Cache atomic update timeout. */
 +        static const int IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT = 2016;
 +
 +        /** Cache partial update. */
 +        static const int IGNITE_ERR_CACHE_PARTIAL_UPDATE = 2017;
 +        
 +        /** Transaction optimisitc exception. */
 +        static const int IGNITE_ERR_TX_OPTIMISTIC = 2018;
 +
 +        /** Transaction timeout. */
 +        static const int IGNITE_ERR_TX_TIMEOUT = 2019;
 +
 +        /** Transaction rollback. */
 +        static const int IGNITE_ERR_TX_ROLLBACK = 2020;
 +
 +        /** Transaction heuristic exception. */
 +        static const int IGNITE_ERR_TX_HEURISTIC = 2021;
 +
 +        /** Authentication error. */
 +        static const int IGNITE_ERR_AUTHENTICATION = 2022;
 +
 +        /** Security error. */
 +        static const int IGNITE_ERR_SECURITY = 2023;
 +        
 +        /** Unknown error. */
 +        static const int IGNITE_ERR_UNKNOWN = -1;
 +
 +        /**
 +         * Throw an error if code is not IGNITE_SUCCESS.
 +         *
 +         * @param err Error.
 +         */
 +        static void ThrowIfNeeded(IgniteError& err);
 +
 +        /**
 +         * Create empty error.
 +         */
 +        IgniteError();
 +
 +        /**
 +         * Create error with specific code.
 +         *
 +         * @param code Error code.
 +         */
 +        IgniteError(const int32_t code);
 +
 +        /**
 +         * Create error with specific code and message.
 +         *
 +         * @param code Error code.
 +         * @param msg Message.
 +         */
 +        IgniteError(const int32_t code, const char* msg);
 +        
 +        /**
 +         * Copy constructor.
 +         *
 +         * @param other Other instance.
 +         */
 +        IgniteError(const IgniteError& other);
 +
 +        /**
 +         * Assignment operator.
 +         *
 +         * @param other Other instance.
 +         * @return Assignment result.
 +         */
 +        IgniteError& operator=(const IgniteError& other);
 +
 +        /**
 +         * Destructor.
 +         */
 +        ~IgniteError();
 +
 +        /**
 +         * Get error code.
 +         *
 +         * @return Error code.
 +         */
 +        int32_t GetCode() const;
 +
 +        /**
 +         * Get error message.
 +         *
 +         * @return Error message.
 +         */
-         const char* GetText() const;
++        const char* GetText() const IGNITE_NO_THROW;
 +
 +        /**
-          * Get error message. Synonim for GetText().
++         * Implementation of the standard std::exception::what() method.
++         * Synonym for GetText() method.
 +         *
-          * @return Error message.
++         * @return Error message string.
 +         */
-         virtual const char* what() const;
++        virtual const char* what() const IGNITE_NO_THROW;
 +
 +        /**
 +         * Set error.
 +         *
 +         * @param jniCode Error code.
 +         * @param jniCls Error class.
 +         * @param jniMsg Error message.
 +         * @param err Error.
 +         */
 +        static void SetError(const int jniCode, const char* jniCls, const char* jniMsg,
IgniteError* err);
 +    private:
 +        /** Error code. */
 +        int32_t code;    
 +        
 +        /** Error message. */
 +        char* msg;       
 +    };    
 +}
 +
 +#endif

http://git-wip-us.apache.org/repos/asf/ignite/blob/5a75eb42/modules/platforms/cpp/common/src/ignite_error.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/common/src/ignite_error.cpp
index 6981a86,0000000..587ef66
mode 100644,000000..100644
--- a/modules/platforms/cpp/common/src/ignite_error.cpp
+++ b/modules/platforms/cpp/common/src/ignite_error.cpp
@@@ -1,226 -1,0 +1,231 @@@
 +/*
 + * 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.
 + */
 +#include <ignite/common/java.h>
 +#include <ignite/common/ignite_error.h>
 +#include <ignite/common/utils.h>
 +
 +using namespace ignite::common::java;
 +using namespace ignite::common::utils;
 +
 +namespace ignite
 +{
 +    void IgniteError::ThrowIfNeeded(IgniteError& err)
 +    {
 +        if (err.code != IGNITE_SUCCESS)
 +            throw err;
 +    }
 +
-     IgniteError::IgniteError() : code(IGNITE_SUCCESS), msg(NULL)
++    IgniteError::IgniteError() :
++        code(IGNITE_SUCCESS),
++        msg(NULL)
 +    {
 +        // No-op.
 +    }
 +
-     IgniteError::IgniteError(int32_t code) : code(code), msg(NULL)
++    IgniteError::IgniteError(int32_t code) :
++        code(code),
++        msg(NULL)
 +    {
-         // No-op.
 +    }
 +
-     IgniteError::IgniteError(int32_t code, const char* msg)
++    IgniteError::IgniteError(int32_t code, const char* msg) :
++        code(code),
++        msg(CopyChars(msg))
 +    {
-         this->code = code;
-         this->msg = CopyChars(msg);
++        // No-op.
 +    }
 +
-     IgniteError::IgniteError(const IgniteError& other)
++    IgniteError::IgniteError(const IgniteError& other) :
++        code(other.code),
++        msg(CopyChars(other.msg))
 +    {
-         this->code = other.code;
-         this->msg = CopyChars(other.msg);
++        // No-op.
 +    }
 +
 +    IgniteError& IgniteError::operator=(const IgniteError& other)
 +    {
 +        if (this != &other)
 +        {
 +            IgniteError tmp(other);
 +
 +            int tmpCode = code;
 +            char* tmpMsg = msg;
 +            
 +            code = tmp.code;
 +            msg = tmp.msg;
 +
 +            tmp.code = tmpCode;
 +            tmp.msg = tmpMsg;
 +        }
 +
 +        return *this;
 +    }
 +
 +    IgniteError::~IgniteError()
 +    {
 +        ReleaseChars(msg);
 +    }
 +
 +    int32_t IgniteError::GetCode() const
 +    {
 +        return code;
 +    }
 +
-     const char* IgniteError::GetText() const
++    const char* IgniteError::GetText() const IGNITE_NO_THROW
 +    {
 +        if (code == IGNITE_SUCCESS)
 +            return "Operation completed successfully.";
 +        else if (msg)
 +            return msg;
 +        else
 +            return  "No additional information available.";
 +    }
 +
-     const char* IgniteError::what() const
++    const char* IgniteError::what() const IGNITE_NO_THROW
 +    {
 +        return GetText();
 +    }
 +
 +    void IgniteError::SetError(const int jniCode, const char* jniCls, const char* jniMsg,
IgniteError* err)
 +    {
 +        if (jniCode == IGNITE_JNI_ERR_SUCCESS)
 +            *err = IgniteError();
 +        else if (jniCode == IGNITE_JNI_ERR_GENERIC)
 +        {
 +            // The most common case when we have Java exception "in hands" and must map
it to respective code.
 +            if (jniCls)
 +            {
 +                std::string jniCls0 = jniCls;
 +
 +                if (jniCls0.compare("java.lang.NoClassDefFoundError") == 0)
 +                {
 +                    std::stringstream stream; 
 +
 +                    stream << "Java class is not found (did you set IGNITE_HOME environment
variable?)";
 +
 +                    if (jniMsg)
 +                        stream << ": " << jniMsg;
 +                    
 +                    *err = IgniteError(IGNITE_ERR_JVM_NO_CLASS_DEF_FOUND, stream.str().c_str());
 +                }
 +                else if (jniCls0.compare("java.lang.NoSuchMethodError") == 0)
 +                {
 +                    std::stringstream stream;
 +
 +                    stream << "Java method is not found (did you set IGNITE_HOME environment
variable?)";
 +
 +                    if (jniMsg)
 +                        stream << ": " << jniMsg;
 +
 +                    *err = IgniteError(IGNITE_ERR_JVM_NO_SUCH_METHOD, stream.str().c_str());
 +                }
 +                else if (jniCls0.compare("java.lang.IllegalArgumentException") == 0)
 +                    *err = IgniteError(IGNITE_ERR_ILLEGAL_ARGUMENT, jniMsg);
 +                else if (jniCls0.compare("java.lang.IllegalStateException") == 0)
 +                    *err = IgniteError(IGNITE_ERR_ILLEGAL_STATE, jniMsg);
 +                else if (jniCls0.compare("java.lang.UnsupportedOperationException") == 0)
 +                    *err = IgniteError(IGNITE_ERR_UNSUPPORTED_OPERATION, jniMsg);
 +                else if (jniCls0.compare("java.lang.InterruptedException") == 0)
 +                    *err = IgniteError(IGNITE_ERR_INTERRUPTED, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterGroupEmptyException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_CLUSTER_GROUP_EMPTY, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.cluster.ClusterTopologyException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_CLUSTER_TOPOLOGY, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.compute.ComputeExecutionRejectedException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_COMPUTE_EXECUTION_REJECTED, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.compute.ComputeJobFailoverException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_COMPUTE_JOB_FAILOVER, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskCancelledException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_COMPUTE_TASK_CANCELLED, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.compute.ComputeTaskTimeoutException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_COMPUTE_TASK_TIMEOUT, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.compute.ComputeUserUndeclaredException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_COMPUTE_USER_UNDECLARED_EXCEPTION, jniMsg);
 +                else if (jniCls0.compare("javax.cache.CacheException") == 0)
 +                    *err = IgniteError(IGNITE_ERR_CACHE, jniMsg);
 +                else if (jniCls0.compare("javax.cache.integration.CacheLoaderException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_CACHE_LOADER, jniMsg);
 +                else if (jniCls0.compare("javax.cache.integration.CacheWriterException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_CACHE_WRITER, jniMsg);
 +                else if (jniCls0.compare("javax.cache.processor.EntryProcessorException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_ENTRY_PROCESSOR, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.cache.CacheAtomicUpdateTimeoutException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_CACHE_ATOMIC_UPDATE_TIMEOUT, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.cache.CachePartialUpdateException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_CACHE_PARTIAL_UPDATE, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionOptimisticException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_TX_OPTIMISTIC, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionTimeoutException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_TX_TIMEOUT, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionRollbackException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_TX_ROLLBACK, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.transactions.TransactionHeuristicException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_TX_HEURISTIC, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.IgniteAuthenticationException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_AUTHENTICATION, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.plugin.security.GridSecurityException")
== 0)
 +                    *err = IgniteError(IGNITE_ERR_SECURITY, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.IgniteException") == 0)
 +                    *err = IgniteError(IGNITE_ERR_GENERIC, jniMsg);
 +                else if (jniCls0.compare("org.apache.ignite.IgniteCheckedException") ==
0)
 +                    *err = IgniteError(IGNITE_ERR_GENERIC, jniMsg);
 +                else
 +                {
 +                    std::stringstream stream;
 +                    
 +                    stream << "Java exception occurred [cls=" << jniCls0;
 +
 +                    if (jniMsg)
 +                        stream << ", msg=" << jniMsg;
 +
 +                    stream << "]";
 +
 +                    *err = IgniteError(IGNITE_ERR_UNKNOWN, stream.str().c_str());
 +                }                    
 +            }
 +            else
 +            {
 +                // JNI class name is not available. Something really weird.
 +                *err = IgniteError(IGNITE_ERR_UNKNOWN);
 +            }
 +        }
 +        else if (jniCode == IGNITE_JNI_ERR_JVM_INIT)
 +        {
 +            std::stringstream stream;
 +
 +            stream << "Failed to initialize JVM [errCls=";
 +
 +            if (jniCls)
 +                stream << jniCls;
 +            else
 +                stream << "N/A";
 +
 +            stream << ", errMsg=";
 +
 +            if (jniMsg)
 +                stream << jniMsg;
 +            else
 +                stream << "N/A";
 +
 +            stream << "]";
 +
 +            *err = IgniteError(IGNITE_ERR_JVM_INIT, stream.str().c_str());
 +        }
 +        else if (jniCode == IGNITE_JNI_ERR_JVM_ATTACH)
 +            *err = IgniteError(IGNITE_ERR_JVM_ATTACH, "Failed to attach to JVM.");
 +    }
 +}


Mime
View raw message