You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/14 08:52:55 UTC
[01/50] [abbrv] ignite git commit: Merge branch 'ignite-3477-master'
of https://github.com/gridgain/apache-ignite into ignite-3477-master
Repository: ignite
Updated Branches:
refs/heads/ignite-4929 9408ba665 -> 5609b76ac
Merge branch 'ignite-3477-master' of https://github.com/gridgain/apache-ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/06cee57e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/06cee57e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/06cee57e
Branch: refs/heads/ignite-4929
Commit: 06cee57e623a1c70c9bfc23547cbc66f2b62eac9
Parents: b9867eb face0c7
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Apr 11 19:53:59 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Apr 11 19:53:59 2017 +0300
----------------------------------------------------------------------
.../configuration/DataPageEvictionMode.java | 16 ++++++++++++++--
.../configuration/MemoryPolicyConfiguration.java | 18 ++++++++++++------
.../core/src/test/config/spring-multicache.xml | 16 ++++++++++++++++
.../eviction/paged/PageEvictionAbstractTest.java | 4 ++--
.../eviction/paged/PageEvictionMultinodeTest.java | 4 ++--
.../paged/PageEvictionReadThroughTest.java | 2 +-
6 files changed, 47 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
[14/50] [abbrv] ignite git commit: ignite-3477-master add latch in
test
Posted by sb...@apache.org.
ignite-3477-master add latch in test
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/355efcd0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/355efcd0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/355efcd0
Branch: refs/heads/ignite-4929
Commit: 355efcd06ec765b78453b0a6d8b7da201ed3596d
Parents: 10c0364
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 17:24:11 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 17:24:11 2017 +0300
----------------------------------------------------------------------
...lerCacheClientRequestsMappingOnMissTest.java | 94 +++++++++++++++-----
1 file changed, 71 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/355efcd0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java
index d0e863e..362d6a1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClientRequestsMappingOnMissTest.java
@@ -24,6 +24,8 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.Ignite;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -151,94 +153,130 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
*/
public void testNoNodesDieOnRequest() throws Exception {
Ignite srv1 = startGrid(0);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv1, "ctx")).io());
Ignite srv2 = startGrid(1);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv2, "ctx")).io());
Ignite srv3 = startGrid(2);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv3, "ctx")).io());
- srv3.cache(null).put(1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
+ srv3.cache(null).put(
+ 1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
clientMode = true;
Ignite cl1 = startGrid(4);
+
cl1.cache(null).get(1);
- assertEquals("Expected requests count is 1, actual is " + mappingReqsCounter.get(),
- 1,
- mappingReqsCounter.get());
+ int result = mappingReqsCounter.get();
+
+ assertEquals("Expected requests count is 1, actual is " + result, 1, result);
}
/**
*
*/
public void testOneNodeDiesOnRequest() throws Exception {
+ CountDownLatch nodeStopLatch = new CountDownLatch(1);
+
Ignite srv1 = startGrid(0);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv1, "ctx")).io(), 0);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv1, "ctx")).io(), 0, nodeStopLatch);
Ignite srv2 = startGrid(1);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv2, "ctx")).io());
Ignite srv3 = startGrid(2);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv3, "ctx")).io());
- srv3.cache(null).put(1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
+ srv3.cache(null).put(
+ 1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
clientMode = true;
Ignite cl1 = startGrid(4);
+
cl1.cache(null).get(1);
- assertEquals("Expected requests count is 2, actual is " + mappingReqsCounter.get(),
- 2,
- mappingReqsCounter.get());
+ nodeStopLatch.await(5_000, TimeUnit.MILLISECONDS);
+
+ int result = mappingReqsCounter.get();
+
+ assertEquals("Expected requests count is 2, actual is " + result, 2, result);
}
/**
*
*/
public void testTwoNodesDieOnRequest() throws Exception {
+ CountDownLatch nodeStopLatch = new CountDownLatch(2);
+
Ignite srv1 = startGrid(0);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv1, "ctx")).io(), 0);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv1, "ctx")).io(), 0, nodeStopLatch);
Ignite srv2 = startGrid(1);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv2, "ctx")).io(), 1);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv2, "ctx")).io(), 1, nodeStopLatch);
Ignite srv3 = startGrid(2);
+
replaceWithCountingMappingRequestListener(((GridKernalContext)U.field(srv3, "ctx")).io());
- srv3.cache(null).put(1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
+ srv3.cache(null).put(
+ 1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
clientMode = true;
Ignite cl1 = startGrid(4);
+
cl1.cache(null).get(1);
- assertEquals("Expected requests count is 3, actual is " + mappingReqsCounter.get(),
- 3,
- mappingReqsCounter.get());
+ nodeStopLatch.await(5_000, TimeUnit.MILLISECONDS);
+
+ int result = mappingReqsCounter.get();
+
+ assertEquals("Expected requests count is 3, actual is " + result, 3, result);
}
/**
*
*/
public void testAllNodesDieOnRequest() throws Exception {
+ CountDownLatch nodeStopLatch = new CountDownLatch(3);
+
Ignite srv1 = startGrid(0);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv1, "ctx")).io(), 0);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv1, "ctx")).io(), 0, nodeStopLatch);
Ignite srv2 = startGrid(1);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv2, "ctx")).io(), 1);
+
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv2, "ctx")).io(), 1, nodeStopLatch);
Ignite srv3 = startGrid(2);
- replaceWithStoppingMappingRequestListener(((GridKernalContext)U.field(srv3, "ctx")).io(), 2);
- srv3.cache(null).put(1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
+ replaceWithStoppingMappingRequestListener(
+ ((GridKernalContext)U.field(srv3, "ctx")).io(), 2, nodeStopLatch);
+
+ srv3.cache(null).put(
+ 1, new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"));
clientMode = true;
Ignite cl1 = startGrid(4);
+
try {
cl1.cache(null).get(1);
}
@@ -246,9 +284,11 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
e.printStackTrace();
}
- assertEquals("Expected requests count is 3, actual is " + mappingReqsCounter.get(),
- 3,
- mappingReqsCounter.get());
+ nodeStopLatch.await(5_000, TimeUnit.MILLISECONDS);
+
+ int result = mappingReqsCounter.get();
+
+ assertEquals("Expected requests count is 3, actual is " + result, 3, result);
}
/**
@@ -262,6 +302,7 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
GridMessageListener wrapper = new GridMessageListener() {
@Override public void onMessage(UUID nodeId, Object msg) {
mappingReqsCounter.incrementAndGet();
+
delegate.onMessage(nodeId, msg);
}
};
@@ -272,7 +313,11 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
/**
*
*/
- private void replaceWithStoppingMappingRequestListener(GridIoManager ioMgr, final int nodeIdToStop) {
+ private void replaceWithStoppingMappingRequestListener(
+ GridIoManager ioMgr,
+ final int nodeIdToStop,
+ final CountDownLatch latch
+ ) {
ioMgr.removeMessageListener(GridTopic.TOPIC_MAPPING_MARSH);
ioMgr.addMessageListener(GridTopic.TOPIC_MAPPING_MARSH, new GridMessageListener() {
@@ -280,6 +325,9 @@ public class IgniteMarshallerCacheClientRequestsMappingOnMissTest extends GridCo
new Thread(new Runnable() {
@Override public void run() {
mappingReqsCounter.incrementAndGet();
+
+ latch.countDown();
+
stopGrid(nodeIdToStop, true);
}
}).start();
[36/50] [abbrv] ignite git commit: IGNITE-3581: Moved enums to
separate structs for C++
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record_storage.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record_storage.cpp b/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record_storage.cpp
index c075567..4b90e44 100644
--- a/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record_storage.cpp
+++ b/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record_storage.cpp
@@ -30,7 +30,7 @@ namespace ignite
rowCount(0),
dynamicFunction(),
dynamicFunctionCode(0),
- result(SQL_RESULT_SUCCESS),
+ result(SqlResult::AI_SUCCESS),
rowsAffected(0)
{
// No-op.
@@ -41,7 +41,7 @@ namespace ignite
// No-op.
}
- void DiagnosticRecordStorage::SetHeaderRecord(SqlResult result)
+ void DiagnosticRecordStorage::SetHeaderRecord(SqlResult::Type result)
{
rowCount = 0;
dynamicFunction.clear();
@@ -57,12 +57,12 @@ namespace ignite
void DiagnosticRecordStorage::Reset()
{
- SetHeaderRecord(SQL_RESULT_ERROR);
+ SetHeaderRecord(SqlResult::AI_ERROR);
statusRecords.clear();
}
- SqlResult DiagnosticRecordStorage::GetOperaionResult() const
+ SqlResult::Type DiagnosticRecordStorage::GetOperaionResult() const
{
return result;
}
@@ -122,55 +122,55 @@ namespace ignite
bool DiagnosticRecordStorage::IsSuccessful() const
{
- return result == SQL_RESULT_SUCCESS ||
- result == SQL_RESULT_SUCCESS_WITH_INFO;
+ return result == SqlResult::AI_SUCCESS ||
+ result == SqlResult::AI_SUCCESS_WITH_INFO;
}
- SqlResult DiagnosticRecordStorage::GetField(int32_t recNum, DiagnosticField field, app::ApplicationDataBuffer& buffer) const
+ SqlResult::Type DiagnosticRecordStorage::GetField(int32_t recNum, DiagnosticField::Type field, app::ApplicationDataBuffer& buffer) const
{
// Header record.
switch (field)
{
- case IGNITE_SQL_DIAG_HEADER_CURSOR_ROW_COUNT:
+ case DiagnosticField::HEADER_CURSOR_ROW_COUNT:
{
buffer.PutInt64(GetRowCount());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION:
+ case DiagnosticField::HEADER_DYNAMIC_FUNCTION:
{
buffer.PutString(GetDynamicFunction());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION_CODE:
+ case DiagnosticField::HEADER_DYNAMIC_FUNCTION_CODE:
{
buffer.PutInt32(GetDynamicFunctionCode());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_HEADER_NUMBER:
+ case DiagnosticField::HEADER_NUMBER:
{
buffer.PutInt32(GetStatusRecordsNumber());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_HEADER_RETURNCODE:
+ case DiagnosticField::HEADER_RETURNCODE:
{
buffer.PutInt32(GetReturnCode());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_HEADER_ROW_COUNT:
+ case DiagnosticField::HEADER_ROW_COUNT:
{
buffer.PutInt64(GetRowsAffected());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
default:
@@ -178,81 +178,81 @@ namespace ignite
}
if (recNum < 1 || static_cast<size_t>(recNum) > statusRecords.size())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
// Status record.
const DiagnosticRecord& record = GetStatusRecord(recNum);
switch (field)
{
- case IGNITE_SQL_DIAG_STATUS_CLASS_ORIGIN:
+ case DiagnosticField::STATUS_CLASS_ORIGIN:
{
buffer.PutString(record.GetClassOrigin());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_STATUS_COLUMN_NUMBER:
+ case DiagnosticField::STATUS_COLUMN_NUMBER:
{
buffer.PutInt32(record.GetColumnNumber());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_STATUS_CONNECTION_NAME:
+ case DiagnosticField::STATUS_CONNECTION_NAME:
{
buffer.PutString(record.GetConnectionName());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_STATUS_MESSAGE_TEXT:
+ case DiagnosticField::STATUS_MESSAGE_TEXT:
{
buffer.PutString(record.GetMessageText());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_STATUS_NATIVE:
+ case DiagnosticField::STATUS_NATIVE:
{
buffer.PutInt32(0);
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_STATUS_ROW_NUMBER:
+ case DiagnosticField::STATUS_ROW_NUMBER:
{
buffer.PutInt64(record.GetRowNumber());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_STATUS_SERVER_NAME:
+ case DiagnosticField::STATUS_SERVER_NAME:
{
buffer.PutString(record.GetServerName());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_STATUS_SQLSTATE:
+ case DiagnosticField::STATUS_SQLSTATE:
{
buffer.PutString(record.GetSqlState());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_DIAG_STATUS_SUBCLASS_ORIGIN:
+ case DiagnosticField::STATUS_SUBCLASS_ORIGIN:
{
buffer.PutString(record.GetSubclassOrigin());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
default:
break;
}
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/environment.cpp b/modules/platforms/cpp/odbc/src/environment.cpp
index 3928295..6182fa2 100644
--- a/modules/platforms/cpp/odbc/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/src/environment.cpp
@@ -43,18 +43,18 @@ namespace ignite
return connection;
}
- SqlResult Environment::InternalCreateConnection(Connection*& connection)
+ SqlResult::Type Environment::InternalCreateConnection(Connection*& connection)
{
connection = new Connection;
if (!connection)
{
- AddStatusRecord(SQL_STATE_HY001_MEMORY_ALLOCATION, "Not enough memory.");
+ AddStatusRecord(SqlState::SHY001_MEMORY_ALLOCATION, "Not enough memory.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Environment::TransactionCommit()
@@ -62,9 +62,9 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalTransactionCommit());
}
- SqlResult Environment::InternalTransactionCommit()
+ SqlResult::Type Environment::InternalTransactionCommit()
{
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Environment::TransactionRollback()
@@ -72,12 +72,12 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalTransactionRollback());
}
- SqlResult Environment::InternalTransactionRollback()
+ SqlResult::Type Environment::InternalTransactionRollback()
{
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Rollback operation is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
void Environment::SetAttribute(int32_t attr, void* value, int32_t len)
@@ -85,51 +85,51 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalSetAttribute(attr, value, len));
}
- SqlResult Environment::InternalSetAttribute(int32_t attr, void* value, int32_t len)
+ SqlResult::Type Environment::InternalSetAttribute(int32_t attr, void* value, int32_t len)
{
- EnvironmentAttribute attribute = EnvironmentAttributeToInternal(attr);
+ EnvironmentAttribute::Type attribute = EnvironmentAttributeToInternal(attr);
switch (attribute)
{
- case IGNITE_SQL_ENV_ATTR_ODBC_VERSION:
+ case EnvironmentAttribute::ODBC_VERSION:
{
int32_t version = static_cast<int32_t>(reinterpret_cast<intptr_t>(value));
if (version != odbcVersion)
{
- AddStatusRecord(SQL_STATE_01S02_OPTION_VALUE_CHANGED,
+ AddStatusRecord(SqlState::S01S02_OPTION_VALUE_CHANGED,
"ODBC version is not supported.");
- return SQL_RESULT_SUCCESS_WITH_INFO;
+ return SqlResult::AI_SUCCESS_WITH_INFO;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_ENV_ATTR_OUTPUT_NTS:
+ case EnvironmentAttribute::OUTPUT_NTS:
{
int32_t nts = static_cast<int32_t>(reinterpret_cast<intptr_t>(value));
if (nts != odbcNts)
{
- AddStatusRecord(SQL_STATE_01S02_OPTION_VALUE_CHANGED,
+ AddStatusRecord(SqlState::S01S02_OPTION_VALUE_CHANGED,
"Only null-termination of strings is supported.");
- return SQL_RESULT_SUCCESS_WITH_INFO;
+ return SqlResult::AI_SUCCESS_WITH_INFO;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_ENV_ATTR_UNKNOWN:
+ case EnvironmentAttribute::UNKNOWN:
default:
break;
}
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Attribute is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
void Environment::GetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer)
@@ -137,35 +137,35 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalGetAttribute(attr, buffer));
}
- SqlResult Environment::InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer)
+ SqlResult::Type Environment::InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer)
{
- EnvironmentAttribute attribute = EnvironmentAttributeToInternal(attr);
+ EnvironmentAttribute::Type attribute = EnvironmentAttributeToInternal(attr);
switch (attribute)
{
- case IGNITE_SQL_ENV_ATTR_ODBC_VERSION:
+ case EnvironmentAttribute::ODBC_VERSION:
{
buffer.PutInt32(odbcVersion);
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_ENV_ATTR_OUTPUT_NTS:
+ case EnvironmentAttribute::OUTPUT_NTS:
{
buffer.PutInt32(odbcNts);
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- case IGNITE_SQL_ENV_ATTR_UNKNOWN:
+ case EnvironmentAttribute::UNKNOWN:
default:
break;
}
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Attribute is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/odbc.cpp b/modules/platforms/cpp/odbc/src/odbc.cpp
index 542e64c..ed5e362 100644
--- a/modules/platforms/cpp/odbc/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/src/odbc.cpp
@@ -85,7 +85,7 @@ namespace ignite
*result = 0;
connection->GetDiagnosticRecords().Reset();
- connection->AddStatusRecord(odbc::SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED,
+ connection->AddStatusRecord(odbc::SqlState::SIM001_FUNCTION_NOT_SUPPORTED,
"The HandleType argument was SQL_HANDLE_DESC, and "
"the driver does not support allocating a descriptor handle");
@@ -919,11 +919,11 @@ namespace ignite
LOG_MSG("SQLGetDiagField called: " << recNum);
SqlLen outResLen;
- ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_DEFAULT, buffer, bufferLen, &outResLen);
+ ApplicationDataBuffer outBuffer(OdbcNativeType::AI_DEFAULT, buffer, bufferLen, &outResLen);
- SqlResult result;
+ SqlResult::Type result;
- DiagnosticField field = DiagnosticFieldToInternal(diagId);
+ DiagnosticField::Type field = DiagnosticFieldToInternal(diagId);
switch (handleType)
{
@@ -940,12 +940,12 @@ namespace ignite
default:
{
- result = SQL_RESULT_NO_DATA;
+ result = SqlResult::AI_NO_DATA;
break;
}
}
- if (resLen && result == SQL_RESULT_SUCCESS)
+ if (resLen && result == SqlResult::AI_SUCCESS)
*resLen = static_cast<SQLSMALLINT>(outResLen);
return SqlResultToReturnCode(result);
@@ -1000,7 +1000,7 @@ namespace ignite
*nativeError = 0;
SqlLen outResLen;
- ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_CHAR, msgBuffer, msgBufferLen, &outResLen);
+ ApplicationDataBuffer outBuffer(OdbcNativeType::AI_CHAR, msgBuffer, msgBufferLen, &outResLen);
outBuffer.PutString(record.GetMessageText());
@@ -1100,7 +1100,7 @@ namespace ignite
if (!statement)
return SQL_INVALID_HANDLE;
- IgniteSqlType driverType = ToDriverType(targetType);
+ OdbcNativeType::Type driverType = ToDriverType(targetType);
ApplicationDataBuffer dataBuffer(driverType, targetValue, bufferLength, strLengthOrIndicator);
@@ -1147,7 +1147,7 @@ namespace ignite
return SQL_INVALID_HANDLE;
SqlLen outResLen;
- ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_DEFAULT, valueBuf,
+ ApplicationDataBuffer outBuffer(OdbcNativeType::AI_DEFAULT, valueBuf,
static_cast<int32_t>(valueBufLen), &outResLen);
environment->GetAttribute(attr, outBuffer);
@@ -1295,7 +1295,7 @@ namespace ignite
*error = 0;
SqlLen outResLen;
- ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_CHAR, msgBuf, msgBufLen, &outResLen);
+ ApplicationDataBuffer outBuffer(OdbcNativeType::AI_CHAR, msgBuf, msgBufLen, &outResLen);
outBuffer.PutString(record.GetMessageText());
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
index 9aa5f7d..cca3eb5 100644
--- a/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
@@ -25,43 +25,46 @@
namespace
{
- enum ResultColumn
+ struct ResultColumn
{
- /** Catalog name. NULL if not applicable to the data source. */
- TABLE_CAT = 1,
+ enum Type
+ {
+ /** Catalog name. NULL if not applicable to the data source. */
+ TABLE_CAT = 1,
- /** Schema name. NULL if not applicable to the data source. */
- TABLE_SCHEM,
+ /** Schema name. NULL if not applicable to the data source. */
+ TABLE_SCHEM,
- /** Table name. */
- TABLE_NAME,
+ /** Table name. */
+ TABLE_NAME,
- /** Column name. */
- COLUMN_NAME,
+ /** Column name. */
+ COLUMN_NAME,
- /** SQL data type. */
- DATA_TYPE,
+ /** SQL data type. */
+ DATA_TYPE,
- /** Data source\ufffddependent data type name. */
- TYPE_NAME,
+ /** Data source\ufffddependent data type name. */
+ TYPE_NAME,
- /** Column size. */
- COLUMN_SIZE,
+ /** Column size. */
+ COLUMN_SIZE,
- /** The length in bytes of data transferred on fetch. */
- BUFFER_LENGTH,
+ /** The length in bytes of data transferred on fetch. */
+ BUFFER_LENGTH,
- /** The total number of significant digits to the right of the decimal point. */
- DECIMAL_DIGITS,
+ /** The total number of significant digits to the right of the decimal point. */
+ DECIMAL_DIGITS,
- /** Precision. */
- NUM_PREC_RADIX,
+ /** Precision. */
+ NUM_PREC_RADIX,
- /** Nullability of the data in column. */
- NULLABLE,
+ /** Nullability of the data in column. */
+ NULLABLE,
- /** A description of the column. */
- REMARKS
+ /** A description of the column. */
+ REMARKS
+ };
};
}
@@ -74,7 +77,7 @@ namespace ignite
ColumnMetadataQuery::ColumnMetadataQuery(diagnostic::Diagnosable& diag,
Connection& connection, const std::string& schema,
const std::string& table, const std::string& column) :
- Query(diag, COLUMN_METADATA),
+ Query(diag, QueryType::COLUMN_METADATA),
connection(connection),
schema(schema),
table(table),
@@ -112,14 +115,14 @@ namespace ignite
// No-op.
}
- SqlResult ColumnMetadataQuery::Execute()
+ SqlResult::Type ColumnMetadataQuery::Execute()
{
if (executed)
Close();
- SqlResult result = MakeRequestGetColumnsMeta();
+ SqlResult::Type result = MakeRequestGetColumnsMeta();
- if (result == SQL_RESULT_SUCCESS)
+ if (result == SqlResult::AI_SUCCESS)
{
executed = true;
@@ -134,17 +137,17 @@ namespace ignite
return columnsMeta;
}
- SqlResult ColumnMetadataQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
+ SqlResult::Type ColumnMetadataQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (cursor == meta.end())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
app::ColumnBindingMap::iterator it;
@@ -153,75 +156,75 @@ namespace ignite
++cursor;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult ColumnMetadataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
+ SqlResult::Type ColumnMetadataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (cursor == meta.end())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
const meta::ColumnMeta& currentColumn = *cursor;
uint8_t columnType = currentColumn.GetDataType();
switch (columnIdx)
{
- case TABLE_CAT:
+ case ResultColumn::TABLE_CAT:
{
buffer.PutNull();
break;
}
- case TABLE_SCHEM:
+ case ResultColumn::TABLE_SCHEM:
{
buffer.PutString(currentColumn.GetSchemaName());
break;
}
- case TABLE_NAME:
+ case ResultColumn::TABLE_NAME:
{
buffer.PutString(currentColumn.GetTableName());
break;
}
- case COLUMN_NAME:
+ case ResultColumn::COLUMN_NAME:
{
buffer.PutString(currentColumn.GetColumnName());
break;
}
- case DATA_TYPE:
+ case ResultColumn::DATA_TYPE:
{
buffer.PutInt16(type_traits::BinaryToSqlType(columnType));
break;
}
- case TYPE_NAME:
+ case ResultColumn::TYPE_NAME:
{
buffer.PutString(type_traits::BinaryTypeToSqlTypeName(currentColumn.GetDataType()));
break;
}
- case COLUMN_SIZE:
+ case ResultColumn::COLUMN_SIZE:
{
buffer.PutInt16(type_traits::BinaryTypeColumnSize(columnType));
break;
}
- case BUFFER_LENGTH:
+ case ResultColumn::BUFFER_LENGTH:
{
buffer.PutInt16(type_traits::BinaryTypeTransferLength(columnType));
break;
}
- case DECIMAL_DIGITS:
+ case ResultColumn::DECIMAL_DIGITS:
{
int32_t decDigits = type_traits::BinaryTypeDecimalDigits(columnType);
if (decDigits < 0)
@@ -231,19 +234,19 @@ namespace ignite
break;
}
- case NUM_PREC_RADIX:
+ case ResultColumn::NUM_PREC_RADIX:
{
buffer.PutInt16(type_traits::BinaryTypeNumPrecRadix(columnType));
break;
}
- case NULLABLE:
+ case ResultColumn::NULLABLE:
{
buffer.PutInt16(type_traits::BinaryTypeNullability(columnType));
break;
}
- case REMARKS:
+ case ResultColumn::REMARKS:
{
buffer.PutNull();
break;
@@ -253,16 +256,16 @@ namespace ignite
break;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult ColumnMetadataQuery::Close()
+ SqlResult::Type ColumnMetadataQuery::Close()
{
meta.clear();
executed = false;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
bool ColumnMetadataQuery::DataAvailable() const
@@ -275,7 +278,7 @@ namespace ignite
return 0;
}
- SqlResult ColumnMetadataQuery::MakeRequestGetColumnsMeta()
+ SqlResult::Type ColumnMetadataQuery::MakeRequestGetColumnsMeta()
{
QueryGetColumnsMetaRequest req(schema, table, column);
QueryGetColumnsMetaResponse rsp;
@@ -286,17 +289,17 @@ namespace ignite
}
catch (const IgniteError& err)
{
- diag.AddStatusRecord(SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT, err.GetText());
+ diag.AddStatusRecord(SqlState::SHYT01_CONNECTIOIN_TIMEOUT, err.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
+ if (rsp.GetStatus() != ResponseStatus::SUCCESS)
{
LOG_MSG("Error: " << rsp.GetError());
- diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
+ diag.AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, rsp.GetError());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
meta = rsp.GetMeta();
@@ -309,7 +312,7 @@ namespace ignite
<< "\n[" << i << "] ColumnType: " << meta[i].GetDataType());
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/query/data_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/data_query.cpp b/modules/platforms/cpp/odbc/src/query/data_query.cpp
index c9762ad..33e763f 100644
--- a/modules/platforms/cpp/odbc/src/query/data_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/data_query.cpp
@@ -29,7 +29,7 @@ namespace ignite
DataQuery::DataQuery(diagnostic::Diagnosable& diag,
Connection& connection, const std::string& sql,
const app::ParameterBindingMap& params) :
- Query(diag, DATA),
+ Query(diag, QueryType::DATA),
connection(connection),
sql(sql),
params(params)
@@ -42,13 +42,13 @@ namespace ignite
Close();
}
- SqlResult DataQuery::Execute()
+ SqlResult::Type DataQuery::Execute()
{
if (cursor.get())
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query cursor is in open state already.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query cursor is in open state already.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
return MakeRequestExecute();
@@ -59,38 +59,38 @@ namespace ignite
return resultMeta;
}
- SqlResult DataQuery::FetchNextRow(app::ColumnBindingMap& columnBindings)
+ SqlResult::Type DataQuery::FetchNextRow(app::ColumnBindingMap& columnBindings)
{
if (!cursor.get())
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (!cursor->HasData())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
cursor->Increment();
if (cursor->NeedDataUpdate())
{
- SqlResult result = MakeRequestFetch();
+ SqlResult::Type result = MakeRequestFetch();
- if (result != SQL_RESULT_SUCCESS)
+ if (result != SqlResult::AI_SUCCESS)
return result;
}
if (!cursor->HasData())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
Row* row = cursor->GetRow();
if (!row)
{
- diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Unknown error.");
+ diag.AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, "Unknown error.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
for (int32_t i = 1; i < row->GetSize() + 1; ++i)
@@ -100,53 +100,53 @@ namespace ignite
if (it == columnBindings.end())
continue;
- SqlResult result = row->ReadColumnToBuffer(i, it->second);
+ SqlResult::Type result = row->ReadColumnToBuffer(i, it->second);
- if (result == SQL_RESULT_ERROR)
+ if (result == SqlResult::AI_ERROR)
{
- diag.AddStatusRecord(SQL_STATE_01S01_ERROR_IN_ROW, "Can not retrieve row column.", 0, i);
+ diag.AddStatusRecord(SqlState::S01S01_ERROR_IN_ROW, "Can not retrieve row column.", 0, i);
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult DataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+ SqlResult::Type DataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
{
if (!cursor.get())
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
Row* row = cursor->GetRow();
if (!row)
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
- SqlResult result = row->ReadColumnToBuffer(columnIdx, buffer);
+ SqlResult::Type result = row->ReadColumnToBuffer(columnIdx, buffer);
- if (result == SQL_RESULT_ERROR)
+ if (result == SqlResult::AI_ERROR)
{
- diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Unknown column type.");
+ diag.AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, "Unknown column type.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
return result;
}
- SqlResult DataQuery::Close()
+ SqlResult::Type DataQuery::Close()
{
if (!cursor.get())
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
- SqlResult result = MakeRequestClose();
+ SqlResult::Type result = MakeRequestClose();
- if (result == SQL_RESULT_SUCCESS)
+ if (result == SqlResult::AI_SUCCESS)
{
cursor.reset();
@@ -167,7 +167,7 @@ namespace ignite
return 0;
}
- SqlResult DataQuery::MakeRequestExecute()
+ SqlResult::Type DataQuery::MakeRequestExecute()
{
const std::string& cacheName = connection.GetCache();
@@ -180,18 +180,18 @@ namespace ignite
}
catch (const IgniteError& err)
{
- diag.AddStatusRecord(SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT, err.GetText());
+ diag.AddStatusRecord(SqlState::SHYT01_CONNECTIOIN_TIMEOUT, err.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
+ if (rsp.GetStatus() != ResponseStatus::SUCCESS)
{
LOG_MSG("Error: " << rsp.GetError());
- diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
+ diag.AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, rsp.GetError());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
cursor.reset(new Cursor(rsp.GetQueryId()));
@@ -207,10 +207,10 @@ namespace ignite
<< "\n[" << i << "] ColumnType: " << rsp.GetMeta()[i].GetDataType());
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult DataQuery::MakeRequestClose()
+ SqlResult::Type DataQuery::MakeRequestClose()
{
QueryCloseRequest req(cursor->GetQueryId());
QueryCloseResponse rsp;
@@ -221,26 +221,26 @@ namespace ignite
}
catch (const IgniteError& err)
{
- diag.AddStatusRecord(SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT, err.GetText());
+ diag.AddStatusRecord(SqlState::SHYT01_CONNECTIOIN_TIMEOUT, err.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
LOG_MSG("Query id: " << rsp.GetQueryId());
- if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
+ if (rsp.GetStatus() != ResponseStatus::SUCCESS)
{
LOG_MSG("Error: " << rsp.GetError());
- diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
+ diag.AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, rsp.GetError());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult DataQuery::MakeRequestFetch()
+ SqlResult::Type DataQuery::MakeRequestFetch()
{
std::auto_ptr<ResultPage> resultPage(new ResultPage());
@@ -253,23 +253,23 @@ namespace ignite
}
catch (const IgniteError& err)
{
- diag.AddStatusRecord(SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT, err.GetText());
+ diag.AddStatusRecord(SqlState::SHYT01_CONNECTIOIN_TIMEOUT, err.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
+ if (rsp.GetStatus() != ResponseStatus::SUCCESS)
{
LOG_MSG("Error: " << rsp.GetError());
- diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
+ diag.AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, rsp.GetError());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
cursor->UpdateData(resultPage);
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/query/foreign_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/foreign_keys_query.cpp b/modules/platforms/cpp/odbc/src/query/foreign_keys_query.cpp
index 5813767..4ca7709 100644
--- a/modules/platforms/cpp/odbc/src/query/foreign_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/foreign_keys_query.cpp
@@ -32,7 +32,7 @@ namespace ignite
const std::string& primaryCatalog, const std::string& primarySchema,
const std::string& primaryTable, const std::string& foreignCatalog,
const std::string& foreignSchema, const std::string& foreignTable) :
- Query(diag, FOREIGN_KEYS),
+ Query(diag, QueryType::FOREIGN_KEYS),
connection(connection),
primaryCatalog(primaryCatalog),
primarySchema(primarySchema),
@@ -74,11 +74,11 @@ namespace ignite
// No-op.
}
- SqlResult ForeignKeysQuery::Execute()
+ SqlResult::Type ForeignKeysQuery::Execute()
{
executed = true;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
const meta::ColumnMetaVector & ForeignKeysQuery::GetMeta() const
@@ -86,35 +86,35 @@ namespace ignite
return columnsMeta;
}
- SqlResult ForeignKeysQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
+ SqlResult::Type ForeignKeysQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
}
- SqlResult ForeignKeysQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+ SqlResult::Type ForeignKeysQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
}
- SqlResult ForeignKeysQuery::Close()
+ SqlResult::Type ForeignKeysQuery::Close()
{
executed = false;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
bool ForeignKeysQuery::DataAvailable() const
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/query/primary_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/primary_keys_query.cpp b/modules/platforms/cpp/odbc/src/query/primary_keys_query.cpp
index a24670d..ef99db3 100644
--- a/modules/platforms/cpp/odbc/src/query/primary_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/primary_keys_query.cpp
@@ -24,25 +24,28 @@
namespace
{
- enum ResultColumn
+ struct ResultColumn
{
- /** Catalog name. NULL if not applicable to the data source. */
- TABLE_CAT = 1,
+ enum Type
+ {
+ /** Catalog name. NULL if not applicable to the data source. */
+ TABLE_CAT = 1,
- /** Schema name. NULL if not applicable to the data source. */
- TABLE_SCHEM,
+ /** Schema name. NULL if not applicable to the data source. */
+ TABLE_SCHEM,
- /** Table name. */
- TABLE_NAME,
+ /** Table name. */
+ TABLE_NAME,
- /** Column name. */
- COLUMN_NAME,
+ /** Column name. */
+ COLUMN_NAME,
- /** Column sequence number in key. */
- KEY_SEQ,
+ /** Column sequence number in key. */
+ KEY_SEQ,
- /** Primary key name. */
- PK_NAME
+ /** Primary key name. */
+ PK_NAME
+ };
};
}
@@ -55,7 +58,7 @@ namespace ignite
PrimaryKeysQuery::PrimaryKeysQuery(diagnostic::Diagnosable& diag,
Connection& connection, const std::string& catalog,
const std::string& schema, const std::string& table) :
- Query(diag, PRIMARY_KEYS),
+ Query(diag, QueryType::PRIMARY_KEYS),
connection(connection),
catalog(catalog),
schema(schema),
@@ -86,7 +89,7 @@ namespace ignite
// No-op.
}
- SqlResult PrimaryKeysQuery::Execute()
+ SqlResult::Type PrimaryKeysQuery::Execute()
{
if (executed)
Close();
@@ -97,7 +100,7 @@ namespace ignite
cursor = meta.begin();
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
const meta::ColumnMetaVector & PrimaryKeysQuery::GetMeta() const
@@ -105,17 +108,17 @@ namespace ignite
return columnsMeta;
}
- SqlResult PrimaryKeysQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
+ SqlResult::Type PrimaryKeysQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (cursor == meta.end())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
app::ColumnBindingMap::iterator it;
@@ -124,56 +127,56 @@ namespace ignite
++cursor;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult PrimaryKeysQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+ SqlResult::Type PrimaryKeysQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (cursor == meta.end())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
const meta::PrimaryKeyMeta& currentColumn = *cursor;
switch (columnIdx)
{
- case TABLE_CAT:
+ case ResultColumn::TABLE_CAT:
{
buffer.PutString(currentColumn.GetCatalogName());
break;
}
- case TABLE_SCHEM:
+ case ResultColumn::TABLE_SCHEM:
{
buffer.PutString(currentColumn.GetSchemaName());
break;
}
- case TABLE_NAME:
+ case ResultColumn::TABLE_NAME:
{
buffer.PutString(currentColumn.GetTableName());
break;
}
- case COLUMN_NAME:
+ case ResultColumn::COLUMN_NAME:
{
buffer.PutString(currentColumn.GetColumnName());
break;
}
- case KEY_SEQ:
+ case ResultColumn::KEY_SEQ:
{
buffer.PutInt16(currentColumn.GetKeySeq());
break;
}
- case PK_NAME:
+ case ResultColumn::PK_NAME:
{
buffer.PutString(currentColumn.GetKeyName());
break;
@@ -183,16 +186,16 @@ namespace ignite
break;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult PrimaryKeysQuery::Close()
+ SqlResult::Type PrimaryKeysQuery::Close()
{
meta.clear();
executed = false;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
bool PrimaryKeysQuery::DataAvailable() const
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/query/special_columns_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/special_columns_query.cpp b/modules/platforms/cpp/odbc/src/query/special_columns_query.cpp
index f507c52..b0f534c 100644
--- a/modules/platforms/cpp/odbc/src/query/special_columns_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/special_columns_query.cpp
@@ -29,7 +29,7 @@ namespace ignite
SpecialColumnsQuery::SpecialColumnsQuery(diagnostic::Diagnosable& diag,
int16_t type, const std::string& catalog, const std::string& schema,
const std::string& table, int16_t scope, int16_t nullable) :
- Query(diag, SPECIAL_COLUMNS),
+ Query(diag, QueryType::SPECIAL_COLUMNS),
type(type),
catalog(catalog),
schema(schema),
@@ -64,11 +64,11 @@ namespace ignite
// No-op.
}
- SqlResult SpecialColumnsQuery::Execute()
+ SqlResult::Type SpecialColumnsQuery::Execute()
{
executed = true;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
const meta::ColumnMetaVector& SpecialColumnsQuery::GetMeta() const
@@ -76,35 +76,35 @@ namespace ignite
return columnsMeta;
}
- SqlResult SpecialColumnsQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
+ SqlResult::Type SpecialColumnsQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
}
- SqlResult SpecialColumnsQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+ SqlResult::Type SpecialColumnsQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
}
- SqlResult SpecialColumnsQuery::Close()
+ SqlResult::Type SpecialColumnsQuery::Close()
{
executed = false;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
bool SpecialColumnsQuery::DataAvailable() const
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp b/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
index 4fd5f7b..401a1d2 100644
--- a/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
@@ -25,22 +25,25 @@
namespace
{
- enum ResultColumn
+ struct ResultColumn
{
- /** Catalog name. NULL if not applicable to the data source. */
- TABLE_CAT = 1,
+ enum Type
+ {
+ /** Catalog name. NULL if not applicable to the data source. */
+ TABLE_CAT = 1,
- /** Schema name. NULL if not applicable to the data source. */
- TABLE_SCHEM,
+ /** Schema name. NULL if not applicable to the data source. */
+ TABLE_SCHEM,
- /** Table name. */
- TABLE_NAME,
+ /** Table name. */
+ TABLE_NAME,
- /** Table type. */
- TABLE_TYPE,
+ /** Table type. */
+ TABLE_TYPE,
- /** A description of the column. */
- REMARKS
+ /** A description of the column. */
+ REMARKS
+ };
};
}
@@ -53,7 +56,7 @@ namespace ignite
TableMetadataQuery::TableMetadataQuery(diagnostic::Diagnosable& diag,
Connection& connection, const std::string& catalog,const std::string& schema,
const std::string& table, const std::string& tableType) :
- Query(diag, TABLE_METADATA),
+ Query(diag, QueryType::TABLE_METADATA),
connection(connection),
catalog(catalog),
schema(schema),
@@ -85,14 +88,14 @@ namespace ignite
// No-op.
}
- SqlResult TableMetadataQuery::Execute()
+ SqlResult::Type TableMetadataQuery::Execute()
{
if (executed)
Close();
- SqlResult result = MakeRequestGetTablesMeta();
+ SqlResult::Type result = MakeRequestGetTablesMeta();
- if (result == SQL_RESULT_SUCCESS)
+ if (result == SqlResult::AI_SUCCESS)
{
executed = true;
@@ -107,17 +110,17 @@ namespace ignite
return columnsMeta;
}
- SqlResult TableMetadataQuery::FetchNextRow(app::ColumnBindingMap& columnBindings)
+ SqlResult::Type TableMetadataQuery::FetchNextRow(app::ColumnBindingMap& columnBindings)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (cursor == meta.end())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
app::ColumnBindingMap::iterator it;
@@ -126,50 +129,50 @@ namespace ignite
++cursor;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult TableMetadataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
+ SqlResult::Type TableMetadataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (cursor == meta.end())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
const meta::TableMeta& currentColumn = *cursor;
switch (columnIdx)
{
- case TABLE_CAT:
+ case ResultColumn::TABLE_CAT:
{
buffer.PutString(currentColumn.GetCatalogName());
break;
}
- case TABLE_SCHEM:
+ case ResultColumn::TABLE_SCHEM:
{
buffer.PutString(currentColumn.GetSchemaName());
break;
}
- case TABLE_NAME:
+ case ResultColumn::TABLE_NAME:
{
buffer.PutString(currentColumn.GetTableName());
break;
}
- case TABLE_TYPE:
+ case ResultColumn::TABLE_TYPE:
{
buffer.PutString(currentColumn.GetTableType());
break;
}
- case REMARKS:
+ case ResultColumn::REMARKS:
{
buffer.PutNull();
break;
@@ -179,16 +182,16 @@ namespace ignite
break;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult TableMetadataQuery::Close()
+ SqlResult::Type TableMetadataQuery::Close()
{
meta.clear();
executed = false;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
bool TableMetadataQuery::DataAvailable() const
@@ -201,7 +204,7 @@ namespace ignite
return 0;
}
- SqlResult TableMetadataQuery::MakeRequestGetTablesMeta()
+ SqlResult::Type TableMetadataQuery::MakeRequestGetTablesMeta()
{
QueryGetTablesMetaRequest req(catalog, schema, table, tableType);
QueryGetTablesMetaResponse rsp;
@@ -212,18 +215,18 @@ namespace ignite
}
catch (const IgniteError& err)
{
- diag.AddStatusRecord(SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT, err.GetText());
+ diag.AddStatusRecord(SqlState::SHYT01_CONNECTIOIN_TIMEOUT, err.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
+ if (rsp.GetStatus() != ResponseStatus::SUCCESS)
{
LOG_MSG("Error: " << rsp.GetError());
- diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
+ diag.AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, rsp.GetError());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
meta = rsp.GetMeta();
@@ -236,7 +239,7 @@ namespace ignite
<< "\n[" << i << "] TableType: " << meta[i].GetTableType());
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/query/type_info_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/type_info_query.cpp b/modules/platforms/cpp/odbc/src/query/type_info_query.cpp
index 2de2a7c..280477b 100644
--- a/modules/platforms/cpp/odbc/src/query/type_info_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/type_info_query.cpp
@@ -25,87 +25,90 @@
namespace
{
- enum ResultColumn
+ struct ResultColumn
{
- /** Data source\ufffddependent data-type name. */
- TYPE_NAME = 1,
-
- /** SQL data type. */
- DATA_TYPE,
-
- /** The maximum column size that the server supports for this data type. */
- COLUMN_SIZE,
-
- /** Character or characters used to prefix a literal. */
- LITERAL_PREFIX,
-
- /** Character or characters used to terminate a literal. */
- LITERAL_SUFFIX,
-
- /**
- * A list of keywords, separated by commas, corresponding to each
- * parameter that the application may specify in parentheses when using
- * the name that is returned in the TYPE_NAME field.
- */
- CREATE_PARAMS,
-
- /** Whether the data type accepts a NULL value. */
- NULLABLE,
-
- /**
- * Whether a character data type is case-sensitive in collations and
- * comparisons.
- */
- CASE_SENSITIVE,
-
- /** How the data type is used in a WHERE clause. */
- SEARCHABLE,
-
- /** Whether the data type is unsigned. */
- UNSIGNED_ATTRIBUTE,
-
- /** Whether the data type has predefined fixed precision and scale. */
- FIXED_PREC_SCALE,
-
- /** Whether the data type is autoincrementing. */
- AUTO_UNIQUE_VALUE,
-
- /**
- * Localized version of the data source\ufffddependent name of the data
- * type.
- */
- LOCAL_TYPE_NAME,
-
- /** The minimum scale of the data type on the data source. */
- MINIMUM_SCALE,
-
- /** The maximum scale of the data type on the data source. */
- MAXIMUM_SCALE,
-
- /**
- * The value of the SQL data type as it appears in the SQL_DESC_TYPE
- * field of the descriptor.
- */
- SQL_DATA_TYPE,
-
- /**
- * When the value of SQL_DATA_TYPE is SQL_DATETIME or SQL_INTERVAL,
- * this column contains the datetime/interval subcode.
- */
- SQL_DATETIME_SUB,
-
- /**
- * If the data type is an approximate numeric type, this column
- * contains the value 2 to indicate that COLUMN_SIZE specifies a number
- * of bits.
- */
- NUM_PREC_RADIX,
-
- /**
- * If the data type is an interval data type, then this column contains
- * the value of the interval leading precision.
- */
- INTERVAL_PRECISION
+ enum Type
+ {
+ /** Data source\ufffddependent data-type name. */
+ TYPE_NAME = 1,
+
+ /** SQL data type. */
+ DATA_TYPE,
+
+ /** The maximum column size that the server supports for this data type. */
+ COLUMN_SIZE,
+
+ /** Character or characters used to prefix a literal. */
+ LITERAL_PREFIX,
+
+ /** Character or characters used to terminate a literal. */
+ LITERAL_SUFFIX,
+
+ /**
+ * A list of keywords, separated by commas, corresponding to each
+ * parameter that the application may specify in parentheses when using
+ * the name that is returned in the TYPE_NAME field.
+ */
+ CREATE_PARAMS,
+
+ /** Whether the data type accepts a NULL value. */
+ NULLABLE,
+
+ /**
+ * Whether a character data type is case-sensitive in collations and
+ * comparisons.
+ */
+ CASE_SENSITIVE,
+
+ /** How the data type is used in a WHERE clause. */
+ SEARCHABLE,
+
+ /** Whether the data type is unsigned. */
+ UNSIGNED_ATTRIBUTE,
+
+ /** Whether the data type has predefined fixed precision and scale. */
+ FIXED_PREC_SCALE,
+
+ /** Whether the data type is autoincrementing. */
+ AUTO_UNIQUE_VALUE,
+
+ /**
+ * Localized version of the data source\ufffddependent name of the data
+ * type.
+ */
+ LOCAL_TYPE_NAME,
+
+ /** The minimum scale of the data type on the data source. */
+ MINIMUM_SCALE,
+
+ /** The maximum scale of the data type on the data source. */
+ MAXIMUM_SCALE,
+
+ /**
+ * The value of the SQL data type as it appears in the SQL_DESC_TYPE
+ * field of the descriptor.
+ */
+ SQL_DATA_TYPE,
+
+ /**
+ * When the value of SQL_DATA_TYPE is SQL_DATETIME or SQL_INTERVAL,
+ * this column contains the datetime/interval subcode.
+ */
+ SQL_DATETIME_SUB,
+
+ /**
+ * If the data type is an approximate numeric type, this column
+ * contains the value 2 to indicate that COLUMN_SIZE specifies a number
+ * of bits.
+ */
+ NUM_PREC_RADIX,
+
+ /**
+ * If the data type is an interval data type, then this column contains
+ * the value of the interval leading precision.
+ */
+ INTERVAL_PRECISION
+ };
};
}
@@ -116,7 +119,7 @@ namespace ignite
namespace query
{
TypeInfoQuery::TypeInfoQuery(diagnostic::Diagnosable& diag, int16_t sqlType) :
- Query(diag, TYPE_INFO),
+ Query(diag, QueryType::TYPE_INFO),
columnsMeta(),
executed(false),
types(),
@@ -177,13 +180,13 @@ namespace ignite
// No-op.
}
- SqlResult TypeInfoQuery::Execute()
+ SqlResult::Type TypeInfoQuery::Execute()
{
cursor = types.begin();
executed = true;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
const meta::ColumnMetaVector & TypeInfoQuery::GetMeta() const
@@ -191,17 +194,17 @@ namespace ignite
return columnsMeta;
}
- SqlResult TypeInfoQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
+ SqlResult::Type TypeInfoQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
{
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (cursor == types.end())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
app::ColumnBindingMap::iterator it;
@@ -210,50 +213,50 @@ namespace ignite
++cursor;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult TypeInfoQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
+ SqlResult::Type TypeInfoQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
{
using namespace ignite::impl::binary;
if (!executed)
{
- diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+ diag.AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query was not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (cursor == types.end())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
int8_t currentType = *cursor;
switch (columnIdx)
{
- case TYPE_NAME:
+ case ResultColumn::TYPE_NAME:
{
buffer.PutString(type_traits::BinaryTypeToSqlTypeName(currentType));
break;
}
- case DATA_TYPE:
- case SQL_DATA_TYPE:
+ case ResultColumn::DATA_TYPE:
+ case ResultColumn::SQL_DATA_TYPE:
{
buffer.PutInt16(type_traits::BinaryToSqlType(currentType));
break;
}
- case COLUMN_SIZE:
+ case ResultColumn::COLUMN_SIZE:
{
buffer.PutInt32(type_traits::BinaryTypeColumnSize(currentType));
break;
}
- case LITERAL_PREFIX:
+ case ResultColumn::LITERAL_PREFIX:
{
if (currentType == IGNITE_TYPE_STRING)
buffer.PutString("'");
@@ -265,7 +268,7 @@ namespace ignite
break;
}
- case LITERAL_SUFFIX:
+ case ResultColumn::LITERAL_SUFFIX:
{
if (currentType == IGNITE_TYPE_STRING)
buffer.PutString("'");
@@ -275,21 +278,21 @@ namespace ignite
break;
}
- case CREATE_PARAMS:
+ case ResultColumn::CREATE_PARAMS:
{
buffer.PutNull();
break;
}
- case NULLABLE:
+ case ResultColumn::NULLABLE:
{
buffer.PutInt32(type_traits::BinaryTypeNullability(currentType));
break;
}
- case CASE_SENSITIVE:
+ case ResultColumn::CASE_SENSITIVE:
{
if (currentType == IGNITE_TYPE_STRING)
buffer.PutInt16(SQL_TRUE);
@@ -299,64 +302,64 @@ namespace ignite
break;
}
- case SEARCHABLE:
+ case ResultColumn::SEARCHABLE:
{
buffer.PutInt16(SQL_SEARCHABLE);
break;
}
- case UNSIGNED_ATTRIBUTE:
+ case ResultColumn::UNSIGNED_ATTRIBUTE:
{
buffer.PutInt16(type_traits::BinaryTypeUnsigned(currentType));
break;
}
- case FIXED_PREC_SCALE:
+ case ResultColumn::FIXED_PREC_SCALE:
{
buffer.PutInt16(SQL_FALSE);
break;
}
- case AUTO_UNIQUE_VALUE:
+ case ResultColumn::AUTO_UNIQUE_VALUE:
{
buffer.PutInt16(SQL_FALSE);
break;
}
- case LOCAL_TYPE_NAME:
+ case ResultColumn::LOCAL_TYPE_NAME:
{
buffer.PutNull();
break;
}
- case MINIMUM_SCALE:
- case MAXIMUM_SCALE:
+ case ResultColumn::MINIMUM_SCALE:
+ case ResultColumn::MAXIMUM_SCALE:
{
buffer.PutInt16(type_traits::BinaryTypeDecimalDigits(currentType));
break;
}
- case SQL_DATETIME_SUB:
+ case ResultColumn::SQL_DATETIME_SUB:
{
buffer.PutNull();
break;
}
- case NUM_PREC_RADIX:
+ case ResultColumn::NUM_PREC_RADIX:
{
buffer.PutInt32(type_traits::BinaryTypeNumPrecRadix(currentType));
break;
}
- case INTERVAL_PRECISION:
+ case ResultColumn::INTERVAL_PRECISION:
{
buffer.PutNull();
@@ -367,16 +370,16 @@ namespace ignite
break;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult TypeInfoQuery::Close()
+ SqlResult::Type TypeInfoQuery::Close()
{
cursor = types.end();
executed = false;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
bool TypeInfoQuery::DataAvailable() const
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/row.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/row.cpp b/modules/platforms/cpp/odbc/src/row.cpp
index 5e5a00e..34b061b 100644
--- a/modules/platforms/cpp/odbc/src/row.cpp
+++ b/modules/platforms/cpp/odbc/src/row.cpp
@@ -74,13 +74,13 @@ namespace ignite
return true;
}
- SqlResult Row::ReadColumnToBuffer(uint16_t columnIdx, app::ApplicationDataBuffer& dataBuf)
+ SqlResult::Type Row::ReadColumnToBuffer(uint16_t columnIdx, app::ApplicationDataBuffer& dataBuf)
{
using namespace ignite::impl::binary;
using namespace ignite::impl::interop;
if (!EnsureColumnDiscovered(columnIdx))
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
Column& column = GetColumn(columnIdx);
[15/50] [abbrv] ignite git commit: ignite-3477-master memory
configuration for test deadlockDetection
Posted by sb...@apache.org.
ignite-3477-master memory configuration for test deadlockDetection
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b066f609
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b066f609
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b066f609
Branch: refs/heads/ignite-4929
Commit: b066f6094997fd3b1b21e624f5599781320cfa83
Parents: 355efcd
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 18:33:17 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 18:33:17 2017 +0300
----------------------------------------------------------------------
.../TxPessimisticDeadlockDetectionTest.java | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b066f609/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java
index 9e7cb1c..4660972 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPessimisticDeadlockDetectionTest.java
@@ -36,6 +36,8 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
@@ -96,6 +98,18 @@ public class TxPessimisticDeadlockDetectionTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(discoSpi);
}
+ MemoryConfiguration memCfg = new MemoryConfiguration();
+
+ MemoryPolicyConfiguration plc = new MemoryPolicyConfiguration();
+
+ plc.setName("dfltPlc");
+ plc.setSize(MemoryConfiguration.DFLT_MEMORY_POLICY_SIZE * 10);
+
+ memCfg.setDefaultMemoryPolicyName("dfltPlc");
+ memCfg.setMemoryPolicies(plc);
+
+ cfg.setMemoryConfiguration(memCfg);
+
cfg.setClientMode(client);
return cfg;
@@ -190,6 +204,9 @@ public class TxPessimisticDeadlockDetectionTest extends GridCommonAbstractTest {
ccfg.setNearConfiguration(near ? new NearCacheConfiguration() : null);
ccfg.setWriteSynchronizationMode(syncMode);
+ if (cacheMode == LOCAL)
+ ccfg.setMemoryPolicyName("dfltPlc");
+
IgniteCache cache = ignite(0).createCache(ccfg);
if (near) {
[27/50] [abbrv] ignite git commit: Merge branch 'ignite-3477-master'
of https://github.com/gridgain/apache-ignite into ignite-3477-master
Posted by sb...@apache.org.
Merge branch 'ignite-3477-master' of https://github.com/gridgain/apache-ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1469f284
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1469f284
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1469f284
Branch: refs/heads/ignite-4929
Commit: 1469f2848e0dc190400b85ee501bf513d47d0239
Parents: 4849447 c31de27
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:32:43 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:32:43 2017 +0300
----------------------------------------------------------------------
.../cache/transactions/IgniteTxHandler.java | 6 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 4 +-
...lerCacheClientRequestsMappingOnMissTest.java | 94 +++++++++++++++-----
.../near/GridCacheNearTxForceKeyTest.java | 7 ++
.../TxPessimisticDeadlockDetectionTest.java | 17 ++++
.../hibernate/HibernateKeyTransformer.java | 2 +-
.../cache/hibernate/HibernateKeyWrapper.java | 2 +-
...QueryNodeRestartDistributedJoinSelfTest.java | 17 +++-
8 files changed, 121 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1469f284/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
index 47d54d5,66f34c9..f5b7635
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
@@@ -78,6 -76,15 +78,13 @@@ public class GridCacheNearTxForceKeyTes
assertNull(cache.getAndPut(key, key));
- awaitPartitionMapExchange();
-
assertTrue(ignite0.affinity(null).isPrimary(ignite1.cluster().localNode(), key));
}
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+
+ stopAllGrids();
+ }
}
[48/50] [abbrv] ignite git commit: .NET: Fix EventsTest
Posted by sb...@apache.org.
.NET: Fix EventsTest
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bec4a3eb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bec4a3eb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bec4a3eb
Branch: refs/heads/ignite-4929
Commit: bec4a3eba3aec10864202aef1c097d4dd3367b77
Parents: 40347ed
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Apr 14 11:05:20 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Apr 14 11:05:20 2017 +0300
----------------------------------------------------------------------
.../Cache/CacheMetricsTest.cs | 5 +--
.../Continuous/ContinuousQueryAbstractTest.cs | 41 +-------------------
.../Compute/ComputeApiTest.cs | 8 ++--
.../Apache.Ignite.Core.Tests/EventsTest.cs | 4 +-
.../Apache.Ignite.Core.Tests/TestUtils.cs | 21 ++++++++++
5 files changed, 30 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/bec4a3eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
index d12afd2..fd5822a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
@@ -25,7 +25,6 @@ namespace Apache.Ignite.Core.Tests.Cache
using Apache.Ignite.Core.Impl;
using Apache.Ignite.Core.Impl.Cache;
using NUnit.Framework;
- using System.Linq;
/// <summary>
/// Tests cache metrics propagation.
@@ -224,9 +223,7 @@ namespace Apache.Ignite.Core.Tests.Cache
Assert.IsTrue(localCache.GetConfiguration().EnableStatistics);
Assert.IsTrue(remoteCache.GetConfiguration().EnableStatistics);
- var aff = localIgnite.GetAffinity(cacheName);
- var localNode = localIgnite.GetCluster().GetLocalNode();
- var localKey = Enumerable.Range(1, 10000).First(x => aff.IsPrimary(localNode, x));
+ var localKey = TestUtils.GetPrimaryKey(localIgnite, cacheName);
localCache.Put(localKey, 1);
localCache.Get(localKey);
http://git-wip-us.apache.org/repos/asf/ignite/blob/bec4a3eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
index 3c0633d..57f3d00 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
@@ -30,7 +30,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous
using Apache.Ignite.Core.Cache.Event;
using Apache.Ignite.Core.Cache.Query;
using Apache.Ignite.Core.Cache.Query.Continuous;
- using Apache.Ignite.Core.Cluster;
using Apache.Ignite.Core.Common;
using Apache.Ignite.Core.Impl.Cache.Event;
using Apache.Ignite.Core.Resource;
@@ -712,7 +711,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous
public void TestBufferSize()
{
// Put two remote keys in advance.
- List<int> rmtKeys = PrimaryKeys(cache2, 2);
+ var rmtKeys = TestUtils.GetPrimaryKeys(cache2.Ignite, cache2.Name).Take(2).ToList();
ContinuousQuery<int, BinarizableEntry> qry = new ContinuousQuery<int, BinarizableEntry>(new Listener<BinarizableEntry>());
@@ -983,43 +982,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous
/// <returns>Primary key.</returns>
private static int PrimaryKey<T>(ICache<int, T> cache)
{
- return PrimaryKeys(cache, 1)[0];
- }
-
- /// <summary>
- /// Get primary keys for cache.
- /// </summary>
- /// <param name="cache">Cache.</param>
- /// <param name="cnt">Amount of keys.</param>
- /// <param name="startFrom">Value to start from.</param>
- /// <returns></returns>
- private static List<int> PrimaryKeys<T>(ICache<int, T> cache, int cnt, int startFrom = 0)
- {
- IClusterNode node = cache.Ignite.GetCluster().GetLocalNode();
-
- ICacheAffinity aff = cache.Ignite.GetAffinity(cache.Name);
-
- List<int> keys = new List<int>(cnt);
-
- Assert.IsTrue(
- TestUtils.WaitForCondition(() =>
- {
- for (int i = startFrom; i < startFrom + 100000; i++)
- {
- if (aff.IsPrimary(node, i))
- {
- keys.Add(i);
-
- if (keys.Count == cnt)
- return true;
- }
- }
-
- return false;
- }, 5000), "Failed to find " + cnt + " primary keys.");
-
-
- return keys;
+ return TestUtils.GetPrimaryKey(cache.Ignite, cache.Name);
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/bec4a3eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
index 3ef9ad0..b5b6c05 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
@@ -1177,9 +1177,9 @@ namespace Apache.Ignite.Core.Tests.Compute
foreach (var node in nodes)
{
- var primaryKey = Enumerable.Range(1, int.MaxValue).First(x => aff.IsPrimary(node, x));
+ var primaryKey = TestUtils.GetPrimaryKey(_grid1, cacheName, node);
- var affinityKey = _grid1.GetAffinity(cacheName).GetAffinityKey<int, int>(primaryKey);
+ var affinityKey = aff.GetAffinityKey<int, int>(primaryKey);
_grid1.GetCompute().AffinityRun(cacheName, affinityKey, new ComputeAction());
Assert.AreEqual(node.Id, ComputeAction.LastNodeId);
@@ -1204,9 +1204,9 @@ namespace Apache.Ignite.Core.Tests.Compute
foreach (var node in nodes)
{
- var primaryKey = Enumerable.Range(1, int.MaxValue).First(x => aff.IsPrimary(node, x));
+ var primaryKey = TestUtils.GetPrimaryKey(_grid1, cacheName, node);
- var affinityKey = _grid1.GetAffinity(cacheName).GetAffinityKey<int, int>(primaryKey);
+ var affinityKey = aff.GetAffinityKey<int, int>(primaryKey);
var result = _grid1.GetCompute().AffinityCall(cacheName, affinityKey, new ComputeFunc());
http://git-wip-us.apache.org/repos/asf/ignite/blob/bec4a3eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs
index 2587479..6f0e2d1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs
@@ -238,7 +238,7 @@ namespace Apache.Ignite.Core.Tests
{
EventType = EventType.CacheAll,
EventObjectType = typeof (CacheEvent),
- GenerateEvent = g => g.GetCache<int, int>(null).Put(1, 1),
+ GenerateEvent = g => g.GetCache<int, int>(null).Put(TestUtils.GetPrimaryKey(g), 1),
VerifyEvents = (e, g) => VerifyCacheEvents(e, g),
EventCount = 3
};
@@ -739,7 +739,7 @@ namespace Apache.Ignite.Core.Tests
cache.Clear();
- cache.Put(1, 1);
+ cache.Put(TestUtils.GetPrimaryKey(g), 1);
cache.Query(new ScanQuery<int, int>()).GetAll();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bec4a3eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
index 0bb3b7f..02df61a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
@@ -24,6 +24,7 @@ namespace Apache.Ignite.Core.Tests
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
+ using Apache.Ignite.Core.Cluster;
using Apache.Ignite.Core.Discovery.Tcp;
using Apache.Ignite.Core.Discovery.Tcp.Static;
using Apache.Ignite.Core.Impl;
@@ -381,5 +382,25 @@ namespace Apache.Ignite.Core.Tests
return marsh.Unmarshal<T>(marsh.Marshal(obj));
}
+
+ /// <summary>
+ /// Gets the primary keys.
+ /// </summary>
+ public static IEnumerable<int> GetPrimaryKeys(IIgnite ignite, string cacheName = null,
+ IClusterNode node = null)
+ {
+ var aff = ignite.GetAffinity(cacheName);
+ node = node ?? ignite.GetCluster().GetLocalNode();
+
+ return Enumerable.Range(1, int.MaxValue).Where(x => aff.IsPrimary(node, x));
+ }
+
+ /// <summary>
+ /// Gets the primary key.
+ /// </summary>
+ public static int GetPrimaryKey(IIgnite ignite, string cacheName = null, IClusterNode node = null)
+ {
+ return GetPrimaryKeys(ignite, cacheName, node).First();
+ }
}
}
[19/50] [abbrv] ignite git commit: Javadoc fixes
Posted by sb...@apache.org.
Javadoc fixes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1218c416
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1218c416
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1218c416
Branch: refs/heads/ignite-4929
Commit: 1218c416adb864989c0760746c7d2e4df2e1644e
Parents: 5839f48
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Apr 13 13:35:16 2017 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Apr 13 13:35:16 2017 +0300
----------------------------------------------------------------------
parent/pom.xml | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1218c416/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 61bf077..8d10713 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -445,6 +445,10 @@
<title>Flink integration</title>
<packages>org.apache.ignite.sink.flink*</packages>
</group>
+ <group>
+ <title>SpringData integration</title>
+ <packages>org.apache.ignite.springdata.repository*</packages>
+ </group>
</groups>
<header>
<![CDATA[
[10/50] [abbrv] ignite git commit: Merge remote-tracking branch
'upstream/master' into ignite-3477-master
Posted by sb...@apache.org.
Merge remote-tracking branch 'upstream/master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5f724512
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5f724512
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5f724512
Branch: refs/heads/ignite-4929
Commit: 5f724512a9997d8e2b2a4ec7d482772fbeb741a3
Parents: 7883668 775c6e5
Author: Igor Sapego <is...@gridgain.com>
Authored: Wed Apr 12 15:40:11 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Wed Apr 12 15:40:11 2017 +0300
----------------------------------------------------------------------
.gitignore | 31 +-
examples/pom.xml | 6 +
.../examples/springdata/PersonRepository.java | 59 ++++
.../examples/springdata/SpringAppCfg.java | 69 ++++
.../examples/springdata/SpringDataExample.java | 154 +++++++++
.../examples/SpringDataExampleSelfTest.java | 32 ++
.../testsuites/IgniteExamplesSelfTestSuite.java | 2 +
.../rendezvous/RendezvousAffinityFunction.java | 26 +-
.../datastructures/GridCacheSemaphoreImpl.java | 74 ++++-
.../datastructures/GridCacheSemaphoreState.java | 22 ++
...inityFunctionFastPowerOfTwoHashSelfTest.java | 50 +++
...ousAffinityFunctionStandardHashSelfTest.java | 50 +++
...eAbstractDataStructuresFailoverSelfTest.java | 21 +-
.../testsuites/IgniteCacheTestSuite2.java | 8 +
.../binary/include/ignite/binary/binary_type.h | 127 +++----
.../ignite/impl/binary/binary_id_resolver.h | 33 +-
.../ignite/impl/binary/binary_object_impl.h | 3 +-
.../ignite/impl/binary/binary_reader_impl.h | 80 ++++-
.../include/ignite/impl/binary/binary_utils.h | 6 +-
.../ignite/impl/binary/binary_writer_impl.h | 15 +-
.../core-test/include/ignite/binary_test_defs.h | 95 +++---
.../cpp/core-test/include/ignite/complex_type.h | 30 +-
.../cpp/core-test/include/ignite/test_type.h | 37 +--
.../src/binary_identity_resolver_test.cpp | 38 +--
.../cpp/core-test/src/binary_object_test.cpp | 4 +-
.../cpp/core-test/src/binary_test_defs.cpp | 5 +
.../cpp/core-test/src/cache_invoke_test.cpp | 18 +-
.../cpp/core-test/src/cache_query_test.cpp | 12 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 36 +-
.../cpp/core-test/src/continuous_query_test.cpp | 30 +-
.../cpp/core/include/ignite/ignite_binding.h | 6 +-
.../impl/cache/cache_entry_processor_holder.h | 33 +-
.../cpp/odbc-test/include/complex_type.h | 26 +-
.../platforms/cpp/odbc-test/include/test_type.h | 37 +--
modules/spring-data/README.txt | 32 ++
modules/spring-data/licenses/apache-2.0.txt | 202 ++++++++++++
modules/spring-data/pom.xml | 79 +++++
.../springdata/repository/IgniteRepository.java | 58 ++++
.../config/EnableIgniteRepositories.java | 119 +++++++
.../config/IgniteRepositoriesRegistar.java | 36 ++
.../IgniteRepositoryConfigurationExtension.java | 49 +++
.../springdata/repository/config/Query.java | 37 +++
.../repository/config/RepositoryConfig.java | 39 +++
.../repository/config/package-info.java | 22 ++
.../springdata/repository/package-info.java | 22 ++
.../repository/query/IgniteQuery.java | 83 +++++
.../repository/query/IgniteQueryGenerator.java | 243 ++++++++++++++
.../repository/query/IgniteRepositoryQuery.java | 306 +++++++++++++++++
.../repository/query/package-info.java | 22 ++
.../support/IgniteRepositoryFactory.java | 168 ++++++++++
.../support/IgniteRepositoryFactoryBean.java | 85 +++++
.../support/IgniteRepositoryImpl.java | 160 +++++++++
.../repository/support/package-info.java | 22 ++
.../IgniteSpringDataCrudSelfTest.java | 233 +++++++++++++
.../IgniteSpringDataQueriesSelfTest.java | 291 ++++++++++++++++
.../misc/ApplicationConfiguration.java | 46 +++
.../apache/ignite/springdata/misc/Person.java | 97 ++++++
.../springdata/misc/PersonRepository.java | 92 ++++++
.../springdata/misc/PersonSecondRepository.java | 40 +++
.../testsuites/IgniteSpringDataTestSuite.java | 41 +++
modules/web-console/frontend/.eslintrc | 2 +-
modules/web-console/frontend/app/app.js | 3 -
.../form-field-datepicker.pug | 59 ----
.../form-field-datepicker.scss | 20 --
.../list-of-registered-users.categories.js | 4 +-
.../list-of-registered-users.column-defs.js | 44 +--
.../list-of-registered-users.controller.js | 141 ++++++--
.../list-of-registered-users.scss | 4 +
.../list-of-registered-users.tpl.pug | 76 +++--
.../ui-grid-header/ui-grid-header.scss | 91 -----
.../ui-grid-header/ui-grid-header.tpl.pug | 29 --
.../ui-grid-settings/ui-grid-settings.pug | 33 --
.../ui-grid-settings/ui-grid-settings.scss | 144 --------
.../frontend/app/helpers/jade/mixins.pug | 3 +
.../frontend/app/modules/states/admin.state.js | 11 +-
.../frontend/app/primitives/badge/index.scss | 4 +
.../frontend/app/primitives/btn/index.scss | 41 +++
.../app/primitives/datepicker/index.pug | 60 ++++
.../app/primitives/datepicker/index.scss | 64 ++++
.../frontend/app/primitives/dropdown/index.pug | 43 +++
.../frontend/app/primitives/dropdown/index.scss | 82 +++++
.../frontend/app/primitives/index.js | 8 +
.../frontend/app/primitives/page/index.scss | 35 ++
.../frontend/app/primitives/panel/index.scss | 51 +++
.../frontend/app/primitives/tabs/index.scss | 15 +
.../app/primitives/ui-grid-header/index.scss | 91 +++++
.../app/primitives/ui-grid-header/index.tpl.pug | 29 ++
.../app/primitives/ui-grid-settings/index.pug | 33 ++
.../app/primitives/ui-grid-settings/index.scss | 171 ++++++++++
.../frontend/app/primitives/ui-grid/index.scss | 329 +++++++++++++++++++
.../frontend/public/stylesheets/style.scss | 5 -
modules/web-console/frontend/views/base2.pug | 22 ++
.../frontend/views/settings/admin.tpl.pug | 3 +-
.../web-console/frontend/views/sql/sql.tpl.pug | 1 -
.../cache/websession/WebSessionFilter.java | 22 +-
parent/pom.xml | 1 +
pom.xml | 1 +
97 files changed, 4811 insertions(+), 863 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
index c9081fc,dcac7d4..8d52564
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
@@@ -186,10 -189,11 +189,12 @@@ public class RendezvousAffinityFunctio
private RendezvousAffinityFunction(boolean exclNeighbors, int parts,
IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
A.ensure(parts > 0, "parts > 0");
+ A.ensure(parts <= CacheConfiguration.MAX_PARTITIONS_COUNT, "parts <=" + CacheConfiguration.MAX_PARTITIONS_COUNT);
this.exclNeighbors = exclNeighbors;
- this.parts = parts;
+
+ setPartitions(parts);
+
this.backupFilter = backupFilter;
try {
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSemaphoreImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index f902242,0db7d06..6f9b401
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@@ -18,8 -18,12 +18,10 @@@
package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
-import org.apache.ignite.cache.affinity.fair.FairAffinityFunctionBackupFilterSelfTest;
-import org.apache.ignite.cache.affinity.fair.FairAffinityFunctionExcludeNeighborsSelfTest;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunctionBackupFilterSelfTest;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunctionExcludeNeighborsSelfTest;
+ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunctionFastPowerOfTwoHashSelfTest;
+ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunctionStandardHashSelfTest;
import org.apache.ignite.internal.processors.cache.CacheConcurrentReadThroughTest;
import org.apache.ignite.internal.processors.cache.CacheConfigurationLeakTest;
import org.apache.ignite.internal.processors.cache.CacheDhtLocalPartitionAfterRemoveSelfTest;
@@@ -107,9 -117,11 +109,12 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.distributed.near.GridCachePartitionedTxTimeoutSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheRendezvousAffinityClientSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheStoreUpdateTest;
+import org.apache.ignite.internal.processors.cache.distributed.near.GridPartitionedBackupLoadSelfTest;
+ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearOffheapCacheStoreUpdateTest;
+ import org.apache.ignite.internal.processors.cache.distributed.near.GridPartitionedBackupLoadSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.NearCacheSyncUpdateTest;
import org.apache.ignite.internal.processors.cache.distributed.near.NoneRebalanceModeSelfTest;
+ import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedEvictionSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedJobExecutionTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicBasicStoreSelfTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicGetAndTransformStoreSelfTest;
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/binary/include/ignite/binary/binary_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_utils.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
index 07e8a14,0870997..6c2bde7
--- a/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
+++ b/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
@@@ -156,17 -158,22 +158,17 @@@ namespace ignit
return GetBinaryStringHashCode(name);
}
- static int32_t GetHashCode(const gt::BinaryDummy& obj)
- {
- return 0;
- }
-
- static bool IsNull(const gt::BinaryDummy& obj)
+ bool IsNull(const gt::BinaryInner& obj)
{
- return obj.GetValue() == 0;
+ return false;
}
- gt::BinaryInner GetNull()
+ static void GetNull(gt::BinaryDummy& dst)
{
- return gt::BinaryInner(0);
+ dst = gt::BinaryDummy();
}
- void Write(BinaryWriter& writer, const gt::BinaryDummy& obj)
+ static void Write(BinaryWriter& writer, const gt::BinaryDummy& obj)
{
// No-op.
}
@@@ -180,17 -187,17 +182,17 @@@
template<>
struct BinaryType<gt::BinaryInner>
{
- int32_t GetTypeId()
- static int32_t GetTypeId()
++ static int32_t GetTypeId()
{
return GetBinaryStringHashCode("BinaryInner");
}
- std::string GetTypeName()
+ static void GetTypeName(std::string& dst)
{
- return "BinaryInner";
+ dst = "BinaryInner";
}
- int32_t GetFieldId(const char* name)
- static int32_t GetFieldId(const char* name)
++ static int32_t GetFieldId(const char* name)
{
return GetBinaryStringHashCode(name);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/include/ignite/complex_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/include/ignite/test_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/binary_identity_resolver_test.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/src/binary_identity_resolver_test.cpp
index 62f37f9,802ec97..dd1e790
--- a/modules/platforms/cpp/core-test/src/binary_identity_resolver_test.cpp
+++ b/modules/platforms/cpp/core-test/src/binary_identity_resolver_test.cpp
@@@ -212,17 -336,45 +204,13 @@@ namespace ignit
writer.WriteInt64("i64", obj.i64);
}
- CompositeKeySimple Read(BinaryReader& reader)
+ static void Read(BinaryReader& reader, CompositeKeySimple& dst)
{
- CompositeKeySimple val;
-
- val.str = reader.ReadString("str");
- val.ts = reader.ReadTimestamp("ts");
- val.i64 = reader.ReadInt64("i64");
-
- return val;
+ dst.str = reader.ReadString("str");
+ dst.ts = reader.ReadTimestamp("ts");
+ dst.i64 = reader.ReadInt64("i64");
}
};
-
- /**
- * Binary type definition for ComplexType2.
- */
- template<>
- struct BinaryType<ComplexType2>
- {
- IGNITE_BINARY_GET_TYPE_ID_AS_HASH(ComplexType2)
- IGNITE_BINARY_GET_TYPE_NAME_AS_IS(ComplexType2)
- IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- IGNITE_BINARY_IS_NULL_FALSE(ComplexType2)
- IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(ComplexType2)
-
- static ignite::Reference<ignite::binary::BinaryIdentityResolver> GetIdentityResolver()
- {
- return ignite::MakeReferenceFromCopy(CustomFieldIdResolver());
- }
-
- static void Write(BinaryWriter& writer, const ComplexType2& obj)
- {
- writer.WriteInt32("i32Field", obj.i32Field);
- writer.WriteObject("objField", obj.objField);
- writer.WriteString("strField", obj.strField);
- }
-
- static void Read(BinaryReader& reader, ComplexType2& dst)
- {
- dst.i32Field = reader.ReadInt32("i32Field");
- dst.objField = reader.ReadObject<InnerObject>("objField");
- dst.strField = reader.ReadString("strField");
- }
- };
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/binary_object_test.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/cache_invoke_test.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/cache_query_test.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/src/cache_test.cpp
index d269f65,99e0f1b..d222009
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@@ -50,25 -50,24 +50,23 @@@ namespace ignit
namespace binary
{
IGNITE_BINARY_TYPE_START(Person)
- IGNITE_BINARY_GET_TYPE_ID_AS_HASH(Person)
- IGNITE_BINARY_GET_TYPE_NAME_AS_IS(Person)
- IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- IGNITE_BINARY_IS_NULL_FALSE(Person)
- IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
+ IGNITE_BINARY_GET_TYPE_ID_AS_HASH(Person)
+ IGNITE_BINARY_GET_TYPE_NAME_AS_IS(Person)
+ IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- IGNITE_BINARY_GET_HASH_CODE_ZERO(Person)
+ IGNITE_BINARY_IS_NULL_FALSE(Person)
+ IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
- void Write(BinaryWriter& writer, Person obj)
- {
- writer.WriteString("name", obj.name);
- writer.WriteInt32("age", obj.age);
- }
+ static void Write(BinaryWriter& writer, const Person& obj)
+ {
+ writer.WriteString("name", obj.name);
- writer.WriteInt32("age", obj.age);
++ writer.WriteInt32("age", obj.age);
+ }
- Person Read(BinaryReader& reader)
- {
- std::string name = reader.ReadString("name");
- int age = reader.ReadInt32("age");
-
- return Person(name, age);
- }
+ static void Read(BinaryReader& reader, Person& dst)
+ {
+ dst.name = reader.ReadString("name");
+ dst.age = reader.ReadInt32("age");
+ }
IGNITE_BINARY_TYPE_END
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/src/continuous_query_test.cpp
index 2d1a2ee,8579c54..ea3d665
--- a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
@@@ -290,14 -288,20 +287,15 @@@ namespace ignit
return GetBinaryStringHashCode("RangeFilter");
}
- std::string GetTypeName()
+ static void GetTypeName(std::string& dst)
{
- return "RangeFilter";
+ dst = "RangeFilter";
}
+
IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- static int32_t GetHashCode(const RangeFilter<K,V>&)
- {
- return 0;
- }
-
- static bool IsNull(const RangeFilter<K,V>&)
+ bool IsNull(const RangeFilter<K,V>&)
{
return false;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/odbc-test/include/complex_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/modules/platforms/cpp/odbc-test/include/test_type.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5f724512/pom.xml
----------------------------------------------------------------------
[45/50] [abbrv] ignite git commit: Merge compilation fix.
Posted by sb...@apache.org.
Merge compilation fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d7c0b52f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d7c0b52f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d7c0b52f
Branch: refs/heads/ignite-4929
Commit: d7c0b52f963c0cf21f77ba69ef5abb2a4b99b067
Parents: 3f54167
Author: dkarachentsev <dk...@gridgain.com>
Authored: Fri Apr 14 09:51:06 2017 +0300
Committer: dkarachentsev <dk...@gridgain.com>
Committed: Fri Apr 14 09:51:06 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/CacheAtomicPrimarySyncBackPressureTest.java | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d7c0b52f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAtomicPrimarySyncBackPressureTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAtomicPrimarySyncBackPressureTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAtomicPrimarySyncBackPressureTest.java
index 30436f5..62707c7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAtomicPrimarySyncBackPressureTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAtomicPrimarySyncBackPressureTest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMemoryMode;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -51,7 +50,6 @@ public class CacheAtomicPrimarySyncBackPressureTest extends GridCommonAbstractTe
ccfg.setBackups(1);
ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
- ccfg.setMemoryMode(CacheMemoryMode.ONHEAP_TIERED);
ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
ccfg.setNodeFilter(new NodeFilter());
[37/50] [abbrv] ignite git commit: IGNITE-3581: Moved enums to
separate structs for C++
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h b/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h
index 32f3520..2439696 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h
@@ -37,23 +37,26 @@ namespace ignite
/**
* Children windows ids.
*/
- enum ChildId
+ struct ChildId
{
- ID_CONNECTION_SETTINGS_GROUP_BOX,
- ID_NAME_EDIT,
- ID_NAME_LABEL,
- ID_ADDRESS_EDIT,
- ID_ADDRESS_LABEL,
- ID_CACHE_EDIT,
- ID_CACHE_LABEL,
- ID_PAGE_SIZE_EDIT,
- ID_PAGE_SIZE_LABEL,
- ID_DISTRIBUTED_JOINS_CHECK_BOX,
- ID_ENFORCE_JOIN_ORDER_CHECK_BOX,
- ID_PROTOCOL_VERSION_LABEL,
- ID_PROTOCOL_VERSION_COMBO_BOX,
- ID_OK_BUTTON,
- ID_CANCEL_BUTTON
+ enum Type
+ {
+ CONNECTION_SETTINGS_GROUP_BOX,
+ NAME_EDIT,
+ NAME_LABEL,
+ ADDRESS_EDIT,
+ ADDRESS_LABEL,
+ CACHE_EDIT,
+ CACHE_LABEL,
+ PAGE_SIZE_EDIT,
+ PAGE_SIZE_LABEL,
+ DISTRIBUTED_JOINS_CHECK_BOX,
+ ENFORCE_JOIN_ORDER_CHECK_BOX,
+ PROTOCOL_VERSION_LABEL,
+ PROTOCOL_VERSION_COMBO_BOX,
+ OK_BUTTON,
+ CANCEL_BUTTON
+ };
};
public:
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h b/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h
index d456d59..81b2845 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h
@@ -43,70 +43,73 @@ namespace ignite
* We use these so we will not be needed to include system-specific
* headers in our header files.
*/
- enum IgniteSqlType
+ struct OdbcNativeType
{
- /** Alias for the SQL_C_CHAR type. */
- IGNITE_ODBC_C_TYPE_CHAR,
+ enum Type
+ {
+ /** Alias for the SQL_C_CHAR type. */
+ AI_CHAR,
- /** Alias for the SQL_C_WCHAR type. */
- IGNITE_ODBC_C_TYPE_WCHAR,
+ /** Alias for the SQL_C_WCHAR type. */
+ AI_WCHAR,
- /** Alias for the SQL_C_SSHORT type. */
- IGNITE_ODBC_C_TYPE_SIGNED_SHORT,
+ /** Alias for the SQL_C_SSHORT type. */
+ AI_SIGNED_SHORT,
- /** Alias for the SQL_C_USHORT type. */
- IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT,
+ /** Alias for the SQL_C_USHORT type. */
+ AI_UNSIGNED_SHORT,
- /** Alias for the SQL_C_SLONG type. */
- IGNITE_ODBC_C_TYPE_SIGNED_LONG,
+ /** Alias for the SQL_C_SLONG type. */
+ AI_SIGNED_LONG,
- /** Alias for the SQL_C_ULONG type. */
- IGNITE_ODBC_C_TYPE_UNSIGNED_LONG,
+ /** Alias for the SQL_C_ULONG type. */
+ AI_UNSIGNED_LONG,
- /** Alias for the SQL_C_FLOAT type. */
- IGNITE_ODBC_C_TYPE_FLOAT,
+ /** Alias for the SQL_C_FLOAT type. */
+ AI_FLOAT,
- /** Alias for the SQL_C_DOUBLE type. */
- IGNITE_ODBC_C_TYPE_DOUBLE,
+ /** Alias for the SQL_C_DOUBLE type. */
+ AI_DOUBLE,
- /** Alias for the SQL_C_BIT type. */
- IGNITE_ODBC_C_TYPE_BIT,
+ /** Alias for the SQL_C_BIT type. */
+ AI_BIT,
- /** Alias for the SQL_C_STINYINT type. */
- IGNITE_ODBC_C_TYPE_SIGNED_TINYINT,
+ /** Alias for the SQL_C_STINYINT type. */
+ AI_SIGNED_TINYINT,
- /** Alias for the SQL_C_UTINYINT type. */
- IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT,
+ /** Alias for the SQL_C_UTINYINT type. */
+ AI_UNSIGNED_TINYINT,
- /** Alias for the SQL_C_SBIGINT type. */
- IGNITE_ODBC_C_TYPE_SIGNED_BIGINT,
+ /** Alias for the SQL_C_SBIGINT type. */
+ AI_SIGNED_BIGINT,
- /** Alias for the SQL_C_UBIGINT type. */
- IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT,
+ /** Alias for the SQL_C_UBIGINT type. */
+ AI_UNSIGNED_BIGINT,
- /** Alias for the SQL_C_BINARY type. */
- IGNITE_ODBC_C_TYPE_BINARY,
+ /** Alias for the SQL_C_BINARY type. */
+ AI_BINARY,
- /** Alias for the SQL_C_TDATE type. */
- IGNITE_ODBC_C_TYPE_TDATE,
+ /** Alias for the SQL_C_TDATE type. */
+ AI_TDATE,
- /** Alias for the SQL_C_TTIME type. */
- IGNITE_ODBC_C_TYPE_TTIME,
+ /** Alias for the SQL_C_TTIME type. */
+ AI_TTIME,
- /** Alias for the SQL_C_TTIMESTAMP type. */
- IGNITE_ODBC_C_TYPE_TTIMESTAMP,
+ /** Alias for the SQL_C_TTIMESTAMP type. */
+ AI_TTIMESTAMP,
- /** Alias for the SQL_C_NUMERIC type. */
- IGNITE_ODBC_C_TYPE_NUMERIC,
+ /** Alias for the SQL_C_NUMERIC type. */
+ AI_NUMERIC,
- /** Alias for the SQL_C_GUID type. */
- IGNITE_ODBC_C_TYPE_GUID,
+ /** Alias for the SQL_C_GUID type. */
+ AI_GUID,
- /** Alias for the SQL_DEFAULT. */
- IGNITE_ODBC_C_TYPE_DEFAULT,
+ /** Alias for the SQL_DEFAULT. */
+ AI_DEFAULT,
- /** Alias for all unsupported types. */
- IGNITE_ODBC_C_TYPE_UNSUPPORTED
+ /** Alias for all unsupported types. */
+ AI_UNSUPPORTED
+ };
};
/**
@@ -196,7 +199,7 @@ namespace ignite
* @param type ODBC type;
* @return Internal driver type.
*/
- IgniteSqlType ToDriverType(int16_t type);
+ OdbcNativeType::Type ToDriverType(int16_t type);
/**
* Convert binary data type to SQL data type.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h b/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h
index 1502c07..0232da3 100644
--- a/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h
+++ b/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h
@@ -31,10 +31,13 @@ namespace ignite
/**
* Application execution result.
*/
- enum Result
+ struct Result
{
- RESULT_OK,
- RESULT_CANCEL
+ enum Type
+ {
+ OK,
+ CANCEL
+ };
};
/**
@@ -44,7 +47,7 @@ namespace ignite
* @param window Main window.
* @return Application execution result.
*/
- Result ProcessMessages(Window& window);
+ Result::Type ProcessMessages(Window& window);
/**
* Window class.
@@ -58,7 +61,6 @@ namespace ignite
* @param parent Parent window.
* @param className Window class name.
* @param title Window title.
- * @param callback Event processing function.
*/
CustomWindow(Window* parent, const char* className, const char* title);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp
index 1e855a1..57690a3 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp
@@ -27,7 +27,7 @@ namespace ignite
{
namespace ui
{
- Result ProcessMessages(Window& window)
+ Result::Type ProcessMessages(Window& window)
{
MSG msg;
@@ -41,7 +41,7 @@ namespace ignite
}
}
- return static_cast<Result>(msg.wParam);
+ return static_cast<Result::Type>(msg.wParam);
}
LRESULT CALLBACK CustomWindow::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
index 864ca85..c839999 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
@@ -104,37 +104,37 @@ namespace ignite
int sectionBegin = margin;
const char* val = config.GetDsn().c_str();
- nameLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "DSN name:", ID_NAME_LABEL);
- nameEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ID_NAME_EDIT);
+ nameLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "DSN name:", ChildId::NAME_LABEL);
+ nameEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ChildId::NAME_EDIT);
rowPos += interval + rowSize;
val = config.GetAddress().c_str();
- addressLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "Address:", ID_ADDRESS_LABEL);
- addressEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ID_ADDRESS_EDIT);
+ addressLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "Address:", ChildId::ADDRESS_LABEL);
+ addressEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ChildId::ADDRESS_EDIT);
rowPos += interval + rowSize;
val = config.GetCache().c_str();
- cacheLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "Cache name:", ID_CACHE_LABEL);
- cacheEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ID_CACHE_EDIT);
+ cacheLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "Cache name:", ChildId::CACHE_LABEL);
+ cacheEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ChildId::CACHE_EDIT);
rowPos += interval + rowSize;
std::string tmp = common::LexicalCast<std::string>(config.GetPageSize());
val = tmp.c_str();
pageSizeLabel = CreateLabel(labelPosX, rowPos, labelSizeX,
- rowSize, "Page size:", ID_PAGE_SIZE_LABEL);
+ rowSize, "Page size:", ChildId::PAGE_SIZE_LABEL);
pageSizeEdit = CreateEdit(editPosX, rowPos, editSizeX,
- rowSize, val, ID_PAGE_SIZE_EDIT, ES_NUMBER);
+ rowSize, val, ChildId::PAGE_SIZE_EDIT, ES_NUMBER);
rowPos += interval + rowSize;
protocolVersionLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize,
- "Protocol version:", ID_PROTOCOL_VERSION_LABEL);
+ "Protocol version:", ChildId::PROTOCOL_VERSION_LABEL);
protocolVersionComboBox = CreateComboBox(editPosX, rowPos, editSizeX, rowSize,
- "Protocol version", ID_PROTOCOL_VERSION_COMBO_BOX);
+ "Protocol version", ChildId::PROTOCOL_VERSION_COMBO_BOX);
int id = 0;
@@ -154,10 +154,10 @@ namespace ignite
rowPos += interval + rowSize;
distributedJoinsCheckBox = CreateCheckBox(editPosX, rowPos, checkBoxSize, rowSize,
- "Distributed Joins", ID_DISTRIBUTED_JOINS_CHECK_BOX, config.IsDistributedJoins());
+ "Distributed Joins", ChildId::DISTRIBUTED_JOINS_CHECK_BOX, config.IsDistributedJoins());
enforceJoinOrderCheckBox = CreateCheckBox(editPosX + checkBoxSize + interval, rowPos, checkBoxSize,
- rowSize, "Enforce Join Order", ID_ENFORCE_JOIN_ORDER_CHECK_BOX, config.IsEnforceJoinOrder());
+ rowSize, "Enforce Join Order", ChildId::ENFORCE_JOIN_ORDER_CHECK_BOX, config.IsEnforceJoinOrder());
if (!config.GetProtocolVersion().IsDistributedJoinsSupported())
{
@@ -168,7 +168,7 @@ namespace ignite
rowPos += interval * 2 + rowSize;
connectionSettingsGroupBox = CreateGroupBox(margin, sectionBegin, width - 2 * margin,
- rowPos - interval - sectionBegin, "Connection settings", ID_CONNECTION_SETTINGS_GROUP_BOX);
+ rowPos - interval - sectionBegin, "Connection settings", ChildId::CONNECTION_SETTINGS_GROUP_BOX);
int buttonSizeX = 80;
int cancelPosX = width - margin - buttonSizeX;
@@ -176,8 +176,8 @@ namespace ignite
rowSize = 25;
- okButton = CreateButton(okPosX, rowPos, buttonSizeX, rowSize, "Ok", ID_OK_BUTTON);
- cancelButton = CreateButton(cancelPosX, rowPos, buttonSizeX, rowSize, "Cancel", ID_CANCEL_BUTTON);
+ okButton = CreateButton(okPosX, rowPos, buttonSizeX, rowSize, "Ok", ChildId::OK_BUTTON);
+ cancelButton = CreateButton(cancelPosX, rowPos, buttonSizeX, rowSize, "Cancel", ChildId::CANCEL_BUTTON);
}
bool DsnConfigurationWindow::OnMessage(UINT msg, WPARAM wParam, LPARAM lParam)
@@ -188,7 +188,7 @@ namespace ignite
{
switch (LOWORD(wParam))
{
- case ID_OK_BUTTON:
+ case ChildId::OK_BUTTON:
{
try
{
@@ -206,7 +206,7 @@ namespace ignite
break;
}
- case ID_PROTOCOL_VERSION_COMBO_BOX:
+ case ChildId::PROTOCOL_VERSION_COMBO_BOX:
{
if (HIWORD(wParam) == CBN_SELCHANGE)
{
@@ -232,21 +232,21 @@ namespace ignite
}
case IDCANCEL:
- case ID_CANCEL_BUTTON:
+ case ChildId::CANCEL_BUTTON:
{
PostMessage(GetHandle(), WM_CLOSE, 0, 0);
break;
}
- case ID_DISTRIBUTED_JOINS_CHECK_BOX:
+ case ChildId::DISTRIBUTED_JOINS_CHECK_BOX:
{
distributedJoinsCheckBox->SetChecked(!distributedJoinsCheckBox->IsChecked());
break;
}
- case ID_ENFORCE_JOIN_ORDER_CHECK_BOX:
+ case ChildId::ENFORCE_JOIN_ORDER_CHECK_BOX:
{
enforceJoinOrderCheckBox->SetChecked(!enforceJoinOrderCheckBox->IsChecked());
@@ -262,7 +262,7 @@ namespace ignite
case WM_DESTROY:
{
- PostQuitMessage(accepted ? RESULT_OK : RESULT_CANCEL);
+ PostQuitMessage(accepted ? Result::OK : Result::CANCEL);
break;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp b/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
index 3d41e3e..3402aca 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
@@ -50,7 +50,7 @@ bool DisplayConfigureDsnWindow(HWND hwndParent, Configuration& config)
window.Show();
window.Update();
- return ProcessMessages(window) == RESULT_OK;
+ return ProcessMessages(window) == Result::OK;
}
catch (const ignite::IgniteError& err)
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp b/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp
index 1b5f536..ced8c01 100644
--- a/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp
+++ b/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp
@@ -36,7 +36,7 @@ namespace ignite
using ignite::impl::binary::BinaryUtils;
ApplicationDataBuffer::ApplicationDataBuffer() :
- type(type_traits::IGNITE_ODBC_C_TYPE_UNSUPPORTED),
+ type(type_traits::OdbcNativeType::AI_UNSUPPORTED),
buffer(0),
buflen(0),
reslen(0),
@@ -45,7 +45,7 @@ namespace ignite
// No-op.
}
- ApplicationDataBuffer::ApplicationDataBuffer(type_traits::IgniteSqlType type,
+ ApplicationDataBuffer::ApplicationDataBuffer(type_traits::OdbcNativeType::Type type,
void* buffer, SqlLen buflen, SqlLen* reslen, int** offset) :
type(type),
buffer(buffer),
@@ -92,80 +92,80 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
{
PutNumToNumBuffer<signed char>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
{
PutNumToNumBuffer<unsigned char>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
{
PutNumToNumBuffer<short>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
{
PutNumToNumBuffer<unsigned short>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_LONG:
{
PutNumToNumBuffer<long>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
{
PutNumToNumBuffer<unsigned long>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
{
PutNumToNumBuffer<int64_t>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
{
PutNumToNumBuffer<uint64_t>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_FLOAT:
+ case OdbcNativeType::AI_FLOAT:
{
PutNumToNumBuffer<float>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_DOUBLE:
+ case OdbcNativeType::AI_DOUBLE:
{
PutNumToNumBuffer<double>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
PutValToStrBuffer<char>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_WCHAR:
+ case OdbcNativeType::AI_WCHAR:
{
PutValToStrBuffer<wchar_t>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_NUMERIC:
+ case OdbcNativeType::AI_NUMERIC:
{
if (dataPtr)
{
@@ -189,8 +189,8 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_BINARY:
- case IGNITE_ODBC_C_TYPE_DEFAULT:
+ case OdbcNativeType::AI_BINARY:
+ case OdbcNativeType::AI_DEFAULT:
{
if (dataPtr)
{
@@ -215,21 +215,21 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TDATE:
+ case OdbcNativeType::AI_TDATE:
{
PutDate(Date(static_cast<int64_t>(value)));
break;
}
- case IGNITE_ODBC_C_TYPE_TTIMESTAMP:
+ case OdbcNativeType::AI_TTIMESTAMP:
{
PutTimestamp(Timestamp(static_cast<int64_t>(value)));
break;
}
- case IGNITE_ODBC_C_TYPE_TTIME:
+ case OdbcNativeType::AI_TTIME:
{
PutTime(Time(static_cast<int64_t>(value)));
@@ -383,16 +383,16 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_NUMERIC:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_NUMERIC:
{
std::stringstream converter;
@@ -409,8 +409,8 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_FLOAT:
- case IGNITE_ODBC_C_TYPE_DOUBLE:
+ case OdbcNativeType::AI_FLOAT:
+ case OdbcNativeType::AI_DOUBLE:
{
std::stringstream converter;
@@ -427,9 +427,9 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_CHAR:
- case IGNITE_ODBC_C_TYPE_BINARY:
- case IGNITE_ODBC_C_TYPE_DEFAULT:
+ case OdbcNativeType::AI_CHAR:
+ case OdbcNativeType::AI_BINARY:
+ case OdbcNativeType::AI_DEFAULT:
{
PutStrToStrBuffer<char>(value);
@@ -438,7 +438,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_WCHAR:
+ case OdbcNativeType::AI_WCHAR:
{
PutStrToStrBuffer<wchar_t>(value);
@@ -467,21 +467,21 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_CHAR:
- case IGNITE_ODBC_C_TYPE_BINARY:
- case IGNITE_ODBC_C_TYPE_DEFAULT:
+ case OdbcNativeType::AI_CHAR:
+ case OdbcNativeType::AI_BINARY:
+ case OdbcNativeType::AI_DEFAULT:
{
PutValToStrBuffer<char>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_WCHAR:
+ case OdbcNativeType::AI_WCHAR:
{
PutValToStrBuffer<wchar_t>(value);
break;
}
- case IGNITE_ODBC_C_TYPE_GUID:
+ case OdbcNativeType::AI_GUID:
{
SQLGUID* guid = reinterpret_cast<SQLGUID*>(GetData());
@@ -515,8 +515,8 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_BINARY:
- case IGNITE_ODBC_C_TYPE_DEFAULT:
+ case OdbcNativeType::AI_BINARY:
+ case OdbcNativeType::AI_DEFAULT:
{
PutRawDataToBuffer(data, len);
@@ -525,7 +525,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
std::stringstream converter;
@@ -546,7 +546,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_WCHAR:
+ case OdbcNativeType::AI_WCHAR:
{
std::wstringstream converter;
@@ -595,31 +595,31 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
{
PutNum<int64_t>(value.ToInt64());
break;
}
- case IGNITE_ODBC_C_TYPE_FLOAT:
- case IGNITE_ODBC_C_TYPE_DOUBLE:
+ case OdbcNativeType::AI_FLOAT:
+ case OdbcNativeType::AI_DOUBLE:
{
PutNum<double>(value.ToDouble());
break;
}
- case IGNITE_ODBC_C_TYPE_CHAR:
- case IGNITE_ODBC_C_TYPE_WCHAR:
+ case OdbcNativeType::AI_CHAR:
+ case OdbcNativeType::AI_WCHAR:
{
std::stringstream converter;
@@ -630,7 +630,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_NUMERIC:
+ case OdbcNativeType::AI_NUMERIC:
{
SQL_NUMERIC_STRUCT* numeric =
reinterpret_cast<SQL_NUMERIC_STRUCT*>(GetData());
@@ -663,8 +663,8 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_DEFAULT:
- case IGNITE_ODBC_C_TYPE_BINARY:
+ case OdbcNativeType::AI_DEFAULT:
+ case OdbcNativeType::AI_BINARY:
default:
{
if (resLenPtr)
@@ -686,7 +686,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
char* buffer = reinterpret_cast<char*>(dataPtr);
@@ -703,7 +703,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_WCHAR:
+ case OdbcNativeType::AI_WCHAR:
{
SQLWCHAR* buffer = reinterpret_cast<SQLWCHAR*>(dataPtr);
@@ -729,7 +729,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TDATE:
+ case OdbcNativeType::AI_TDATE:
{
SQL_DATE_STRUCT* buffer = reinterpret_cast<SQL_DATE_STRUCT*>(dataPtr);
@@ -743,7 +743,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIME:
+ case OdbcNativeType::AI_TTIME:
{
SQL_TIME_STRUCT* buffer = reinterpret_cast<SQL_TIME_STRUCT*>(dataPtr);
@@ -757,7 +757,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIMESTAMP:
+ case OdbcNativeType::AI_TTIMESTAMP:
{
SQL_TIMESTAMP_STRUCT* buffer = reinterpret_cast<SQL_TIMESTAMP_STRUCT*>(dataPtr);
@@ -775,8 +775,8 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_BINARY:
- case IGNITE_ODBC_C_TYPE_DEFAULT:
+ case OdbcNativeType::AI_BINARY:
+ case OdbcNativeType::AI_DEFAULT:
{
if (dataPtr)
memcpy(dataPtr, &value, std::min(static_cast<size_t>(buflen), sizeof(value)));
@@ -787,18 +787,18 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_FLOAT:
- case IGNITE_ODBC_C_TYPE_DOUBLE:
- case IGNITE_ODBC_C_TYPE_NUMERIC:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_FLOAT:
+ case OdbcNativeType::AI_DOUBLE:
+ case OdbcNativeType::AI_NUMERIC:
default:
{
if (resLenPtr)
@@ -820,7 +820,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
char* buffer = reinterpret_cast<char*>(dataPtr);
@@ -837,7 +837,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_WCHAR:
+ case OdbcNativeType::AI_WCHAR:
{
SQLWCHAR* buffer = reinterpret_cast<SQLWCHAR*>(dataPtr);
@@ -863,7 +863,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TDATE:
+ case OdbcNativeType::AI_TDATE:
{
SQL_DATE_STRUCT* buffer = reinterpret_cast<SQL_DATE_STRUCT*>(dataPtr);
@@ -877,7 +877,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIME:
+ case OdbcNativeType::AI_TTIME:
{
SQL_TIME_STRUCT* buffer = reinterpret_cast<SQL_TIME_STRUCT*>(dataPtr);
@@ -891,7 +891,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIMESTAMP:
+ case OdbcNativeType::AI_TTIMESTAMP:
{
SQL_TIMESTAMP_STRUCT* buffer = reinterpret_cast<SQL_TIMESTAMP_STRUCT*>(dataPtr);
@@ -909,8 +909,8 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_BINARY:
- case IGNITE_ODBC_C_TYPE_DEFAULT:
+ case OdbcNativeType::AI_BINARY:
+ case OdbcNativeType::AI_DEFAULT:
{
if (dataPtr)
memcpy(dataPtr, &value, std::min(static_cast<size_t>(buflen), sizeof(value)));
@@ -921,18 +921,18 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_FLOAT:
- case IGNITE_ODBC_C_TYPE_DOUBLE:
- case IGNITE_ODBC_C_TYPE_NUMERIC:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_FLOAT:
+ case OdbcNativeType::AI_DOUBLE:
+ case OdbcNativeType::AI_NUMERIC:
default:
{
if (resLenPtr)
@@ -954,7 +954,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
char* buffer = reinterpret_cast<char*>(dataPtr);
@@ -971,7 +971,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_WCHAR:
+ case OdbcNativeType::AI_WCHAR:
{
SQLWCHAR* buffer = reinterpret_cast<SQLWCHAR*>(dataPtr);
@@ -997,7 +997,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIME:
+ case OdbcNativeType::AI_TTIME:
{
SQL_TIME_STRUCT* buffer = reinterpret_cast<SQL_TIME_STRUCT*>(dataPtr);
@@ -1011,7 +1011,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIMESTAMP:
+ case OdbcNativeType::AI_TTIMESTAMP:
{
SQL_TIMESTAMP_STRUCT* buffer = reinterpret_cast<SQL_TIMESTAMP_STRUCT*>(dataPtr);
@@ -1029,8 +1029,8 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_BINARY:
- case IGNITE_ODBC_C_TYPE_DEFAULT:
+ case OdbcNativeType::AI_BINARY:
+ case OdbcNativeType::AI_DEFAULT:
{
if (dataPtr)
memcpy(dataPtr, &value, std::min(static_cast<size_t>(buflen), sizeof(value)));
@@ -1041,19 +1041,19 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_FLOAT:
- case IGNITE_ODBC_C_TYPE_DOUBLE:
- case IGNITE_ODBC_C_TYPE_NUMERIC:
- case IGNITE_ODBC_C_TYPE_TDATE:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_FLOAT:
+ case OdbcNativeType::AI_DOUBLE:
+ case OdbcNativeType::AI_NUMERIC:
+ case OdbcNativeType::AI_TDATE:
default:
{
if (resLenPtr)
@@ -1069,7 +1069,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
size_t paramLen = GetInputSize();
@@ -1085,10 +1085,10 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
{
std::stringstream converter;
@@ -1099,11 +1099,11 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
{
std::stringstream converter;
@@ -1114,7 +1114,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_FLOAT:
+ case OdbcNativeType::AI_FLOAT:
{
std::stringstream converter;
@@ -1125,8 +1125,8 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_NUMERIC:
- case IGNITE_ODBC_C_TYPE_DOUBLE:
+ case OdbcNativeType::AI_NUMERIC:
+ case OdbcNativeType::AI_DOUBLE:
{
std::stringstream converter;
@@ -1182,7 +1182,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
SqlLen paramLen = GetInputSize();
@@ -1201,7 +1201,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_GUID:
+ case OdbcNativeType::AI_GUID:
{
const SQLGUID* guid = reinterpret_cast<const SQLGUID*>(GetData());
@@ -1255,7 +1255,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
SqlLen paramLen = GetInputSize();
@@ -1284,68 +1284,68 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
{
res = static_cast<T>(*reinterpret_cast<const signed char*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
{
res = static_cast<T>(*reinterpret_cast<const unsigned char*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
{
res = static_cast<T>(*reinterpret_cast<const signed short*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
{
res = static_cast<T>(*reinterpret_cast<const unsigned short*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_LONG:
{
res = static_cast<T>(*reinterpret_cast<const signed long*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
{
res = static_cast<T>(*reinterpret_cast<const unsigned long*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
{
res = static_cast<T>(*reinterpret_cast<const int64_t*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
{
res = static_cast<T>(*reinterpret_cast<const uint64_t*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_FLOAT:
+ case OdbcNativeType::AI_FLOAT:
{
res = static_cast<T>(*reinterpret_cast<const float*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_DOUBLE:
+ case OdbcNativeType::AI_DOUBLE:
{
res = static_cast<T>(*reinterpret_cast<const double*>(GetData()));
break;
}
- case IGNITE_ODBC_C_TYPE_NUMERIC:
+ case OdbcNativeType::AI_NUMERIC:
{
const SQL_NUMERIC_STRUCT* numeric =
reinterpret_cast<const SQL_NUMERIC_STRUCT*>(GetData());
@@ -1373,7 +1373,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_TDATE:
+ case OdbcNativeType::AI_TDATE:
{
const SQL_DATE_STRUCT* buffer = reinterpret_cast<const SQL_DATE_STRUCT*>(GetData());
@@ -1384,7 +1384,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIME:
+ case OdbcNativeType::AI_TTIME:
{
const SQL_TIME_STRUCT* buffer = reinterpret_cast<const SQL_TIME_STRUCT*>(GetData());
@@ -1397,7 +1397,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIMESTAMP:
+ case OdbcNativeType::AI_TTIMESTAMP:
{
const SQL_TIMESTAMP_STRUCT* buffer = reinterpret_cast<const SQL_TIMESTAMP_STRUCT*>(GetData());
@@ -1411,7 +1411,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
SqlLen paramLen = GetInputSize();
@@ -1447,7 +1447,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_TDATE:
+ case OdbcNativeType::AI_TDATE:
{
const SQL_DATE_STRUCT* buffer = reinterpret_cast<const SQL_DATE_STRUCT*>(GetData());
@@ -1458,7 +1458,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIME:
+ case OdbcNativeType::AI_TTIME:
{
const SQL_TIME_STRUCT* buffer = reinterpret_cast<const SQL_TIME_STRUCT*>(GetData());
@@ -1471,7 +1471,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIMESTAMP:
+ case OdbcNativeType::AI_TTIMESTAMP:
{
const SQL_TIMESTAMP_STRUCT* buffer = reinterpret_cast<const SQL_TIMESTAMP_STRUCT*>(GetData());
@@ -1487,7 +1487,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
SqlLen paramLen = GetInputSize();
@@ -1525,7 +1525,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_TTIME:
+ case OdbcNativeType::AI_TTIME:
{
const SQL_TIME_STRUCT* buffer = reinterpret_cast<const SQL_TIME_STRUCT*>(GetData());
@@ -1536,7 +1536,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_TTIMESTAMP:
+ case OdbcNativeType::AI_TTIMESTAMP:
{
const SQL_TIMESTAMP_STRUCT* buffer = reinterpret_cast<const SQL_TIMESTAMP_STRUCT*>(GetData());
@@ -1547,7 +1547,7 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
SqlLen paramLen = GetInputSize();
@@ -1575,7 +1575,7 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_CHAR:
+ case OdbcNativeType::AI_CHAR:
{
SqlLen paramLen = GetInputSize();
@@ -1593,36 +1593,36 @@ namespace ignite
break;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
{
val.AssignInt64(GetNum<int64_t>());
break;
}
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
{
val.AssignUint64(GetNum<uint64_t>());
break;
}
- case IGNITE_ODBC_C_TYPE_FLOAT:
- case IGNITE_ODBC_C_TYPE_DOUBLE:
+ case OdbcNativeType::AI_FLOAT:
+ case OdbcNativeType::AI_DOUBLE:
{
val.AssignDouble(GetNum<double>());
break;
}
- case IGNITE_ODBC_C_TYPE_NUMERIC:
+ case OdbcNativeType::AI_NUMERIC:
{
const SQL_NUMERIC_STRUCT* numeric =
reinterpret_cast<const SQL_NUMERIC_STRUCT*>(GetData());
@@ -1671,9 +1671,9 @@ namespace ignite
switch (type)
{
- case IGNITE_ODBC_C_TYPE_WCHAR:
- case IGNITE_ODBC_C_TYPE_CHAR:
- case IGNITE_ODBC_C_TYPE_BINARY:
+ case OdbcNativeType::AI_WCHAR:
+ case OdbcNativeType::AI_CHAR:
+ case OdbcNativeType::AI_BINARY:
{
const SqlLen* resLenPtr = GetResLen();
@@ -1687,52 +1687,52 @@ namespace ignite
else
ilen = 0;
- if (type == IGNITE_ODBC_C_TYPE_WCHAR)
+ if (type == OdbcNativeType::AI_WCHAR)
ilen *= 2;
return ilen;
}
- case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
+ case OdbcNativeType::AI_SIGNED_SHORT:
+ case OdbcNativeType::AI_UNSIGNED_SHORT:
return static_cast<SqlLen>(sizeof(short));
- case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
+ case OdbcNativeType::AI_SIGNED_LONG:
+ case OdbcNativeType::AI_UNSIGNED_LONG:
return static_cast<SqlLen>(sizeof(long));
- case IGNITE_ODBC_C_TYPE_FLOAT:
+ case OdbcNativeType::AI_FLOAT:
return static_cast<SqlLen>(sizeof(float));
- case IGNITE_ODBC_C_TYPE_DOUBLE:
+ case OdbcNativeType::AI_DOUBLE:
return static_cast<SqlLen>(sizeof(double));
- case IGNITE_ODBC_C_TYPE_BIT:
- case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
+ case OdbcNativeType::AI_BIT:
+ case OdbcNativeType::AI_SIGNED_TINYINT:
+ case OdbcNativeType::AI_UNSIGNED_TINYINT:
return static_cast<SqlLen>(sizeof(char));
- case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
- case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
+ case OdbcNativeType::AI_SIGNED_BIGINT:
+ case OdbcNativeType::AI_UNSIGNED_BIGINT:
return static_cast<SqlLen>(sizeof(SQLBIGINT));
- case IGNITE_ODBC_C_TYPE_TDATE:
+ case OdbcNativeType::AI_TDATE:
return static_cast<SqlLen>(sizeof(SQL_DATE_STRUCT));
- case IGNITE_ODBC_C_TYPE_TTIME:
+ case OdbcNativeType::AI_TTIME:
return static_cast<SqlLen>(sizeof(SQL_TIME_STRUCT));
- case IGNITE_ODBC_C_TYPE_TTIMESTAMP:
+ case OdbcNativeType::AI_TTIMESTAMP:
return static_cast<SqlLen>(sizeof(SQL_TIMESTAMP_STRUCT));
- case IGNITE_ODBC_C_TYPE_NUMERIC:
+ case OdbcNativeType::AI_NUMERIC:
return static_cast<SqlLen>(sizeof(SQL_NUMERIC_STRUCT));
- case IGNITE_ODBC_C_TYPE_GUID:
+ case OdbcNativeType::AI_GUID:
return static_cast<SqlLen>(sizeof(SQLGUID));
- case IGNITE_ODBC_C_TYPE_DEFAULT:
- case IGNITE_ODBC_C_TYPE_UNSUPPORTED:
+ case OdbcNativeType::AI_DEFAULT:
+ case OdbcNativeType::AI_UNSUPPORTED:
default:
break;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/app/parameter.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/app/parameter.cpp b/modules/platforms/cpp/odbc/src/app/parameter.cpp
index d351e29..13136f0 100644
--- a/modules/platforms/cpp/odbc/src/app/parameter.cpp
+++ b/modules/platforms/cpp/odbc/src/app/parameter.cpp
@@ -242,12 +242,12 @@ namespace ignite
return;
}
- if (buffer.GetType() == type_traits::IGNITE_ODBC_C_TYPE_CHAR ||
- buffer.GetType() == type_traits::IGNITE_ODBC_C_TYPE_BINARY)
+ if (buffer.GetType() == type_traits::OdbcNativeType::AI_CHAR ||
+ buffer.GetType() == type_traits::OdbcNativeType::AI_BINARY)
{
SqlLen slen = len;
- if (buffer.GetType() == type_traits::IGNITE_ODBC_C_TYPE_CHAR && slen == SQL_NTSL)
+ if (buffer.GetType() == type_traits::OdbcNativeType::AI_CHAR && slen == SQL_NTSL)
{
const char* str = reinterpret_cast<char*>(data);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/column.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/column.cpp b/modules/platforms/cpp/odbc/src/column.cpp
index e20c7a8..a9783a9 100644
--- a/modules/platforms/cpp/odbc/src/column.cpp
+++ b/modules/platforms/cpp/odbc/src/column.cpp
@@ -326,22 +326,22 @@ namespace ignite
size = sizeTmp;
}
- SqlResult Column::ReadToBuffer(BinaryReaderImpl& reader, app::ApplicationDataBuffer& dataBuf)
+ SqlResult::Type Column::ReadToBuffer(BinaryReaderImpl& reader, app::ApplicationDataBuffer& dataBuf)
{
if (!IsValid())
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
if (GetUnreadDataLength() == 0)
{
dataBuf.PutNull();
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
}
InteropInputStream* stream = reader.GetStream();
if (!stream)
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
InteropStreamPositionGuard<InteropInputStream> guard(*stream);
@@ -451,7 +451,7 @@ namespace ignite
int32_t len;
if (!GetObjectLength(*stream, len))
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
std::vector<int8_t> data(len);
@@ -521,11 +521,11 @@ namespace ignite
default:
{
// This is a fail case. Return false.
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Column::IncreaseOffset(int32_t value)
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/common_types.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/common_types.cpp b/modules/platforms/cpp/odbc/src/common_types.cpp
index 36d11c2..09ea3dc 100644
--- a/modules/platforms/cpp/odbc/src/common_types.cpp
+++ b/modules/platforms/cpp/odbc/src/common_types.cpp
@@ -24,99 +24,99 @@ namespace ignite
{
namespace odbc
{
- int SqlResultToReturnCode(SqlResult result)
+ int SqlResultToReturnCode(SqlResult::Type result)
{
switch (result)
{
- case SQL_RESULT_SUCCESS:
+ case SqlResult::AI_SUCCESS:
return SQL_SUCCESS;
- case SQL_RESULT_SUCCESS_WITH_INFO:
+ case SqlResult::AI_SUCCESS_WITH_INFO:
return SQL_SUCCESS_WITH_INFO;
- case SQL_RESULT_NO_DATA:
+ case SqlResult::AI_NO_DATA:
return SQL_NO_DATA;
- case SQL_RESULT_NEED_DATA:
+ case SqlResult::AI_NEED_DATA:
return SQL_NEED_DATA;
- case SQL_RESULT_ERROR:
+ case SqlResult::AI_ERROR:
default:
return SQL_ERROR;
}
}
- DiagnosticField DiagnosticFieldToInternal(int16_t field)
+ DiagnosticField::Type DiagnosticFieldToInternal(int16_t field)
{
switch (field)
{
case SQL_DIAG_CURSOR_ROW_COUNT:
- return IGNITE_SQL_DIAG_HEADER_CURSOR_ROW_COUNT;
+ return DiagnosticField::HEADER_CURSOR_ROW_COUNT;
case SQL_DIAG_DYNAMIC_FUNCTION:
- return IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION;
+ return DiagnosticField::HEADER_DYNAMIC_FUNCTION;
case SQL_DIAG_DYNAMIC_FUNCTION_CODE:
- return IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION_CODE;
+ return DiagnosticField::HEADER_DYNAMIC_FUNCTION_CODE;
case SQL_DIAG_NUMBER:
- return IGNITE_SQL_DIAG_HEADER_NUMBER;
+ return DiagnosticField::HEADER_NUMBER;
case SQL_DIAG_RETURNCODE:
- return IGNITE_SQL_DIAG_HEADER_RETURNCODE;
+ return DiagnosticField::HEADER_RETURNCODE;
case SQL_DIAG_ROW_COUNT:
- return IGNITE_SQL_DIAG_HEADER_ROW_COUNT;
+ return DiagnosticField::HEADER_ROW_COUNT;
case SQL_DIAG_CLASS_ORIGIN:
- return IGNITE_SQL_DIAG_STATUS_CLASS_ORIGIN;
+ return DiagnosticField::STATUS_CLASS_ORIGIN;
case SQL_DIAG_COLUMN_NUMBER:
- return IGNITE_SQL_DIAG_STATUS_COLUMN_NUMBER;
+ return DiagnosticField::STATUS_COLUMN_NUMBER;
case SQL_DIAG_CONNECTION_NAME:
- return IGNITE_SQL_DIAG_STATUS_CONNECTION_NAME;
+ return DiagnosticField::STATUS_CONNECTION_NAME;
case SQL_DIAG_MESSAGE_TEXT:
- return IGNITE_SQL_DIAG_STATUS_MESSAGE_TEXT;
+ return DiagnosticField::STATUS_MESSAGE_TEXT;
case SQL_DIAG_NATIVE:
- return IGNITE_SQL_DIAG_STATUS_NATIVE;
+ return DiagnosticField::STATUS_NATIVE;
case SQL_DIAG_ROW_NUMBER:
- return IGNITE_SQL_DIAG_STATUS_ROW_NUMBER;
+ return DiagnosticField::STATUS_ROW_NUMBER;
case SQL_DIAG_SERVER_NAME:
- return IGNITE_SQL_DIAG_STATUS_SERVER_NAME;
+ return DiagnosticField::STATUS_SERVER_NAME;
case SQL_DIAG_SQLSTATE:
- return IGNITE_SQL_DIAG_STATUS_SQLSTATE;
+ return DiagnosticField::STATUS_SQLSTATE;
case SQL_DIAG_SUBCLASS_ORIGIN:
- return IGNITE_SQL_DIAG_STATUS_SUBCLASS_ORIGIN;
+ return DiagnosticField::STATUS_SUBCLASS_ORIGIN;
default:
break;
}
- return IGNITE_SQL_DIAG_UNKNOWN;
+ return DiagnosticField::UNKNOWN;
}
- EnvironmentAttribute EnvironmentAttributeToInternal(int32_t attr)
+ EnvironmentAttribute::Type EnvironmentAttributeToInternal(int32_t attr)
{
switch (attr)
{
case SQL_ATTR_ODBC_VERSION:
- return IGNITE_SQL_ENV_ATTR_ODBC_VERSION;
+ return EnvironmentAttribute::ODBC_VERSION;
case SQL_ATTR_OUTPUT_NTS:
- return IGNITE_SQL_ENV_ATTR_OUTPUT_NTS;
+ return EnvironmentAttribute::OUTPUT_NTS;
default:
break;
}
- return IGNITE_SQL_ENV_ATTR_UNKNOWN;
+ return EnvironmentAttribute::UNKNOWN;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/config/connection_info.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/config/connection_info.cpp b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
index a34d434..b642a39 100644
--- a/modules/platforms/cpp/odbc/src/config/connection_info.cpp
+++ b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
@@ -627,11 +627,11 @@ namespace ignite
// No-op.
}
- SqlResult ConnectionInfo::GetInfo(InfoType type, void* buf,
+ SqlResult::Type ConnectionInfo::GetInfo(InfoType type, void* buf,
short buflen, short* reslen) const
{
if (!buf || !buflen)
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
StringInfoMap::const_iterator itStr = strParams.find(type);
@@ -644,7 +644,7 @@ namespace ignite
if (reslen)
*reslen = strlen;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
UintInfoMap::const_iterator itInt = intParams.find(type);
@@ -655,7 +655,7 @@ namespace ignite
*res = itInt->second;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
UshortInfoMap::const_iterator itShort = shortParams.find(type);
@@ -666,10 +666,10 @@ namespace ignite
*res = itShort->second;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index 960a507..62194d0 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -76,14 +76,14 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalGetInfo(type, buf, buflen, reslen));
}
- SqlResult Connection::InternalGetInfo(config::ConnectionInfo::InfoType type, void* buf, short buflen, short* reslen)
+ SqlResult::Type Connection::InternalGetInfo(config::ConnectionInfo::InfoType type, void* buf, short buflen, short* reslen)
{
const config::ConnectionInfo& info = GetInfo();
- SqlResult res = info.GetInfo(type, buf, buflen, reslen);
+ SqlResult::Type res = info.GetInfo(type, buf, buflen, reslen);
- if (res != SQL_RESULT_SUCCESS)
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED, "Not implemented.");
+ if (res != SqlResult::AI_SUCCESS)
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED, "Not implemented.");
return res;
}
@@ -93,7 +93,7 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalEstablish(connectStr));
}
- SqlResult Connection::InternalEstablish(const std::string& connectStr)
+ SqlResult::Type Connection::InternalEstablish(const std::string& connectStr)
{
config::Configuration config;
@@ -103,9 +103,9 @@ namespace ignite
}
catch (IgniteError& e)
{
- AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, e.GetText());
+ AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, e.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
return InternalEstablish(config);
@@ -116,24 +116,24 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalEstablish(cfg));
}
- SqlResult Connection::InternalEstablish(const config::Configuration cfg)
+ SqlResult::Type Connection::InternalEstablish(const config::Configuration cfg)
{
config = cfg;
if (connected)
{
- AddStatusRecord(SQL_STATE_08002_ALREADY_CONNECTED, "Already connected.");
+ AddStatusRecord(SqlState::S08002_ALREADY_CONNECTED, "Already connected.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
connected = socket.Connect(cfg.GetHost().c_str(), cfg.GetTcpPort());
if (!connected)
{
- AddStatusRecord(SQL_STATE_08001_CANNOT_CONNECT, "Failed to establish connection with the host.");
+ AddStatusRecord(SqlState::S08001_CANNOT_CONNECT, "Failed to establish connection with the host.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
return MakeRequestHandshake();
@@ -144,20 +144,20 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalRelease());
}
- SqlResult Connection::InternalRelease()
+ SqlResult::Type Connection::InternalRelease()
{
if (!connected)
{
- AddStatusRecord(SQL_STATE_08003_NOT_CONNECTED, "Connection is not open.");
+ AddStatusRecord(SqlState::S08003_NOT_CONNECTED, "Connection is not open.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
socket.Close();
connected = false;
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
Statement* Connection::CreateStatement()
@@ -169,18 +169,18 @@ namespace ignite
return statement;
}
- SqlResult Connection::InternalCreateStatement(Statement*& statement)
+ SqlResult::Type Connection::InternalCreateStatement(Statement*& statement)
{
statement = new Statement(*this);
if (!statement)
{
- AddStatusRecord(SQL_STATE_HY001_MEMORY_ALLOCATION, "Not enough memory.");
+ AddStatusRecord(SqlState::SHY001_MEMORY_ALLOCATION, "Not enough memory.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Connection::Send(const int8_t* data, size_t len)
@@ -288,7 +288,7 @@ namespace ignite
return config;
}
- diagnostic::DiagnosticRecord Connection::CreateStatusRecord(SqlState sqlState,
+ diagnostic::DiagnosticRecord Connection::CreateStatusRecord(SqlState::Type sqlState,
const std::string& message, int32_t rowNum, int32_t columnNum)
{
return diagnostic::DiagnosticRecord(sqlState, message, "", "", rowNum, columnNum);
@@ -299,9 +299,9 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalTransactionCommit());
}
- SqlResult Connection::InternalTransactionCommit()
+ SqlResult::Type Connection::InternalTransactionCommit()
{
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Connection::TransactionRollback()
@@ -309,15 +309,15 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalTransactionRollback());
}
- SqlResult Connection::InternalTransactionRollback()
+ SqlResult::Type Connection::InternalTransactionRollback()
{
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Rollback operation is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- SqlResult Connection::MakeRequestHandshake()
+ SqlResult::Type Connection::MakeRequestHandshake()
{
bool distributedJoins = false;
bool enforceJoinOrder = false;
@@ -331,9 +331,9 @@ namespace ignite
}
catch (const IgniteError& err)
{
- AddStatusRecord(SQL_STATE_01S00_INVALID_CONNECTION_STRING_ATTRIBUTE, err.GetText());
+ AddStatusRecord(SqlState::S01S00_INVALID_CONNECTION_STRING_ATTRIBUTE, err.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
HandshakeRequest req(protocolVersion, distributedJoins, enforceJoinOrder);
@@ -345,20 +345,20 @@ namespace ignite
}
catch (const IgniteError& err)
{
- AddStatusRecord(SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT, err.GetText());
+ AddStatusRecord(SqlState::SHYT01_CONNECTIOIN_TIMEOUT, err.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
+ if (rsp.GetStatus() != ResponseStatus::SUCCESS)
{
LOG_MSG("Error: " << rsp.GetError().c_str());
- AddStatusRecord(SQL_STATE_08001_CANNOT_CONNECT, rsp.GetError());
+ AddStatusRecord(SqlState::S08001_CANNOT_CONNECT, rsp.GetError());
InternalRelease();
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (!rsp.IsAccepted())
@@ -372,14 +372,14 @@ namespace ignite
<< "node protocol version introduced in version: " << rsp.ProtoVerSince() << ", "
<< "driver protocol version introduced in version: " << config.GetProtocolVersion().ToString() << ".";
- AddStatusRecord(SQL_STATE_08001_CANNOT_CONNECT, constructor.str());
+ AddStatusRecord(SqlState::S08001_CANNOT_CONNECT, constructor.str());
InternalRelease();
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp b/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
index 94ea53e..6c07c29 100644
--- a/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
+++ b/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
@@ -25,7 +25,7 @@ namespace ignite
{
namespace diagnostic
{
- void DiagnosableAdapter::AddStatusRecord(SqlState sqlState,
+ void DiagnosableAdapter::AddStatusRecord(SqlState::Type sqlState,
const std::string& message, int32_t rowNum, int32_t columnNum)
{
if (connection)
@@ -40,7 +40,7 @@ namespace ignite
}
}
- void DiagnosableAdapter::AddStatusRecord(SqlState sqlState, const std::string& message)
+ void DiagnosableAdapter::AddStatusRecord(SqlState::Type sqlState, const std::string& message)
{
LOG_MSG("Adding new record: " << message);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp b/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
index 3c411d2..c8e0e81 100644
--- a/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
+++ b/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
@@ -102,7 +102,7 @@ namespace ignite
namespace diagnostic
{
DiagnosticRecord::DiagnosticRecord() :
- sqlState(SQL_STATE_UNKNOWN),
+ sqlState(SqlState::UNKNOWN),
message(),
connectionName(),
serverName(),
@@ -113,7 +113,7 @@ namespace ignite
// No-op.
}
- DiagnosticRecord::DiagnosticRecord(SqlState sqlState,
+ DiagnosticRecord::DiagnosticRecord(SqlState::Type sqlState,
const std::string& message, const std::string& connectionName,
const std::string& serverName, int32_t rowNum, int32_t columnNum) :
sqlState(sqlState),
@@ -221,67 +221,67 @@ namespace ignite
{
switch (sqlState)
{
- case SQL_STATE_01004_DATA_TRUNCATED:
+ case SqlState::S01004_DATA_TRUNCATED:
return STATE_01004;
- case SQL_STATE_01S00_INVALID_CONNECTION_STRING_ATTRIBUTE:
+ case SqlState::S01S00_INVALID_CONNECTION_STRING_ATTRIBUTE:
return STATE_01S00;
- case SQL_STATE_01S01_ERROR_IN_ROW:
+ case SqlState::S01S01_ERROR_IN_ROW:
return STATE_01S01;
- case SQL_STATE_22026_DATA_LENGTH_MISMATCH:
+ case SqlState::S22026_DATA_LENGTH_MISMATCH:
return STATE_22026;
- case SQL_STATE_24000_INVALID_CURSOR_STATE:
+ case SqlState::S24000_INVALID_CURSOR_STATE:
return STATE_24000;
- case SQL_STATE_07009_INVALID_DESCRIPTOR_INDEX:
+ case SqlState::S07009_INVALID_DESCRIPTOR_INDEX:
return STATE_07009;
- case SQL_STATE_08001_CANNOT_CONNECT:
+ case SqlState::S08001_CANNOT_CONNECT:
return STATE_08001;
- case SQL_STATE_08002_ALREADY_CONNECTED:
+ case SqlState::S08002_ALREADY_CONNECTED:
return STATE_08002;
- case SQL_STATE_08003_NOT_CONNECTED:
+ case SqlState::S08003_NOT_CONNECTED:
return STATE_08003;
- case SQL_STATE_HY000_GENERAL_ERROR:
+ case SqlState::SHY000_GENERAL_ERROR:
return STATE_HY000;
- case SQL_STATE_HY001_MEMORY_ALLOCATION:
+ case SqlState::SHY001_MEMORY_ALLOCATION:
return STATE_HY001;
- case SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE:
+ case SqlState::SHY003_INVALID_APPLICATION_BUFFER_TYPE:
return STATE_HY003;
- case SQL_STATE_HY009_INVALID_USE_OF_NULL_POINTER:
+ case SqlState::SHY009_INVALID_USE_OF_NULL_POINTER:
return STATE_HY009;
- case SQL_STATE_HY010_SEQUENCE_ERROR:
+ case SqlState::SHY010_SEQUENCE_ERROR:
return STATE_HY010;
- case SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH:
+ case SqlState::SHY090_INVALID_STRING_OR_BUFFER_LENGTH:
return STATE_HY090;
- case SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE:
+ case SqlState::SHY092_OPTION_TYPE_OUT_OF_RANGE:
return STATE_HY092;
- case SQL_STATE_HY105_INVALID_PARAMETER_TYPE:
+ case SqlState::SHY105_INVALID_PARAMETER_TYPE:
return STATE_HY105;
- case SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE:
+ case SqlState::SHY106_FETCH_TYPE_OUT_OF_RANGE:
return STATE_HY106;
- case SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED:
+ case SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED:
return STATE_HYC00;
- case SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT:
+ case SqlState::SHYT01_CONNECTIOIN_TIMEOUT:
return STATE_HYT01;
- case SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED:
+ case SqlState::SIM001_FUNCTION_NOT_SUPPORTED:
return STATE_IM001;
default:
[20/50] [abbrv] ignite git commit: IGNITE-3503 .NET: Remove "Default"
prefix from BinaryConfiguration properties
Posted by sb...@apache.org.
IGNITE-3503 .NET: Remove "Default" prefix from BinaryConfiguration properties
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dd4a5c42
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dd4a5c42
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dd4a5c42
Branch: refs/heads/ignite-4929
Commit: dd4a5c423ca8313206db79d241960ca96228b746
Parents: 027b2c2
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Thu Apr 13 15:41:23 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Thu Apr 13 15:41:23 2017 +0300
----------------------------------------------------------------------
.../Binary/BinaryBuilderSelfTest.cs | 4 ++--
.../Binary/BinaryDynamicRegistrationTest.cs | 11 +++++----
.../Binary/BinarySelfTest.cs | 4 ++--
.../IgniteConfigurationSerializerTest.cs | 15 ++++++------
.../Binary/BinaryConfiguration.cs | 24 ++++++++++----------
.../IgniteConfigurationSection.xsd | 8 +++----
.../Binary/BinarySurrogateTypeDescriptor.cs | 10 ++++----
.../Impl/Binary/BinaryUtils.cs | 8 +++----
.../Impl/Binary/Marshaller.cs | 14 ++++++------
9 files changed, 51 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
index 35c7e47..63faaec 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
@@ -57,8 +57,8 @@ namespace Apache.Ignite.Core.Tests.Binary
BinaryConfiguration = new BinaryConfiguration
{
TypeConfigurations = GetTypeConfigurations(),
- DefaultIdMapper = new IdMapper(),
- DefaultNameMapper = new NameMapper(),
+ IdMapper = new IdMapper(),
+ NameMapper = new NameMapper(),
CompactFooter = GetCompactFooter()
}
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs
index dc5e7df..24f5e7c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs
@@ -265,7 +265,10 @@ namespace Apache.Ignite.Core.Tests.Binary
using (var ignite2 = Ignition.Start(cfg))
{
- var cache = ignite2.CreateCache<int, Foo>("foos");
+ var cache = ignite2.CreateCache<int, Foo>(new CacheConfiguration("foos")
+ {
+ CacheMode = CacheMode.Replicated
+ });
cache[1] = new Foo();
}
@@ -322,15 +325,15 @@ namespace Apache.Ignite.Core.Tests.Binary
/// </summary>
private static void Test(IIgnite ignite1, IIgnite ignite2)
{
- const string cacheName = "cache";
+ var cfg = new CacheConfiguration("cache") {CacheMode = CacheMode.Partitioned};
// Put on one grid.
- var cache1 = ignite1.GetOrCreateCache<int, object>(cacheName);
+ var cache1 = ignite1.GetOrCreateCache<int, object>(cfg);
cache1[1] = new Foo {Int = 1, Str = "1"};
cache1[2] = ignite1.GetBinary().GetBuilder(typeof (Bar)).SetField("Int", 5).SetField("Str", "s").Build();
// Get on another grid.
- var cache2 = ignite2.GetOrCreateCache<int, Foo>(cacheName);
+ var cache2 = ignite2.GetOrCreateCache<int, Foo>(cfg);
var foo = cache2[1];
Assert.AreEqual(1, foo.Int);
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinarySelfTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinarySelfTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinarySelfTest.cs
index eb2751e..06fbe48 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinarySelfTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinarySelfTest.cs
@@ -1398,7 +1398,7 @@ namespace Apache.Ignite.Core.Tests.Binary
{
BinaryConfiguration cfg = new BinaryConfiguration();
- cfg.DefaultKeepDeserialized = false;
+ cfg.KeepDeserialized = false;
CheckKeepSerialized(cfg, false);
}
@@ -1430,7 +1430,7 @@ namespace Apache.Ignite.Core.Tests.Binary
typeCfg.KeepDeserialized = true;
BinaryConfiguration cfg = new BinaryConfiguration();
- cfg.DefaultKeepDeserialized = false;
+ cfg.KeepDeserialized = false;
cfg.TypeConfigurations = new List<BinaryTypeConfiguration> { typeCfg };
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
index 1d39e69..8549c84 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -70,8 +70,9 @@ namespace Apache.Ignite.Core.Tests
{
var xml = @"<igniteConfig workDirectory='c:' JvmMaxMemoryMb='1024' MetricsLogFrequency='0:0:10' isDaemon='true' isLateAffinityAssignment='false' springConfigUrl='c:\myconfig.xml'>
<localhost>127.1.1.1</localhost>
- <binaryConfiguration compactFooter='false'>
- <defaultNameMapper type='Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+NameMapper' bar='testBar' />
+ <binaryConfiguration compactFooter='false' keepDeserialized='true'>
+ <nameMapper type='Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+NameMapper' bar='testBar' />
+ <idMapper type='Apache.Ignite.Core.Tests.Binary.IdMapper' />
<types>
<string>Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+FooClass, Apache.Ignite.Core.Tests</string>
</types>
@@ -155,7 +156,7 @@ namespace Apache.Ignite.Core.Tests
((TcpDiscoveryMulticastIpFinder) ((TcpDiscoverySpi) cfg.DiscoverySpi).IpFinder).AddressRequestAttempts);
Assert.AreEqual(new[] { "-Xms1g", "-Xmx4g" }, cfg.JvmOptions);
Assert.AreEqual(15, ((LifecycleBean) cfg.LifecycleBeans.Single()).Foo);
- Assert.AreEqual("testBar", ((NameMapper) cfg.BinaryConfiguration.DefaultNameMapper).Bar);
+ Assert.AreEqual("testBar", ((NameMapper) cfg.BinaryConfiguration.NameMapper).Bar);
Assert.AreEqual(
"Apache.Ignite.Core.Tests.IgniteConfigurationSerializerTest+FooClass, Apache.Ignite.Core.Tests",
cfg.BinaryConfiguration.Types.Single());
@@ -615,10 +616,10 @@ namespace Apache.Ignite.Core.Tests
}
},
Types = new[] {typeof (string).FullName},
- DefaultIdMapper = new IdMapper(),
- DefaultKeepDeserialized = true,
- DefaultNameMapper = new NameMapper(),
- DefaultSerializer = new TestSerializer()
+ IdMapper = new IdMapper(),
+ KeepDeserialized = true,
+ NameMapper = new NameMapper(),
+ Serializer = new TestSerializer()
},
CacheConfiguration = new[]
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryConfiguration.cs
index c738f28..a67244b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryConfiguration.cs
@@ -35,9 +35,9 @@ namespace Apache.Ignite.Core.Binary
public const bool DefaultCompactFooter = true;
/// <summary>
- /// Default <see cref="DefaultKeepDeserialized"/> setting.
+ /// Default <see cref="KeepDeserialized"/> setting.
/// </summary>
- public const bool DefaultDefaultKeepDeserialized = true;
+ public const bool DefaultKeepDeserialized = true;
/** Footer setting. */
private bool? _compactFooter;
@@ -47,7 +47,7 @@ namespace Apache.Ignite.Core.Binary
/// </summary>
public BinaryConfiguration()
{
- DefaultKeepDeserialized = DefaultDefaultKeepDeserialized;
+ KeepDeserialized = DefaultKeepDeserialized;
}
/// <summary>
@@ -58,10 +58,10 @@ namespace Apache.Ignite.Core.Binary
{
IgniteArgumentCheck.NotNull(cfg, "cfg");
- DefaultIdMapper = cfg.DefaultIdMapper;
- DefaultNameMapper = cfg.DefaultNameMapper;
- DefaultKeepDeserialized = cfg.DefaultKeepDeserialized;
- DefaultSerializer = cfg.DefaultSerializer;
+ IdMapper = cfg.IdMapper;
+ NameMapper = cfg.NameMapper;
+ KeepDeserialized = cfg.KeepDeserialized;
+ Serializer = cfg.Serializer;
TypeConfigurations = cfg.TypeConfigurations == null
? null
@@ -99,23 +99,23 @@ namespace Apache.Ignite.Core.Binary
/// <summary>
/// Default name mapper.
/// </summary>
- public IBinaryNameMapper DefaultNameMapper { get; set; }
+ public IBinaryNameMapper NameMapper { get; set; }
/// <summary>
/// Default ID mapper.
/// </summary>
- public IBinaryIdMapper DefaultIdMapper { get; set; }
+ public IBinaryIdMapper IdMapper { get; set; }
/// <summary>
/// Default serializer.
/// </summary>
- public IBinarySerializer DefaultSerializer { get; set; }
+ public IBinarySerializer Serializer { get; set; }
/// <summary>
/// Default keep deserialized flag.
/// </summary>
- [DefaultValue(DefaultDefaultKeepDeserialized)]
- public bool DefaultKeepDeserialized { get; set; }
+ [DefaultValue(DefaultKeepDeserialized)]
+ public bool KeepDeserialized { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to write footers in compact form.
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
index 3691aa0..887e068 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -206,7 +206,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="defaultNameMapper" minOccurs="0">
+ <xs:element name="nameMapper" minOccurs="0">
<xs:annotation>
<xs:documentation>Default name mapper.</xs:documentation>
</xs:annotation>
@@ -218,7 +218,7 @@
</xs:attribute>
</xs:complexType>
</xs:element>
- <xs:element name="defaultIdMapper" minOccurs="0">
+ <xs:element name="idMapper" minOccurs="0">
<xs:annotation>
<xs:documentation>Default ID mapper.</xs:documentation>
</xs:annotation>
@@ -230,7 +230,7 @@
</xs:attribute>
</xs:complexType>
</xs:element>
- <xs:element name="defaultSerializer" minOccurs="0">
+ <xs:element name="serializer" minOccurs="0">
<xs:annotation>
<xs:documentation>Default serializer.</xs:documentation>
</xs:annotation>
@@ -243,7 +243,7 @@
</xs:complexType>
</xs:element>
</xs:all>
- <xs:attribute name="defaultKeepDeserialized" type="xs:boolean">
+ <xs:attribute name="keepDeserialized" type="xs:boolean">
<xs:annotation>
<xs:documentation>Default keep deserialized flag.</xs:documentation>
</xs:annotation>
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs
index 8c7e5e9..0af4910 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs
@@ -72,7 +72,7 @@ namespace Apache.Ignite.Core.Impl.Binary
_cfg = cfg;
_name = name;
- _id = BinaryUtils.TypeId(name, cfg.DefaultNameMapper, cfg.DefaultIdMapper);
+ _id = BinaryUtils.TypeId(name, cfg.NameMapper, cfg.IdMapper);
}
/** <inheritDoc /> */
@@ -102,25 +102,25 @@ namespace Apache.Ignite.Core.Impl.Binary
/** <inheritDoc /> */
public bool KeepDeserialized
{
- get { return _cfg.DefaultKeepDeserialized; }
+ get { return _cfg.KeepDeserialized; }
}
/** <inheritDoc /> */
public IBinaryNameMapper NameMapper
{
- get { return _cfg.DefaultNameMapper; }
+ get { return _cfg.NameMapper; }
}
/** <inheritDoc /> */
public IBinaryIdMapper IdMapper
{
- get { return _cfg.DefaultIdMapper; }
+ get { return _cfg.IdMapper; }
}
/** <inheritDoc /> */
public IBinarySerializerInternal Serializer
{
- get { return new UserSerializerProxy(_cfg.DefaultSerializer); }
+ get { return new UserSerializerProxy(_cfg.Serializer); }
}
/** <inheritDoc /> */
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
index bb58ea5..ae11d06 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
@@ -1972,10 +1972,10 @@ namespace Apache.Ignite.Core.Impl.Binary
}
// Read the rest.
- cfg.DefaultNameMapper = CreateInstance<IBinaryNameMapper>(reader);
- cfg.DefaultIdMapper = CreateInstance<IBinaryIdMapper>(reader);
- cfg.DefaultSerializer = CreateInstance<IBinarySerializer>(reader);
- cfg.DefaultKeepDeserialized = reader.ReadBoolean();
+ cfg.NameMapper = CreateInstance<IBinaryNameMapper>(reader);
+ cfg.IdMapper = CreateInstance<IBinaryIdMapper>(reader);
+ cfg.Serializer = CreateInstance<IBinarySerializer>(reader);
+ cfg.KeepDeserialized = reader.ReadBoolean();
}
else
cfg = null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/dd4a5c42/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
index 5a4460a..1dae576 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
@@ -472,7 +472,7 @@ namespace Apache.Ignite.Core.Impl.Binary
Debug.Assert(type != null);
var typeName = BinaryUtils.GetTypeName(type);
- var typeId = BinaryUtils.TypeId(typeName, _cfg.DefaultNameMapper, _cfg.DefaultIdMapper);
+ var typeId = BinaryUtils.TypeId(typeName, _cfg.NameMapper, _cfg.IdMapper);
var registered = _ignite != null && _ignite.BinaryProcessor.RegisterType(typeId, type);
@@ -505,8 +505,8 @@ namespace Apache.Ignite.Core.Impl.Binary
var ser = GetSerializer(_cfg, null, type, typeId, null, null, _log);
desc = desc == null
- ? new BinaryFullTypeDescriptor(type, typeId, typeName, true, _cfg.DefaultNameMapper,
- _cfg.DefaultIdMapper, ser, false, null, type.IsEnum, null, registered)
+ ? new BinaryFullTypeDescriptor(type, typeId, typeName, true, _cfg.NameMapper,
+ _cfg.IdMapper, ser, false, null, type.IsEnum, null, registered)
: new BinaryFullTypeDescriptor(desc, type, ser, registered);
if (RegistrationDisabled)
@@ -546,11 +546,11 @@ namespace Apache.Ignite.Core.Impl.Binary
private void AddUserType(BinaryConfiguration cfg, BinaryTypeConfiguration typeCfg, TypeResolver typeResolver)
{
// Get converter/mapper/serializer.
- IBinaryNameMapper nameMapper = typeCfg.NameMapper ?? _cfg.DefaultNameMapper;
+ IBinaryNameMapper nameMapper = typeCfg.NameMapper ?? _cfg.NameMapper;
- IBinaryIdMapper idMapper = typeCfg.IdMapper ?? _cfg.DefaultIdMapper;
+ IBinaryIdMapper idMapper = typeCfg.IdMapper ?? _cfg.IdMapper;
- bool keepDeserialized = typeCfg.KeepDeserialized ?? _cfg.DefaultKeepDeserialized;
+ bool keepDeserialized = typeCfg.KeepDeserialized ?? _cfg.KeepDeserialized;
// Try resolving type.
Type type = typeResolver.ResolveType(typeCfg.TypeName);
@@ -597,7 +597,7 @@ namespace Apache.Ignite.Core.Impl.Binary
IBinaryIdMapper idMapper, ILogger log)
{
var serializer = (typeCfg != null ? typeCfg.Serializer : null) ??
- (cfg != null ? cfg.DefaultSerializer : null);
+ (cfg != null ? cfg.Serializer : null);
if (serializer == null)
{
[42/50] [abbrv] ignite git commit: IGNITE-3477 - Fixed direct
marshallable code
Posted by sb...@apache.org.
IGNITE-3477 - Fixed direct marshallable code
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b6b3d375
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b6b3d375
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b6b3d375
Branch: refs/heads/ignite-4929
Commit: b6b3d3754849aa54626befe2375cbc88cbebfab9
Parents: faaf92d
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 19:16:23 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 20:56:59 2017 +0300
----------------------------------------------------------------------
.../cache/binary/MetadataRequestMessage.java | 2 ++
.../cache/binary/MetadataResponseMessage.java | 36 +++++++++++++++-----
2 files changed, 30 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b6b3d375/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java
index 87bf805..b34acd8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataRequestMessage.java
@@ -70,6 +70,7 @@ public class MetadataRequestMessage implements Message {
return false;
writer.incrementState();
+
}
return true;
@@ -90,6 +91,7 @@ public class MetadataRequestMessage implements Message {
return false;
reader.incrementState();
+
}
return reader.afterMessageRead(MetadataRequestMessage.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/b6b3d375/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java
index bb3d3a3..6ff4fd8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java
@@ -63,22 +63,23 @@ public class MetadataResponseMessage implements Message {
switch (writer.state()) {
case 0:
- if (!writer.writeInt("typeId", typeId))
+ if (!writer.writeByteArray("binaryMetadataBytes", binaryMetadataBytes))
return false;
writer.incrementState();
case 1:
- if (!writer.writeInt("status", status.ordinal()))
+ if (!writer.writeByte("status", status != null ? (byte)status.ordinal() : -1))
return false;
writer.incrementState();
case 2:
- if (!writer.writeByteArray("binMetaBytes", binaryMetadataBytes))
+ if (!writer.writeInt("typeId", typeId))
return false;
writer.incrementState();
+
}
return true;
@@ -93,7 +94,7 @@ public class MetadataResponseMessage implements Message {
switch (reader.state()) {
case 0:
- typeId = reader.readInt("typeId");
+ binaryMetadataBytes = reader.readByteArray("binaryMetadataBytes");
if (!reader.isLastRead())
return false;
@@ -101,18 +102,25 @@ public class MetadataResponseMessage implements Message {
reader.incrementState();
case 1:
- status = ClientResponseStatus.values()[reader.readInt("status")];
+ byte statusOrd;
+
+ statusOrd = reader.readByte("status");
if (!reader.isLastRead())
return false;
+ status = ClientResponseStatus.fromOrdinal(statusOrd);
+
reader.incrementState();
case 2:
- binaryMetadataBytes = reader.readByteArray("binMetaBytes");
+ typeId = reader.readInt("typeId");
if (!reader.isLastRead())
return false;
+
+ reader.incrementState();
+
}
return reader.afterMessageRead(MetadataResponseMessage.class);
@@ -131,7 +139,6 @@ public class MetadataResponseMessage implements Message {
/** {@inheritDoc} */
@Override public void onAckReceived() {
// No-op.
-
}
/**
@@ -185,7 +192,20 @@ public class MetadataResponseMessage implements Message {
METADATA_NOT_FOUND,
/** */
- ERROR
+ ERROR;
+
+ /** Enumerated values. */
+ private static final ClientResponseStatus[] VALS = values();
+
+ /**
+ * Efficiently gets enumerated value from its ordinal.
+ *
+ * @param ord Ordinal value.
+ * @return Enumerated value.
+ */
+ public static ClientResponseStatus fromOrdinal(byte ord) {
+ return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
+ }
}
/** {@inheritDoc} */
[34/50] [abbrv] ignite git commit: Merge-related fix for C++
Posted by sb...@apache.org.
Merge-related fix for C++
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/02427284
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/02427284
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/02427284
Branch: refs/heads/ignite-4929
Commit: 024272844e6507482c2bee4bbb0cfdfa993fbe5e
Parents: 2c4ef9e
Author: Igor Sapego <is...@gridgain.com>
Authored: Thu Apr 13 18:18:43 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Thu Apr 13 18:18:43 2017 +0300
----------------------------------------------------------------------
.../core-test/include/ignite/binary_test_defs.h | 10 ++++----
.../cpp/core-test/src/continuous_query_test.cpp | 2 +-
.../examples/include/ignite/examples/address.h | 26 +++++++++-----------
.../include/ignite/examples/organization.h | 26 +++++++++-----------
.../examples/include/ignite/examples/person.h | 16 ++++++------
5 files changed, 37 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h b/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
index 6c2bde7..9d7dcd2 100644
--- a/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
+++ b/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h
@@ -158,7 +158,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::BinaryInner& obj)
+ static bool IsNull(const gt::BinaryInner& obj)
{
return false;
}
@@ -197,7 +197,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::BinaryInner& obj)
+ static bool IsNull(const gt::BinaryInner& obj)
{
return obj.GetValue() == 0;
}
@@ -238,7 +238,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::BinaryOuter& obj)
+ static bool IsNull(const gt::BinaryOuter& obj)
{
return obj.GetValue() == 0 && obj.GetInner().GetValue();
}
@@ -281,7 +281,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::BinaryFields& obj)
+ static bool IsNull(const gt::BinaryFields& obj)
{
return false;
}
@@ -334,7 +334,7 @@ namespace ignite
return GetBinaryStringHashCode(name);
}
- bool IsNull(const gt::PureRaw& obj)
+ static bool IsNull(const gt::PureRaw& obj)
{
return false;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
index ea3d665..e092728 100644
--- a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
@@ -295,7 +295,7 @@ namespace ignite
IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- bool IsNull(const RangeFilter<K,V>&)
+ static bool IsNull(const RangeFilter<K,V>&)
{
return false;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/address.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/include/ignite/examples/address.h b/modules/platforms/cpp/examples/include/ignite/examples/address.h
index b19fb4d..6a06f60 100644
--- a/modules/platforms/cpp/examples/include/ignite/examples/address.h
+++ b/modules/platforms/cpp/examples/include/ignite/examples/address.h
@@ -59,48 +59,46 @@ namespace ignite
template<>
struct BinaryType<ignite::examples::Address>
{
- int32_t GetTypeId()
+ static int32_t GetTypeId()
{
return GetBinaryStringHashCode("Address");
}
- std::string GetTypeName()
+ static void GetTypeName(std::string& dst)
{
- return "Address";
+ dst = "Address";
}
- int32_t GetFieldId(const char* name)
+ static int32_t GetFieldId(const char* name)
{
return GetBinaryStringHashCode(name);
}
- int32_t GetHashCode(ignite::examples::Address obj)
+ static int32_t GetHashCode(ignite::examples::Address obj)
{
return 0;
}
- bool IsNull(ignite::examples::Address obj)
+ static bool IsNull(ignite::examples::Address obj)
{
return false;
}
- ignite::examples::Address GetNull()
+ static void GetNull(ignite::examples::Address& dst)
{
- return ignite::examples::Address("", 0);
+ dst = ignite::examples::Address("", 0);
}
- void Write(BinaryWriter& writer, ignite::examples::Address obj)
+ static void Write(BinaryWriter& writer, const ignite::examples::Address& obj)
{
writer.WriteString("street", obj.street);
writer.WriteInt32("zip", obj.zip);
}
- ignite::examples::Address Read(BinaryReader& reader)
+ static void Read(BinaryReader& reader, ignite::examples::Address& dst)
{
- std::string street = reader.ReadString("street");
- int zip = reader.ReadInt32("zip");
-
- return ignite::examples::Address(street, zip);
+ dst.street = reader.ReadString("street");
+ dst.zip = reader.ReadInt32("zip");
}
};
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/organization.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/include/ignite/examples/organization.h b/modules/platforms/cpp/examples/include/ignite/examples/organization.h
index e819d69..942897d 100644
--- a/modules/platforms/cpp/examples/include/ignite/examples/organization.h
+++ b/modules/platforms/cpp/examples/include/ignite/examples/organization.h
@@ -68,48 +68,46 @@ namespace ignite
template<>
struct BinaryType<ignite::examples::Organization>
{
- int32_t GetTypeId()
+ static int32_t GetTypeId()
{
return GetBinaryStringHashCode("Organization");
}
- std::string GetTypeName()
+ static void GetTypeName(std::string& dst)
{
- return "Organization";
+ dst = "Organization";
}
- int32_t GetFieldId(const char* name)
+ static int32_t GetFieldId(const char* name)
{
return GetBinaryStringHashCode(name);
}
- int32_t GetHashCode(ignite::examples::Organization obj)
+ static int32_t GetHashCode(ignite::examples::Organization obj)
{
return 0;
}
- bool IsNull(ignite::examples::Organization obj)
+ static bool IsNull(ignite::examples::Organization obj)
{
return false;
}
- ignite::examples::Organization GetNull()
+ static void GetNull(ignite::examples::Organization& dst)
{
- return ignite::examples::Organization("", ignite::examples::Address());
+ dst = ignite::examples::Organization("", ignite::examples::Address());
}
- void Write(BinaryWriter& writer, ignite::examples::Organization obj)
+ static void Write(BinaryWriter& writer, const ignite::examples::Organization& obj)
{
writer.WriteString("name", obj.name);
writer.WriteObject<ignite::examples::Address>("addr", obj.addr);
}
- ignite::examples::Organization Read(BinaryReader& reader)
+ static void Read(BinaryReader& reader, ignite::examples::Organization& dst)
{
- std::string name = reader.ReadString("name");
- ignite::examples::Address addr = reader.ReadObject<ignite::examples::Address>("addr");
-
- return ignite::examples::Organization(name, addr);
+ dst.name = reader.ReadString("name");
+ dst.addr = reader.ReadObject<ignite::examples::Address>("addr");
}
};
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/person.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/include/ignite/examples/person.h b/modules/platforms/cpp/examples/include/ignite/examples/person.h
index 64693a9..9a87ef2 100644
--- a/modules/platforms/cpp/examples/include/ignite/examples/person.h
+++ b/modules/platforms/cpp/examples/include/ignite/examples/person.h
@@ -82,7 +82,7 @@ namespace ignite
IGNITE_BINARY_IS_NULL_FALSE(Person)
IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
- void Write(BinaryWriter& writer, ignite::examples::Person obj)
+ static void Write(BinaryWriter& writer, const ignite::examples::Person& obj)
{
writer.WriteInt64("orgId", obj.orgId);
writer.WriteString("firstName", obj.firstName);
@@ -91,15 +91,13 @@ namespace ignite
writer.WriteDouble("salary", obj.salary);
}
- ignite::examples::Person Read(BinaryReader& reader)
+ static void Read(BinaryReader& reader, ignite::examples::Person& dst)
{
- int64_t orgId = reader.ReadInt64("orgId");
- std::string firstName = reader.ReadString("firstName");
- std::string lastName = reader.ReadString("lastName");
- std::string resume = reader.ReadString("resume");
- double salary = reader.ReadDouble("salary");
-
- return ignite::examples::Person(orgId, firstName, lastName, resume, salary);
+ dst.orgId = reader.ReadInt64("orgId");
+ dst.firstName = reader.ReadString("firstName");
+ dst.lastName = reader.ReadString("lastName");
+ dst.resume = reader.ReadString("resume");
+ dst.salary = reader.ReadDouble("salary");
}
IGNITE_BINARY_TYPE_END
[03/50] [abbrv] ignite git commit: ignite-3477 : Fixed possible
endless iteration over queue with evicted patitions.
Posted by sb...@apache.org.
ignite-3477 : Fixed possible endless iteration over queue with evicted patitions.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5cded42e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5cded42e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5cded42e
Branch: refs/heads/ignite-4929
Commit: 5cded42e8a45cd799122061499e0c95b00803504
Parents: face0c7
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Wed Apr 12 12:43:49 2017 +0300
Committer: Ilya Lantukh <il...@gridgain.com>
Committed: Wed Apr 12 12:43:49 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/preloader/GridDhtPreloader.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5cded42e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index c033b93..517f04a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -47,6 +47,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffini
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateRequest;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
@@ -72,6 +73,7 @@ import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING;
+import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.OWNING;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.RENTING;
import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap;
@@ -790,7 +792,9 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
try {
part.tryEvict();
- if (part.state() == RENTING || part.shouldBeRenting())
+ GridDhtPartitionState state = part.state();
+
+ if (state == RENTING || ((state == MOVING || state == OWNING) && part.shouldBeRenting()))
partsToEvict.push(part);
}
catch (Throwable ex) {
[43/50] [abbrv] ignite git commit: Merge branch master into
ignite-3477-master
Posted by sb...@apache.org.
Merge branch master into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/922b2582
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/922b2582
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/922b2582
Branch: refs/heads/ignite-4929
Commit: 922b2582d0053455b7616afd5ff35a59027871e4
Parents: b6b3d37 7e106cd
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 21:35:09 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 21:35:09 2017 +0300
----------------------------------------------------------------------
.../include/ignite/binary/binary_consts.h | 86 +++--
.../include/ignite/binary/binary_containers.h | 12 +-
.../include/ignite/binary/binary_raw_reader.h | 6 +-
.../include/ignite/binary/binary_raw_writer.h | 16 +-
.../include/ignite/binary/binary_reader.h | 6 +-
.../include/ignite/binary/binary_writer.h | 13 +-
.../ignite/impl/binary/binary_reader_impl.h | 31 +-
.../include/ignite/impl/binary/binary_schema.h | 19 +-
.../ignite/impl/binary/binary_writer_impl.h | 18 +-
.../cpp/binary/src/binary/binary_raw_reader.cpp | 2 +-
.../cpp/binary/src/binary/binary_reader.cpp | 2 +-
.../src/impl/binary/binary_reader_impl.cpp | 50 +--
.../binary/src/impl/binary/binary_schema.cpp | 17 +-
.../src/impl/binary/binary_writer_impl.cpp | 14 +-
.../src/binary_reader_writer_raw_test.cpp | 34 +-
.../core-test/src/binary_reader_writer_test.cpp | 96 ++---
.../cpp/core-test/src/cache_store_test.cpp | 6 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 24 +-
.../cpp/core-test/src/transactions_test.cpp | 76 ++--
.../cpp/core/include/ignite/cache/cache.h | 12 +-
.../core/include/ignite/cache/cache_peek_mode.h | 67 ++--
.../cpp/core/include/ignite/ignite_binding.h | 4 +-
.../cpp/core/include/ignite/impl/bindings.h | 4 +-
.../impl/cache/cache_entry_processor_holder.h | 37 +-
.../include/ignite/impl/ignite_binding_impl.h | 11 +-
.../ignite/impl/interop/interop_target.h | 21 +-
.../ignite/impl/transactions/transaction_impl.h | 4 +-
.../impl/transactions/transactions_impl.h | 10 +-
.../include/ignite/transactions/transaction.h | 12 +-
.../ignite/transactions/transaction_consts.h | 181 ++++-----
.../include/ignite/transactions/transactions.h | 16 +-
.../impl/binary/binary_type_updater_impl.cpp | 17 +-
.../continuous/continuous_query_handle_impl.cpp | 13 +-
.../src/impl/cluster/cluster_group_impl.cpp | 9 +-
.../cpp/core/src/impl/ignite_environment.cpp | 42 +-
.../core/src/impl/interop/interop_target.cpp | 12 +-
.../src/impl/transactions/transaction_impl.cpp | 18 +-
.../src/impl/transactions/transactions_impl.cpp | 92 +++--
.../cpp/core/src/transactions/transaction.cpp | 8 +-
.../cpp/core/src/transactions/transactions.cpp | 20 +-
.../src/application_data_buffer_test.cpp | 94 ++---
.../platforms/cpp/odbc-test/src/column_test.cpp | 56 +--
.../cpp/odbc-test/src/connection_info_test.cpp | 72 ++--
.../platforms/cpp/odbc-test/src/row_test.cpp | 16 +-
.../ignite/odbc/app/application_data_buffer.h | 6 +-
.../cpp/odbc/include/ignite/odbc/column.h | 2 +-
.../cpp/odbc/include/ignite/odbc/common_types.h | 350 +++++++++--------
.../ignite/odbc/config/connection_info.h | 2 +-
.../cpp/odbc/include/ignite/odbc/connection.h | 18 +-
.../ignite/odbc/diagnostic/diagnosable.h | 4 +-
.../odbc/diagnostic/diagnosable_adapter.h | 8 +-
.../ignite/odbc/diagnostic/diagnostic_record.h | 4 +-
.../odbc/diagnostic/diagnostic_record_storage.h | 8 +-
.../cpp/odbc/include/ignite/odbc/environment.h | 10 +-
.../cpp/odbc/include/ignite/odbc/message.h | 56 +--
.../ignite/odbc/query/column_metadata_query.h | 10 +-
.../odbc/include/ignite/odbc/query/data_query.h | 23 +-
.../ignite/odbc/query/foreign_keys_query.h | 8 +-
.../ignite/odbc/query/primary_keys_query.h | 8 +-
.../cpp/odbc/include/ignite/odbc/query/query.h | 32 +-
.../ignite/odbc/query/special_columns_query.h | 8 +-
.../ignite/odbc/query/table_metadata_query.h | 10 +-
.../include/ignite/odbc/query/type_info_query.h | 8 +-
.../cpp/odbc/include/ignite/odbc/row.h | 2 +-
.../cpp/odbc/include/ignite/odbc/statement.h | 52 +--
.../odbc/system/ui/dsn_configuration_window.h | 35 +-
.../cpp/odbc/include/ignite/odbc/type_traits.h | 91 ++---
.../ignite/odbc/system/ui/custom_window.h | 12 +-
.../odbc/os/win/src/system/ui/custom_window.cpp | 4 +-
.../src/system/ui/dsn_configuration_window.cpp | 42 +-
.../cpp/odbc/os/win/src/system_dsn.cpp | 2 +-
.../odbc/src/app/application_data_buffer.cpp | 386 +++++++++----------
.../platforms/cpp/odbc/src/app/parameter.cpp | 6 +-
modules/platforms/cpp/odbc/src/column.cpp | 14 +-
modules/platforms/cpp/odbc/src/common_types.cpp | 54 +--
.../cpp/odbc/src/config/connection_info.cpp | 12 +-
modules/platforms/cpp/odbc/src/connection.cpp | 74 ++--
.../odbc/src/diagnostic/diagnosable_adapter.cpp | 4 +-
.../odbc/src/diagnostic/diagnostic_record.cpp | 46 +--
.../diagnostic/diagnostic_record_storage.cpp | 78 ++--
modules/platforms/cpp/odbc/src/environment.cpp | 62 +--
modules/platforms/cpp/odbc/src/odbc.cpp | 20 +-
.../odbc/src/query/column_metadata_query.cpp | 123 +++---
.../platforms/cpp/odbc/src/query/data_query.cpp | 102 ++---
.../cpp/odbc/src/query/foreign_keys_query.cpp | 26 +-
.../cpp/odbc/src/query/primary_keys_query.cpp | 71 ++--
.../odbc/src/query/special_columns_query.cpp | 26 +-
.../cpp/odbc/src/query/table_metadata_query.cpp | 81 ++--
.../cpp/odbc/src/query/type_info_query.cpp | 231 +++++------
modules/platforms/cpp/odbc/src/row.cpp | 4 +-
modules/platforms/cpp/odbc/src/statement.cpp | 258 ++++++-------
modules/platforms/cpp/odbc/src/type_traits.cpp | 46 +--
92 files changed, 2004 insertions(+), 1911 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/922b2582/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/922b2582/modules/platforms/cpp/core-test/src/cache_store_test.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/922b2582/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --cc modules/platforms/cpp/core-test/src/cache_test.cpp
index ab29797,d3f73be..cfbd86a
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@@ -129,9 -125,9 +129,9 @@@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeys
cache.RemoveAll();
- size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
+ size = cache.Size(cache::CachePeekMode::ALL);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@@ -152,9 -148,9 +152,9 @@@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysI
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
+ int size = cache.Size(cache::CachePeekMode::ALL);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@@ -175,9 -171,9 +175,9 @@@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysI
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
+ int size = cache.Size(cache::CachePeekMode::ALL);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
http://git-wip-us.apache.org/repos/asf/ignite/blob/922b2582/modules/platforms/cpp/core-test/src/transactions_test.cpp
----------------------------------------------------------------------
[30/50] [abbrv] ignite git commit: IGNITE-3477 - Fixing .NET tests
Posted by sb...@apache.org.
IGNITE-3477 - Fixing .NET tests
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/10485a0f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/10485a0f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/10485a0f
Branch: refs/heads/ignite-4929
Commit: 10485a0f99faa67b25682e623167e1246b83cc67
Parents: 8d2b020
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:37:23 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:37:23 2017 +0300
----------------------------------------------------------------------
.../internal/binary/BinaryReaderExImpl.java | 2 +-
.../ignite/internal/binary/BinaryUtils.java | 14 ++++++--
.../cache/database/tree/io/DataPageIO.java | 5 +--
...tCachePluginConfigurationClosureFactory.java | 37 ++++++++++++++++++++
4 files changed, 52 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
index d6fefe3..c8ca803 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
@@ -1911,7 +1911,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
break;
case BINARY_OBJ:
- obj = BinaryUtils.doReadBinaryObject(in, ctx);
+ obj = BinaryUtils.doReadBinaryObject(in, ctx, false);
((BinaryObjectImpl)obj).context(ctx);
http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
index e4011a4..f36c137 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -1451,7 +1451,7 @@ public class BinaryUtils {
/**
* @return Value.
*/
- public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) {
+ public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx, boolean detach) {
if (in.offheapPointer() > 0) {
int len = in.readInt();
@@ -1467,7 +1467,15 @@ public class BinaryUtils {
byte[] arr = doReadByteArray(in);
int start = in.readInt();
- return new BinaryObjectImpl(ctx, arr, start);
+ BinaryObjectImpl binO = new BinaryObjectImpl(ctx, arr, start);
+
+ if (detach) {
+ binO.detachAllowed(true);
+
+ return binO.detach();
+ }
+
+ return binO;
}
}
@@ -1892,7 +1900,7 @@ public class BinaryUtils {
return doReadMap(in, ctx, ldr, handles, false, null);
case GridBinaryMarshaller.BINARY_OBJ:
- return doReadBinaryObject(in, ctx);
+ return doReadBinaryObject(in, ctx, detach);
case GridBinaryMarshaller.ENUM:
return doReadBinaryEnum(in, ctx, doReadEnumType(in));
http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
index 9546890..3ed69e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
@@ -1397,10 +1397,11 @@ public class DataPageIO extends PageIO {
PageUtils.putShort(addr, 0, (short)payloadSize);
addr += 2;
- if (cacheIdSize != 0)
+ if (cacheIdSize != 0) {
PageUtils.putInt(addr, 0, row.cacheId());
- addr += cacheIdSize;
+ addr += cacheIdSize;
+ }
addr += row.key().putValue(addr);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java b/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
new file mode 100644
index 0000000..c294342
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.platform.plugin.cache;
+
+import org.apache.ignite.plugin.platform.PlatformCachePluginConfigurationClosure;
+import org.apache.ignite.plugin.platform.PlatformCachePluginConfigurationClosureFactory;
+
+/**
+ * Test closure factory.
+ */
+public class PlatformTestCachePluginConfigurationClosureFactory
+ implements PlatformCachePluginConfigurationClosureFactory {
+ /** {@inheritDoc} */
+ @Override public int id() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ @Override public PlatformCachePluginConfigurationClosure create() {
+ return new PlatformTestCachePluginConfigurationClosure();
+ }
+}
[17/50] [abbrv] ignite git commit: Merge remote-tracking branch
'origin/ignite-3477-master' into ignite-3477-master
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-3477-master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6bb4c817
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6bb4c817
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6bb4c817
Branch: refs/heads/ignite-4929
Commit: 6bb4c817177c6c1680737ae14e1a9369184caef7
Parents: 5489ace 5839f48
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Thu Apr 13 12:14:54 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Thu Apr 13 12:14:54 2017 +0300
----------------------------------------------------------------------
.gitignore | 31 +-
examples/pom.xml | 6 +
.../examples/springdata/PersonRepository.java | 59 ++++
.../examples/springdata/SpringAppCfg.java | 69 ++++
.../examples/springdata/SpringDataExample.java | 154 +++++++++
.../examples/SpringDataExampleSelfTest.java | 32 ++
.../testsuites/IgniteExamplesSelfTestSuite.java | 2 +
.../rendezvous/RendezvousAffinityFunction.java | 26 +-
.../datastructures/GridCacheSemaphoreImpl.java | 74 ++++-
.../datastructures/GridCacheSemaphoreState.java | 22 ++
...inityFunctionFastPowerOfTwoHashSelfTest.java | 50 +++
...ousAffinityFunctionStandardHashSelfTest.java | 50 +++
...eAbstractDataStructuresFailoverSelfTest.java | 21 +-
.../testsuites/IgniteCacheTestSuite2.java | 4 +
.../binary/include/ignite/binary/binary_type.h | 127 +++----
.../ignite/impl/binary/binary_id_resolver.h | 33 +-
.../ignite/impl/binary/binary_object_impl.h | 3 +-
.../ignite/impl/binary/binary_reader_impl.h | 80 ++++-
.../include/ignite/impl/binary/binary_utils.h | 6 +-
.../ignite/impl/binary/binary_writer_impl.h | 15 +-
.../core-test/include/ignite/binary_test_defs.h | 95 +++---
.../cpp/core-test/include/ignite/complex_type.h | 30 +-
.../cpp/core-test/include/ignite/test_type.h | 37 +--
.../src/binary_identity_resolver_test.cpp | 38 +--
.../cpp/core-test/src/binary_object_test.cpp | 4 +-
.../cpp/core-test/src/binary_test_defs.cpp | 5 +
.../cpp/core-test/src/cache_invoke_test.cpp | 18 +-
.../cpp/core-test/src/cache_query_test.cpp | 12 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 36 +-
.../cpp/core-test/src/continuous_query_test.cpp | 30 +-
.../cpp/core/include/ignite/ignite_binding.h | 6 +-
.../impl/cache/cache_entry_processor_holder.h | 33 +-
.../cpp/odbc-test/include/complex_type.h | 26 +-
.../platforms/cpp/odbc-test/include/test_type.h | 37 +--
.../Binary/BinaryTypeConfiguration.cs | 1 -
.../Impl/Binary/BinaryObject.cs | 2 -
modules/spring-data/README.txt | 32 ++
modules/spring-data/licenses/apache-2.0.txt | 202 ++++++++++++
modules/spring-data/pom.xml | 79 +++++
.../springdata/repository/IgniteRepository.java | 58 ++++
.../config/EnableIgniteRepositories.java | 119 +++++++
.../config/IgniteRepositoriesRegistar.java | 36 ++
.../IgniteRepositoryConfigurationExtension.java | 49 +++
.../springdata/repository/config/Query.java | 37 +++
.../repository/config/RepositoryConfig.java | 39 +++
.../repository/config/package-info.java | 22 ++
.../springdata/repository/package-info.java | 22 ++
.../repository/query/IgniteQuery.java | 83 +++++
.../repository/query/IgniteQueryGenerator.java | 243 ++++++++++++++
.../repository/query/IgniteRepositoryQuery.java | 306 +++++++++++++++++
.../repository/query/package-info.java | 22 ++
.../support/IgniteRepositoryFactory.java | 168 ++++++++++
.../support/IgniteRepositoryFactoryBean.java | 85 +++++
.../support/IgniteRepositoryImpl.java | 160 +++++++++
.../repository/support/package-info.java | 22 ++
.../IgniteSpringDataCrudSelfTest.java | 233 +++++++++++++
.../IgniteSpringDataQueriesSelfTest.java | 291 ++++++++++++++++
.../misc/ApplicationConfiguration.java | 46 +++
.../apache/ignite/springdata/misc/Person.java | 97 ++++++
.../springdata/misc/PersonRepository.java | 92 ++++++
.../springdata/misc/PersonSecondRepository.java | 40 +++
.../testsuites/IgniteSpringDataTestSuite.java | 41 +++
modules/web-console/frontend/.eslintrc | 2 +-
modules/web-console/frontend/app/app.js | 3 -
.../form-field-datepicker.pug | 59 ----
.../form-field-datepicker.scss | 20 --
.../list-of-registered-users.categories.js | 4 +-
.../list-of-registered-users.column-defs.js | 44 +--
.../list-of-registered-users.controller.js | 141 ++++++--
.../list-of-registered-users.scss | 4 +
.../list-of-registered-users.tpl.pug | 76 +++--
.../ui-grid-header/ui-grid-header.scss | 91 -----
.../ui-grid-header/ui-grid-header.tpl.pug | 29 --
.../ui-grid-settings/ui-grid-settings.pug | 33 --
.../ui-grid-settings/ui-grid-settings.scss | 144 --------
.../frontend/app/helpers/jade/mixins.pug | 3 +
.../frontend/app/modules/states/admin.state.js | 11 +-
.../frontend/app/primitives/badge/index.scss | 4 +
.../frontend/app/primitives/btn/index.scss | 41 +++
.../app/primitives/datepicker/index.pug | 60 ++++
.../app/primitives/datepicker/index.scss | 64 ++++
.../frontend/app/primitives/dropdown/index.pug | 43 +++
.../frontend/app/primitives/dropdown/index.scss | 82 +++++
.../frontend/app/primitives/index.js | 8 +
.../frontend/app/primitives/page/index.scss | 35 ++
.../frontend/app/primitives/panel/index.scss | 51 +++
.../frontend/app/primitives/tabs/index.scss | 15 +
.../app/primitives/ui-grid-header/index.scss | 91 +++++
.../app/primitives/ui-grid-header/index.tpl.pug | 29 ++
.../app/primitives/ui-grid-settings/index.pug | 33 ++
.../app/primitives/ui-grid-settings/index.scss | 171 ++++++++++
.../frontend/app/primitives/ui-grid/index.scss | 329 +++++++++++++++++++
.../frontend/public/stylesheets/style.scss | 5 -
modules/web-console/frontend/views/base2.pug | 22 ++
.../frontend/views/settings/admin.tpl.pug | 3 +-
.../web-console/frontend/views/sql/sql.tpl.pug | 1 -
.../cache/websession/WebSessionFilter.java | 22 +-
parent/pom.xml | 1 +
pom.xml | 1 +
99 files changed, 4807 insertions(+), 866 deletions(-)
----------------------------------------------------------------------
[40/50] [abbrv] ignite git commit: IGNITE-3581: Moved enums to
separate structs for C++
Posted by sb...@apache.org.
IGNITE-3581: Moved enums to separate structs for C++
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7e106cd0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7e106cd0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7e106cd0
Branch: refs/heads/ignite-4929
Commit: 7e106cd093134acab1c4202a6849c177bacc909b
Parents: d298e75
Author: Igor Sapego <is...@gridgain.com>
Authored: Thu Apr 13 19:06:01 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Thu Apr 13 19:06:01 2017 +0300
----------------------------------------------------------------------
.../include/ignite/binary/binary_consts.h | 86 +++--
.../include/ignite/binary/binary_containers.h | 12 +-
.../include/ignite/binary/binary_raw_reader.h | 6 +-
.../include/ignite/binary/binary_raw_writer.h | 16 +-
.../include/ignite/binary/binary_reader.h | 6 +-
.../include/ignite/binary/binary_writer.h | 13 +-
.../ignite/impl/binary/binary_reader_impl.h | 31 +-
.../include/ignite/impl/binary/binary_schema.h | 19 +-
.../ignite/impl/binary/binary_writer_impl.h | 18 +-
.../cpp/binary/src/binary/binary_raw_reader.cpp | 2 +-
.../cpp/binary/src/binary/binary_reader.cpp | 2 +-
.../src/impl/binary/binary_reader_impl.cpp | 50 +--
.../binary/src/impl/binary/binary_schema.cpp | 17 +-
.../src/impl/binary/binary_writer_impl.cpp | 14 +-
.../src/binary_reader_writer_raw_test.cpp | 34 +-
.../core-test/src/binary_reader_writer_test.cpp | 96 ++---
.../cpp/core-test/src/cache_store_test.cpp | 6 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 62 +--
.../cpp/core-test/src/transactions_test.cpp | 76 ++--
.../cpp/core/include/ignite/cache/cache.h | 12 +-
.../core/include/ignite/cache/cache_peek_mode.h | 67 ++--
.../cpp/core/include/ignite/ignite_binding.h | 4 +-
.../cpp/core/include/ignite/impl/bindings.h | 4 +-
.../impl/cache/cache_entry_processor_holder.h | 37 +-
.../include/ignite/impl/ignite_binding_impl.h | 11 +-
.../ignite/impl/interop/interop_target.h | 21 +-
.../ignite/impl/transactions/transaction_impl.h | 4 +-
.../impl/transactions/transactions_impl.h | 10 +-
.../include/ignite/transactions/transaction.h | 12 +-
.../ignite/transactions/transaction_consts.h | 181 ++++-----
.../include/ignite/transactions/transactions.h | 16 +-
.../impl/binary/binary_type_updater_impl.cpp | 17 +-
.../continuous/continuous_query_handle_impl.cpp | 13 +-
.../src/impl/cluster/cluster_group_impl.cpp | 9 +-
.../cpp/core/src/impl/ignite_environment.cpp | 42 +-
.../core/src/impl/interop/interop_target.cpp | 12 +-
.../src/impl/transactions/transaction_impl.cpp | 18 +-
.../src/impl/transactions/transactions_impl.cpp | 92 +++--
.../cpp/core/src/transactions/transaction.cpp | 8 +-
.../cpp/core/src/transactions/transactions.cpp | 20 +-
.../src/application_data_buffer_test.cpp | 94 ++---
.../platforms/cpp/odbc-test/src/column_test.cpp | 56 +--
.../cpp/odbc-test/src/connection_info_test.cpp | 72 ++--
.../platforms/cpp/odbc-test/src/row_test.cpp | 16 +-
.../ignite/odbc/app/application_data_buffer.h | 6 +-
.../cpp/odbc/include/ignite/odbc/column.h | 2 +-
.../cpp/odbc/include/ignite/odbc/common_types.h | 350 +++++++++--------
.../ignite/odbc/config/connection_info.h | 2 +-
.../cpp/odbc/include/ignite/odbc/connection.h | 18 +-
.../ignite/odbc/diagnostic/diagnosable.h | 4 +-
.../odbc/diagnostic/diagnosable_adapter.h | 8 +-
.../ignite/odbc/diagnostic/diagnostic_record.h | 4 +-
.../odbc/diagnostic/diagnostic_record_storage.h | 8 +-
.../cpp/odbc/include/ignite/odbc/environment.h | 10 +-
.../cpp/odbc/include/ignite/odbc/message.h | 56 +--
.../ignite/odbc/query/column_metadata_query.h | 10 +-
.../odbc/include/ignite/odbc/query/data_query.h | 23 +-
.../ignite/odbc/query/foreign_keys_query.h | 8 +-
.../ignite/odbc/query/primary_keys_query.h | 8 +-
.../cpp/odbc/include/ignite/odbc/query/query.h | 32 +-
.../ignite/odbc/query/special_columns_query.h | 8 +-
.../ignite/odbc/query/table_metadata_query.h | 10 +-
.../include/ignite/odbc/query/type_info_query.h | 8 +-
.../cpp/odbc/include/ignite/odbc/row.h | 2 +-
.../cpp/odbc/include/ignite/odbc/statement.h | 52 +--
.../odbc/system/ui/dsn_configuration_window.h | 35 +-
.../cpp/odbc/include/ignite/odbc/type_traits.h | 91 ++---
.../ignite/odbc/system/ui/custom_window.h | 12 +-
.../odbc/os/win/src/system/ui/custom_window.cpp | 4 +-
.../src/system/ui/dsn_configuration_window.cpp | 42 +-
.../cpp/odbc/os/win/src/system_dsn.cpp | 2 +-
.../odbc/src/app/application_data_buffer.cpp | 386 +++++++++----------
.../platforms/cpp/odbc/src/app/parameter.cpp | 6 +-
modules/platforms/cpp/odbc/src/column.cpp | 14 +-
modules/platforms/cpp/odbc/src/common_types.cpp | 54 +--
.../cpp/odbc/src/config/connection_info.cpp | 12 +-
modules/platforms/cpp/odbc/src/connection.cpp | 74 ++--
.../odbc/src/diagnostic/diagnosable_adapter.cpp | 4 +-
.../odbc/src/diagnostic/diagnostic_record.cpp | 46 +--
.../diagnostic/diagnostic_record_storage.cpp | 78 ++--
modules/platforms/cpp/odbc/src/environment.cpp | 62 +--
modules/platforms/cpp/odbc/src/odbc.cpp | 20 +-
.../odbc/src/query/column_metadata_query.cpp | 123 +++---
.../platforms/cpp/odbc/src/query/data_query.cpp | 102 ++---
.../cpp/odbc/src/query/foreign_keys_query.cpp | 26 +-
.../cpp/odbc/src/query/primary_keys_query.cpp | 71 ++--
.../odbc/src/query/special_columns_query.cpp | 26 +-
.../cpp/odbc/src/query/table_metadata_query.cpp | 81 ++--
.../cpp/odbc/src/query/type_info_query.cpp | 231 +++++------
modules/platforms/cpp/odbc/src/row.cpp | 4 +-
modules/platforms/cpp/odbc/src/statement.cpp | 258 ++++++-------
modules/platforms/cpp/odbc/src/type_traits.cpp | 46 +--
92 files changed, 2023 insertions(+), 1930 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/binary/binary_consts.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/binary/binary_consts.h b/modules/platforms/cpp/binary/include/ignite/binary/binary_consts.h
index 8f3245a..f076e6a 100644
--- a/modules/platforms/cpp/binary/include/ignite/binary/binary_consts.h
+++ b/modules/platforms/cpp/binary/include/ignite/binary/binary_consts.h
@@ -23,8 +23,6 @@
#ifndef _IGNITE_BINARY_BINARY_CONSTS
#define _IGNITE_BINARY_BINARY_CONSTS
-#include <ignite/common/common.h>
-
namespace ignite
{
namespace binary
@@ -32,53 +30,59 @@ namespace ignite
/**
* Binary collection types.
*/
- enum CollectionType
+ struct CollectionType
{
- /**
- * Undefined. Maps to ArrayList in Java.
- */
- IGNITE_COLLECTION_UNDEFINED = 0,
+ enum Type
+ {
+ /**
+ * Undefined. Maps to ArrayList in Java.
+ */
+ UNDEFINED = 0,
+
+ /**
+ * Array list. Maps to ArrayList in Java.
+ */
+ ARRAY_LIST = 1,
+
+ /**
+ * Linked list. Maps to LinkedList in Java.
+ */
+ LINKED_LIST = 2,
- /**
- * Array list. Maps to ArrayList in Java.
- */
- IGNITE_COLLECTION_ARRAY_LIST = 1,
-
- /**
- * Linked list. Maps to LinkedList in Java.
- */
- IGNITE_COLLECTION_LINKED_LIST = 2,
-
- /**
- * Hash set. Maps to HashSet in Java.
- */
- IGNITE_COLLECTION_HASH_SET = 3,
-
- /**
- * Linked hash set. Maps to LinkedHashSet in Java.
- */
- IGNITE_COLLECTION_LINKED_HASH_SET = 4
+ /**
+ * Hash set. Maps to HashSet in Java.
+ */
+ HASH_SET = 3,
+
+ /**
+ * Linked hash set. Maps to LinkedHashSet in Java.
+ */
+ LINKED_HASH_SET = 4
+ };
};
/**
* Binary map types.
*/
- enum MapType
+ struct MapType
{
- /**
- * Undefined. Maps to HashMap in Java.
- */
- IGNITE_MAP_UNDEFINED = 0,
-
- /**
- * Hash map. Maps to HashMap in Java.
- */
- IGNITE_MAP_HASH_MAP = 1,
-
- /**
- * Linked hash map. Maps to LinkedHashMap in Java.
- */
- IGNITE_MAP_LINKED_HASH_MAP = 2
+ enum Type
+ {
+ /**
+ * Undefined. Maps to HashMap in Java.
+ */
+ UNDEFINED = 0,
+
+ /**
+ * Hash map. Maps to HashMap in Java.
+ */
+ HASH_MAP = 1,
+
+ /**
+ * Linked hash map. Maps to LinkedHashMap in Java.
+ */
+ LINKED_HASH_MAP = 2
+ };
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h b/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h
index fb77b44..72e98a5 100644
--- a/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h
+++ b/modules/platforms/cpp/binary/include/ignite/binary/binary_containers.h
@@ -478,7 +478,7 @@ namespace ignite
* @param size Collection size.
*/
BinaryCollectionReader(impl::binary::BinaryReaderImpl* impl, int32_t id,
- const CollectionType type, int32_t size) : impl(impl), id(id), type(type), size(size)
+ const CollectionType::Type type, int32_t size) : impl(impl), id(id), type(type), size(size)
{
// No-op.
}
@@ -511,7 +511,7 @@ namespace ignite
* @return Collection type. See CollectionType for the list of
* available values and their description.
*/
- CollectionType GetType()
+ CollectionType::Type GetType()
{
return type;
}
@@ -543,7 +543,7 @@ namespace ignite
const int32_t id;
/** Collection type. */
- const CollectionType type;
+ const CollectionType::Type type;
/** Size. */
const int32_t size;
@@ -570,7 +570,7 @@ namespace ignite
* @param type Map type.
* @param size Map size.
*/
- BinaryMapReader(impl::binary::BinaryReaderImpl* impl, int32_t id, MapType type,
+ BinaryMapReader(impl::binary::BinaryReaderImpl* impl, int32_t id, MapType::Type type,
int32_t size) : impl(impl), id(id), type(type), size(size)
{
// No-op.
@@ -607,7 +607,7 @@ namespace ignite
* @return Map type. See MapType for the list of available values
* and their description.
*/
- MapType GetType()
+ MapType::Type GetType()
{
return type;
}
@@ -639,7 +639,7 @@ namespace ignite
const int32_t id;
/** Map type. */
- const MapType type;
+ const MapType::Type type;
/** Size. */
const int32_t size;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_reader.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_reader.h b/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_reader.h
index d110078..c06cb91 100644
--- a/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_reader.h
+++ b/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_reader.h
@@ -357,7 +357,7 @@ namespace ignite
template<typename T>
BinaryCollectionReader<T> ReadCollection()
{
- CollectionType typ;
+ CollectionType::Type typ;
int32_t size;
int32_t id = impl->ReadCollection(&typ, &size);
@@ -385,7 +385,7 @@ namespace ignite
template<typename K, typename V>
BinaryMapReader<K, V> ReadMap()
{
- MapType typ;
+ MapType::Type typ;
int32_t size;
int32_t id = impl->ReadMap(&typ, &size);
@@ -398,7 +398,7 @@ namespace ignite
*
* @return Collection type.
*/
- CollectionType ReadCollectionType();
+ CollectionType::Type ReadCollectionType();
/**
* Read type of the collection.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_writer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_writer.h b/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_writer.h
index a43c957..81e34b0 100644
--- a/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_writer.h
+++ b/modules/platforms/cpp/binary/include/ignite/binary/binary_raw_writer.h
@@ -302,17 +302,17 @@ namespace ignite
template<typename T>
BinaryCollectionWriter<T> WriteCollection()
{
- return WriteCollection<T>(IGNITE_COLLECTION_UNDEFINED);
+ return WriteCollection<T>(CollectionType::UNDEFINED);
}
/**
* Start collection write.
*
- * @param type Collection type.
+ * @param typ Collection type.
* @return Collection writer.
*/
template<typename T>
- BinaryCollectionWriter<T> WriteCollection(CollectionType typ)
+ BinaryCollectionWriter<T> WriteCollection(CollectionType::Type typ)
{
int32_t id = impl->WriteCollection(typ);
@@ -324,12 +324,11 @@ namespace ignite
*
* @param first Iterator pointing to the beginning of the interval.
* @param last Iterator pointing to the end of the interval.
- * @param typ Collection type.
*/
template<typename InputIterator>
void WriteCollection(InputIterator first, InputIterator last)
{
- impl->WriteCollection(first, last, IGNITE_COLLECTION_UNDEFINED);
+ impl->WriteCollection(first, last, CollectionType::UNDEFINED);
}
/**
@@ -340,7 +339,7 @@ namespace ignite
* @param typ Collection type.
*/
template<typename InputIterator>
- void WriteCollection(InputIterator first, InputIterator last, CollectionType typ)
+ void WriteCollection(InputIterator first, InputIterator last, CollectionType::Type typ)
{
impl->WriteCollection(first, last, typ);
}
@@ -348,13 +347,12 @@ namespace ignite
/**
* Start map write.
*
- * @param typ Map type.
* @return Map writer.
*/
template<typename K, typename V>
BinaryMapWriter<K, V> WriteMap()
{
- return WriteMap<K, V>(IGNITE_MAP_UNDEFINED);
+ return WriteMap<K, V>(MapType::UNDEFINED);
}
/**
@@ -364,7 +362,7 @@ namespace ignite
* @return Map writer.
*/
template<typename K, typename V>
- BinaryMapWriter<K, V> WriteMap(MapType typ)
+ BinaryMapWriter<K, V> WriteMap(MapType::Type typ)
{
int32_t id = impl->WriteMap(typ);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/binary/binary_reader.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/binary/binary_reader.h b/modules/platforms/cpp/binary/include/ignite/binary/binary_reader.h
index e07ec14..7103fec 100644
--- a/modules/platforms/cpp/binary/include/ignite/binary/binary_reader.h
+++ b/modules/platforms/cpp/binary/include/ignite/binary/binary_reader.h
@@ -385,7 +385,7 @@ namespace ignite
template<typename T>
BinaryCollectionReader<T> ReadCollection(const char* fieldName)
{
- CollectionType typ;
+ CollectionType::Type typ;
int32_t size;
int32_t id = impl->ReadCollection(fieldName, &typ, &size);
@@ -415,7 +415,7 @@ namespace ignite
template<typename K, typename V>
BinaryMapReader<K, V> ReadMap(const char* fieldName)
{
- MapType typ;
+ MapType::Type typ;
int32_t size;
int32_t id = impl->ReadMap(fieldName, &typ, &size);
@@ -429,7 +429,7 @@ namespace ignite
* @param fieldName Field name.
* @return Collection type.
*/
- CollectionType ReadCollectionType(const char* fieldName);
+ CollectionType::Type ReadCollectionType(const char* fieldName);
/**
* Read type of the collection.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/binary/binary_writer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/binary/binary_writer.h b/modules/platforms/cpp/binary/include/ignite/binary/binary_writer.h
index f8e7de3..1489494 100644
--- a/modules/platforms/cpp/binary/include/ignite/binary/binary_writer.h
+++ b/modules/platforms/cpp/binary/include/ignite/binary/binary_writer.h
@@ -330,7 +330,7 @@ namespace ignite
template<typename T>
BinaryCollectionWriter<T> WriteCollection(const char* fieldName)
{
- return WriteCollection<T>(fieldName, IGNITE_COLLECTION_UNDEFINED);
+ return WriteCollection<T>(fieldName, CollectionType::UNDEFINED);
}
/**
@@ -341,7 +341,7 @@ namespace ignite
* @return Collection writer.
*/
template<typename T>
- BinaryCollectionWriter<T> WriteCollection(const char* fieldName, ignite::binary::CollectionType typ)
+ BinaryCollectionWriter<T> WriteCollection(const char* fieldName, CollectionType::Type typ)
{
int32_t id = impl->WriteCollection(fieldName, typ);
@@ -358,7 +358,7 @@ namespace ignite
template<typename InputIterator>
void WriteCollection(const char* fieldName, InputIterator first, InputIterator last)
{
- WriteCollection(fieldName, first, last, IGNITE_COLLECTION_UNDEFINED);
+ WriteCollection(fieldName, first, last, CollectionType::UNDEFINED);
}
/**
@@ -370,7 +370,7 @@ namespace ignite
* @param typ Collection type.
*/
template<typename InputIterator>
- void WriteCollection(const char* fieldName, InputIterator first, InputIterator last, CollectionType typ)
+ void WriteCollection(const char* fieldName, InputIterator first, InputIterator last, CollectionType::Type typ)
{
impl->WriteCollection(fieldName, first, last, typ);
}
@@ -379,13 +379,12 @@ namespace ignite
* Start map write.
*
* @param fieldName Field name.
- * @param typ Map type.
* @return Map writer.
*/
template<typename K, typename V>
BinaryMapWriter<K, V> WriteMap(const char* fieldName)
{
- return WriteMap<K, V>(fieldName, IGNITE_MAP_UNDEFINED);
+ return WriteMap<K, V>(fieldName, MapType::UNDEFINED);
}
/**
@@ -396,7 +395,7 @@ namespace ignite
* @return Map writer.
*/
template<typename K, typename V>
- BinaryMapWriter<K, V> WriteMap(const char* fieldName, ignite::binary::MapType typ)
+ BinaryMapWriter<K, V> WriteMap(const char* fieldName, MapType::Type typ)
{
int32_t id = impl->WriteMap(fieldName, typ);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h
index 6d66416..5621c0d 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_reader_impl.h
@@ -55,7 +55,7 @@ namespace ignite
* @param pos Object position in the stream.
* @param usrType user type flag.
* @param typeId Type ID.
- * @param hashcode Hash code.
+ * @param hashCode Hash code.
* @param len Length in bytes.
* @param rawOff Raw data offset.
* @param footerBegin Footer beginning absolute position in stream.
@@ -63,7 +63,7 @@ namespace ignite
*/
BinaryReaderImpl(interop::InteropInputStream* stream, BinaryIdResolver* idRslvr,
int32_t pos, bool usrType, int32_t typeId, int32_t hashCode, int32_t len, int32_t rawOff,
- int32_t footerBegin, int32_t footerEnd, BinaryOffsetType schemaType);
+ int32_t footerBegin, int32_t footerEnd, BinaryOffsetType::Type schemaType);
/**
* Constructor used to construct light-weight reader allowing only raw operations
@@ -632,7 +632,7 @@ namespace ignite
* @param size Collection size.
* @return Read session ID.
*/
- int32_t ReadCollection(ignite::binary::CollectionType* typ, int32_t* size);
+ int32_t ReadCollection(ignite::binary::CollectionType::Type* typ, int32_t* size);
/**
* Start collection read.
@@ -642,7 +642,8 @@ namespace ignite
* @param size Collection size.
* @return Read session ID.
*/
- int32_t ReadCollection(const char* fieldName, ignite::binary::CollectionType* typ, int32_t* size);
+ int32_t ReadCollection(const char* fieldName,
+ ignite::binary::CollectionType::Type* typ, int32_t* size);
/**
* Read values and insert them to specified position.
@@ -713,7 +714,7 @@ namespace ignite
* @param size Map size.
* @return Read session ID.
*/
- int32_t ReadMap(ignite::binary::MapType* typ, int32_t* size);
+ int32_t ReadMap(ignite::binary::MapType::Type* typ, int32_t* size);
/**
* Start map read.
@@ -723,14 +724,14 @@ namespace ignite
* @param size Map size.
* @return Read session ID.
*/
- int32_t ReadMap(const char* fieldName, ignite::binary::MapType* typ, int32_t* size);
+ int32_t ReadMap(const char* fieldName, ignite::binary::MapType::Type* typ, int32_t* size);
/**
* Read type of the collection.
*
* @return Collection type.
*/
- ignite::binary::CollectionType ReadCollectionType();
+ ignite::binary::CollectionType::Type ReadCollectionType();
/**
* Read type of the collection.
@@ -738,7 +739,7 @@ namespace ignite
* @param fieldName Field name.
* @return Collection type.
*/
- ignite::binary::CollectionType ReadCollectionType(const char* fieldName);
+ ignite::binary::CollectionType::Type ReadCollectionType(const char* fieldName);
/**
* Read size of the collection.
@@ -950,14 +951,14 @@ namespace ignite
else
footerBegin = pos + len;
- BinaryOffsetType schemaType;
+ BinaryOffsetType::Type schemaType;
if (flags & IGNITE_BINARY_FLAG_OFFSET_ONE_BYTE)
- schemaType = OFFSET_TYPE_ONE_BYTE;
+ schemaType = BinaryOffsetType::ONE_BYTE;
else if (flags & IGNITE_BINARY_FLAG_OFFSET_TWO_BYTES)
- schemaType = OFFSET_TYPE_TWO_BYTES;
+ schemaType = BinaryOffsetType::TWO_BYTES;
else
- schemaType = OFFSET_TYPE_FOUR_BYTES;
+ schemaType = BinaryOffsetType::FOUR_BYTES;
int32_t footerEnd;
@@ -1066,7 +1067,7 @@ namespace ignite
int32_t footerEnd;
/** Object schema type. */
- BinaryOffsetType schemaType;
+ BinaryOffsetType::Type schemaType;
IGNITE_NO_COPY_ASSIGNMENT(BinaryReaderImpl)
@@ -1351,7 +1352,7 @@ namespace ignite
/**
* Check whether session ID matches.
*
- * @param ses Expected session ID.
+ * @param expSes Expected session ID.
*/
void CheckSession(int32_t expSes) const;
@@ -1386,7 +1387,7 @@ namespace ignite
*
* @return Collection type.
*/
- ignite::binary::CollectionType ReadCollectionTypeUnprotected();
+ ignite::binary::CollectionType::Type ReadCollectionTypeUnprotected();
/**
* Read size of the collection. Do not preserve stream position.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_schema.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_schema.h b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_schema.h
index c42adef..50429c9 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_schema.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_schema.h
@@ -38,16 +38,19 @@ namespace ignite
/**
* Schema size variants.
*/
- enum BinaryOffsetType
+ struct BinaryOffsetType
{
- /** Means all field offsets can be fit in one byte. */
- OFFSET_TYPE_ONE_BYTE,
+ enum Type
+ {
+ /** Means all field offsets can be fit in one byte. */
+ ONE_BYTE,
- /** Means all field offsets can be fit in two bytes. */
- OFFSET_TYPE_TWO_BYTES,
+ /** Means all field offsets can be fit in two bytes. */
+ TWO_BYTES,
- /** Means field offsets should be stored in four bytes. */
- OFFSET_TYPE_FOUR_BYTES
+ /** Means field offsets should be stored in four bytes. */
+ FOUR_BYTES
+ };
};
/**
@@ -108,7 +111,7 @@ namespace ignite
*
* @return Type of schema.
*/
- BinaryOffsetType GetType() const;
+ BinaryOffsetType::Type GetType() const;
private:
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h
index e7dafb2..5d38e93 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_writer_impl.h
@@ -531,7 +531,7 @@ namespace ignite
* @param typ Collection type.
* @return Session ID.
*/
- int32_t WriteCollection(ignite::binary::CollectionType typ);
+ int32_t WriteCollection(ignite::binary::CollectionType::Type typ);
/**
* Start collection write.
@@ -540,7 +540,7 @@ namespace ignite
* @param typ Collection type.
* @return Session ID.
*/
- int32_t WriteCollection(const char* fieldName, ignite::binary::CollectionType typ);
+ int32_t WriteCollection(const char* fieldName, ignite::binary::CollectionType::Type typ);
/**
* Write values in interval [first, last).
@@ -550,7 +550,7 @@ namespace ignite
* @param typ Collection type.
*/
template<typename InputIterator>
- void WriteCollection(InputIterator first, InputIterator last, ignite::binary::CollectionType typ)
+ void WriteCollection(InputIterator first, InputIterator last, ignite::binary::CollectionType::Type typ)
{
StartContainerSession(true);
@@ -567,7 +567,7 @@ namespace ignite
*/
template<typename InputIterator>
void WriteCollection(const char* fieldName, InputIterator first, InputIterator last,
- ignite::binary::CollectionType typ)
+ ignite::binary::CollectionType::Type typ)
{
StartContainerSession(false);
@@ -582,7 +582,7 @@ namespace ignite
* @param typ Map type.
* @return Session ID.
*/
- int32_t WriteMap(ignite::binary::MapType typ);
+ int32_t WriteMap(ignite::binary::MapType::Type typ);
/**
* Start map write.
@@ -591,7 +591,7 @@ namespace ignite
* @param typ Map type.
* @return Session ID.
*/
- int32_t WriteMap(const char* fieldName, ignite::binary::MapType typ);
+ int32_t WriteMap(const char* fieldName, ignite::binary::MapType::Type typ);
/**
* Write collection element.
@@ -755,10 +755,10 @@ namespace ignite
*
* @return Stream.
*/
- impl::interop::InteropOutputStream* GetStream();
+ interop::InteropOutputStream* GetStream();
private:
/** Underlying stream. */
- ignite::impl::interop::InteropOutputStream* stream;
+ interop::InteropOutputStream* stream;
/** ID resolver. */
BinaryIdResolver* idRslvr;
@@ -916,7 +916,7 @@ namespace ignite
*/
template<typename InputIterator>
void WriteCollectionWithinSession(InputIterator first, InputIterator last,
- ignite::binary::CollectionType typ)
+ ignite::binary::CollectionType::Type typ)
{
stream->WriteInt8(IGNITE_TYPE_COLLECTION);
stream->Position(stream->Position() + 4);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp b/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp
index 9c1d6d9..f751685 100644
--- a/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp
+++ b/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp
@@ -163,7 +163,7 @@ namespace ignite
return BinaryStringArrayReader(impl, id, size);
}
- CollectionType BinaryRawReader::ReadCollectionType()
+ CollectionType::Type BinaryRawReader::ReadCollectionType()
{
return impl->ReadCollectionType();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/src/binary/binary_reader.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/binary/binary_reader.cpp b/modules/platforms/cpp/binary/src/binary/binary_reader.cpp
index f9fa72e..0ba82e6 100644
--- a/modules/platforms/cpp/binary/src/binary/binary_reader.cpp
+++ b/modules/platforms/cpp/binary/src/binary/binary_reader.cpp
@@ -163,7 +163,7 @@ namespace ignite
return BinaryStringArrayReader(impl, id, size);
}
- CollectionType BinaryReader::ReadCollectionType(const char* fieldName)
+ CollectionType::Type BinaryReader::ReadCollectionType(const char* fieldName)
{
return impl->ReadCollectionType(fieldName);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp b/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp
index 1c4104b..c6bb4f3 100644
--- a/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp
+++ b/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp
@@ -37,7 +37,7 @@ namespace ignite
{
BinaryReaderImpl::BinaryReaderImpl(InteropInputStream* stream, BinaryIdResolver* idRslvr,
int32_t pos, bool usrType, int32_t typeId, int32_t hashCode, int32_t len, int32_t rawOff,
- int32_t footerBegin, int32_t footerEnd, BinaryOffsetType schemaType) :
+ int32_t footerBegin, int32_t footerEnd, BinaryOffsetType::Type schemaType) :
stream(stream), idRslvr(idRslvr), pos(pos), usrType(usrType), typeId(typeId),
hashCode(hashCode), len(len), rawOff(rawOff), rawMode(false), elemIdGen(0), elemId(0),
elemCnt(-1), elemRead(0), footerBegin(footerBegin), footerEnd(footerEnd), schemaType(schemaType)
@@ -48,7 +48,7 @@ namespace ignite
BinaryReaderImpl::BinaryReaderImpl(InteropInputStream* stream) :
stream(stream), idRslvr(NULL), pos(0), usrType(false), typeId(0), hashCode(0), len(0),
rawOff(0), rawMode(true), elemIdGen(0), elemId(0), elemCnt(-1), elemRead(0), footerBegin(-1),
- footerEnd(-1), schemaType(OFFSET_TYPE_FOUR_BYTES)
+ footerEnd(-1), schemaType(BinaryOffsetType::FOUR_BYTES)
{
// No-op.
}
@@ -556,19 +556,19 @@ namespace ignite
return StartContainerSession(false, IGNITE_TYPE_ARRAY, size);
}
- int32_t BinaryReaderImpl::ReadCollection(CollectionType* typ, int32_t* size)
+ int32_t BinaryReaderImpl::ReadCollection(CollectionType::Type* typ, int32_t* size)
{
int32_t id = StartContainerSession(true, IGNITE_TYPE_COLLECTION, size);
if (*size == -1)
- *typ = IGNITE_COLLECTION_UNDEFINED;
+ *typ = CollectionType::UNDEFINED;
else
- *typ = static_cast<CollectionType>(stream->ReadInt8());
+ *typ = static_cast<CollectionType::Type>(stream->ReadInt8());
return id;
}
- int32_t BinaryReaderImpl::ReadCollection(const char* fieldName, CollectionType* typ, int32_t* size)
+ int32_t BinaryReaderImpl::ReadCollection(const char* fieldName, CollectionType::Type* typ, int32_t* size)
{
CheckRawMode(false);
CheckSingleMode(true);
@@ -578,7 +578,7 @@ namespace ignite
if (fieldPos <= 0)
{
- *typ = IGNITE_COLLECTION_UNDEFINED;
+ *typ = CollectionType::UNDEFINED;
*size = -1;
return ++elemIdGen;
@@ -589,26 +589,26 @@ namespace ignite
int32_t id = StartContainerSession(false, IGNITE_TYPE_COLLECTION, size);
if (*size == -1)
- *typ = IGNITE_COLLECTION_UNDEFINED;
+ *typ = CollectionType::UNDEFINED;
else
- *typ = static_cast<CollectionType>(stream->ReadInt8());
+ *typ = static_cast<CollectionType::Type>(stream->ReadInt8());
return id;
}
- int32_t BinaryReaderImpl::ReadMap(MapType* typ, int32_t* size)
+ int32_t BinaryReaderImpl::ReadMap(MapType::Type* typ, int32_t* size)
{
int32_t id = StartContainerSession(true, IGNITE_TYPE_MAP, size);
if (*size == -1)
- *typ = IGNITE_MAP_UNDEFINED;
+ *typ = MapType::UNDEFINED;
else
- *typ = static_cast<MapType>(stream->ReadInt8());
+ *typ = static_cast<MapType::Type>(stream->ReadInt8());
return id;
}
- int32_t BinaryReaderImpl::ReadMap(const char* fieldName, MapType* typ, int32_t* size)
+ int32_t BinaryReaderImpl::ReadMap(const char* fieldName, MapType::Type* typ, int32_t* size)
{
CheckRawMode(false);
CheckSingleMode(true);
@@ -618,7 +618,7 @@ namespace ignite
if (fieldPos <= 0)
{
- *typ = IGNITE_MAP_UNDEFINED;
+ *typ = MapType::UNDEFINED;
*size = -1;
return ++elemIdGen;
@@ -629,32 +629,32 @@ namespace ignite
int32_t id = StartContainerSession(false, IGNITE_TYPE_MAP, size);
if (*size == -1)
- *typ = IGNITE_MAP_UNDEFINED;
+ *typ = MapType::UNDEFINED;
else
- *typ = static_cast<MapType>(stream->ReadInt8());
+ *typ = static_cast<MapType::Type>(stream->ReadInt8());
return id;
}
- CollectionType BinaryReaderImpl::ReadCollectionTypeUnprotected()
+ CollectionType::Type BinaryReaderImpl::ReadCollectionTypeUnprotected()
{
int32_t size = ReadCollectionSizeUnprotected();
if (size == -1)
- return IGNITE_COLLECTION_UNDEFINED;
+ return CollectionType::UNDEFINED;
- CollectionType typ = static_cast<CollectionType>(stream->ReadInt8());
+ CollectionType::Type typ = static_cast<CollectionType::Type>(stream->ReadInt8());
return typ;
}
- CollectionType BinaryReaderImpl::ReadCollectionType()
+ CollectionType::Type BinaryReaderImpl::ReadCollectionType()
{
InteropStreamPositionGuard<InteropInputStream> positionGuard(*stream);
return ReadCollectionTypeUnprotected();
}
- CollectionType BinaryReaderImpl::ReadCollectionType(const char* fieldName)
+ CollectionType::Type BinaryReaderImpl::ReadCollectionType(const char* fieldName)
{
CheckRawMode(false);
CheckSingleMode(true);
@@ -665,7 +665,7 @@ namespace ignite
int32_t fieldPos = FindField(fieldId);
if (fieldPos <= 0)
- return IGNITE_COLLECTION_UNDEFINED;
+ return CollectionType::UNDEFINED;
stream->Position(fieldPos);
@@ -892,7 +892,7 @@ namespace ignite
switch (schemaType)
{
- case OFFSET_TYPE_ONE_BYTE:
+ case BinaryOffsetType::ONE_BYTE:
{
for (int32_t schemaPos = footerBegin; schemaPos < footerEnd; schemaPos += 5)
{
@@ -904,7 +904,7 @@ namespace ignite
break;
}
- case OFFSET_TYPE_TWO_BYTES:
+ case BinaryOffsetType::TWO_BYTES:
{
for (int32_t schemaPos = footerBegin; schemaPos < footerEnd; schemaPos += 6)
{
@@ -916,7 +916,7 @@ namespace ignite
break;
}
- case OFFSET_TYPE_FOUR_BYTES:
+ case BinaryOffsetType::FOUR_BYTES:
{
for (int32_t schemaPos = footerBegin; schemaPos < footerEnd; schemaPos += 8)
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/src/impl/binary/binary_schema.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/binary/binary_schema.cpp b/modules/platforms/cpp/binary/src/impl/binary/binary_schema.cpp
index 0b8025a..736b43c 100644
--- a/modules/platforms/cpp/binary/src/impl/binary/binary_schema.cpp
+++ b/modules/platforms/cpp/binary/src/impl/binary/binary_schema.cpp
@@ -70,7 +70,7 @@ namespace ignite
{
switch (GetType())
{
- case OFFSET_TYPE_ONE_BYTE:
+ case BinaryOffsetType::ONE_BYTE:
{
for (FieldContainer::const_iterator i = fieldsInfo->begin(); i != fieldsInfo->end(); ++i)
{
@@ -80,7 +80,7 @@ namespace ignite
break;
}
- case OFFSET_TYPE_TWO_BYTES:
+ case BinaryOffsetType::TWO_BYTES:
{
for (FieldContainer::const_iterator i = fieldsInfo->begin(); i != fieldsInfo->end(); ++i)
{
@@ -90,7 +90,7 @@ namespace ignite
break;
}
- case OFFSET_TYPE_FOUR_BYTES:
+ case BinaryOffsetType::FOUR_BYTES:
{
for (FieldContainer::const_iterator i = fieldsInfo->begin(); i != fieldsInfo->end(); ++i)
{
@@ -119,16 +119,17 @@ namespace ignite
fieldsInfo->clear();
}
- BinaryOffsetType BinarySchema::GetType() const
+ BinaryOffsetType::Type BinarySchema::GetType() const
{
int32_t maxOffset = fieldsInfo->back().offset;
if (maxOffset < 0x100)
- return OFFSET_TYPE_ONE_BYTE;
- else if (maxOffset < 0x10000)
- return OFFSET_TYPE_TWO_BYTES;
+ return BinaryOffsetType::ONE_BYTE;
- return OFFSET_TYPE_FOUR_BYTES;
+ if (maxOffset < 0x10000)
+ return BinaryOffsetType::TWO_BYTES;
+
+ return BinaryOffsetType::FOUR_BYTES;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp b/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp
index 15e1ab9..f93f0d3 100644
--- a/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp
+++ b/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp
@@ -560,7 +560,7 @@ namespace ignite
return elemId;
}
- int32_t BinaryWriterImpl::WriteCollection(CollectionType typ)
+ int32_t BinaryWriterImpl::WriteCollection(CollectionType::Type typ)
{
StartContainerSession(true);
@@ -571,7 +571,7 @@ namespace ignite
return elemId;
}
- int32_t BinaryWriterImpl::WriteCollection(const char* fieldName, CollectionType typ)
+ int32_t BinaryWriterImpl::WriteCollection(const char* fieldName, CollectionType::Type typ)
{
StartContainerSession(false);
@@ -584,7 +584,7 @@ namespace ignite
return elemId;
}
- int32_t BinaryWriterImpl::WriteMap(ignite::binary::MapType typ)
+ int32_t BinaryWriterImpl::WriteMap(ignite::binary::MapType::Type typ)
{
StartContainerSession(true);
@@ -595,7 +595,7 @@ namespace ignite
return elemId;
}
- int32_t BinaryWriterImpl::WriteMap(const char* fieldName, ignite::binary::MapType typ)
+ int32_t BinaryWriterImpl::WriteMap(const char* fieldName, ignite::binary::MapType::Type typ)
{
StartContainerSession(false);
@@ -785,7 +785,7 @@ namespace ignite
else
{
int32_t schemaId = schema.GetId();
- BinaryOffsetType schemaType = schema.GetType();
+ BinaryOffsetType::Type schemaType = schema.GetType();
WriteAndClearSchema();
@@ -796,9 +796,9 @@ namespace ignite
flags |= IGNITE_BINARY_FLAG_HAS_SCHEMA;
- if (schemaType == OFFSET_TYPE_ONE_BYTE)
+ if (schemaType == BinaryOffsetType::ONE_BYTE)
flags |= IGNITE_BINARY_FLAG_OFFSET_ONE_BYTE;
- else if (schemaType == OFFSET_TYPE_TWO_BYTES)
+ else if (schemaType == BinaryOffsetType::TWO_BYTES)
flags |= IGNITE_BINARY_FLAG_OFFSET_TWO_BYTES;
stream->WriteInt16(start + IGNITE_OFFSET_FLAGS, flags);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp b/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp
index 14d64b0..53e584f 100644
--- a/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp
+++ b/modules/platforms/cpp/core-test/src/binary_reader_writer_raw_test.cpp
@@ -221,7 +221,7 @@ void CheckRawReadsRestricted(BinaryRawReader& reader)
BOOST_CHECK_EXCEPTION((reader.ReadMap<int8_t, int8_t>()), IgniteError, IsBinaryError);
}
-void CheckRawCollectionEmpty(CollectionType* colType)
+void CheckRawCollectionEmpty(CollectionType::Type* colType)
{
InteropUnpooledMemory mem(1024);
@@ -253,7 +253,7 @@ void CheckRawCollectionEmpty(CollectionType* colType)
if (colType)
BOOST_REQUIRE(colReader.GetType() == *colType);
else
- BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+ BOOST_REQUIRE(colReader.GetType() == CollectionType::UNDEFINED);
BOOST_REQUIRE(colReader.GetSize() == 0);
BOOST_REQUIRE(!colReader.HasNext());
@@ -264,7 +264,7 @@ void CheckRawCollectionEmpty(CollectionType* colType)
BOOST_REQUIRE(rawReader.ReadInt8() == 1);
}
-void CheckRawCollection(CollectionType* colType)
+void CheckRawCollection(CollectionType::Type* colType)
{
BinaryInner writeVal1 = BinaryInner(1);
BinaryInner writeVal2 = BinaryInner(0);
@@ -306,7 +306,7 @@ void CheckRawCollection(CollectionType* colType)
if (colType)
BOOST_REQUIRE(colReader.GetType() == *colType);
else
- BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+ BOOST_REQUIRE(colReader.GetType() == CollectionType::UNDEFINED);
BOOST_REQUIRE(colReader.GetSize() == 3);
BOOST_REQUIRE(!colReader.IsNull());
@@ -327,7 +327,7 @@ void CheckRawCollection(CollectionType* colType)
BOOST_REQUIRE(rawReader.ReadInt8() == 1);
}
-void CheckRawCollectionIterators(CollectionType* colType)
+void CheckRawCollectionIterators(CollectionType::Type* colType)
{
typedef std::vector<BinaryInner> BinaryInnerVector;
@@ -361,7 +361,7 @@ void CheckRawCollectionIterators(CollectionType* colType)
if (colType)
BOOST_REQUIRE(rawReader.ReadCollectionType() == *colType);
else
- BOOST_REQUIRE(rawReader.ReadCollectionType() == IGNITE_COLLECTION_UNDEFINED);
+ BOOST_REQUIRE(rawReader.ReadCollectionType() == CollectionType::UNDEFINED);
BinaryInnerVector readValues(collectionSize);
@@ -376,7 +376,7 @@ void CheckRawCollectionIterators(CollectionType* colType)
BOOST_REQUIRE(rawReader.ReadInt8() == 1);
}
-void CheckRawMapEmpty(MapType* mapType)
+void CheckRawMapEmpty(MapType::Type* mapType)
{
InteropUnpooledMemory mem(1024);
@@ -408,7 +408,7 @@ void CheckRawMapEmpty(MapType* mapType)
if (mapType)
BOOST_REQUIRE(mapReader.GetType() == *mapType);
else
- BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+ BOOST_REQUIRE(mapReader.GetType() == MapType::UNDEFINED);
BOOST_REQUIRE(mapReader.GetSize() == 0);
BOOST_REQUIRE(!mapReader.HasNext());
@@ -421,7 +421,7 @@ void CheckRawMapEmpty(MapType* mapType)
BOOST_REQUIRE(rawReader.ReadInt8() == 1);
}
-void CheckRawMap(MapType* mapType)
+void CheckRawMap(MapType::Type* mapType)
{
BinaryInner writeVal1 = BinaryInner(1);
BinaryInner writeVal2 = BinaryInner(0);
@@ -463,7 +463,7 @@ void CheckRawMap(MapType* mapType)
if (mapType)
BOOST_REQUIRE(mapReader.GetType() == *mapType);
else
- BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+ BOOST_REQUIRE(mapReader.GetType() == MapType::UNDEFINED);
BOOST_REQUIRE(mapReader.GetSize() == 3);
BOOST_REQUIRE(!mapReader.IsNull());
@@ -1157,7 +1157,7 @@ BOOST_AUTO_TEST_CASE(TestCollectionNull)
BinaryCollectionReader<BinaryInner> colReader = rawReader.ReadCollection<BinaryInner>();
- BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+ BOOST_REQUIRE(colReader.GetType() == CollectionType::UNDEFINED);
BOOST_REQUIRE(colReader.GetSize() == -1);
BOOST_REQUIRE(!colReader.HasNext());
BOOST_REQUIRE(colReader.IsNull());
@@ -1174,7 +1174,7 @@ BOOST_AUTO_TEST_CASE(TestCollectionEmpty)
BOOST_AUTO_TEST_CASE(TestCollectionEmptyTyped)
{
- CollectionType typ = IGNITE_COLLECTION_LINKED_HASH_SET;
+ CollectionType::Type typ = CollectionType::LINKED_HASH_SET;
CheckRawCollectionEmpty(&typ);
}
@@ -1186,7 +1186,7 @@ BOOST_AUTO_TEST_CASE(TestCollection)
BOOST_AUTO_TEST_CASE(TestCollectionTyped)
{
- CollectionType typ = IGNITE_COLLECTION_LINKED_HASH_SET;
+ CollectionType::Type typ = CollectionType::LINKED_HASH_SET;
CheckRawCollection(&typ);
}
@@ -1198,7 +1198,7 @@ BOOST_AUTO_TEST_CASE(TestCollectionIterators)
BOOST_AUTO_TEST_CASE(TestCollectionIteratorsTyped)
{
- CollectionType typ = IGNITE_COLLECTION_LINKED_HASH_SET;
+ CollectionType::Type typ = CollectionType::LINKED_HASH_SET;
CheckRawCollectionIterators(&typ);
}
@@ -1222,7 +1222,7 @@ BOOST_AUTO_TEST_CASE(TestMapNull)
BinaryMapReader<int8_t, BinaryInner> mapReader = rawReader.ReadMap<int8_t, BinaryInner>();
- BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+ BOOST_REQUIRE(mapReader.GetType() == MapType::UNDEFINED);
BOOST_REQUIRE(mapReader.GetSize() == -1);
BOOST_REQUIRE(!mapReader.HasNext());
BOOST_REQUIRE(mapReader.IsNull());
@@ -1241,7 +1241,7 @@ BOOST_AUTO_TEST_CASE(TestMapEmpty)
BOOST_AUTO_TEST_CASE(TestMapEmptyTyped)
{
- MapType typ = IGNITE_MAP_LINKED_HASH_MAP;
+ MapType::Type typ = MapType::LINKED_HASH_MAP;
CheckRawMapEmpty(&typ);
}
@@ -1253,7 +1253,7 @@ BOOST_AUTO_TEST_CASE(TestMap)
BOOST_AUTO_TEST_CASE(TestMapTyped)
{
- MapType typ = IGNITE_MAP_LINKED_HASH_MAP;
+ MapType::Type typ = MapType::LINKED_HASH_MAP;
CheckRawMap(&typ);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp b/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp
index 7802d15..f494cb0 100644
--- a/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp
+++ b/modules/platforms/cpp/core-test/src/binary_reader_writer_test.cpp
@@ -61,7 +61,7 @@ void CheckPrimitive(T val)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
BOOST_CHECK_EXCEPTION(Read<T>(reader, NULL), IgniteError, IsBinaryError);
@@ -116,7 +116,7 @@ void CheckPrimitiveArray(T dflt, T val1, T val2)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -149,7 +149,7 @@ void CheckPrimitiveArray(T dflt, T val1, T val2)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -186,7 +186,7 @@ void CheckPrimitiveArray(T dflt, T val1, T val2)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -226,7 +226,7 @@ void CheckPrimitiveArray(T dflt, T val1, T val2)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -301,7 +301,7 @@ void CheckReadsRestricted(BinaryReader& reader)
BOOST_CHECK_EXCEPTION((reader.ReadMap<int8_t, int8_t>("field")), IgniteError, IsBinaryError);
}
-void CheckCollectionEmpty(CollectionType* colType)
+void CheckCollectionEmpty(CollectionType::Type* colType)
{
TemplatedBinaryIdResolver<BinaryDummy> idRslvr;
@@ -335,7 +335,7 @@ void CheckCollectionEmpty(CollectionType* colType)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -345,7 +345,7 @@ void CheckCollectionEmpty(CollectionType* colType)
if (colType)
BOOST_REQUIRE(colReader.GetType() == *colType);
else
- BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+ BOOST_REQUIRE(colReader.GetType() == CollectionType::UNDEFINED);
BOOST_REQUIRE(colReader.GetSize() == 0);
BOOST_REQUIRE(!colReader.HasNext());
@@ -356,7 +356,7 @@ void CheckCollectionEmpty(CollectionType* colType)
BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
}
-void CheckCollection(CollectionType* colType)
+void CheckCollection(CollectionType::Type* colType)
{
BinaryInner writeVal1 = BinaryInner(1);
BinaryInner writeVal2 = BinaryInner(0);
@@ -398,7 +398,7 @@ void CheckCollection(CollectionType* colType)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -410,7 +410,7 @@ void CheckCollection(CollectionType* colType)
if (colType)
BOOST_REQUIRE(colReader.GetType() == *colType);
else
- BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+ BOOST_REQUIRE(colReader.GetType() == CollectionType::UNDEFINED);
BOOST_REQUIRE(colReader.GetSize() == 3);
BOOST_REQUIRE(!colReader.IsNull());
@@ -431,7 +431,7 @@ void CheckCollection(CollectionType* colType)
BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
}
-void CheckCollectionIterators(CollectionType* colType)
+void CheckCollectionIterators(CollectionType::Type* colType)
{
typedef std::vector<BinaryInner> BinaryInnerVector;
BinaryInnerVector writeValues;
@@ -466,14 +466,14 @@ void CheckCollectionIterators(CollectionType* colType)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
BOOST_REQUIRE(reader.ReadCollectionSize("field1") == writeValues.size());
- CollectionType expectedCollectionType = colType ? *colType : IGNITE_COLLECTION_UNDEFINED;
+ CollectionType::Type expectedCollectionType = colType ? *colType : CollectionType::UNDEFINED;
BOOST_REQUIRE(reader.ReadCollectionType("field1") == expectedCollectionType);
BinaryInnerVector readValues;
@@ -490,7 +490,7 @@ void CheckCollectionIterators(CollectionType* colType)
BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
}
-void CheckMapEmpty(MapType* mapType)
+void CheckMapEmpty(MapType::Type* mapType)
{
TemplatedBinaryIdResolver<BinaryDummy> idRslvr;
@@ -524,7 +524,7 @@ void CheckMapEmpty(MapType* mapType)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -534,7 +534,7 @@ void CheckMapEmpty(MapType* mapType)
if (mapType)
BOOST_REQUIRE(mapReader.GetType() == *mapType);
else
- BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+ BOOST_REQUIRE(mapReader.GetType() == MapType::UNDEFINED);
BOOST_REQUIRE(mapReader.GetSize() == 0);
BOOST_REQUIRE(!mapReader.HasNext());
@@ -547,7 +547,7 @@ void CheckMapEmpty(MapType* mapType)
BOOST_REQUIRE(reader.ReadInt8("field2") == 1);
}
-void CheckMap(MapType* mapType)
+void CheckMap(MapType::Type* mapType)
{
BinaryInner writeVal1 = BinaryInner(1);
BinaryInner writeVal2 = BinaryInner(0);
@@ -589,7 +589,7 @@ void CheckMap(MapType* mapType)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -601,7 +601,7 @@ void CheckMap(MapType* mapType)
if (mapType)
BOOST_REQUIRE(mapReader.GetType() == *mapType);
else
- BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+ BOOST_REQUIRE(mapReader.GetType() == MapType::UNDEFINED);
BOOST_REQUIRE(mapReader.GetSize() == 3);
BOOST_REQUIRE(!mapReader.IsNull());
@@ -801,7 +801,7 @@ BOOST_AUTO_TEST_CASE(TestGuidNull)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -839,7 +839,7 @@ BOOST_AUTO_TEST_CASE(TestDateNull)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -877,7 +877,7 @@ BOOST_AUTO_TEST_CASE(TestTimeNull)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -915,7 +915,7 @@ BOOST_AUTO_TEST_CASE(TestTimestampNull)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -964,7 +964,7 @@ BOOST_AUTO_TEST_CASE(TestString) {
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 5;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1023,7 +1023,7 @@ BOOST_AUTO_TEST_CASE(TestStringArrayNull)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1079,7 +1079,7 @@ BOOST_AUTO_TEST_CASE(TestStringArrayEmpty)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1146,7 +1146,7 @@ BOOST_AUTO_TEST_CASE(TestStringArray)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1241,7 +1241,7 @@ BOOST_AUTO_TEST_CASE(TestObject)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 3;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1285,7 +1285,7 @@ BOOST_AUTO_TEST_CASE(TestNestedObject)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 3;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1327,7 +1327,7 @@ BOOST_AUTO_TEST_CASE(TestArrayNull)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1376,7 +1376,7 @@ BOOST_AUTO_TEST_CASE(TestArrayEmpty)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1433,7 +1433,7 @@ BOOST_AUTO_TEST_CASE(TestArray)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1485,14 +1485,14 @@ BOOST_AUTO_TEST_CASE(TestCollectionNull)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
BinaryCollectionReader<BinaryInner> colReader = reader.ReadCollection<BinaryInner>("field1");
- BOOST_REQUIRE(colReader.GetType() == IGNITE_COLLECTION_UNDEFINED);
+ BOOST_REQUIRE(colReader.GetType() == CollectionType::UNDEFINED);
BOOST_REQUIRE(colReader.GetSize() == -1);
BOOST_REQUIRE(!colReader.HasNext());
BOOST_REQUIRE(colReader.IsNull());
@@ -1509,7 +1509,7 @@ BOOST_AUTO_TEST_CASE(TestCollectionEmpty)
BOOST_AUTO_TEST_CASE(TestCollectionEmptyTyped)
{
- CollectionType typ = IGNITE_COLLECTION_LINKED_HASH_SET;
+ CollectionType::Type typ = CollectionType::LINKED_HASH_SET;
CheckCollectionEmpty(&typ);
}
@@ -1521,7 +1521,7 @@ BOOST_AUTO_TEST_CASE(TestCollection)
BOOST_AUTO_TEST_CASE(testCollectionTyped)
{
- CollectionType typ = IGNITE_COLLECTION_LINKED_HASH_SET;
+ CollectionType::Type typ = CollectionType::LINKED_HASH_SET;
CheckCollection(&typ);
}
@@ -1533,7 +1533,7 @@ BOOST_AUTO_TEST_CASE(TestCollectionIterators)
BOOST_AUTO_TEST_CASE(TestCollectionIteratorsTyped)
{
- CollectionType typ = IGNITE_COLLECTION_LINKED_HASH_SET;
+ CollectionType::Type typ = CollectionType::LINKED_HASH_SET;
CheckCollectionIterators(&typ);
}
@@ -1562,14 +1562,14 @@ BOOST_AUTO_TEST_CASE(TestMapNull)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 5 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
BinaryMapReader<int8_t, BinaryInner> mapReader = reader.ReadMap<int8_t, BinaryInner>("field1");
- BOOST_REQUIRE(mapReader.GetType() == IGNITE_MAP_UNDEFINED);
+ BOOST_REQUIRE(mapReader.GetType() == MapType::UNDEFINED);
BOOST_REQUIRE(mapReader.GetSize() == -1);
BOOST_REQUIRE(!mapReader.HasNext());
BOOST_REQUIRE(mapReader.IsNull());
@@ -1588,7 +1588,7 @@ BOOST_AUTO_TEST_CASE(TestMapEmpty)
BOOST_AUTO_TEST_CASE(TestMapEmptyTyped)
{
- MapType typ = IGNITE_MAP_LINKED_HASH_MAP;
+ MapType::Type typ = MapType::LINKED_HASH_MAP;
CheckMapEmpty(&typ);
}
@@ -1600,7 +1600,7 @@ BOOST_AUTO_TEST_CASE(TestMap)
BOOST_AUTO_TEST_CASE(TestMapTyped)
{
- MapType typ = IGNITE_MAP_LINKED_HASH_MAP;
+ MapType::Type typ = MapType::LINKED_HASH_MAP;
CheckMap(&typ);
}
@@ -1634,7 +1634,7 @@ BOOST_AUTO_TEST_CASE(TestRawMode)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, footerBegin, footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 1000, footerBegin, footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1702,7 +1702,7 @@ BOOST_AUTO_TEST_CASE(TestFieldSeek)
BinaryReaderImpl readerImpl(&in, &idRslvr, pos, usrType,
typeId, hashCode, len, rawOff,
- footerBegin, footerEnd, OFFSET_TYPE_ONE_BYTE);
+ footerBegin, footerEnd, BinaryOffsetType::ONE_BYTE);
BinaryReader reader(&readerImpl);
@@ -1824,7 +1824,7 @@ BOOST_AUTO_TEST_CASE(TestSchemaOffset2ByteFields)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 6 * fieldsNum;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_TWO_BYTES);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::TWO_BYTES);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1869,7 +1869,7 @@ BOOST_AUTO_TEST_CASE(TestSchemaOffset4ByteFields)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 8 * fieldsNum;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_FOUR_BYTES);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::FOUR_BYTES);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1909,7 +1909,7 @@ BOOST_AUTO_TEST_CASE(TestSchemaOffset2ByteArray)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 6 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_TWO_BYTES);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::TWO_BYTES);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
@@ -1943,7 +1943,7 @@ BOOST_AUTO_TEST_CASE(TestSchemaOffset4ByteArray)
int32_t footerBegin = in.ReadInt32(IGNITE_OFFSET_SCHEMA_OR_RAW_OFF);
int32_t footerEnd = footerBegin + 8 * 2;
- BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, OFFSET_TYPE_FOUR_BYTES);
+ BinaryReaderImpl readerImpl(&in, &idRslvr, 0, true, idRslvr.GetTypeId(), 0, 100, 100, footerBegin, footerEnd, BinaryOffsetType::FOUR_BYTES);
BinaryReader reader(&readerImpl);
in.Position(IGNITE_DFLT_HDR_LEN);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core-test/src/cache_store_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_store_test.cpp b/modules/platforms/cpp/core-test/src/cache_store_test.cpp
index f1b4630..b6bfefb 100644
--- a/modules/platforms/cpp/core-test/src/cache_store_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_store_test.cpp
@@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(LoadCacheSingleNodeNoPredicate)
BOOST_CHECK(!cache.IsEmpty());
- BOOST_CHECK_EQUAL(cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY), entriesNum);
+ BOOST_CHECK_EQUAL(cache.Size(cache::CachePeekMode::PRIMARY), entriesNum);
std::string val42 = cache.Get(42);
@@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(LoadCacheSeveralNodesNoPredicate)
BOOST_CHECK(!cache.IsEmpty());
- BOOST_CHECK_EQUAL(cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY), entriesNum);
+ BOOST_CHECK_EQUAL(cache.Size(cache::CachePeekMode::PRIMARY), entriesNum);
std::string val42 = cache.Get(42);
@@ -141,7 +141,7 @@ BOOST_AUTO_TEST_CASE(LocalLoadCacheSingleNodeNoPredicate)
BOOST_CHECK(!cache.IsEmpty());
- BOOST_CHECK_EQUAL(cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY), entriesNum);
+ BOOST_CHECK_EQUAL(cache.Size(cache::CachePeekMode::PRIMARY), entriesNum);
std::string val42 = cache.Get(42);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_test.cpp b/modules/platforms/cpp/core-test/src/cache_test.cpp
index 99e0f1b..d3f73be 100644
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@ -119,13 +119,13 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeys)
cache.Put(2, 2);
cache.Put(3, 3);
- int size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ int size = cache.Size(cache::CachePeekMode::PRIMARY);
BOOST_REQUIRE(3 == size);
cache.RemoveAll();
- size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ size = cache.Size(cache::CachePeekMode::ALL);
BOOST_REQUIRE(0 == size);
@@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeys)
cache.RemoveAll(keySet);
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::CachePeekMode::PRIMARY);
BOOST_REQUIRE(1 == size);
}
@@ -148,7 +148,7 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterVector)
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ int size = cache.Size(cache::CachePeekMode::ALL);
BOOST_REQUIRE(0 == size);
@@ -162,7 +162,7 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterVector)
cache.RemoveAll(keySet.begin(), keySet.end());
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::CachePeekMode::PRIMARY);
BOOST_REQUIRE(1 == size);
}
@@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterArray)
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ int size = cache.Size(cache::CachePeekMode::ALL);
BOOST_REQUIRE(0 == size);
@@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterArray)
cache.RemoveAll(keys, keys + 4);
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::CachePeekMode::PRIMARY);
BOOST_REQUIRE(1 == size);
}
@@ -455,11 +455,11 @@ BOOST_AUTO_TEST_CASE(TestLocalClear)
cache.Put(0, 2);
- BOOST_REQUIRE(2 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(2 == cache.LocalPeek(0, cache::CachePeekMode::PRIMARY));
cache.LocalClear(0);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::CachePeekMode::PRIMARY));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAll)
@@ -473,13 +473,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAll)
std::set<int> keySet(keys, keys + 2);
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::CachePeekMode::PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::CachePeekMode::PRIMARY));
cache.LocalClearAll(keySet);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::CachePeekMode::PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::CachePeekMode::PRIMARY));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAllIterList)
@@ -493,13 +493,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAllIterList)
std::list<int> keySet(keys, keys + 2);
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::CachePeekMode::PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::CachePeekMode::PRIMARY));
cache.LocalClearAll(keySet.begin(), keySet.end());
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::CachePeekMode::PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::CachePeekMode::PRIMARY));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAllIterArray)
@@ -511,13 +511,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAllIterArray)
int keys[] = { 0, 1 };
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::CachePeekMode::PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::CachePeekMode::PRIMARY));
cache.LocalClearAll(keys, keys + 2);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::CachePeekMode::PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::CachePeekMode::PRIMARY));
}
BOOST_AUTO_TEST_CASE(TestSizes)
@@ -531,7 +531,7 @@ BOOST_AUTO_TEST_CASE(TestSizes)
BOOST_REQUIRE(2 <= cache.Size());
- BOOST_REQUIRE(1 <= cache.LocalSize(cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(1 <= cache.LocalSize(cache::CachePeekMode::PRIMARY));
}
BOOST_AUTO_TEST_CASE(TestLocalEvict)
@@ -540,7 +540,7 @@ BOOST_AUTO_TEST_CASE(TestLocalEvict)
cache.Put(1, 5);
- BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
int keys[] = { 0, 1 };
@@ -548,11 +548,11 @@ BOOST_AUTO_TEST_CASE(TestLocalEvict)
cache.LocalEvict(keySet);
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
BOOST_REQUIRE(5 == cache.Get(1));
- BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
}
BOOST_AUTO_TEST_CASE(TestLocalEvictIterSet)
@@ -561,7 +561,7 @@ BOOST_AUTO_TEST_CASE(TestLocalEvictIterSet)
cache.Put(1, 5);
- BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
int keys[] = { 0, 1 };
@@ -569,11 +569,11 @@ BOOST_AUTO_TEST_CASE(TestLocalEvictIterSet)
cache.LocalEvict(keySet.begin(), keySet.end());
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
BOOST_REQUIRE(5 == cache.Get(1));
- BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
}
BOOST_AUTO_TEST_CASE(TestLocalEvictIterArray)
@@ -582,17 +582,17 @@ BOOST_AUTO_TEST_CASE(TestLocalEvictIterArray)
cache.Put(1, 5);
- BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
int keys[] = { 0, 1 };
cache.LocalEvict(keys, keys + 2);
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
BOOST_REQUIRE(5 == cache.Get(1));
- BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ONHEAP));
+ BOOST_REQUIRE(5 == cache.LocalPeek(1, cache::CachePeekMode::ONHEAP));
}
BOOST_AUTO_TEST_CASE(TestBinary)
[41/50] [abbrv] ignite git commit: Fix for C++ tests
Posted by sb...@apache.org.
Fix for C++ tests
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/faaf92d6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/faaf92d6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/faaf92d6
Branch: refs/heads/ignite-4929
Commit: faaf92d65614daa65d6f6cbff9fe08cea31c6d4e
Parents: 0242728
Author: Igor Sapego <is...@gridgain.com>
Authored: Thu Apr 13 20:08:05 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Thu Apr 13 20:08:05 2017 +0300
----------------------------------------------------------------------
.../platforms/cpp/core-test/src/cache_test.cpp | 58 ++++++++++----------
1 file changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/faaf92d6/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_test.cpp b/modules/platforms/cpp/core-test/src/cache_test.cpp
index d222009..ab29797 100644
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@ -123,15 +123,15 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeys)
cache.Put(2, 2);
cache.Put(3, 3);
- int size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(3 == size);
+ BOOST_CHECK_EQUAL(3, size);
cache.RemoveAll();
- size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@ -143,18 +143,18 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeys)
cache.RemoveAll(keySet);
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(1 == size);
+ BOOST_CHECK_EQUAL(1, size);
}
BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterVector)
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@ -166,18 +166,18 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterVector)
cache.RemoveAll(keySet.begin(), keySet.end());
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(1 == size);
+ BOOST_CHECK_EQUAL(1, size);
}
BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterArray)
{
cache::Cache<int, int> cache = Cache();
- int size = cache.Size(cache::IGNITE_PEEK_MODE_ALL);
+ int size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(0 == size);
+ BOOST_CHECK_EQUAL(0, size);
cache.Put(1, 1);
cache.Put(2, 2);
@@ -187,9 +187,9 @@ BOOST_AUTO_TEST_CASE(TestRemoveAllKeysIterArray)
cache.RemoveAll(keys, keys + 4);
- size = cache.Size(cache::IGNITE_PEEK_MODE_PRIMARY);
+ size = cache.Size(cache::IGNITE_PEEK_MODE_ONHEAP);
- BOOST_REQUIRE(1 == size);
+ BOOST_CHECK_EQUAL(1, size);
}
BOOST_AUTO_TEST_CASE(TestPut)
@@ -459,11 +459,11 @@ BOOST_AUTO_TEST_CASE(TestLocalClear)
cache.Put(0, 2);
- BOOST_REQUIRE(2 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(2 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
cache.LocalClear(0);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAll)
@@ -477,13 +477,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAll)
std::set<int> keySet(keys, keys + 2);
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
cache.LocalClearAll(keySet);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAllIterList)
@@ -497,13 +497,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAllIterList)
std::list<int> keySet(keys, keys + 2);
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
cache.LocalClearAll(keySet.begin(), keySet.end());
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestLocalClearAllIterArray)
@@ -515,13 +515,13 @@ BOOST_AUTO_TEST_CASE(TestLocalClearAllIterArray)
int keys[] = { 0, 1 };
- BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(3 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(3 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
cache.LocalClearAll(keys, keys + 2);
- BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_PRIMARY));
- BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(0 == cache.LocalPeek(0, cache::IGNITE_PEEK_MODE_ALL));
+ BOOST_REQUIRE(0 == cache.LocalPeek(1, cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestSizes)
@@ -535,7 +535,7 @@ BOOST_AUTO_TEST_CASE(TestSizes)
BOOST_REQUIRE(2 <= cache.Size());
- BOOST_REQUIRE(1 <= cache.LocalSize(cache::IGNITE_PEEK_MODE_PRIMARY));
+ BOOST_REQUIRE(1 <= cache.LocalSize(cache::IGNITE_PEEK_MODE_ALL));
}
BOOST_AUTO_TEST_CASE(TestLocalEvict)
[22/50] [abbrv] ignite git commit: ignite-4681 Apply new future
adapter
Posted by sb...@apache.org.
ignite-4681 Apply new future adapter
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e922dda6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e922dda6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e922dda6
Branch: refs/heads/ignite-4929
Commit: e922dda6e9230ff7715f83c7b81e5656e8e856a0
Parents: dd4a5c4
Author: Igor Seliverstov <gv...@gmail.com>
Authored: Thu Apr 13 15:41:54 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu Apr 13 15:42:50 2017 +0300
----------------------------------------------------------------------
.../jmh/future/JmhFutureAdapterBenchmark.java | 145 ++++++
.../ignite/internal/IgniteInternalFuture.java | 15 -
.../cache/GridCacheCompoundFuture.java | 63 +++
.../cache/GridCacheCompoundIdentityFuture.java | 63 +++
.../processors/cache/GridCacheFuture.java | 15 +
.../cache/GridCacheFutureAdapter.java | 61 +++
.../distributed/GridCacheTxRecoveryFuture.java | 9 +-
.../dht/CacheDistributedGetFutureAdapter.java | 4 +-
.../distributed/dht/GridDhtLockFuture.java | 33 +-
.../distributed/dht/GridDhtTxFinishFuture.java | 4 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 16 +-
.../dht/GridPartitionedSingleGetFuture.java | 4 +-
.../GridDhtAtomicAbstractUpdateFuture.java | 4 +-
.../GridNearAtomicAbstractUpdateFuture.java | 8 +-
.../GridNearAtomicSingleUpdateFuture.java | 24 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 24 +-
.../colocated/GridDhtColocatedLockFuture.java | 23 +-
.../GridDhtPartitionsExchangeFuture.java | 35 +-
.../distributed/near/GridNearLockFuture.java | 20 +-
...arOptimisticSerializableTxPrepareFuture.java | 2 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 9 +-
.../GridNearPessimisticTxPrepareFuture.java | 5 +-
.../near/GridNearTxFinishFuture.java | 13 +-
.../cache/distributed/near/GridNearTxLocal.java | 2 +-
.../near/GridNearTxPrepareFutureAdapter.java | 4 +-
.../cache/local/GridLocalLockFuture.java | 6 +-
.../query/GridCacheDistributedQueryFuture.java | 18 +-
.../query/GridCacheQueryFutureAdapter.java | 31 +-
.../cache/transactions/TxDeadlockDetection.java | 5 +-
.../platform/compute/PlatformCompute.java | 10 -
.../tcp/GridTcpMemcachedNioListener.java | 20 +-
.../util/future/GridCompoundFuture.java | 45 +-
.../util/future/GridFinishedFuture.java | 13 -
.../internal/util/future/GridFutureAdapter.java | 479 ++++++++++---------
.../internal/util/future/IgniteFutureImpl.java | 10 -
.../org/apache/ignite/lang/IgniteFuture.java | 15 -
.../GridCacheOrderedPreloadingSelfTest.java | 48 +-
.../util/future/IgniteFutureImplTest.java | 38 --
.../external/HadoopExternalTaskExecutor.java | 2 +-
.../processors/schedule/ScheduleFutureImpl.java | 20 -
40 files changed, 810 insertions(+), 555 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/future/JmhFutureAdapterBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/future/JmhFutureAdapterBenchmark.java b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/future/JmhFutureAdapterBenchmark.java
new file mode 100644
index 0000000..ef3643a
--- /dev/null
+++ b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/future/JmhFutureAdapterBenchmark.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.benchmarks.jmh.future;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.benchmarks.jmh.JmhAbstractBenchmark;
+import org.apache.ignite.internal.benchmarks.jmh.runner.JmhIdeBenchmarkRunner;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+import org.openjdk.jmh.annotations.Threads;
+
+/**
+ *
+ */
+public class JmhFutureAdapterBenchmark extends JmhAbstractBenchmark {
+ /** */
+ private static final IgniteInClosure<IgniteInternalFuture<Long>> LSNR = new IgniteInClosure<IgniteInternalFuture<Long>>() {
+ /** {@inheritDoc} */
+ @Override public void apply(IgniteInternalFuture<Long> fut) {
+ // No-op
+ }
+ };
+
+ /** */
+ private static final Long RES = 0L;
+
+ /**
+ *
+ */
+ @State(Scope.Thread)
+ public static class CompleteState {
+ /** */
+ private final BlockingQueue<GridFutureAdapter<Long>> queue = new ArrayBlockingQueue<>(10);
+
+ /** */
+ private final Thread compleete = new Thread() {
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ while (!Thread.interrupted()) {
+ GridFutureAdapter<Long> fut = queue.poll();
+ if (fut != null)
+ fut.onDone(RES);
+ }
+ }
+ };
+
+ /**
+ *
+ */
+ @Setup public void setup() {
+ compleete.start();
+ }
+
+ /**
+ * @throws InterruptedException If failed.
+ */
+ @TearDown public void destroy() throws InterruptedException {
+ compleete.interrupt();
+ compleete.join();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @Benchmark
+ public void testSimpleGet() throws Exception {
+ GridFutureAdapter<Long> fut = new GridFutureAdapter<>();
+ fut.onDone(RES);
+ fut.get();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @Benchmark
+ public void testSimpleGetWithListener() throws Exception {
+ GridFutureAdapter<Long> fut = new GridFutureAdapter<>();
+ fut.listen(LSNR);
+ fut.onDone(RES);
+ fut.get();
+ }
+
+ /**
+ * @param state Benchmark context.
+ * @throws Exception If failed.
+ */
+ @Benchmark
+ @Threads(4)
+ public void completeFutureGet(CompleteState state) throws Exception {
+ GridFutureAdapter<Long> fut = new GridFutureAdapter<>();
+ state.queue.put(fut);
+ fut.get();
+ }
+
+ /**
+ * Run benchmarks.
+ *
+ * @param args Arguments.
+ * @throws Exception If failed.
+ */
+ public static void main(String[] args) throws Exception {
+ run(8);
+ }
+
+ /**
+ * Run benchmark.
+ *
+ * @param threads Amount of threads.
+ * @throws Exception If failed.
+ */
+ private static void run(int threads) throws Exception {
+ JmhIdeBenchmarkRunner.create()
+ .forks(1)
+ .threads(threads)
+ .warmupIterations(30)
+ .measurementIterations(30)
+ .benchmarks(JmhFutureAdapterBenchmark.class.getSimpleName())
+ .jvmArguments("-Xms4g", "-Xmx4g")
+ .run();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
index 789556d..76f8c71 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
@@ -103,21 +103,6 @@ public interface IgniteInternalFuture<R> {
public boolean isCancelled();
/**
- * Gets start time for this future.
- *
- * @return Start time for this future.
- */
- public long startTime();
-
- /**
- * Gets duration in milliseconds between start of the future and current time if future
- * is not finished, or between start and finish of this future.
- *
- * @return Time in milliseconds this future has taken to execute.
- */
- public long duration();
-
- /**
* Registers listener closure to be asynchronously notified whenever future completes.
*
* @param lsnr Listener closure to register. If not provided - this method is no-op.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheCompoundFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheCompoundFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheCompoundFuture.java
new file mode 100644
index 0000000..9869d4a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheCompoundFuture.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.internal.util.future.GridCompoundFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteReducer;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ *
+ */
+public abstract class GridCacheCompoundFuture<T, R> extends GridCompoundFuture<T, R> implements GridCacheFuture<R> {
+ /** Future start time. */
+ private final long startTime = U.currentTimeMillis();
+
+ /** Future end time. */
+ private volatile long endTime;
+
+ /**
+ * @param rdc Reducer.
+ */
+ protected GridCacheCompoundFuture(@Nullable IgniteReducer<T, R> rdc) {
+ super(rdc);
+ }
+
+ /** {@inheritDoc} */
+ @Override public long startTime() {
+ return startTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long duration() {
+ long endTime = this.endTime;
+
+ return (endTime == 0 ? U.currentTimeMillis() : endTime) - startTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean onDone(@Nullable R res, @Nullable Throwable err, boolean cancel) {
+ if(super.onDone(res, err, cancel)){
+ endTime = U.currentTimeMillis();
+ return true;
+ }
+
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheCompoundIdentityFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheCompoundIdentityFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheCompoundIdentityFuture.java
new file mode 100644
index 0000000..8fd619a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheCompoundIdentityFuture.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteReducer;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ *
+ */
+public abstract class GridCacheCompoundIdentityFuture<T> extends GridCompoundIdentityFuture<T> implements GridCacheFuture<T> {
+ /** Future start time. */
+ private final long startTime = U.currentTimeMillis();
+
+ /** Future end time. */
+ private volatile long endTime;
+
+ /**
+ * @param rdc Reducer.
+ */
+ protected GridCacheCompoundIdentityFuture(@Nullable IgniteReducer<T, T> rdc) {
+ super(rdc);
+ }
+
+ /** {@inheritDoc} */
+ @Override public long startTime() {
+ return startTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long duration() {
+ long endTime = this.endTime;
+
+ return (endTime == 0 ? U.currentTimeMillis() : endTime) - startTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean onDone(@Nullable T res, @Nullable Throwable err, boolean cancel) {
+ if(super.onDone(res, err, cancel)){
+ endTime = U.currentTimeMillis();
+ return true;
+ }
+
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFuture.java
index 8bf8d40..90a219a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFuture.java
@@ -26,6 +26,21 @@ import org.apache.ignite.lang.IgniteUuid;
*/
public interface GridCacheFuture<R> extends IgniteInternalFuture<R> {
/**
+ * Gets start time for this future.
+ *
+ * @return Start time for this future.
+ */
+ public long startTime();
+
+ /**
+ * Gets duration in milliseconds between start of the future and current time if future
+ * is not finished, or between start and finish of this future.
+ *
+ * @return Time in milliseconds this future has taken to execute.
+ */
+ public long duration();
+
+ /**
* @return Unique identifier for this future.
*/
public IgniteUuid futureId();
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFutureAdapter.java
new file mode 100644
index 0000000..babd707
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheFutureAdapter.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ *
+ */
+public abstract class GridCacheFutureAdapter<R> extends GridFutureAdapter<R> implements GridCacheFuture<R> {
+ /** Future start time. */
+ private final long startTime = U.currentTimeMillis();
+
+ /** Future end time. */
+ private volatile long endTime;
+
+ /**
+ * Default constructor.
+ */
+ public GridCacheFutureAdapter() {
+ }
+
+ /** {@inheritDoc} */
+ @Override public long startTime() {
+ return startTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long duration() {
+ long endTime = this.endTime;
+
+ return endTime == 0 ? U.currentTimeMillis() - startTime : endTime - startTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean onDone(@Nullable R res, @Nullable Throwable err, boolean cancel) {
+ if(super.onDone(res, err, cancel)){
+ endTime = U.currentTimeMillis();
+ return true;
+ }
+
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
index e27f777..1c97de2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
@@ -28,11 +28,11 @@ import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheFuture;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
import org.apache.ignite.internal.util.GridLeanMap;
-import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.C1;
@@ -49,7 +49,7 @@ import static org.apache.ignite.transactions.TransactionState.PREPARED;
/**
* Future verifying that all remote transactions related to transaction were prepared or committed.
*/
-public class GridCacheTxRecoveryFuture extends GridCompoundIdentityFuture<Boolean> implements GridCacheFuture<Boolean> {
+public class GridCacheTxRecoveryFuture extends GridCacheCompoundIdentityFuture<Boolean> {
/** */
private static final long serialVersionUID = 0L;
@@ -426,7 +426,7 @@ public class GridCacheTxRecoveryFuture extends GridCompoundIdentityFuture<Boolea
@SuppressWarnings("ForLoopReplaceableByForEach")
private MiniFuture miniFuture(IgniteUuid miniId) {
// We iterate directly over the futs collection here to avoid copy.
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
// Avoid iterator creation.
@@ -547,9 +547,6 @@ public class GridCacheTxRecoveryFuture extends GridCompoundIdentityFuture<Boolea
*
*/
private class MiniFuture extends GridFutureAdapter<Boolean> {
- /** */
- private static final long serialVersionUID = 0L;
-
/** Mini future ID. */
private final IgniteUuid futId = IgniteUuid.randomUuid();
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
index 4381dfd..259b096 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
@@ -25,11 +25,11 @@ import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheFuture;
import org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
-import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.lang.IgniteUuid;
@@ -42,7 +42,7 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh
/**
*
*/
-public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoundIdentityFuture<Map<K, V>>
+public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCacheCompoundIdentityFuture<Map<K, V>>
implements GridCacheFuture<Map<K, V>>, CacheGetFuture {
/** Default max remap count value. */
public static final int DFLT_MAX_REMAP_CNT = 3;
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index a0270b0..1a7c2c6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -38,6 +38,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CacheLockCandidates;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
@@ -54,7 +55,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.dr.GridDrType;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
-import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
@@ -77,7 +77,7 @@ import static org.apache.ignite.internal.processors.dr.GridDrType.DR_PRELOAD;
/**
* Cache lock future.
*/
-public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
+public final class GridDhtLockFuture extends GridCacheCompoundIdentityFuture<Boolean>
implements GridCacheMvccFuture<Boolean>, GridDhtFuture<Boolean>, GridCacheMappedVersion {
/** */
private static final long serialVersionUID = 0L;
@@ -298,10 +298,8 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
/**
* @return Entries.
*/
- public Collection<GridDhtCacheEntry> entriesCopy() {
- synchronized (sync) {
- return new ArrayList<>(entries());
- }
+ public synchronized Collection<GridDhtCacheEntry> entriesCopy() {
+ return new ArrayList<>(entries());
}
/**
@@ -395,7 +393,7 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
return null;
}
- synchronized (sync) {
+ synchronized (this) {
entries.add(c == null || c.reentry() ? null : entry);
if (c != null && !c.reentry())
@@ -529,7 +527,7 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
@SuppressWarnings("ForLoopReplaceableByForEach")
private MiniFuture miniFuture(IgniteUuid miniId) {
// We iterate directly over the futs collection here to avoid copy.
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
// Avoid iterator creation.
@@ -599,7 +597,7 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
* @param t Error.
*/
public void onError(Throwable t) {
- synchronized (sync) {
+ synchronized (this) {
if (err != null)
return;
@@ -646,7 +644,7 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
log.debug("Received onOwnerChanged() callback [entry=" + entry + ", owner=" + owner + "]");
if (owner != null && owner.version().equals(lockVer)) {
- synchronized (sync) {
+ synchronized (this) {
if (!pendingLocks.remove(entry.key()))
return false;
}
@@ -663,10 +661,8 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
/**
* @return {@code True} if locks have been acquired.
*/
- private boolean checkLocks() {
- synchronized (sync) {
- return pendingLocks.isEmpty();
- }
+ private synchronized boolean checkLocks() {
+ return pendingLocks.isEmpty();
}
/** {@inheritDoc} */
@@ -697,7 +693,7 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
if (isDone() || (err == null && success && !checkLocks()))
return false;
- synchronized (sync) {
+ synchronized (this) {
if (this.err == null)
this.err = err;
}
@@ -776,7 +772,7 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
* @param entries Entries.
*/
private void map(Iterable<GridDhtCacheEntry> entries) {
- synchronized (sync) {
+ synchronized (this) {
if (mapped)
return;
@@ -1120,7 +1116,7 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
if (log.isDebugEnabled())
log.debug("Timed out waiting for lock response: " + this);
- synchronized (sync) {
+ synchronized (GridDhtLockFuture.this) {
timedOut = true;
// Stop locks and responses processing.
@@ -1146,9 +1142,6 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture<Boolean>
*/
private class MiniFuture extends GridFutureAdapter<Boolean> {
/** */
- private static final long serialVersionUID = 0L;
-
- /** */
private final IgniteUuid futId = IgniteUuid.randomUuid();
/** Node. */
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 17e9047..23d7657 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -28,12 +28,12 @@ import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheFuture;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping;
import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
-import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
@@ -50,7 +50,7 @@ import static org.apache.ignite.transactions.TransactionState.COMMITTING;
/**
*
*/
-public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFuture<IgniteInternalTx>
+public final class GridDhtTxFinishFuture<K, V> extends GridCacheCompoundIdentityFuture<IgniteInternalTx>
implements GridCacheFuture<IgniteInternalTx> {
/** */
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 93ea30d..964d423 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -42,6 +42,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheInvokeEntry;
import org.apache.ignite.internal.processors.cache.CacheLockCandidates;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
@@ -97,7 +98,7 @@ import static org.apache.ignite.transactions.TransactionState.PREPARED;
*
*/
@SuppressWarnings("unchecked")
-public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInternalTx, GridNearTxPrepareResponse>
+public final class GridDhtTxPrepareFuture extends GridCacheCompoundFuture<IgniteInternalTx, GridNearTxPrepareResponse>
implements GridCacheMvccFuture<GridNearTxPrepareResponse> {
/** */
private static final long serialVersionUID = 0L;
@@ -279,7 +280,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
boolean rmv;
- synchronized (sync) {
+ synchronized (this) {
rmv = lockKeys.remove(entry.txKey());
}
@@ -310,7 +311,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
if (!locksReady)
return false;
- synchronized (sync) {
+ synchronized (this) {
return lockKeys.isEmpty();
}
}
@@ -564,7 +565,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
@SuppressWarnings("ForLoopReplaceableByForEach")
private MiniFuture miniFuture(int miniId) {
// We iterate directly over the futs collection here to avoid copy.
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
// Avoid iterator creation.
@@ -623,7 +624,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
}
if (tx.optimistic() && txEntry.explicitVersion() == null) {
- synchronized (sync) {
+ synchronized (this) {
lockKeys.add(txEntry.txKey());
}
}
@@ -1597,9 +1598,6 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
*/
private class MiniFuture extends GridFutureAdapter<IgniteInternalTx> {
/** */
- private static final long serialVersionUID = 0L;
-
- /** */
private final int futId;
/** Node ID. */
@@ -1811,7 +1809,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
/** {@inheritDoc} */
@Override public void onTimeout() {
- synchronized (sync) {
+ synchronized (GridDhtTxPrepareFuture.this) {
clear();
lockKeys.clear();
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
index 47f4066..3af691c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
@@ -37,6 +37,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException;
import org.apache.ignite.internal.processors.cache.GridCacheFuture;
+import org.apache.ignite.internal.processors.cache.GridCacheFutureAdapter;
import org.apache.ignite.internal.processors.cache.GridCacheMessage;
import org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
@@ -45,7 +46,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetR
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearSingleGetRequest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearSingleGetResponse;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.CI1;
import org.apache.ignite.internal.util.typedef.CIX1;
@@ -61,7 +61,7 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh
/**
*
*/
-public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object> implements GridCacheFuture<Object>,
+public class GridPartitionedSingleGetFuture extends GridCacheFutureAdapter<Object> implements GridCacheFuture<Object>,
CacheGetFuture {
/** */
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
index 0940acb..039cb99 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
@@ -36,12 +36,12 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.GridCacheAtomicFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.GridCacheFutureAdapter;
import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException;
import org.apache.ignite.internal.processors.cache.GridCacheReturn;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.CI1;
@@ -58,7 +58,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC
/**
* DHT atomic cache backup update future.
*/
-public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapter<Void>
+public abstract class GridDhtAtomicAbstractUpdateFuture extends GridCacheFutureAdapter<Void>
implements GridCacheAtomicFuture<Void> {
/** */
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
index a2adb05..122e17c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
@@ -38,6 +38,7 @@ import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException;
import org.apache.ignite.internal.processors.cache.GridCacheAtomicFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.GridCacheFutureAdapter;
import org.apache.ignite.internal.processors.cache.GridCacheMvccManager;
import org.apache.ignite.internal.processors.cache.GridCacheOperation;
import org.apache.ignite.internal.processors.cache.GridCacheReturn;
@@ -58,7 +59,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC
/**
* Base for near atomic update futures.
*/
-public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapter<Object>
+public abstract class GridNearAtomicAbstractUpdateFuture extends GridCacheFutureAdapter<Object>
implements GridCacheAtomicFuture<Object> {
/** Logger reference. */
private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
@@ -114,9 +115,6 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
/** Near cache flag. */
protected final boolean nearEnabled;
- /** Mutex to synchronize state updates. */
- protected final Object mux = new Object();
-
/** Topology locked flag. Set if atomic update is performed inside a TX or explicit lock. */
protected boolean topLocked;
@@ -138,7 +136,7 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
/** Future ID. */
@GridToStringInclude
- protected long futId;
+ protected volatile long futId;
/** Operation result. */
protected GridCacheReturn opRes;
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
index e4ba457..11c3336 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
@@ -126,9 +126,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
/** {@inheritDoc} */
@Override public long id() {
- synchronized (mux) {
- return futId;
- }
+ return futId;
}
/** {@inheritDoc} */
@@ -141,7 +139,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
boolean rcvAll = false;
- synchronized (mux) {
+ synchronized (this) {
if (reqState == null)
return false;
@@ -215,7 +213,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
CachePartialUpdateCheckedException err0;
AffinityTopologyVersion remapTopVer0;
- synchronized (mux) {
+ synchronized (this) {
if (futId == 0 || futId != res.futureId())
return;
@@ -257,7 +255,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
GridCacheReturn opRes0 = null;
CachePartialUpdateCheckedException err0 = null;
- synchronized (mux) {
+ synchronized (this) {
if (futId == 0 || futId != res.futureId())
return;
@@ -331,7 +329,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
* @return Non-null topology version if update should be remapped.
*/
private AffinityTopologyVersion onAllReceived() {
- assert Thread.holdsLock(mux);
+ assert Thread.holdsLock(this);
assert futId > 0;
AffinityTopologyVersion remapTopVer0 = null;
@@ -488,7 +486,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
try {
reqState0 = mapSingleUpdate(topVer, futId);
- synchronized (mux) {
+ synchronized (this) {
assert this.futId == 0 : this;
assert this.topVer == AffinityTopologyVersion.ZERO : this;
@@ -537,7 +535,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
GridNearAtomicCheckUpdateRequest checkReq = null;
- synchronized (mux) {
+ synchronized (this) {
if (this.futId == 0 || this.futId != futId)
return;
@@ -568,7 +566,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
private Long onFutureDone() {
Long id0;
- synchronized (mux) {
+ synchronized (this) {
id0 = futId;
futId = 0;
@@ -734,9 +732,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
}
/** {@inheritDoc} */
- public String toString() {
- synchronized (mux) {
- return S.toString(GridNearAtomicSingleUpdateFuture.class, this, super.toString());
- }
+ public synchronized String toString() {
+ return S.toString(GridNearAtomicSingleUpdateFuture.class, this, super.toString());
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 84deefc..6198de4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -151,9 +151,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
/** {@inheritDoc} */
@Override public long id() {
- synchronized (mux) {
- return futId;
- }
+ return futId;
}
/** {@inheritDoc} */
@@ -166,7 +164,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
List<GridNearAtomicCheckUpdateRequest> checkReqs = null;
- synchronized (mux) {
+ synchronized (this) {
if (futId == 0)
return false;
@@ -299,7 +297,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
CachePartialUpdateCheckedException err0;
AffinityTopologyVersion remapTopVer0;
- synchronized (mux) {
+ synchronized (this) {
if (futId == 0 || futId != res.futureId())
return;
@@ -372,7 +370,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
boolean rcvAll;
- synchronized (mux) {
+ synchronized (this) {
if (futId == 0 || futId != res.futureId())
return;
@@ -534,7 +532,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
* @return Non null topology version if update should be remapped.
*/
@Nullable private AffinityTopologyVersion onAllReceived() {
- assert Thread.holdsLock(mux);
+ assert Thread.holdsLock(this);
assert futId > 0;
AffinityTopologyVersion remapTopVer0 = null;
@@ -801,7 +799,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
}
}
- synchronized (mux) {
+ synchronized (this) {
assert this.futId == 0 : this;
assert this.topVer == AffinityTopologyVersion.ZERO : this;
@@ -866,7 +864,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
boolean rcvAll = false;
- synchronized (mux) {
+ synchronized (this) {
if (this.futId == 0 || this.futId != futId)
return;
@@ -938,7 +936,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
private Long onFutureDone() {
Long id0;
- synchronized (mux) {
+ synchronized (this) {
id0 = futId;
futId = 0;
@@ -1181,9 +1179,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
}
/** {@inheritDoc} */
- public String toString() {
- synchronized (mux) {
- return S.toString(GridNearAtomicUpdateFuture.class, this, super.toString());
- }
+ public synchronized String toString() {
+ return S.toString(GridNearAtomicUpdateFuture.class, this, super.toString());
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 79c15fb..8512298 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -36,6 +36,7 @@ import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException;
@@ -56,7 +57,6 @@ import org.apache.ignite.internal.processors.cache.transactions.TxDeadlock;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException;
-import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -82,7 +82,7 @@ import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ;
/**
* Colocated cache lock future.
*/
-public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture<Boolean>
+public final class GridDhtColocatedLockFuture extends GridCacheCompoundIdentityFuture<Boolean>
implements GridCacheMvccFuture<Boolean> {
/** */
private static final long serialVersionUID = 0L;
@@ -203,7 +203,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture
this.skipStore = skipStore;
this.keepBinary = keepBinary;
- ignoreInterrupts(true);
+ ignoreInterrupts();
threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
@@ -452,13 +452,11 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture
/**
* @return Keys for which locks requested from remote nodes but response isn't received.
*/
- public Set<IgniteTxKey> requestedKeys() {
- synchronized (sync) {
- if (timeoutObj != null && timeoutObj.requestedKeys != null)
- return timeoutObj.requestedKeys;
+ public synchronized Set<IgniteTxKey> requestedKeys() {
+ if (timeoutObj != null && timeoutObj.requestedKeys != null)
+ return timeoutObj.requestedKeys;
- return requestedKeys0();
- }
+ return requestedKeys0();
}
/**
@@ -490,7 +488,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture
@SuppressWarnings({"ForLoopReplaceableByForEach", "IfMayBeConditional"})
private MiniFuture miniFuture(int miniId) {
// We iterate directly over the futs collection here to avoid copy.
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
// Avoid iterator creation.
@@ -1341,7 +1339,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture
log.debug("Timed out waiting for lock response: " + this);
if (inTx() && cctx.tm().deadlockDetectionEnabled()) {
- synchronized (sync) {
+ synchronized (GridDhtColocatedLockFuture.this) {
requestedKeys = requestedKeys0();
clear(); // Stop response processing.
@@ -1390,9 +1388,6 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture
*/
private class MiniFuture extends GridFutureAdapter<Boolean> {
/** */
- private static final long serialVersionUID = 0L;
-
- /** */
private final int futId;
/** Node ID. */
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index f41da2b..55aca2a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -171,9 +171,6 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
@GridToStringInclude
private volatile IgniteInternalFuture<?> partReleaseFut;
- /** */
- private final Object mux = new Object();
-
/** Logger. */
private IgniteLogger log;
@@ -1087,7 +1084,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
if (super.onDone(res, err) && realExchange) {
if (log.isDebugEnabled())
log.debug("Completed partition exchange [localNode=" + cctx.localNodeId() + ", exchange= " + this +
- "duration=" + duration() + ", durationFromInit=" + (U.currentTimeMillis() - initTs) + ']');
+ ", durationFromInit=" + (U.currentTimeMillis() - initTs) + ']');
initFut.onDone(err == null);
@@ -1201,7 +1198,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
boolean allReceived = false;
boolean updateSingleMap = false;
- synchronized (mux) {
+ synchronized (this) {
assert crd != null;
if (crd.isLocal()) {
@@ -1222,13 +1219,13 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
updatePartitionSingleMap(msg);
}
finally {
- synchronized (mux) {
+ synchronized (this) {
assert pendingSingleUpdates > 0;
pendingSingleUpdates--;
if (pendingSingleUpdates == 0)
- mux.notifyAll();
+ notifyAll();
}
}
}
@@ -1243,15 +1240,13 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
/**
*
*/
- private void awaitSingleMapUpdates() {
- synchronized (mux) {
- try {
- while (pendingSingleUpdates > 0)
- U.wait(mux);
- }
- catch (IgniteInterruptedCheckedException e) {
- U.warn(log, "Failed to wait for partition map updates, thread was interrupted: " + e);
- }
+ private synchronized void awaitSingleMapUpdates() {
+ try {
+ while (pendingSingleUpdates > 0)
+ U.wait(this);
+ }
+ catch (IgniteInterruptedCheckedException e) {
+ U.warn(log, "Failed to wait for partition map updates, thread was interrupted: " + e);
}
}
@@ -1316,7 +1311,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
else {
List<ClusterNode> nodes;
- synchronized (mux) {
+ synchronized (this) {
srvNodes.remove(cctx.localNode());
nodes = new ArrayList<>(srvNodes);
@@ -1423,7 +1418,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
assert msg.exchangeId().equals(exchId) : msg;
assert msg.lastVersion() != null : msg;
- synchronized (mux) {
+ synchronized (this) {
if (crd == null)
return;
@@ -1605,7 +1600,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
discoCache.updateAlives(node);
- synchronized (mux) {
+ synchronized (this) {
if (!srvNodes.remove(node))
return;
@@ -1755,7 +1750,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
Set<UUID> remaining;
List<ClusterNode> srvNodes;
- synchronized (mux) {
+ synchronized (this) {
remaining = new HashSet<>(this.remaining);
srvNodes = this.srvNodes != null ? new ArrayList<>(this.srvNodes) : null;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index 1948df0..8de01c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -37,6 +37,7 @@ import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException;
@@ -54,7 +55,6 @@ import org.apache.ignite.internal.processors.cache.transactions.TxDeadlock;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException;
-import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -80,7 +80,7 @@ import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ;
/**
* Cache lock future.
*/
-public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean>
+public final class GridNearLockFuture extends GridCacheCompoundIdentityFuture<Boolean>
implements GridCacheMvccFuture<Boolean> {
/** */
private static final long serialVersionUID = 0L;
@@ -209,7 +209,7 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
this.skipStore = skipStore;
this.keepBinary = keepBinary;
- ignoreInterrupts(true);
+ ignoreInterrupts();
threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
@@ -499,13 +499,11 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
/**
* @return Keys for which locks requested from remote nodes but response isn't received.
*/
- public Set<IgniteTxKey> requestedKeys() {
- synchronized (sync) {
- if (timeoutObj != null && timeoutObj.requestedKeys != null)
- return timeoutObj.requestedKeys;
+ public synchronized Set<IgniteTxKey> requestedKeys() {
+ if (timeoutObj != null && timeoutObj.requestedKeys != null)
+ return timeoutObj.requestedKeys;
- return requestedKeys0();
- }
+ return requestedKeys0();
}
/**
@@ -537,7 +535,7 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
@SuppressWarnings({"ForLoopReplaceableByForEach", "IfMayBeConditional"})
private MiniFuture miniFuture(int miniId) {
// We iterate directly over the futs collection here to avoid copy.
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
// Avoid iterator creation.
@@ -1440,7 +1438,7 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean
timedOut = true;
if (inTx() && cctx.tm().deadlockDetectionEnabled()) {
- synchronized (sync) {
+ synchronized (GridNearLockFuture.this) {
requestedKeys = requestedKeys0();
clear(); // Stop response processing.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
index 80508dc..cbd9d23 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
@@ -227,7 +227,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
@SuppressWarnings("ForLoopReplaceableByForEach")
private MiniFuture miniFuture(int miniId) {
// We iterate directly over the futs collection here to avoid copy.
- synchronized (sync) {
+ synchronized (GridNearOptimisticSerializableTxPrepareFuture.this) {
int size = futuresCountNoLock();
// Avoid iterator creation.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index 6189b38..81179ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -206,7 +206,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
*/
@SuppressWarnings("ForLoopReplaceableByForEach")
public Set<IgniteTxKey> requestedKeys() {
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
for (int i = 0; i < size; i++) {
@@ -239,7 +239,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
@SuppressWarnings("ForLoopReplaceableByForEach")
private MiniFuture miniFuture(int miniId) {
// We iterate directly over the futs collection here to avoid copy.
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
// Avoid iterator creation.
@@ -694,7 +694,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
if (keyLockFut != null)
keys = new HashSet<>(keyLockFut.lockKeys);
else {
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
for (int i = 0; i < size; i++) {
@@ -765,9 +765,6 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
*
*/
private static class MiniFuture extends GridFutureAdapter<GridNearTxPrepareResponse> {
- /** */
- private static final long serialVersionUID = 0L;
-
/** Receive result flag updater. */
private static final AtomicIntegerFieldUpdater<MiniFuture> RCV_RES_UPD =
AtomicIntegerFieldUpdater.newUpdater(MiniFuture.class, "rcvRes");
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
index 4a443a9..cb15bca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
@@ -132,7 +132,7 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
@SuppressWarnings("ForLoopReplaceableByForEach")
private MiniFuture miniFuture(int miniId) {
// We iterate directly over the futs collection here to avoid copy.
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
// Avoid iterator creation.
@@ -365,9 +365,6 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
*/
private class MiniFuture extends GridFutureAdapter<GridNearTxPrepareResponse> {
/** */
- private static final long serialVersionUID = 0L;
-
- /** */
private final int futId;
/** */
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index 1b0566b..37be0fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
@@ -32,6 +32,7 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.NodeStoppingException;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheFuture;
@@ -46,7 +47,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException;
import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException;
-import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.C1;
@@ -66,7 +66,7 @@ import static org.apache.ignite.transactions.TransactionState.UNKNOWN;
/**
*
*/
-public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFuture<IgniteInternalTx>
+public final class GridNearTxFinishFuture<K, V> extends GridCacheCompoundIdentityFuture<IgniteInternalTx>
implements GridCacheFuture<IgniteInternalTx> {
/** */
private static final long serialVersionUID = 0L;
@@ -114,7 +114,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
this.tx = tx;
this.commit = commit;
- ignoreInterrupts(true);
+ ignoreInterrupts();
mappings = tx.mappings();
@@ -189,7 +189,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
if (!isDone()) {
FinishMiniFuture finishFut = null;
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
for (int i = 0; i < size; i++) {
@@ -878,9 +878,6 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
*
*/
private class FinishMiniFuture extends MinFuture {
- /** */
- private static final long serialVersionUID = 0L;
-
/** Keys. */
@GridToStringInclude
private GridDistributedTxMapping m;
@@ -926,7 +923,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
if (!F.isEmpty(backups)) {
final CheckRemoteTxMiniFuture mini;
- synchronized (sync) {
+ synchronized (GridNearTxFinishFuture.this) {
int futId = Integer.MIN_VALUE + futuresCountNoLock();
mini = new CheckRemoteTxMiniFuture(futId, new HashSet<>(backups));
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index 8be87d4..5baec99 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -3946,7 +3946,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter implements AutoClosea
private <T> IgniteInternalFuture<T> nonInterruptable(IgniteInternalFuture<T> fut) {
// Safety.
if (fut instanceof GridFutureAdapter)
- ((GridFutureAdapter)fut).ignoreInterrupts(true);
+ ((GridFutureAdapter)fut).ignoreInterrupts();
return fut;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
index f9a6353..7f1f5a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
@@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import javax.cache.expiry.ExpiryPolicy;
import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.processors.cache.GridCacheCompoundFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException;
import org.apache.ignite.internal.processors.cache.GridCacheMvccFuture;
@@ -35,7 +36,6 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.internal.util.future.GridCompoundFuture;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.CU;
@@ -49,7 +49,7 @@ import static org.apache.ignite.internal.processors.cache.GridCacheOperation.NOO
* Common code for tx prepare in optimistic and pessimistic modes.
*/
public abstract class GridNearTxPrepareFutureAdapter extends
- GridCompoundFuture<GridNearTxPrepareResponse, IgniteInternalTx> implements GridCacheMvccFuture<IgniteInternalTx> {
+ GridCacheCompoundFuture<GridNearTxPrepareResponse, IgniteInternalTx> implements GridCacheMvccFuture<IgniteInternalTx> {
/** Logger reference. */
protected static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
index 8e224c8..d8e95b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
@@ -32,6 +32,7 @@ import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException;
+import org.apache.ignite.internal.processors.cache.GridCacheFutureAdapter;
import org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate;
import org.apache.ignite.internal.processors.cache.GridCacheMvccFuture;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
@@ -41,7 +42,6 @@ import org.apache.ignite.internal.processors.cache.transactions.TxDeadlock;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
import org.apache.ignite.transactions.TransactionDeadlockException;
-import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
@@ -53,7 +53,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Cache lock future.
*/
-public final class GridLocalLockFuture<K, V> extends GridFutureAdapter<Boolean>
+public final class GridLocalLockFuture<K, V> extends GridCacheFutureAdapter<Boolean>
implements GridCacheMvccFuture<Boolean> {
/** */
private static final long serialVersionUID = 0L;
@@ -135,7 +135,7 @@ public final class GridLocalLockFuture<K, V> extends GridFutureAdapter<Boolean>
this.filter = filter;
this.tx = tx;
- ignoreInterrupts(true);
+ ignoreInterrupts();
threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
index 6110e0c..4c8e34f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
@@ -71,7 +71,7 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
assert mgr != null;
- synchronized (mux) {
+ synchronized (this) {
for (ClusterNode node : nodes)
subgrid.add(node.id());
}
@@ -87,7 +87,7 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
Collection<ClusterNode> allNodes = cctx.discovery().allNodes();
Collection<ClusterNode> nodes;
- synchronized (mux) {
+ synchronized (this) {
nodes = F.retain(allNodes, true,
new P1<ClusterNode>() {
@Override public boolean apply(ClusterNode node) {
@@ -139,7 +139,7 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
@Override protected void onNodeLeft(UUID nodeId) {
boolean callOnPage;
- synchronized (mux) {
+ synchronized (this) {
callOnPage = !loc && subgrid.contains(nodeId);
}
@@ -166,7 +166,7 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
/** {@inheritDoc} */
@Override protected boolean onPage(UUID nodeId, boolean last) {
- assert Thread.holdsLock(mux);
+ assert Thread.holdsLock(this);
if (!loc) {
rcvd.add(nodeId);
@@ -192,11 +192,11 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
/** {@inheritDoc} */
@SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
@Override protected void loadPage() {
- assert !Thread.holdsLock(mux);
+ assert !Thread.holdsLock(this);
Collection<ClusterNode> nodes = null;
- synchronized (mux) {
+ synchronized (this) {
if (!isDone() && rcvd.containsAll(subgrid)) {
rcvd.clear();
@@ -211,13 +211,13 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
/** {@inheritDoc} */
@SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
@Override protected void loadAllPages() throws IgniteInterruptedCheckedException {
- assert !Thread.holdsLock(mux);
+ assert !Thread.holdsLock(this);
U.await(firstPageLatch);
Collection<ClusterNode> nodes = null;
- synchronized (mux) {
+ synchronized (this) {
if (!isDone() && !subgrid.isEmpty())
nodes = nodes();
}
@@ -230,7 +230,7 @@ public class GridCacheDistributedQueryFuture<K, V, R> extends GridCacheQueryFutu
* @return Nodes to send requests to.
*/
private Collection<ClusterNode> nodes() {
- assert Thread.holdsLock(mux);
+ assert Thread.holdsLock(this);
Collection<ClusterNode> nodes = new ArrayList<>(subgrid.size());
[13/50] [abbrv] ignite git commit: ignite-3477-master fix stop node
after test
Posted by sb...@apache.org.
ignite-3477-master fix stop node after test
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/10c0364c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/10c0364c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/10c0364c
Branch: refs/heads/ignite-4929
Commit: 10c0364c4a6f5bd90d8dfb3d222b4a5792222c7a
Parents: 2b6826e
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 15:58:41 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 15:58:41 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/near/GridCacheNearTxForceKeyTest.java | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/10c0364c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
index f1c791e..66f34c9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxForceKeyTest.java
@@ -80,4 +80,11 @@ public class GridCacheNearTxForceKeyTest extends GridCommonAbstractTest {
assertTrue(ignite0.affinity(null).isPrimary(ignite1.cluster().localNode(), key));
}
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+
+ stopAllGrids();
+ }
}
[50/50] [abbrv] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-4929
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-4929
# Conflicts:
# modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5609b76a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5609b76a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5609b76a
Branch: refs/heads/ignite-4929
Commit: 5609b76acc90b64594b877cbec79167237a012c1
Parents: 9408ba6 bec4a3e
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 14 11:47:30 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 14 11:47:30 2017 +0300
----------------------------------------------------------------------
assembly/dependencies-fabric.xml | 1 +
assembly/libs/README.txt | 1 +
assembly/release-fabric-base.xml | 6 +
bin/control.bat | 229 +
bin/control.sh | 180 +
examples/pom-standalone-lgpl.xml | 6 +
examples/pom-standalone.xml | 6 +
.../starschema/CacheStarSchemaExample.java | 59 +-
.../jmh/future/JmhFutureAdapterBenchmark.java | 145 +
.../benchmarks/jmh/tree/BPlusTreeBenchmark.java | 325 ++
.../integration/ClientAbstractSelfTest.java | 6 -
.../jdbc2/JdbcComplexQuerySelfTest.java | 82 +-
.../internal/jdbc2/JdbcLocalCachesSelfTest.java | 30 +-
.../internal/jdbc2/JdbcMetadataSelfTest.java | 96 +-
.../jdbc2/JdbcPreparedStatementSelfTest.java | 53 +-
.../rest/ChangeStateCommandHandlerTest.java | 125 +
.../JettyRestProcessorAbstractSelfTest.java | 70 +-
.../ignite/jdbc/JdbcComplexQuerySelfTest.java | 44 +-
.../ignite/jdbc/JdbcMetadataSelfTest.java | 103 +-
.../ignite/codegen/MessageCodeGenerator.java | 2 +
.../src/main/java/org/apache/ignite/Ignite.java | 31 +-
.../java/org/apache/ignite/IgniteCache.java | 24 +-
.../apache/ignite/IgniteCheckedException.java | 12 +
.../apache/ignite/IgniteSystemProperties.java | 51 +
.../java/org/apache/ignite/MemoryMetrics.java | 95 +
.../binary/BinaryAbstractIdentityResolver.java | 53 -
.../binary/BinaryArrayIdentityResolver.java | 224 -
.../binary/BinaryFieldIdentityResolver.java | 307 --
.../ignite/binary/BinaryIdentityResolver.java | 42 -
.../ignite/binary/BinaryTypeConfiguration.java | 25 -
.../apache/ignite/cache/CacheMemoryMode.java | 63 -
.../org/apache/ignite/cache/CacheMetrics.java | 70 -
.../org/apache/ignite/cache/CachePeekMode.java | 6 +-
.../cache/CacheWriteSynchronizationMode.java | 4 +-
.../ignite/cache/PartitionLossPolicy.java | 66 +
.../org/apache/ignite/cache/QueryIndex.java | 21 +
.../affinity/fair/FairAffinityFunction.java | 1158 -----
.../cache/affinity/fair/package-info.java | 21 -
.../rendezvous/RendezvousAffinityFunction.java | 1 +
.../store/jdbc/CacheAbstractJdbcStore.java | 11 +-
.../configuration/CacheConfiguration.java | 501 +-
.../configuration/CollectionConfiguration.java | 22 -
.../configuration/DataPageEvictionMode.java | 44 +
.../configuration/IgniteConfiguration.java | 94 +-
.../configuration/MemoryConfiguration.java | 173 +
.../MemoryPolicyConfiguration.java | 162 +
.../configuration/NearCacheConfiguration.java | 1 -
.../ignite/internal/GridCachePluginContext.java | 13 +-
.../apache/ignite/internal/GridComponent.java | 10 +-
.../internal/GridEventConsumeHandler.java | 5 +-
.../ignite/internal/GridKernalContext.java | 24 +-
.../ignite/internal/GridKernalContextImpl.java | 36 +-
.../internal/GridMessageListenHandler.java | 5 +-
.../ignite/internal/GridPluginComponent.java | 4 +-
.../org/apache/ignite/internal/GridTopic.java | 2 +
.../ignite/internal/IgniteInternalFuture.java | 15 -
.../apache/ignite/internal/IgniteKernal.java | 353 +-
.../ignite/internal/IgniteNodeAttributes.java | 3 +
.../org/apache/ignite/internal/IgnitionEx.java | 41 +-
.../ignite/internal/MarshallerContextImpl.java | 14 +-
.../binary/BinaryAbstractIdentityResolver.java | 56 +
.../binary/BinaryArrayIdentityResolver.java | 222 +
.../ignite/internal/binary/BinaryContext.java | 18 +-
.../internal/binary/BinaryEnumObjectImpl.java | 39 +-
.../ignite/internal/binary/BinaryFieldEx.java | 45 +
.../ignite/internal/binary/BinaryFieldImpl.java | 173 +-
.../internal/binary/BinaryIdentityResolver.java | 43 +
.../ignite/internal/binary/BinaryMetadata.java | 1 +
.../internal/binary/BinaryObjectExImpl.java | 11 +-
.../internal/binary/BinaryObjectImpl.java | 137 +
.../binary/BinaryObjectOffheapImpl.java | 26 +
.../internal/binary/BinaryReaderExImpl.java | 2 +-
.../ignite/internal/binary/BinarySchema.java | 11 +
.../ignite/internal/binary/BinaryUtils.java | 14 +-
.../internal/binary/BinaryWriterExImpl.java | 1 -
.../binary/builder/BinaryBuilderReader.java | 8 +
.../streams/BinaryByteBufferInputStream.java | 301 ++
.../ignite/internal/client/GridClient.java | 9 +
.../internal/client/GridClientClusterState.java | 33 +
.../client/impl/GridClientClusterStateImpl.java | 75 +
.../internal/client/impl/GridClientImpl.java | 11 +
.../impl/connection/GridClientConnection.java | 17 +
.../connection/GridClientNioTcpConnection.java | 21 +
.../router/impl/GridRouterClientImpl.java | 6 +
.../internal/commandline/CommandHandler.java | 89 +
.../internal/managers/GridManagerAdapter.java | 38 +-
.../checkpoint/GridCheckpointManager.java | 2 +-
.../collision/GridCollisionManager.java | 2 +-
.../managers/communication/GridIoManager.java | 26 +-
.../communication/GridIoMessageFactory.java | 40 +-
.../communication/IgniteIoTestMessage.java | 11 +-
.../deployment/GridDeploymentManager.java | 2 +-
.../discovery/GridDiscoveryManager.java | 76 +-
.../eventstorage/GridEventStorageManager.java | 343 +-
.../managers/failover/GridFailoverManager.java | 2 +-
.../managers/indexing/GridIndexingManager.java | 2 +-
.../loadbalancer/GridLoadBalancerManager.java | 2 +-
.../swapspace/GridSwapSpaceManager.java | 417 --
.../managers/swapspace/package-info.java | 22 -
.../ignite/internal/mem/DirectMemory.java | 55 +
.../internal/mem/DirectMemoryProvider.java | 25 +
.../ignite/internal/mem/DirectMemoryRegion.java | 41 +
.../internal/mem/OutOfMemoryException.java | 51 +
.../apache/ignite/internal/mem/UnsafeChunk.java | 66 +
.../ignite/internal/mem/file/MappedFile.java | 152 +
.../mem/file/MappedFileMemoryProvider.java | 225 +
.../mem/unsafe/UnsafeMemoryProvider.java | 89 +
.../ignite/internal/pagemem/FullPageId.java | 157 +
.../internal/pagemem/PageIdAllocator.java | 53 +
.../ignite/internal/pagemem/PageIdUtils.java | 201 +
.../ignite/internal/pagemem/PageMemory.java | 46 +
.../ignite/internal/pagemem/PageSupport.java | 114 +
.../ignite/internal/pagemem/PageUtils.java | 185 +
.../pagemem/impl/PageMemoryNoStoreImpl.java | 663 +++
.../snapshot/SnapshotFinishedMessage.java | 136 +
.../snapshot/SnapshotProgressMessage.java | 135 +
.../StartFullSnapshotAckDiscoveryMessage.java | 147 +
.../StartFullSnapshotDiscoveryMessage.java | 160 +
.../pagemem/store/IgnitePageStoreManager.java | 192 +
.../internal/pagemem/store/PageStore.java | 96 +
.../pagemem/wal/IgniteWriteAheadLogManager.java | 86 +
.../internal/pagemem/wal/StorageException.java | 44 +
.../internal/pagemem/wal/WALIterator.java | 29 +
.../ignite/internal/pagemem/wal/WALPointer.java | 28 +
.../internal/pagemem/wal/record/CacheState.java | 96 +
.../pagemem/wal/record/CheckpointRecord.java | 112 +
.../internal/pagemem/wal/record/DataEntry.java | 171 +
.../internal/pagemem/wal/record/DataRecord.java | 70 +
.../pagemem/wal/record/LazyDataEntry.java | 116 +
.../wal/record/MemoryRecoveryRecord.java | 44 +
.../pagemem/wal/record/PageSnapshot.java | 81 +
.../wal/record/StoreOperationRecord.java | 118 +
.../internal/pagemem/wal/record/TxRecord.java | 111 +
.../internal/pagemem/wal/record/WALRecord.java | 257 +
.../delta/DataPageInsertFragmentRecord.java | 84 +
.../wal/record/delta/DataPageInsertRecord.java | 66 +
.../wal/record/delta/DataPageRemoveRecord.java | 67 +
.../delta/DataPageSetFreeListPageRecord.java | 62 +
.../wal/record/delta/DataPageUpdateRecord.java | 79 +
.../record/delta/DeltaApplicationException.java | 35 +
.../wal/record/delta/FixCountRecord.java | 57 +
.../record/delta/FixLeftmostChildRecord.java | 58 +
.../pagemem/wal/record/delta/FixRemoveId.java | 62 +
.../wal/record/delta/InitNewPageRecord.java | 98 +
.../wal/record/delta/InnerReplaceRecord.java | 96 +
.../pagemem/wal/record/delta/InsertRecord.java | 110 +
.../pagemem/wal/record/delta/MergeRecord.java | 97 +
.../wal/record/delta/MetaPageAddRootRecord.java | 57 +
.../wal/record/delta/MetaPageCutRootRecord.java | 48 +
.../wal/record/delta/MetaPageInitRecord.java | 93 +
.../delta/MetaPageInitRootInlineRecord.java | 62 +
.../record/delta/MetaPageInitRootRecord.java | 61 +
.../delta/MetaPageUpdateLastAllocatedIndex.java | 62 +
...aPageUpdateLastSuccessfulFullSnapshotId.java | 59 +
.../MetaPageUpdateLastSuccessfulSnapshotId.java | 70 +
.../delta/MetaPageUpdateNextSnapshotId.java | 59 +
.../MetaPageUpdatePartitionDataRecord.java | 107 +
.../wal/record/delta/NewRootInitRecord.java | 115 +
.../wal/record/delta/PageDeltaRecord.java | 77 +
.../delta/PageListMetaResetCountRecord.java | 47 +
.../record/delta/PagesListAddPageRecord.java | 73 +
.../delta/PagesListInitNewPageRecord.java | 100 +
.../record/delta/PagesListRemovePageRecord.java | 74 +
.../record/delta/PagesListSetNextRecord.java | 60 +
.../delta/PagesListSetPreviousRecord.java | 60 +
.../record/delta/PartitionMetaStateRecord.java | 82 +
.../pagemem/wal/record/delta/RecycleRecord.java | 55 +
.../pagemem/wal/record/delta/RemoveRecord.java | 82 +
.../pagemem/wal/record/delta/ReplaceRecord.java | 86 +
.../record/delta/SplitExistingPageRecord.java | 76 +
.../record/delta/SplitForwardPageRecord.java | 115 +
.../record/delta/TrackingPageDeltaRecord.java | 85 +
.../processors/GridProcessorAdapter.java | 4 +-
.../affinity/GridAffinityProcessor.java | 2 +-
.../cache/CacheAffinitySharedManager.java | 27 +-
.../cache/CacheClusterMetricsMXBeanImpl.java | 50 -
.../cache/CacheEntryPredicateAdapter.java | 7 +-
.../cache/CacheEvictableEntryImpl.java | 18 +-
.../processors/cache/CacheEvictionManager.java | 63 +
.../cache/CacheInvalidStateException.java | 65 +
.../processors/cache/CacheLazyEntry.java | 2 +-
.../cache/CacheLocalMetricsMXBeanImpl.java | 50 -
.../processors/cache/CacheMetricsImpl.java | 157 +-
.../processors/cache/CacheMetricsSnapshot.java | 120 -
.../internal/processors/cache/CacheObject.java | 33 +
.../processors/cache/CacheObjectAdapter.java | 123 +
.../cache/CacheObjectByteArrayImpl.java | 26 +-
.../processors/cache/CacheObjectImpl.java | 16 +-
.../cache/CacheOffheapEvictionManager.java | 72 +
.../processors/cache/CacheOperationContext.java | 50 +-
.../cache/CacheOsConflictResolutionManager.java | 2 +-
.../cache/ChangeGlobalStateMessage.java | 120 +
.../internal/processors/cache/ClusterState.java | 38 +
.../cache/DynamicCacheChangeRequest.java | 71 +-
.../cache/DynamicCacheDescriptor.java | 17 +
.../processors/cache/GridCacheAdapter.java | 821 ++-
.../cache/GridCacheAffinityManager.java | 2 +-
.../processors/cache/GridCacheAttributes.java | 21 -
.../cache/GridCacheClearAllRunnable.java | 54 +-
.../cache/GridCacheCompoundFuture.java | 63 +
.../cache/GridCacheCompoundIdentityFuture.java | 63 +
.../cache/GridCacheConcurrentMap.java | 10 +-
.../cache/GridCacheConcurrentMapImpl.java | 224 +-
.../processors/cache/GridCacheContext.java | 180 +-
.../cache/GridCacheDeploymentManager.java | 6 +-
.../processors/cache/GridCacheEntryEx.java | 58 +-
.../cache/GridCacheEvictionManager.java | 1822 +------
.../cache/GridCacheEvictionRequest.java | 248 -
.../cache/GridCacheEvictionResponse.java | 225 -
.../processors/cache/GridCacheFuture.java | 15 +
.../cache/GridCacheFutureAdapter.java | 61 +
.../processors/cache/GridCacheIoManager.java | 14 -
.../cache/GridCacheLocalConcurrentMap.java | 54 +
.../processors/cache/GridCacheManager.java | 3 +-
.../cache/GridCacheManagerAdapter.java | 7 +-
.../processors/cache/GridCacheMapEntry.java | 2894 +++++------
.../cache/GridCacheOffheapSwapEntry.java | 191 -
.../GridCachePartitionExchangeManager.java | 155 +-
.../processors/cache/GridCachePreloader.java | 1 +
.../cache/GridCachePreloaderAdapter.java | 1 +
.../processors/cache/GridCacheProcessor.java | 908 ++--
.../processors/cache/GridCacheProxyImpl.java | 95 +-
.../cache/GridCacheSharedContext.java | 106 +-
.../cache/GridCacheSharedManagerAdapter.java | 7 +
.../cache/GridCacheSharedTtlCleanupManager.java | 9 +
.../processors/cache/GridCacheSwapManager.java | 2616 ----------
.../processors/cache/GridCacheTtlManager.java | 120 +-
.../cache/GridCacheUpdateAtomicResult.java | 96 +-
.../processors/cache/GridCacheUtils.java | 30 +-
.../GridChangeGlobalStateMessageResponse.java | 177 +
.../processors/cache/GridNoStorageCacheMap.java | 6 +-
.../cache/IgniteCacheOffheapManager.java | 408 ++
.../cache/IgniteCacheOffheapManagerImpl.java | 2007 ++++++++
.../processors/cache/IgniteCacheProxy.java | 118 +-
.../processors/cache/IgniteInternalCache.java | 100 +-
.../cache/IgniteRebalanceIterator.java | 31 +
.../processors/cache/IncompleteCacheObject.java | 84 +
.../processors/cache/IncompleteObject.java | 89 +
.../binary/CacheObjectBinaryProcessorImpl.java | 22 +-
.../cache/binary/MetadataRequestMessage.java | 2 +
.../cache/binary/MetadataResponseMessage.java | 36 +-
.../processors/cache/database/CacheDataRow.java | 62 +
.../cache/database/CacheDataRowAdapter.java | 578 +++
.../cache/database/CacheSearchRow.java | 40 +
.../cache/database/DataStructure.java | 384 ++
.../IgniteCacheDatabaseSharedManager.java | 717 +++
.../cache/database/MemoryMetricsImpl.java | 314 ++
.../processors/cache/database/MemoryPolicy.java | 84 +
.../processors/cache/database/MetaStore.java | 51 +
.../cache/database/MetadataStorage.java | 417 ++
.../processors/cache/database/RootPage.java | 62 +
.../processors/cache/database/RowStore.java | 91 +
.../evict/FairFifoPageEvictionTracker.java | 74 +
.../database/evict/NoOpPageEvictionTracker.java | 50 +
.../evict/PageAbstractEvictionTracker.java | 243 +
.../database/evict/PageEvictionTracker.java | 52 +
.../evict/Random2LruPageEvictionTracker.java | 180 +
.../evict/RandomLruPageEvictionTracker.java | 157 +
.../cache/database/freelist/FreeList.java | 51 +
.../cache/database/freelist/FreeListImpl.java | 595 +++
.../cache/database/freelist/PagesList.java | 1450 ++++++
.../database/freelist/io/PagesListMetaIO.java | 186 +
.../database/freelist/io/PagesListNodeIO.java | 231 +
.../cache/database/tree/BPlusTree.java | 4754 ++++++++++++++++++
.../cache/database/tree/io/BPlusIO.java | 403 ++
.../cache/database/tree/io/BPlusInnerIO.java | 180 +
.../cache/database/tree/io/BPlusLeafIO.java | 56 +
.../cache/database/tree/io/BPlusMetaIO.java | 182 +
.../cache/database/tree/io/CacheVersionIO.java | 188 +
.../cache/database/tree/io/DataPageIO.java | 1450 ++++++
.../cache/database/tree/io/DataPagePayload.java | 64 +
.../cache/database/tree/io/IOVersions.java | 99 +
.../cache/database/tree/io/PageIO.java | 510 ++
.../cache/database/tree/io/PageMetaIO.java | 217 +
.../database/tree/io/PagePartitionMetaIO.java | 123 +
.../cache/database/tree/io/TrackingPageIO.java | 334 ++
.../cache/database/tree/reuse/ReuseBag.java | 33 +
.../cache/database/tree/reuse/ReuseList.java | 43 +
.../database/tree/reuse/ReuseListImpl.java | 95 +
.../cache/database/tree/util/PageHandler.java | 512 ++
.../database/tree/util/PageLockListener.java | 69 +
.../distributed/GridCacheTxRecoveryFuture.java | 9 +-
.../GridDistributedCacheAdapter.java | 76 +-
.../GridDistributedTxRemoteAdapter.java | 442 +-
.../dht/CacheDistributedGetFutureAdapter.java | 11 +-
.../dht/GridCachePartitionedConcurrentMap.java | 15 +-
.../dht/GridClientPartitionTopology.java | 166 +-
.../distributed/dht/GridDhtCacheAdapter.java | 80 +-
.../distributed/dht/GridDhtCacheEntry.java | 35 +-
.../cache/distributed/dht/GridDhtGetFuture.java | 13 +-
.../distributed/dht/GridDhtGetSingleFuture.java | 13 +-
.../distributed/dht/GridDhtLocalPartition.java | 752 ++-
.../distributed/dht/GridDhtLockFuture.java | 42 +-
.../dht/GridDhtOffHeapCacheEntry.java | 71 -
.../distributed/dht/GridDhtPartitionState.java | 5 +-
.../dht/GridDhtPartitionTopology.java | 63 +-
.../dht/GridDhtPartitionTopologyImpl.java | 652 ++-
.../distributed/dht/GridDhtTopologyFuture.java | 13 +-
.../dht/GridDhtTransactionalCacheAdapter.java | 2 -
.../distributed/dht/GridDhtTxFinishFuture.java | 11 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 26 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 34 +-
.../dht/GridPartitionedGetFuture.java | 30 +-
.../dht/GridPartitionedSingleGetFuture.java | 36 +-
.../GridDhtAtomicAbstractUpdateFuture.java | 4 +-
.../dht/atomic/GridDhtAtomicCache.java | 341 +-
.../dht/atomic/GridDhtAtomicNearResponse.java | 2 +-
.../atomic/GridDhtAtomicOffHeapCacheEntry.java | 71 -
...idNearAtomicAbstractSingleUpdateRequest.java | 2 +
.../GridNearAtomicAbstractUpdateFuture.java | 14 +-
.../GridNearAtomicAbstractUpdateRequest.java | 20 +
.../GridNearAtomicCheckUpdateRequest.java | 2 +-
.../atomic/GridNearAtomicFullUpdateRequest.java | 3 +-
...GridNearAtomicSingleUpdateFilterRequest.java | 2 +
.../GridNearAtomicSingleUpdateFuture.java | 33 +-
...GridNearAtomicSingleUpdateInvokeRequest.java | 2 +
.../GridNearAtomicSingleUpdateRequest.java | 5 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 31 +-
.../atomic/GridNearAtomicUpdateResponse.java | 3 +
.../dht/atomic/NearCacheUpdates.java | 2 +-
.../distributed/dht/atomic/UpdateErrors.java | 2 +-
.../dht/colocated/GridDhtColocatedCache.java | 31 +-
.../colocated/GridDhtColocatedLockFuture.java | 62 +-
.../GridDhtColocatedOffHeapCacheEntry.java | 71 -
.../colocated/GridDhtDetachedCacheEntry.java | 18 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 10 +-
.../GridDhtPartitionDemandMessage.java | 49 +-
.../dht/preloader/GridDhtPartitionDemander.java | 87 +-
.../dht/preloader/GridDhtPartitionMap.java | 13 +-
.../dht/preloader/GridDhtPartitionSupplier.java | 318 +-
.../GridDhtPartitionSupplyMessage.java | 56 +-
.../GridDhtPartitionsAbstractMessage.java | 12 +-
.../GridDhtPartitionsExchangeFuture.java | 585 ++-
.../preloader/GridDhtPartitionsFullMessage.java | 83 +-
.../GridDhtPartitionsSingleMessage.java | 81 +-
.../GridDhtPartitionsSingleRequest.java | 8 +
.../dht/preloader/GridDhtPreloader.java | 77 +-
.../distributed/near/GridNearAtomicCache.java | 2 +
.../distributed/near/GridNearCacheAdapter.java | 57 +-
.../distributed/near/GridNearCacheEntry.java | 22 +-
.../distributed/near/GridNearGetFuture.java | 22 +-
.../distributed/near/GridNearGetRequest.java | 50 +-
.../distributed/near/GridNearLockFuture.java | 34 +-
.../near/GridNearOffHeapCacheEntry.java | 60 -
...arOptimisticSerializableTxPrepareFuture.java | 2 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 11 +-
...ridNearOptimisticTxPrepareFutureAdapter.java | 20 +-
.../GridNearPessimisticTxPrepareFuture.java | 5 +-
.../near/GridNearSingleGetRequest.java | 24 +-
.../near/GridNearTransactionalCache.java | 11 +-
.../near/GridNearTxFinishFuture.java | 13 +-
.../cache/distributed/near/GridNearTxLocal.java | 76 +-
.../near/GridNearTxPrepareFutureAdapter.java | 4 +-
.../distributed/near/GridNearTxRemote.java | 8 +-
.../cache/dr/GridOsCacheDrManager.java | 2 +-
.../extras/GridCacheAttributesEntryExtras.java | 7 +-
.../GridCacheAttributesMvccEntryExtras.java | 5 +-
...dCacheAttributesMvccObsoleteEntryExtras.java | 5 +-
...cheAttributesMvccObsoleteTtlEntryExtras.java | 7 +-
.../GridCacheAttributesMvccTtlEntryExtras.java | 7 +-
.../GridCacheAttributesObsoleteEntryExtras.java | 5 +-
...idCacheAttributesObsoleteTtlEntryExtras.java | 7 +-
.../GridCacheAttributesTtlEntryExtras.java | 7 +-
.../cache/extras/GridCacheMvccEntryExtras.java | 3 +-
.../GridCacheMvccObsoleteEntryExtras.java | 5 +-
.../GridCacheMvccObsoleteTtlEntryExtras.java | 7 +-
.../extras/GridCacheMvccTtlEntryExtras.java | 7 +-
.../extras/GridCacheObsoleteEntryExtras.java | 3 +-
.../extras/GridCacheObsoleteTtlEntryExtras.java | 7 +-
.../cache/extras/GridCacheTtlEntryExtras.java | 5 +-
.../processors/cache/local/GridLocalCache.java | 22 +
.../cache/local/GridLocalCacheEntry.java | 18 -
.../cache/local/GridLocalLockFuture.java | 6 +-
.../local/atomic/GridLocalAtomicCache.java | 56 +-
.../query/GridCacheDistributedQueryFuture.java | 25 +-
.../query/GridCacheQueryFutureAdapter.java | 31 +-
.../cache/query/GridCacheQueryManager.java | 776 +--
.../cache/query/GridCacheQueryResponse.java | 49 +-
.../continuous/CacheContinuousQueryEntry.java | 4 +-
.../continuous/CacheContinuousQueryEvent.java | 3 +-
.../continuous/CacheContinuousQueryHandler.java | 40 +-
.../continuous/CacheContinuousQueryManager.java | 7 +-
.../cache/store/CacheStoreManager.java | 15 +-
.../store/GridCacheStoreManagerAdapter.java | 49 +-
.../cache/transactions/IgniteTxAdapter.java | 16 +-
.../cache/transactions/IgniteTxEntry.java | 4 +-
.../cache/transactions/IgniteTxHandler.java | 128 +-
.../IgniteTxImplicitSingleStateImpl.java | 18 +-
.../transactions/IgniteTxLocalAdapter.java | 42 +-
.../cache/transactions/IgniteTxManager.java | 5 +-
.../IgniteTxRemoteSingleStateImpl.java | 2 +-
.../IgniteTxRemoteStateAdapter.java | 8 +-
.../cache/transactions/IgniteTxState.java | 9 +-
.../cache/transactions/IgniteTxStateImpl.java | 41 +-
.../cache/transactions/TxDeadlockDetection.java | 5 +-
.../processors/cache/transactions/TxLock.java | 2 +
.../cache/version/GridCacheVersionManager.java | 3 +
.../cacheobject/IgniteCacheObjectProcessor.java | 40 +-
.../IgniteCacheObjectProcessorImpl.java | 111 +-
.../clock/GridClockDeltaSnapshot.java | 2 +-
.../clock/GridClockSyncProcessor.java | 8 +-
.../closure/GridClosureProcessor.java | 2 +-
.../processors/cluster/ClusterProcessor.java | 2 +-
.../cluster/GridClusterStateProcessor.java | 947 ++++
.../cluster/IgniteChangeGlobalStateSupport.java | 42 +
.../continuous/GridContinuousHandler.java | 5 +-
.../continuous/GridContinuousProcessor.java | 7 +-
.../StartRoutineAckDiscoveryMessage.java | 13 +-
.../StartRoutineDiscoveryMessage.java | 19 +-
.../datastreamer/DataStreamProcessor.java | 2 +-
.../datastreamer/DataStreamerImpl.java | 102 +-
.../datastructures/DataStructuresProcessor.java | 133 +-
.../datastructures/GridCacheAtomicLongImpl.java | 14 +-
.../GridCacheAtomicReferenceImpl.java | 16 +-
.../GridCacheAtomicSequenceImpl.java | 14 +-
.../GridCacheAtomicStampedImpl.java | 14 +-
.../GridCacheCountDownLatchImpl.java | 14 +-
.../datastructures/GridCacheLockImpl.java | 17 +-
.../datastructures/GridCacheSemaphoreImpl.java | 14 +-
.../internal/processors/hadoop/HadoopJobId.java | 10 +-
.../shuffle/HadoopDirectShuffleMessage.java | 22 +-
.../hadoop/shuffle/HadoopShuffleAck.java | 10 +-
.../hadoop/shuffle/HadoopShuffleMessage.java | 18 +-
.../internal/processors/igfs/IgfsProcessor.java | 24 +-
.../processors/job/GridJobProcessor.java | 2 +-
.../jobmetrics/GridJobMetricsProcessor.java | 2 +-
.../GridMarshallerMappingProcessor.java | 3 +-
.../marshaller/MarshallerMappingTransport.java | 14 +-
.../MissingMappingRequestMessage.java | 4 +
.../MissingMappingResponseMessage.java | 15 +-
.../internal/processors/odbc/OdbcProcessor.java | 11 +-
.../platform/PlatformProcessorImpl.java | 2 +-
.../platform/cache/PlatformCache.java | 10 -
.../platform/compute/PlatformCompute.java | 10 -
.../cache/PlatformCachePluginConfiguration.java | 7 -
.../cache/PlatformCachePluginProvider.java | 8 +-
.../utils/PlatformConfigurationUtils.java | 191 +-
.../processors/plugin/CachePluginManager.java | 20 +-
.../plugin/IgnitePluginProcessor.java | 5 +-
.../processors/port/GridPortProcessor.java | 2 +-
.../query/GridQueryIndexDescriptor.java | 7 +
.../processors/query/GridQueryIndexing.java | 43 +-
.../processors/query/GridQueryProcessor.java | 221 +-
.../query/GridQueryTypeDescriptor.java | 5 +
.../query/QueryIndexDescriptorImpl.java | 11 +-
.../query/QueryTypeDescriptorImpl.java | 36 +-
.../internal/processors/query/QueryUtils.java | 4 +-
.../twostep/messages/GridQueryFailResponse.java | 10 +-
.../query/property/QueryBinaryProperty.java | 4 +-
.../resource/GridResourceProcessor.java | 3 +-
.../processors/rest/GridRestCommand.java | 11 +-
.../processors/rest/GridRestProcessor.java | 7 +-
.../client/message/GridClientStateRequest.java | 80 +
.../cluster/GridChangeStateCommandHandler.java | 90 +
.../tcp/GridTcpMemcachedNioListener.java | 20 +-
.../protocols/tcp/GridTcpRestNioListener.java | 20 +
.../request/GridRestChangeStateRequest.java | 57 +
.../service/GridServiceProcessor.java | 211 +-
.../session/GridTaskSessionProcessor.java | 2 +-
.../processors/task/GridTaskProcessor.java | 6 +-
.../timeout/GridTimeoutProcessor.java | 2 +-
.../apache/ignite/internal/util/GridArrays.java | 116 +
.../util/GridCursorIteratorWrapper.java | 52 +
.../apache/ignite/internal/util/GridDebug.java | 2 +-
.../util/GridMultiCollectionWrapper.java | 186 +
.../ignite/internal/util/GridStringBuilder.java | 19 +
.../apache/ignite/internal/util/GridUnsafe.java | 67 +-
.../apache/ignite/internal/util/IgniteTree.java | 134 +
.../ignite/internal/util/IgniteUtils.java | 194 +-
.../internal/util/OffheapReadWriteLock.java | 661 +++
.../util/future/GridCompoundFuture.java | 45 +-
.../util/future/GridFinishedFuture.java | 13 -
.../internal/util/future/GridFutureAdapter.java | 479 +-
.../internal/util/future/IgniteFutureImpl.java | 10 -
.../util/future/IgniteRemoteMapTask.java | 142 +
.../ignite/internal/util/lang/GridCursor.java | 41 +
.../internal/util/lang/GridTreePrinter.java | 81 +
.../util/nio/GridNioBackPressureControl.java | 39 +-
.../util/nio/GridNioMessageTracker.java | 7 +
.../util/nio/GridNioRecoveryDescriptor.java | 1 +
.../offheap/unsafe/GridOffHeapSnapTreeMap.java | 11 +-
.../internal/util/snaptree/SnapTreeMap.java | 10 +-
.../ignite/internal/util/worker/GridWorker.java | 2 +-
.../internal/visor/VisorTaskArgument.java | 2 +-
.../ignite/internal/visor/cache/VisorCache.java | 209 +-
.../visor/cache/VisorCacheConfiguration.java | 24 -
.../cache/VisorCacheEvictionConfiguration.java | 55 -
.../internal/visor/cache/VisorCacheMetrics.java | 6 +-
.../visor/cache/VisorCachePartition.java | 14 +-
.../visor/cache/VisorCachePartitions.java | 10 +-
.../visor/cache/VisorCachePartitionsTask.java | 25 +-
.../cache/VisorCacheQueryConfiguration.java | 15 +-
.../visor/cache/VisorCacheSwapBackupsTask.java | 102 -
.../visor/compute/VisorGatewayTask.java | 14 +-
.../ignite/internal/visor/igfs/VisorIgfs.java | 2 +-
.../misc/VisorChangeGridActiveStateTask.java | 65 +
.../visor/node/VisorGridConfiguration.java | 11 +
.../visor/node/VisorIgfsConfiguration.java | 30 -
.../visor/node/VisorMemoryConfiguration.java | 115 +
.../node/VisorMemoryPolicyConfiguration.java | 72 +
.../node/VisorNodeDataCollectorJobResult.java | 8 +-
.../visor/node/VisorNodeDataCollectorTask.java | 2 +
.../node/VisorNodeDataCollectorTaskResult.java | 17 +
.../visor/node/VisorSpisConfiguration.java | 11 -
.../internal/visor/query/VisorQueryJob.java | 5 +-
.../internal/visor/util/VisorMimeTypes.java | 12 +-
.../internal/visor/util/VisorTaskUtils.java | 8 +-
.../org/apache/ignite/lang/IgniteFuture.java | 15 -
.../ignite/mxbean/CacheMetricsMXBean.java | 40 -
.../org/apache/ignite/mxbean/IgniteMXBean.java | 29 +-
.../ignite/mxbean/MemoryMetricsMXBean.java | 89 +
.../ignite/plugin/CachePluginConfiguration.java | 7 -
.../ignite/plugin/CachePluginContext.java | 5 -
.../ignite/plugin/CachePluginProvider.java | 4 +-
.../apache/ignite/plugin/PluginProvider.java | 11 +-
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 9 +
.../communication/tcp/TcpCommunicationSpi.java | 65 +-
.../ignite/spi/discovery/DiscoverySpi.java | 11 +-
.../spi/discovery/DiscoverySpiListener.java | 9 +
.../ignite/spi/discovery/tcp/ClientImpl.java | 6 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 52 +-
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 10 +
.../spi/discovery/tcp/TcpDiscoverySpi.java | 92 +-
.../tcp/internal/TcpDiscoveryNode.java | 15 +-
.../tcp/internal/TcpDiscoveryNodesRing.java | 3 +-
.../ignite/spi/swapspace/SwapContext.java | 47 -
.../apache/ignite/spi/swapspace/SwapKey.java | 128 -
.../ignite/spi/swapspace/SwapSpaceSpi.java | 225 -
.../spi/swapspace/SwapSpaceSpiListener.java | 35 -
.../spi/swapspace/file/FileSwapArray.java | 188 -
.../spi/swapspace/file/FileSwapSpaceSpi.java | 2025 --------
.../swapspace/file/FileSwapSpaceSpiMBean.java | 67 -
.../ignite/spi/swapspace/file/package-info.java | 22 -
.../spi/swapspace/noop/NoopSwapSpaceSpi.java | 159 -
.../ignite/spi/swapspace/noop/package-info.java | 22 -
.../ignite/spi/swapspace/package-info.java | 22 -
.../ignite/startup/BasicWarmupClosure.java | 3 +-
.../org/jsr166/ConcurrentLinkedHashMap.java | 2 +-
.../resources/META-INF/classnames.properties | 143 +-
.../core/src/test/config/spring-multicache.xml | 16 +
.../config/websession/example-cache-client.xml | 4 +
.../org.apache.ignite.plugin.PluginProvider | 3 +-
.../GridCacheAffinityBackupsSelfTest.java | 20 +-
.../ignite/IgniteCacheAffinitySelfTest.java | 12 +-
.../ignite/cache/LargeEntryUpdateTest.java | 176 +
.../affinity/AffinityClientNodeSelfTest.java | 15 +-
.../affinity/AffinityHistoryCleanupTest.java | 3 +-
.../fair/FairAffinityDynamicCacheSelfTest.java | 86 -
...airAffinityFunctionBackupFilterSelfTest.java | 44 -
...ffinityFunctionExcludeNeighborsSelfTest.java | 31 -
.../fair/FairAffinityFunctionNodesSelfTest.java | 247 -
.../fair/FairAffinityFunctionSelfTest.java | 31 -
.../affinity/fair/FairAffinityNodesRestart.java | 130 -
.../local/LocalAffinityFunctionTest.java | 4 +-
...ndezvousAffinityFunctionSimpleBenchmark.java | 4 +-
.../IgniteCacheExpiryStoreLoadSelfTest.java | 14 +-
.../CacheJdbcPojoStoreAbstractSelfTest.java | 1 -
.../store/jdbc/CacheJdbcPojoStoreTest.java | 13 +
...eJdbcStoreAbstractMultithreadedSelfTest.java | 1 -
...CacheJdbcBlobStoreMultithreadedSelfTest.java | 1 -
.../internal/ClusterNodeMetricsSelfTest.java | 48 +-
.../internal/GridAffinityNoCacheSelfTest.java | 21 +
.../IgniteSlowClientDetectionSelfTest.java | 6 +
.../MarshallerContextLockingSelfTest.java | 33 +-
.../BinaryArrayIdentityResolverSelfTest.java | 4 -
.../binary/BinaryFieldExtractionSelfTest.java | 161 +
.../BinaryFieldIdentityResolverSelfTest.java | 333 --
...ryIdentityResolverConfigurationSelfTest.java | 138 -
.../BinaryObjectBuilderAdditionalSelfTest.java | 1 -
...naryObjectBuilderDefaultMappersSelfTest.java | 1 -
.../binary/BinaryObjectExceptionSelfTest.java | 209 -
.../mutabletest/GridBinaryTestClasses.java | 9 +
...GridManagerLocalMessageListenerSelfTest.java | 8 +-
.../managers/GridManagerStopSelfTest.java | 18 -
.../managers/GridNoopManagerSelfTest.java | 2 +-
.../GridCommunicationSendMessageSelfTest.java | 1 -
.../GridDeploymentMessageCountSelfTest.java | 10 +
.../GridSwapSpaceCustomLocalValue.java | 85 -
.../swapspace/GridSwapSpaceManagerSelfTest.java | 170 -
.../managers/swapspace/package-info.java | 22 -
.../pagemem/impl/PageIdUtilsSelfTest.java | 146 +
.../pagemem/impl/PageMemoryNoLoadSelfTest.java | 346 ++
.../BinaryObjectOffHeapUnswapTemporaryTest.java | 367 --
.../cache/CacheClientStoreSelfTest.java | 35 +-
.../cache/CacheConfigurationLeakTest.java | 27 +-
.../cache/CacheDeferredDeleteQueueTest.java | 2 +-
...cheDhtLocalPartitionAfterRemoveSelfTest.java | 2 +-
.../cache/CacheEnumOperationsAbstractTest.java | 52 +-
...CacheExchangeMessageDuplicatedStateTest.java | 37 +-
.../cache/CacheGetEntryAbstractTest.java | 8 +-
...erceptorPartitionCounterLocalSanityTest.java | 25 +-
...torPartitionCounterRandomOperationsTest.java | 111 -
.../CacheMemoryPolicyConfigurationTest.java | 164 +
.../cache/CacheNearReaderUpdateTest.java | 24 -
.../cache/CacheOffheapMapEntrySelfTest.java | 61 +-
.../CachePutEventListenerErrorSelfTest.java | 41 +-
.../cache/CacheRebalancingSelfTest.java | 5 +-
.../cache/CacheRemoveAllSelfTest.java | 1 -
.../CacheSerializableTransactionsTest.java | 63 +-
.../cache/CacheStopAndDestroySelfTest.java | 48 +-
.../cache/CacheSwapUnswapGetTest.java | 313 --
.../CacheSwapUnswapGetTestSmallQueueSize.java | 35 -
.../cache/ClusterStateAbstractTest.java | 439 ++
.../cache/ClusterStatePartitionedSelfTest.java | 41 +
.../cache/ClusterStateReplicatedSelfTest.java | 42 +
.../cache/CrossCacheTxRandomOperationsTest.java | 36 +-
.../EntryVersionConsistencyReadThroughTest.java | 6 +-
...idAbstractCacheInterceptorRebalanceTest.java | 38 +-
...ridCacheAbstractByteArrayValuesSelfTest.java | 6 -
.../GridCacheAbstractFailoverSelfTest.java | 4 +
.../cache/GridCacheAbstractFullApiSelfTest.java | 205 +-
.../GridCacheAbstractLocalStoreSelfTest.java | 24 +-
.../cache/GridCacheAbstractMetricsSelfTest.java | 36 +-
.../GridCacheAbstractRemoveFailureTest.java | 29 +-
.../cache/GridCacheAbstractSelfTest.java | 35 +-
.../cache/GridCacheAbstractTxReadTest.java | 2 -
.../cache/GridCacheBasicStoreAbstractTest.java | 6 +-
...acheBasicStoreMultithreadedAbstractTest.java | 1 -
.../cache/GridCacheClearSelfTest.java | 125 +-
...GridCacheConcurrentGetCacheOnClientTest.java | 129 +
.../GridCacheConcurrentTxMultiNodeTest.java | 3 +-
.../GridCacheConditionalDeploymentSelfTest.java | 19 +-
...idCacheConfigurationConsistencySelfTest.java | 41 +-
...ridCacheConfigurationValidationSelfTest.java | 13 -
.../GridCacheDeploymentOffHeapSelfTest.java | 41 -
...ridCacheDeploymentOffHeapValuesSelfTest.java | 41 -
.../cache/GridCacheEntryMemorySizeSelfTest.java | 18 +-
.../GridCacheEvictionEventAbstractTest.java | 8 +-
...idCacheGetAndTransformStoreAbstractTest.java | 1 -
...heInterceptorAtomicOffheapRebalanceTest.java | 30 -
...GridCacheInterceptorAtomicRebalanceTest.java | 6 -
...ceptorTransactionalOffheapRebalanceTest.java | 35 -
...heInterceptorTransactionalRebalanceTest.java | 6 -
.../cache/GridCacheLifecycleAwareSelfTest.java | 1 +
.../cache/GridCacheMemoryModeSelfTest.java | 289 --
.../cache/GridCacheObjectToStringSelfTest.java | 1 +
.../cache/GridCacheOffHeapCleanupTest.java | 169 -
...HeapMultiThreadedUpdateAbstractSelfTest.java | 3 -
.../GridCacheOffHeapTieredAbstractSelfTest.java | 675 ---
.../GridCacheOffHeapTieredAtomicSelfTest.java | 32 -
...heOffHeapTieredEvictionAbstractSelfTest.java | 364 --
...acheOffHeapTieredEvictionAtomicSelfTest.java | 32 -
.../GridCacheOffHeapTieredEvictionSelfTest.java | 33 -
.../cache/GridCacheOffHeapTieredSelfTest.java | 33 -
.../GridCacheOffHeapValuesEvictionSelfTest.java | 210 -
.../cache/GridCacheOffheapUpdateSelfTest.java | 3 -
.../GridCacheOrderedPreloadingSelfTest.java | 48 +-
.../cache/GridCacheP2PUndeploySelfTest.java | 29 +-
.../cache/GridCachePartitionedGetSelfTest.java | 2 -
...chePartitionedOffHeapLocalStoreSelfTest.java | 44 -
.../cache/GridCachePartitionedWritesTest.java | 1 -
.../GridCachePreloadingEvictionsSelfTest.java | 8 +-
.../cache/GridCachePutAllFailoverSelfTest.java | 58 -
.../cache/GridCacheQueryEmbeddedValue.java | 37 +
.../cache/GridCacheReloadSelfTest.java | 4 +-
.../processors/cache/GridCacheStopSelfTest.java | 2 -
...ridCacheStoreManagerDeserializationTest.java | 11 +-
.../cache/GridCacheStoreValueBytesSelfTest.java | 7 +-
.../cache/GridCacheSwapCleanupTest.java | 99 -
.../cache/GridCacheSwapPreloadSelfTest.java | 2 -
.../cache/GridCacheSwapReloadSelfTest.java | 260 -
...ridCacheSwapSpaceSpiConsistencySelfTest.java | 146 -
.../processors/cache/GridCacheTestEntryEx.java | 25 +-
.../GridCacheTtlManagerEvictionSelfTest.java | 52 +-
.../GridCacheValueBytesPreloadingSelfTest.java | 61 +-
...idCacheValueConsistencyAbstractSelfTest.java | 51 +-
.../cache/GridCacheVersionMultinodeTest.java | 6 +-
.../GridCacheVersionTopologyChangeTest.java | 5 -
.../processors/cache/H2CacheStoreStrategy.java | 37 +-
.../cache/IgniteCacheAbstractTest.java | 7 +-
...IgniteCacheAtomicPutAllFailoverSelfTest.java | 5 -
.../IgniteCacheConfigVariationsFullApiTest.java | 282 +-
.../IgniteCacheEntryListenerAbstractTest.java | 11 -
...cheEntryListenerAtomicOffheapTieredTest.java | 32 -
...cheEntryListenerAtomicOffheapValuesTest.java | 32 -
...niteCacheEntryListenerExpiredEventsTest.java | 26 +-
...teCacheEntryListenerTxOffheapTieredTest.java | 32 -
...teCacheEntryListenerTxOffheapValuesTest.java | 32 -
...niteCacheExpireAndUpdateConsistencyTest.java | 37 +-
.../IgniteCacheInterceptorSelfTestSuite.java | 12 +-
.../cache/IgniteCacheInvokeAbstractTest.java | 2 +-
...gniteCacheInvokeReadThroughAbstractTest.java | 4 -
...iteCacheInvokeReadThroughSingleNodeTest.java | 32 +-
.../cache/IgniteCacheInvokeReadThroughTest.java | 92 +-
...gniteCacheLoadRebalanceEvictionSelfTest.java | 3 +-
.../cache/IgniteCacheObjectPutSelfTest.java | 179 +
...gniteCacheP2pUnmarshallingNearErrorTest.java | 4 +-
.../cache/IgniteCachePeekModesAbstractTest.java | 249 +-
.../IgniteCacheReadThroughEvictionSelfTest.java | 12 +-
.../IgniteCacheStoreValueAbstractTest.java | 5 -
.../IgniteCacheTopologySafeGetSelfTest.java | 2 +-
.../cache/IgniteCacheTxNearPeekModesTest.java | 5 +-
.../cache/IgniteCacheTxPeekModesTest.java | 5 +-
.../IgniteClientAffinityAssignmentSelfTest.java | 20 +-
...eDynamicCacheStartNoExchangeTimeoutTest.java | 11 +-
.../IgniteIncompleteCacheObjectSelfTest.java | 186 +
...iteMarshallerCacheClassNameConflictTest.java | 5 +
...lerCacheClientRequestsMappingOnMissTest.java | 94 +-
.../IgniteTxStoreExceptionAbstractSelfTest.java | 4 +-
.../cache/MemoryPolicyConfigValidationTest.java | 241 +
.../cache/OffHeapTieredTransactionSelfTest.java | 135 -
...heapCacheMetricsForClusterGroupSelfTest.java | 3 -
.../cache/OffheapCacheOnClientsTest.java | 143 -
.../GridCacheBinaryObjectsAbstractSelfTest.java | 84 +-
...ntNodeBinaryObjectMetadataMultinodeTest.java | 2 +
.../GridDataStreamerImplSelfTest.java | 8 +-
...AtomicNearDisabledOffheapTieredSelfTest.java | 29 -
...ObjectsAtomicNearDisabledOnheapSelfTest.java | 25 +
...inaryObjectsAtomicOffheapTieredSelfTest.java | 29 -
...dCacheBinaryObjectsAtomicOnheapSelfTest.java | 25 +
...tionedNearDisabledOffheapTieredSelfTest.java | 30 -
...tsPartitionedNearDisabledOnheapSelfTest.java | 25 +
...ObjectsPartitionedOffheapTieredSelfTest.java | 30 -
...eBinaryObjectsPartitionedOnheapSelfTest.java | 25 +
.../dht/GridCacheMemoryModeBinarySelfTest.java | 36 -
...dCacheOffHeapTieredAtomicBinarySelfTest.java | 48 -
.../GridCacheOffHeapTieredBinarySelfTest.java | 48 -
...fHeapTieredEvictionAtomicBinarySelfTest.java | 96 -
...acheOffHeapTieredEvictionBinarySelfTest.java | 96 -
...BinaryObjectsLocalOffheapTieredSelfTest.java | 29 -
...idCacheBinaryObjectsLocalOnheapSelfTest.java | 26 +
.../database/tree/io/TrackingPageIOTest.java | 283 ++
...actQueueFailoverDataConsistencySelfTest.java | 17 +-
.../GridCacheQueueCleanupSelfTest.java | 7 -
...dCacheQueueMultiNodeConsistencySelfTest.java | 7 -
.../IgniteCollectionAbstractTest.java | 7 -
.../IgniteDataStructureUniqueNameTest.java | 7 -
.../GridCacheLocalAtomicOffheapSetSelfTest.java | 32 -
.../GridCacheLocalAtomicQueueApiSelfTest.java | 6 -
.../local/GridCacheLocalAtomicSetSelfTest.java | 7 -
.../GridCacheLocalOffheapQueueApiSelfTest.java | 31 -
.../local/GridCacheLocalQueueApiSelfTest.java | 7 -
.../local/GridCacheLocalSetSelfTest.java | 7 -
...artitionedAtomicOffheapQueueApiSelfTest.java | 32 -
...omicOffheapQueueCreateMultiNodeSelfTest.java | 32 -
...onedAtomicOffheapQueueMultiNodeSelfTest.java | 32 -
...dCachePartitionedAtomicQueueApiSelfTest.java | 7 -
...ionedAtomicQueueCreateMultiNodeSelfTest.java | 7 -
...micQueueFailoverDataConsistencySelfTest.java | 7 -
...PartitionedAtomicQueueMultiNodeSelfTest.java | 7 -
...itionedAtomicQueueRotativeMultiNodeTest.java | 7 -
...chePartitionedAtomicSetFailoverSelfTest.java | 7 -
...rtitionedDataStructuresFailoverSelfTest.java | 7 -
...artitionedOffHeapValuesQueueApiSelfTest.java | 35 -
...achePartitionedOffHeapValuesSetSelfTest.java | 32 -
...edOffheapDataStructuresFailoverSelfTest.java | 33 -
...hePartitionedOffheapSetFailoverSelfTest.java | 32 -
.../GridCachePartitionedQueueApiSelfTest.java | 7 -
...PartitionedQueueCreateMultiNodeSelfTest.java | 7 -
...dCachePartitionedQueueEntryMoveSelfTest.java | 7 -
...nedQueueFailoverDataConsistencySelfTest.java | 7 -
...CachePartitionedQueueJoinedNodeSelfTest.java | 7 -
...dCachePartitionedQueueMultiNodeSelfTest.java | 7 -
...hePartitionedQueueRotativeMultiNodeTest.java | 7 -
...GridCachePartitionedSetFailoverSelfTest.java | 7 -
.../GridCachePartitionedSetSelfTest.java | 7 -
.../IgnitePartitionedQueueNoBackupsTest.java | 7 -
...eplicatedDataStructuresFailoverSelfTest.java | 7 -
.../GridCacheReplicatedQueueApiSelfTest.java | 7 -
...idCacheReplicatedQueueMultiNodeSelfTest.java | 7 -
...cheReplicatedQueueRotativeMultiNodeTest.java | 7 -
.../GridCacheReplicatedSetSelfTest.java | 7 -
.../CacheAtomicPrimarySyncBackPressureTest.java | 165 +
...eLateAffinityAssignmentFairAffinityTest.java | 32 -
.../CacheLateAffinityAssignmentTest.java | 2 +-
...CacheLoadingConcurrentGridStartSelfTest.java | 22 +-
...tractDistributedByteArrayValuesSelfTest.java | 130 +-
.../GridCacheAbstractNodeRestartSelfTest.java | 116 +-
...tractPartitionedByteArrayValuesSelfTest.java | 35 +-
.../GridCacheClientModesAbstractSelfTest.java | 4 +-
.../distributed/GridCacheEventAbstractTest.java | 103 +-
...heExpiredEntriesPreloadAbstractSelfTest.java | 122 -
...dCacheMultithreadedFailoverAbstractTest.java | 1 -
...ridCachePartitionNotLoadedEventSelfTest.java | 19 +-
...GridCachePreloadRestartAbstractSelfTest.java | 12 +-
...ActiveOnStartNodeJoinValidationSelfTest.java | 134 +
.../IgniteCacheAtomicNodeRestartTest.java | 5 -
...niteCacheClientNodeChangingTopologyTest.java | 52 +-
...teCacheClientNodePartitionsExchangeTest.java | 18 +-
.../IgniteCacheNearOffheapGetSelfTest.java | 136 -
.../IgniteCachePartitionLossPolicySelfTest.java | 352 ++
.../IgniteCacheTxFairAffinityNodeJoinTest.java | 35 -
.../IgniteCacheTxIteratorSelfTest.java | 34 +-
...arDisabledFairAffinityPutGetRestartTest.java | 35 -
.../IgniteTxCachePrimarySyncTest.java | 2 +
...teSynchronizationModesMultithreadedTest.java | 5 +-
...xOriginatingNodeFailureAbstractSelfTest.java | 3 +-
...cOriginatingNodeFailureAbstractSelfTest.java | 5 +-
...tPartitionedOnlyByteArrayValuesSelfTest.java | 58 +-
...acheAtomicExpiredEntriesPreloadSelfTest.java | 46 -
.../dht/GridCacheAtomicNearCacheSelfTest.java | 60 +-
.../dht/GridCacheColocatedDebugTest.java | 1 -
...eColocatedOptimisticTransactionSelfTest.java | 4 -
.../dht/GridCacheDhtEntrySelfTest.java | 14 +-
...GridCacheDhtEvictionNearReadersSelfTest.java | 7 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 357 --
.../GridCacheDhtEvictionsDisabledSelfTest.java | 6 +-
...idCacheDhtExpiredEntriesPreloadSelfTest.java | 39 -
.../dht/GridCacheDhtPreloadDelayedSelfTest.java | 2 +-
.../GridCacheDhtPreloadDisabledSelfTest.java | 11 +-
.../dht/GridCacheDhtPreloadOffHeapSelfTest.java | 38 -
.../dht/GridCacheDhtPreloadOnheapSelfTest.java | 26 +
.../dht/GridCacheDhtPreloadSelfTest.java | 43 +-
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 43 -
...NearDisabledAtomicOnheapFullApiSelfTest.java | 38 +
...ledAtomicOnheapMultiNodeFullApiSelfTest.java | 38 +
...ledFairAffinityMultiNodeFullApiSelfTest.java | 36 -
...ionedNearDisabledOffHeapFullApiSelfTest.java | 33 -
...DisabledOffHeapMultiNodeFullApiSelfTest.java | 33 -
...abledOffHeapTieredAtomicFullApiSelfTest.java | 57 -
...earDisabledOffHeapTieredFullApiSelfTest.java | 33 -
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 -
...tionedNearDisabledOnheapFullApiSelfTest.java | 27 +
...rDisabledOnheapMultiNodeFullApiSelfTest.java | 27 +
.../dht/GridCacheTxNodeFailureSelfTest.java | 13 +-
.../dht/IgniteCacheConcurrentPutGetRemove.java | 27 +-
.../IgniteCacheCrossCacheTxFailoverTest.java | 49 +-
.../dht/IgniteCacheMultiTxLockSelfTest.java | 3 +
...artitionedBackupNodeFailureRecoveryTest.java | 16 +-
.../IgniteCachePutRetryAbstractSelfTest.java | 56 +-
.../dht/IgniteCachePutRetryAtomicSelfTest.java | 2 +-
...gniteCachePutRetryTransactionalSelfTest.java | 28 +-
.../AtomicPutAllChangingTopologyTest.java | 4 +-
...eAtomicInvalidPartitionHandlingSelfTest.java | 85 +-
...nlyFairAffinityMultiNodeFullApiSelfTest.java | 36 -
...tomicClientOnlyMultiNodeFullApiSelfTest.java | 116 +-
...micFairAffinityMultiNodeFullApiSelfTest.java | 35 -
...ledFairAffinityMultiNodeFullApiSelfTest.java | 36 -
...eAtomicNearOnlyMultiNodeFullApiSelfTest.java | 52 -
.../GridCacheAtomicOffHeapFullApiSelfTest.java | 67 -
...heAtomicOffHeapMultiNodeFullApiSelfTest.java | 68 -
...CacheAtomicOffHeapTieredFullApiSelfTest.java | 32 -
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 33 -
.../GridCacheAtomicOnheapFullApiSelfTest.java | 28 +
...cheAtomicOnheapMultiNodeFullApiSelfTest.java | 26 +
...derFairAffinityMultiNodeFullApiSelfTest.java | 36 -
...PrimaryWriteOrderOffHeapFullApiSelfTest.java | 32 -
...yWriteOrderOffHeapTieredFullApiSelfTest.java | 33 -
...cPrimaryWriteOrderOnheapFullApiSelfTest.java | 28 +
...riteOrderOnheapMultiNodeFullApiSelfTest.java | 29 +
...ityOrderOffHeapMultiNodeFullApiSelfTest.java | 33 -
...erOffHeapTieredMultiNodeFullApiSelfTest.java | 33 -
...dCacheNearExpiredEntriesPreloadSelfTest.java | 33 -
.../near/GridCacheNearMultiNodeSelfTest.java | 36 +-
.../near/GridCacheNearOneNodeSelfTest.java | 2 +-
...nlyFairAffinityMultiNodeFullApiSelfTest.java | 35 -
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 10 +-
.../near/GridCacheNearReadersSelfTest.java | 36 +-
.../near/GridCacheNearTxForceKeyTest.java | 7 +
...ePartitionedAtomicOnheapFullApiSelfTest.java | 38 +
...nedAtomicOnheapMultiNodeFullApiSelfTest.java | 38 +
...ePartitionedBasicStoreMultiNodeSelfTest.java | 1 -
.../GridCachePartitionedEvictionSelfTest.java | 3 +-
.../GridCachePartitionedFullApiSelfTest.java | 3 -
...achePartitionedMultiNodeCounterSelfTest.java | 12 +-
...achePartitionedMultiNodeFullApiSelfTest.java | 41 -
...ePartitionedMultiThreadedPutGetSelfTest.java | 3 +-
...dCachePartitionedOffHeapFullApiSelfTest.java | 32 -
...titionedOffHeapMultiNodeFullApiSelfTest.java | 32 -
...PartitionedOffHeapTieredFullApiSelfTest.java | 32 -
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 73 -
...idCachePartitionedOnheapFullApiSelfTest.java | 26 +
...rtitionedOnheapMultiNodeFullApiSelfTest.java | 26 +
...achePartitionedPreloadLifecycleSelfTest.java | 1 -
.../GridNearOffheapCacheStoreUpdateTest.java | 35 -
.../near/GridPartitionedBackupLoadSelfTest.java | 4 +-
.../near/IgniteCacheNearOnlyTxTest.java | 12 +-
.../near/NearCachePutAllMultinodeTest.java | 1 -
.../near/NoneRebalanceModeSelfTest.java | 4 +-
.../GridCacheRebalancingSyncSelfTest.java | 26 +-
...eRebalancingUnmarshallingFailedSelfTest.java | 6 +-
...xcludeNeighborsMultiNodeFullApiSelfTest.java | 36 -
...tedFairAffinityMultiNodeFullApiSelfTest.java | 35 -
...stractReplicatedByteArrayValuesSelfTest.java | 30 -
...nedFairAffinityMultiNodeFullApiSelfTest.java | 37 -
.../GridCacheReplicatedEvictionSelfTest.java | 135 -
.../GridCacheReplicatedFullApiSelfTest.java | 9 -
...idCacheReplicatedOffHeapFullApiSelfTest.java | 32 -
...plicatedOffHeapMultiNodeFullApiSelfTest.java | 32 -
...eReplicatedOffHeapTieredFullApiSelfTest.java | 33 -
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 -
...ridCacheReplicatedOnheapFullApiSelfTest.java | 26 +
...eplicatedOnheapMultiNodeFullApiSelfTest.java | 26 +
...idCacheReplicatedUnswapAdvancedSelfTest.java | 6 +-
...CacheReplicatedPreloadLifecycleSelfTest.java | 1 -
...idCacheReplicatedPreloadOffHeapSelfTest.java | 37 -
.../GridCacheReplicatedPreloadSelfTest.java | 25 +-
.../cache/eviction/EvictionAbstractTest.java | 38 +-
.../GridCacheBatchEvictUnswapSelfTest.java | 200 -
...heConcurrentEvictionConsistencySelfTest.java | 8 +-
.../GridCacheConcurrentEvictionsSelfTest.java | 3 +-
.../GridCacheDistributedEvictionsSelfTest.java | 237 -
.../GridCacheEmptyEntriesAbstractSelfTest.java | 6 +-
.../GridCacheEvictableEntryEqualsSelfTest.java | 1 +
.../GridCacheEvictionFilterSelfTest.java | 3 +-
.../GridCacheEvictionLockUnlockSelfTest.java | 1 +
.../GridCacheEvictionTouchSelfTest.java | 14 +-
...cheSynchronousEvictionsFailoverSelfTest.java | 167 -
.../lru/LruNearEvictionPolicySelfTest.java | 28 -
.../LruNearOnlyNearEvictionPolicySelfTest.java | 55 -
.../paged/PageEvictionAbstractTest.java | 124 +
.../paged/PageEvictionMultinodeTest.java | 110 +
.../paged/PageEvictionReadThroughTest.java | 140 +
.../paged/PageEvictionTouchOrderTest.java | 109 +
.../paged/PageEvictionWithRebalanceTest.java | 81 +
.../Random2LruPageEvictionMultinodeTest.java | 30 +
...Random2LruPageEvictionWithRebalanceTest.java | 30 +
.../RandomLruPageEvictionMultinodeTest.java | 30 +
.../RandomLruPageEvictionWithRebalanceTest.java | 30 +
.../cache/eviction/paged/TestObject.java | 78 +
.../SortedEvictionPolicyPerformanceTest.java | 2 +-
...CacheAtomicLocalOffheapExpiryPolicyTest.java | 30 -
...eCacheAtomicLocalOnheapExpiryPolicyTest.java | 26 +
...gniteCacheAtomicOffheapExpiryPolicyTest.java | 30 -
...IgniteCacheAtomicOnheapExpiryPolicyTest.java | 26 +
...rimaryWriteOrderOffheapExpiryPolicyTest.java | 31 -
...maryWriteOrderWithStoreExpiryPolicyTest.java | 2 +-
...teOrderWithStoreOffheapExpiryPolicyTest.java | 31 -
...AtomicReplicatedOffheapExpiryPolicyTest.java | 30 -
...eAtomicWithStoreOffheapExpiryPolicyTest.java | 30 -
.../IgniteCacheClientNearCacheExpiryTest.java | 28 +-
.../IgniteCacheExpiryPolicyAbstractTest.java | 75 +-
.../IgniteCacheExpiryPolicyTestSuite.java | 15 +-
...eCacheExpiryPolicyWithStoreAbstractTest.java | 22 +-
.../expiry/IgniteCacheLargeValueExpireTest.java | 175 +
...niteCacheTxLocalOffheapExpiryPolicyTest.java | 30 -
.../IgniteCacheTxOffheapExpiryPolicyTest.java | 30 -
...acheTxReplicatedOffheapExpiryPolicyTest.java | 30 -
...CacheTxWithStoreOffheapExpiryPolicyTest.java | 30 -
.../IgniteCacheLoadAllAbstractTest.java | 9 +-
...dCacheLocalAtomicOffHeapFullApiSelfTest.java | 42 -
...LocalAtomicOffHeapTieredFullApiSelfTest.java | 32 -
...cheLocalBasicStoreMultithreadedSelfTest.java | 1 +
.../GridCacheLocalByteArrayValuesSelfTest.java | 71 +-
.../local/GridCacheLocalFullApiSelfTest.java | 9 -
.../GridCacheLocalOffHeapFullApiSelfTest.java | 30 -
...dCacheLocalOffHeapTieredFullApiSelfTest.java | 32 -
...LocalCacheOffHeapAndSwapMetricsSelfTest.java | 621 ---
...OnlyFairAffinityMultiJvmFullApiSelfTest.java | 31 -
...omicFairAffinityMultiJvmFullApiSelfTest.java | 31 -
...bledFairAffinityMultiJvmFullApiSelfTest.java | 36 -
...cheAtomicOffHeapMultiJvmFullApiSelfTest.java | 31 -
...micOffHeapTieredMultiJvmFullApiSelfTest.java | 36 -
...acheAtomicOnheapMultiJvmFullApiSelfTest.java | 28 +
...rderFairAffinityMultiJvmFullApiSelfTest.java | 31 -
...WriteOrderOnheapMultiJvmFullApiSelfTest.java | 29 +
...rityOrderOffHeapMultiJvmFullApiSelfTest.java | 31 -
...derOffHeapTieredMultiJvmFullApiSelfTest.java | 36 -
...OnlyFairAffinityMultiJvmFullApiSelfTest.java | 31 -
...onedFairAffinityMultiJvmFullApiSelfTest.java | 31 -
...micOffHeapTieredMultiJvmFullApiSelfTest.java | 36 -
...bledAtomicOnheapMultiJvmFullApiSelfTest.java | 28 +
...bledFairAffinityMultiJvmFullApiSelfTest.java | 31 -
...rDisabledOffHeapMultiJvmFullApiSelfTest.java | 31 -
...ledOffHeapTieredMultiJvmFullApiSelfTest.java | 36 -
...arDisabledOnheapMultiJvmFullApiSelfTest.java | 28 +
...rtitionedOffHeapMultiJvmFullApiSelfTest.java | 31 -
...nedOffHeapTieredMultiJvmFullApiSelfTest.java | 36 -
...artitionedOnheapMultiJvmFullApiSelfTest.java | 28 +
...eplicatedOffHeapMultiJvmFullApiSelfTest.java | 31 -
...tedOffHeapTieredMultiJvmFullApiSelfTest.java | 36 -
...ReplicatedOnheapMultiJvmFullApiSelfTest.java | 28 +
.../GridCacheSwapScanQueryAbstractSelfTest.java | 435 --
.../query/GridCacheSwapScanQuerySelfTest.java | 25 -
.../IgniteCacheQueryCacheDestroySelfTest.java | 2 -
.../continuous/CacheContinuousBatchAckTest.java | 73 +-
...eContinuousQueryAsyncFilterListenerTest.java | 180 +-
...acheContinuousQueryExecuteInPrimaryTest.java | 2 -
...usQueryFactoryFilterRandomOperationTest.java | 2 -
...ContinuousQueryFailoverAbstractSelfTest.java | 16 +-
...tomicPrimaryWriteOrderOffheapTieredTest.java | 33 -
...tinuousQueryFailoverTxOffheapTieredTest.java | 32 -
.../CacheContinuousQueryOperationP2PTest.java | 31 +-
.../CacheContinuousQueryOrderingEventTest.java | 128 +-
...acheContinuousQueryRandomOperationsTest.java | 323 +-
...CacheKeepBinaryIterationNearEnabledTest.java | 6 +-
...acheKeepBinaryIterationStoreEnabledTest.java | 6 +-
...CacheKeepBinaryIterationSwapEnabledTest.java | 56 -
.../CacheKeepBinaryIterationTest.java | 103 +-
...ridCacheContinuousQueryAbstractSelfTest.java | 10 -
...eContinuousQueryAtomicOffheapTieredTest.java | 32 -
...eContinuousQueryAtomicOffheapValuesTest.java | 32 -
.../GridCacheContinuousQueryConcurrentTest.java | 47 +-
...CacheContinuousQueryTxOffheapTieredTest.java | 32 -
...CacheContinuousQueryTxOffheapValuesTest.java | 32 -
...niteCacheContinuousQueryBackupQueueTest.java | 6 +
.../IgniteCacheContinuousQueryClientTest.java | 23 +-
...teCacheContinuousQueryNoUnsubscribeTest.java | 2 +
.../GridCacheWriteBehindStoreAbstractTest.java | 1 -
.../TxOptimisticDeadlockDetectionTest.java | 12 +-
.../TxPessimisticDeadlockDetectionTest.java | 17 +
.../CacheVersionedEntryAbstractTest.java | 4 +-
...edEntryPartitionedAtomicOffHeapSelfTest.java | 35 -
...PartitionedTransactionalOffHeapSelfTest.java | 36 -
...nedEntryReplicatedAtomicOffHeapSelfTest.java | 35 -
...yReplicatedTransactionalOffHeapSelfTest.java | 36 -
.../continuous/GridEventConsumeSelfTest.java | 3 +-
.../database/BPlusTreeFakeReuseSelfTest.java | 63 +
.../database/BPlusTreeReuseSelfTest.java | 131 +
.../processors/database/BPlusTreeSelfTest.java | 1757 +++++++
.../database/FreeListImplSelfTest.java | 557 ++
.../database/IgniteDbAbstractTest.java | 367 ++
.../database/IgniteDbDynamicCacheSelfTest.java | 152 +
.../IgniteDbMemoryLeakAbstractTest.java | 259 +
.../IgniteDbMemoryLeakLargeObjectsTest.java | 56 +
.../IgniteDbMemoryLeakLargePagesTest.java | 33 +
.../IgniteDbMemoryLeakNonTransactionalTest.java | 31 +
.../database/IgniteDbMemoryLeakTest.java | 46 +
.../IgniteDbMemoryLeakWithExpirationTest.java | 44 +
.../database/IgniteDbMultiNodePutGetTest.java | 33 +
.../database/IgniteDbPutGetAbstractTest.java | 1212 +++++
.../database/IgniteDbSingleNodePutGetTest.java | 33 +
.../IgniteDbSingleNodeTinyPutGetTest.java | 151 +
.../database/MemoryMetricsSelfTest.java | 313 ++
.../database/MetadataStorageSelfTest.java | 166 +
.../DataStreamProcessorSelfTest.java | 8 +-
.../IgniteDataStreamerPerformanceTest.java | 1 -
.../igfs/IgfsAbstractBaseSelfTest.java | 18 -
.../processors/igfs/IgfsAbstractSelfTest.java | 11 -
.../IgfsAtomicPrimaryOffheapTieredSelfTest.java | 39 -
.../IgfsAtomicPrimaryOffheapValuesSelfTest.java | 39 -
...sCachePerBlockLruEvictionPolicySelfTest.java | 1 +
.../processors/igfs/IgfsIgniteMock.java | 25 +
.../processors/igfs/IgfsMaxSizeSelfTest.java | 1 -
.../igfs/IgfsPrimaryOffheapTieredSelfTest.java | 33 -
.../igfs/IgfsPrimaryOffheapValuesSelfTest.java | 33 -
.../processors/igfs/IgfsProcessorSelfTest.java | 2 +-
.../odbc/OdbcProcessorValidationSelfTest.java | 23 +-
.../GridServiceProcessorProxySelfTest.java | 24 +-
.../IgniteServiceDynamicCachesSelfTest.java | 2 +
.../internal/util/GridArraysSelfTest.java | 129 +
.../util/future/IgniteFutureImplTest.java | 38 -
.../unsafe/GridUnsafeMemorySelfTest.java | 35 +
.../IgniteOffheapReadWriteLockSelfTest.java | 479 ++
...idFileSwapSpaceSpiMultithreadedLoadTest.java | 252 -
.../loadtests/GridCacheMultiNodeLoadTest.java | 2 +-
.../GridCacheWriteBehindStoreLoadTest.java | 1 -
.../GridCachePartitionedAtomicLongLoadTest.java | 2 +-
.../loadtests/hashmap/GridCacheTestContext.java | 12 +-
.../swap/GridSwapEvictAllBenchmark.java | 309 --
.../marshaller/MarshallerContextSelfTest.java | 10 +-
.../ignite/messaging/GridMessagingSelfTest.java | 13 +-
.../platform/PlatformCacheWriteMetricsTask.java | 126 +-
.../platform/PlatformEventsWriteEventTask.java | 14 +-
.../plugin/PlatformTestPluginProvider.java | 6 +
.../PlatformTestCachePluginConfiguration.java | 5 -
...tCachePluginConfigurationClosureFactory.java | 2 +-
.../cache/PlatformTestCachePluginProvider.java | 5 +-
.../communication/GridCacheMessageSelfTest.java | 2 +-
...cpCommunicationSpiMultithreadedSelfTest.java | 4 +-
.../discovery/AbstractDiscoverySelfTest.java | 15 +
...gniteClientReconnectMassiveShutdownTest.java | 3 -
.../tcp/TcpClientDiscoverySpiSelfTest.java | 2 +-
.../tcp/TestReconnectPluginProvider.java | 7 +
.../GridSwapSpaceSpiAbstractSelfTest.java | 652 ---
.../GridSwapSpaceSpiConsistencySelfTest.java | 131 -
.../file/GridFileSwapCompactionSelfTest.java | 131 -
.../file/GridFileSwapSpaceSpiSelfTest.java | 456 --
.../inmemory/GridTestSwapSpaceSpi.java | 518 --
.../noop/GridNoopSwapSpaceSpiSelfTest.java | 61 -
.../ignite/spi/swapspace/package-info.java | 22 -
.../ignite/testframework/GridTestUtils.java | 210 +-
.../configvariations/ConfigVariations.java | 31 +-
.../testframework/junits/GridAbstractTest.java | 12 +-
.../junits/GridTestKernalContext.java | 2 +-
...IgniteCacheConfigVariationsAbstractTest.java | 59 +-
.../ignite/testframework/junits/IgniteMock.java | 21 +
.../junits/common/GridCommonAbstractTest.java | 304 +-
.../multijvm/IgniteCacheProcessProxy.java | 37 +-
.../junits/multijvm/IgniteNodeRunner.java | 5 +-
.../junits/multijvm/IgniteProcessProxy.java | 35 +
.../ConfigVariationsTestSuiteBuilderTest.java | 4 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 16 +-
.../testsuites/IgniteBinaryCacheTestSuite.java | 22 +-
.../IgniteBinaryObjectsTestSuite.java | 19 -
.../IgniteCacheDataStructuresSelfTestSuite.java | 18 -
.../IgniteCacheEvictionSelfTestSuite.java | 21 +-
.../IgniteCacheFailoverTestSuite.java | 4 -
...IgniteCacheFullApiMultiJvmSelfTestSuite.java | 54 +-
.../IgniteCacheFullApiSelfTestSuite.java | 102 +-
.../IgniteCacheMetricsSelfTestSuite.java | 2 -
.../ignite/testsuites/IgniteCacheTestSuite.java | 64 +-
.../testsuites/IgniteCacheTestSuite2.java | 34 +-
.../testsuites/IgniteCacheTestSuite3.java | 12 +-
.../testsuites/IgniteCacheTestSuite4.java | 52 +-
.../testsuites/IgniteCacheTestSuite5.java | 26 +-
.../testsuites/IgniteComputeGridTestSuite.java | 1 -
.../testsuites/IgniteDatabaseTestSuite.java | 40 +
.../testsuites/IgniteDbMemoryLeakTestSuite.java | 49 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 9 -
.../testsuites/IgniteKernalSelfTestSuite.java | 2 -
.../IgniteSpiSwapSpaceSelfTestSuite.java | 44 -
.../ignite/testsuites/IgniteSpiTestSuite.java | 3 -
.../testsuites/IgniteUtilSelfTestSuite.java | 6 +
.../org.apache.ignite.plugin.PluginProvider | 1 -
...CacheDeploymentCachePluginConfiguration.java | 10 +-
.../apache/ignite/tests/p2p/cache/Person.java | 41 +
.../query/h2/opt/GridH2SpatialIndex.java | 29 +-
.../processors/hadoop/HadoopProcessor.java | 6 +-
.../hadoop/impl/v1/HadoopV1ReduceTask.java | 2 +-
.../external/HadoopExternalTaskExecutor.java | 2 +-
.../resources/META-INF/classnames.properties | 8 +-
.../impl/HadoopAbstractMapReduceTest.java | 1 -
.../igfs/HadoopFIleSystemFactorySelfTest.java | 1 -
.../igfs/HadoopIgfsDualAbstractSelfTest.java | 1 -
.../HibernateAccessStrategyAdapter.java | 8 +-
.../cache/hibernate/HibernateCacheProxy.java | 811 +++
.../hibernate/HibernateCollectionRegion.java | 3 +-
.../cache/hibernate/HibernateEntityRegion.java | 3 +-
.../hibernate/HibernateGeneralDataRegion.java | 3 +-
.../hibernate/HibernateKeyTransformer.java | 28 +
.../cache/hibernate/HibernateKeyWrapper.java | 72 +
.../hibernate/HibernateNaturalIdRegion.java | 3 +-
.../HibernateNonStrictAccessStrategy.java | 5 +-
.../hibernate/HibernateQueryResultsRegion.java | 3 +-
.../HibernateReadOnlyAccessStrategy.java | 3 +-
.../HibernateReadWriteAccessStrategy.java | 3 +-
.../ignite/cache/hibernate/HibernateRegion.java | 6 +-
.../cache/hibernate/HibernateRegionFactory.java | 30 +-
.../hibernate/HibernateTimestampsRegion.java | 3 +-
.../HibernateTransactionalAccessStrategy.java | 2 +-
.../HibernateTransactionalDataRegion.java | 3 +-
.../hibernate/HibernateL2CacheSelfTest.java | 2 +-
.../IgniteBinaryHibernateTestSuite.java | 37 +
modules/hibernate5/README.txt | 48 +
modules/hibernate5/licenses/apache-2.0.txt | 202 +
modules/hibernate5/pom.xml | 146 +
.../HibernateAbstractRegionAccessStrategy.java | 99 +
.../HibernateAccessStrategyAdapter.java | 379 ++
.../cache/hibernate/HibernateCacheProxy.java | 811 +++
.../hibernate/HibernateCollectionRegion.java | 114 +
.../cache/hibernate/HibernateEntityRegion.java | 129 +
.../hibernate/HibernateGeneralDataRegion.java | 72 +
.../hibernate/HibernateKeyTransformer.java | 28 +
.../cache/hibernate/HibernateKeyWrapper.java | 108 +
.../hibernate/HibernateNaturalIdRegion.java | 113 +
.../HibernateNonStrictAccessStrategy.java | 222 +
.../hibernate/HibernateQueryResultsRegion.java | 70 +
.../HibernateReadOnlyAccessStrategy.java | 107 +
.../HibernateReadWriteAccessStrategy.java | 328 ++
.../ignite/cache/hibernate/HibernateRegion.java | 99 +
.../cache/hibernate/HibernateRegionFactory.java | 255 +
.../hibernate/HibernateTimestampsRegion.java | 39 +
.../HibernateTransactionalAccessStrategy.java | 141 +
.../HibernateTransactionalDataRegion.java | 107 +
.../ignite/cache/hibernate/package-info.java | 24 +
.../hibernate/CacheHibernateBlobStore.java | 542 ++
.../CacheHibernateBlobStoreEntry.hbm.xml | 31 +
.../hibernate/CacheHibernateBlobStoreEntry.java | 89 +
.../CacheHibernateBlobStoreFactory.java | 235 +
.../CacheHibernateStoreSessionListener.java | 223 +
.../cache/store/hibernate/package-info.java | 22 +
.../src/test/config/factory-cache.xml | 59 +
.../src/test/config/factory-cache1.xml | 61 +
.../config/factory-incorrect-store-cache.xml | 56 +
.../HibernateL2CacheConfigurationSelfTest.java | 409 ++
.../hibernate/HibernateL2CacheSelfTest.java | 1948 +++++++
.../HibernateL2CacheTransactionalSelfTest.java | 154 +
...nateL2CacheTransactionalUseSyncSelfTest.java | 31 +
.../CacheHibernateBlobStoreNodeRestartTest.java | 54 +
.../CacheHibernateBlobStoreSelfTest.java | 113 +
.../CacheHibernateStoreFactorySelfTest.java | 326 ++
...heHibernateStoreSessionListenerSelfTest.java | 241 +
.../cache/store/hibernate/hibernate.cfg.xml | 42 +
.../cache/store/hibernate/package-info.java | 22 +
.../IgniteBinaryHibernate5TestSuite.java | 37 +
.../testsuites/IgniteHibernate5TestSuite.java | 57 +
.../query/h2/DmlStatementsProcessor.java | 2 +-
.../internal/processors/query/h2/H2Cursor.java | 108 +
.../processors/query/h2/IgniteH2Indexing.java | 421 +-
.../query/h2/database/H2PkHashIndex.java | 323 ++
.../query/h2/database/H2RowFactory.java | 80 +
.../processors/query/h2/database/H2Tree.java | 250 +
.../query/h2/database/H2TreeIndex.java | 420 ++
.../query/h2/database/InlineIndexHelper.java | 572 +++
.../query/h2/database/io/H2ExtrasInnerIO.java | 140 +
.../query/h2/database/io/H2ExtrasLeafIO.java | 135 +
.../query/h2/database/io/H2InnerIO.java | 74 +
.../query/h2/database/io/H2LeafIO.java | 74 +
.../query/h2/database/io/H2RowLinkIO.java | 30 +
.../query/h2/database/util/CompareUtils.java | 332 ++
.../query/h2/opt/GridH2AbstractKeyValueRow.java | 8 +-
.../query/h2/opt/GridH2IndexBase.java | 215 +-
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 2 +-
.../query/h2/opt/GridH2KeyValueRowOnheap.java | 8 +
.../query/h2/opt/GridH2MetaTable.java | 5 +
.../processors/query/h2/opt/GridH2Row.java | 66 +-
.../query/h2/opt/GridH2RowDescriptor.java | 13 +-
.../query/h2/opt/GridH2RowFactory.java | 15 +
.../query/h2/opt/GridH2ScanIndex.java | 55 +-
.../processors/query/h2/opt/GridH2Table.java | 200 +-
.../query/h2/opt/GridH2TreeIndex.java | 223 +-
.../query/h2/opt/GridLuceneIndex.java | 5 +-
.../h2/twostep/GridReduceQueryExecutor.java | 28 +-
.../cache/CacheIndexStreamerTest.java | 6 -
.../cache/CacheIndexingOffheapCleanupTest.java | 157 -
.../CacheOffheapBatchIndexingBaseTest.java | 6 +-
.../CacheOffheapBatchIndexingMultiTypeTest.java | 17 +-
...CacheOffheapBatchIndexingSingleTypeTest.java | 20 +-
.../CacheOperationsWithExpirationTest.java | 69 +-
.../cache/CacheQueryEvictDataLostTest.java | 120 +
.../cache/CacheQueryFilterExpiredTest.java | 111 +
.../CacheQueryOffheapEvictDataLostTest.java | 138 -
.../CacheRandomOperationsMultithreadedTest.java | 64 +-
.../ClientReconnectAfterClusterRestartTest.java | 16 +-
.../cache/GridCacheCrossCacheQuerySelfTest.java | 36 +-
.../cache/GridCacheOffHeapAndSwapSelfTest.java | 570 ---
.../cache/GridCacheOffHeapSelfTest.java | 16 +-
.../GridCacheOffheapIndexEntryEvictTest.java | 7 -
.../cache/GridCacheOffheapIndexGetSelfTest.java | 38 +-
.../GridCacheQueryIndexDisabledSelfTest.java | 16 +-
.../cache/GridCacheQuerySimpleBenchmark.java | 4 -
.../processors/cache/GridCacheSwapSelfTest.java | 724 ---
.../cache/GridIndexingWithNoopSwapSelfTest.java | 7 +-
.../IgniteBinaryObjectFieldsQuerySelfTest.java | 5 +-
...aryObjectQueryArgumentsOffheapLocalTest.java | 28 -
...teBinaryObjectQueryArgumentsOffheapTest.java | 30 -
.../IgniteBinaryObjectQueryArgumentsTest.java | 11 -
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 492 +-
...niteCacheAbstractInsertSqlQuerySelfTest.java | 129 -
.../cache/IgniteCacheAbstractQuerySelfTest.java | 273 +-
.../IgniteCacheCollocatedQuerySelfTest.java | 1 -
...acheConfigurationPrimitiveTypesSelfTest.java | 50 +-
.../IgniteCacheCrossCacheJoinRandomTest.java | 2 +-
...CacheDistributedJoinQueryConditionsTest.java | 16 -
.../IgniteCacheInsertSqlQuerySelfTest.java | 36 -
...PartitionedAndReplicatedCollocationTest.java | 5 +-
.../cache/IgniteCacheLargeResultSelfTest.java | 1 -
...niteCacheLockPartitionOnAffinityRunTest.java | 35 +-
.../cache/IgniteCacheMergeSqlQuerySelfTest.java | 34 -
.../IgniteCacheMultipleIndexedTypesTest.java | 200 +
.../cache/IgniteCacheOffheapEvictQueryTest.java | 10 -
.../cache/IgniteCacheOffheapIndexScanTest.java | 3 -
...CacheOffheapTieredMultithreadedSelfTest.java | 302 --
.../cache/IgniteCacheQueriesLoadTest1.java | 2 -
...QueryMultiThreadedOffHeapTieredSelfTest.java | 38 -
.../IgniteCacheQueryMultiThreadedSelfTest.java | 122 +-
...QueryOffheapEvictsMultiThreadedSelfTest.java | 28 -
...eCacheQueryOffheapMultiThreadedSelfTest.java | 28 -
.../cache/IgniteCacheUnionDuplicatesTest.java | 21 +-
.../cache/IgniteCrossCachesJoinsQueryTest.java | 25 +-
.../cache/IncorrectQueryEntityTest.java | 8 +-
.../cache/SqlFieldsQuerySelfTest.java | 23 -
...niteCachePartitionedFieldsQuerySelfTest.java | 13 +-
.../IgniteCachePartitionedQuerySelfTest.java | 8 +-
...QueryNodeRestartDistributedJoinSelfTest.java | 165 +-
.../IgniteCacheQueryNodeRestartSelfTest.java | 3 +-
...gniteCacheReplicatedFieldsQuerySelfTest.java | 6 +-
.../IgniteCacheReplicatedQuerySelfTest.java | 25 +-
.../IgniteCacheLocalFieldsQuerySelfTest.java | 4 +-
.../local/IgniteCacheLocalQuerySelfTest.java | 2 +-
.../cache/ttl/CacheTtlAbstractSelfTest.java | 31 +-
.../ttl/CacheTtlAtomicAbstractSelfTest.java | 29 +
.../cache/ttl/CacheTtlAtomicLocalSelfTest.java | 34 +
.../ttl/CacheTtlAtomicPartitionedSelfTest.java | 34 +
.../ttl/CacheTtlOffheapAbstractSelfTest.java | 29 -
.../CacheTtlOffheapAtomicAbstractSelfTest.java | 29 -
.../ttl/CacheTtlOffheapAtomicLocalSelfTest.java | 34 -
...acheTtlOffheapAtomicPartitionedSelfTest.java | 34 -
...TtlOffheapTransactionalAbstractSelfTest.java | 29 -
...cheTtlOffheapTransactionalLocalSelfTest.java | 34 -
...OffheapTransactionalPartitionedSelfTest.java | 34 -
.../ttl/CacheTtlOnheapAbstractSelfTest.java | 29 -
.../CacheTtlOnheapAtomicAbstractSelfTest.java | 29 -
.../ttl/CacheTtlOnheapAtomicLocalSelfTest.java | 34 -
...CacheTtlOnheapAtomicPartitionedSelfTest.java | 34 -
...eTtlOnheapTransactionalAbstractSelfTest.java | 29 -
...acheTtlOnheapTransactionalLocalSelfTest.java | 34 -
...lOnheapTransactionalPartitionedSelfTest.java | 34 -
.../CacheTtlTransactionalAbstractSelfTest.java | 29 +
.../ttl/CacheTtlTransactionalLocalSelfTest.java | 34 +
...acheTtlTransactionalPartitionedSelfTest.java | 34 +
.../database/IgniteDbMemoryLeakIndexedTest.java | 33 +
.../IgniteDbMemoryLeakSqlQueryTest.java | 76 +
...IgniteDbMultiNodeWithIndexingPutGetTest.java | 28 +
...gniteDbSingleNodeWithIndexingPutGetTest.java | 251 +
.../query/IgniteSqlDistributedJoinSelfTest.java | 199 +
.../query/IgniteSqlSchemaIndexingTest.java | 17 +-
.../query/IgniteSqlSegmentedIndexSelfTest.java | 7 +-
.../query/IgniteSqlSplitterSelfTest.java | 92 +-
.../h2/GridIndexingSpiAbstractSelfTest.java | 254 +-
.../query/h2/IgniteSqlQueryMinMaxTest.java | 376 ++
.../h2/database/InlineIndexHelperTest.java | 364 ++
.../query/h2/opt/GridH2TableSelfTest.java | 87 +-
.../h2/sql/AbstractH2CompareQueryTest.java | 75 +-
.../query/h2/sql/BaseH2CompareQueryTest.java | 346 +-
.../query/h2/sql/GridQueryParsingTest.java | 168 +-
.../query/h2/sql/H2CompareBigQueryTest.java | 114 +-
.../IgniteCacheQuerySelfTestSuite.java | 31 +-
.../IgniteCacheQuerySelfTestSuite2.java | 10 +-
.../IgniteCacheQuerySelfTestSuite3.java | 12 +-
.../IgniteCacheQuerySelfTestSuite4.java | 4 -
.../IgniteCacheWithIndexingTestSuite.java | 32 +-
...IgniteDbMemoryLeakWithIndexingTestSuite.java | 40 +
.../IgniteDistributedJoinTestSuite.java | 55 +
.../processors/query/h2/sql/bigQuery.sql | 14 +-
.../ignite/stream/kafka/TestKafkaBroker.java | 2 +-
modules/osgi/pom.xml | 1 -
modules/platforms/.gitignore | 31 +
modules/platforms/cpp/binary/Makefile.am | 1 -
.../platforms/cpp/binary/include/Makefile.am | 3 -
.../binary/binary_array_identity_resolver.h | 64 -
.../include/ignite/binary/binary_consts.h | 86 +-
.../include/ignite/binary/binary_containers.h | 12 +-
.../ignite/binary/binary_identity_resolver.h | 61 -
.../include/ignite/binary/binary_object.h | 12 +-
.../include/ignite/binary/binary_raw_reader.h | 6 +-
.../include/ignite/binary/binary_raw_writer.h | 16 +-
.../include/ignite/binary/binary_reader.h | 6 +-
.../binary/include/ignite/binary/binary_type.h | 10 -
.../include/ignite/binary/binary_writer.h | 13 +-
.../ignite/impl/binary/binary_reader_impl.h | 31 +-
.../include/ignite/impl/binary/binary_schema.h | 19 +-
.../ignite/impl/binary/binary_type_impl.h | 147 -
.../include/ignite/impl/binary/binary_utils.h | 1 -
.../ignite/impl/binary/binary_writer_impl.h | 26 +-
.../cpp/binary/project/vs/binary.vcxproj | 4 -
.../binary/project/vs/binary.vcxproj.filters | 12 -
.../binary/binary_array_identity_resolver.cpp | 42 -
.../cpp/binary/src/binary/binary_raw_reader.cpp | 2 +-
.../cpp/binary/src/binary/binary_reader.cpp | 2 +-
.../src/impl/binary/binary_reader_impl.cpp | 50 +-
.../binary/src/impl/binary/binary_schema.cpp | 17 +-
.../src/impl/binary/binary_writer_impl.cpp | 14 +-
modules/platforms/cpp/common/configure.ac | 62 +
.../cpp/core-test/config/cache-identity-32.xml | 50 +
.../core-test/config/cache-identity-default.xml | 154 +
.../cpp/core-test/config/cache-identity.xml | 124 +-
.../cpp/core-test/config/cache-query-32.xml | 50 +
.../config/cache-query-continuous-32.xml | 46 +
.../config/cache-query-continuous-default.xml | 87 +
.../core-test/config/cache-query-continuous.xml | 61 +-
.../core-test/config/cache-query-default.xml | 153 +
.../cpp/core-test/config/cache-query.xml | 123 +-
.../cpp/core-test/config/cache-store-32.xml | 50 +
.../core-test/config/cache-store-default.xml | 71 +
.../cpp/core-test/config/cache-store.xml | 41 +-
.../cpp/core-test/config/cache-test-32.xml | 50 +
.../cpp/core-test/config/cache-test-default.xml | 136 +
.../cpp/core-test/config/cache-test.xml | 106 +-
modules/platforms/cpp/core-test/configure.ac | 62 +
.../core-test/include/ignite/binary_test_defs.h | 31 +-
.../cpp/core-test/include/ignite/complex_type.h | 2 -
.../cpp/core-test/include/ignite/test_type.h | 1 -
.../cpp/core-test/project/vs/core-test.vcxproj | 15 +
.../project/vs/core-test.vcxproj.filters | 33 +
.../src/binary_identity_resolver_test.cpp | 246 +-
.../cpp/core-test/src/binary_object_test.cpp | 8 +
.../src/binary_reader_writer_raw_test.cpp | 34 +-
.../core-test/src/binary_reader_writer_test.cpp | 96 +-
.../cpp/core-test/src/cache_invoke_test.cpp | 7 +-
.../cpp/core-test/src/cache_query_test.cpp | 6 +-
.../cpp/core-test/src/cache_store_test.cpp | 17 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 86 +-
.../cpp/core-test/src/cluster_test.cpp | 4 +
.../cpp/core-test/src/continuous_query_test.cpp | 26 +-
.../cpp/core-test/src/ignition_test.cpp | 4 +
.../cpp/core-test/src/interop_test.cpp | 4 +
.../cpp/core-test/src/transactions_test.cpp | 80 +-
modules/platforms/cpp/core/configure.ac | 62 +
.../cpp/core/include/ignite/cache/cache.h | 12 +-
.../core/include/ignite/cache/cache_peek_mode.h | 67 +-
.../cpp/core/include/ignite/ignite_binding.h | 4 +-
.../cpp/core/include/ignite/impl/bindings.h | 4 +-
.../impl/cache/cache_entry_processor_holder.h | 37 +-
.../include/ignite/impl/ignite_binding_impl.h | 11 +-
.../ignite/impl/interop/interop_target.h | 21 +-
.../core/include/ignite/impl/module_manager.h | 26 +
.../ignite/impl/transactions/transaction_impl.h | 4 +-
.../impl/transactions/transactions_impl.h | 10 +-
.../include/ignite/transactions/transaction.h | 12 +-
.../ignite/transactions/transaction_consts.h | 181 +-
.../include/ignite/transactions/transactions.h | 16 +-
.../impl/binary/binary_type_updater_impl.cpp | 17 +-
.../continuous/continuous_query_handle_impl.cpp | 13 +-
.../src/impl/cluster/cluster_group_impl.cpp | 9 +-
.../cpp/core/src/impl/ignite_environment.cpp | 42 +-
.../core/src/impl/interop/interop_target.cpp | 12 +-
.../src/impl/transactions/transaction_impl.cpp | 18 +-
.../src/impl/transactions/transactions_impl.cpp | 92 +-
.../cpp/core/src/transactions/transaction.cpp | 8 +-
.../cpp/core/src/transactions/transactions.cpp | 20 +-
.../examples/include/ignite/examples/address.h | 26 +-
.../include/ignite/examples/organization.h | 26 +-
.../examples/include/ignite/examples/person.h | 17 +-
modules/platforms/cpp/ignite/configure.ac | 62 +
.../cpp/odbc-test/config/queries-test-32.xml | 47 +
.../odbc-test/config/queries-test-default.xml | 38 +
.../odbc-test/config/queries-test-noodbc-32.xml | 47 +
.../cpp/odbc-test/config/queries-test.xml | 11 +-
.../cpp/odbc-test/include/complex_type.h | 2 -
.../platforms/cpp/odbc-test/include/test_type.h | 1 -
.../cpp/odbc-test/project/vs/odbc-test.vcxproj | 3 +
.../project/vs/odbc-test.vcxproj.filters | 6 +
.../cpp/odbc-test/src/api_robustness_test.cpp | 20 +-
.../src/application_data_buffer_test.cpp | 94 +-
.../platforms/cpp/odbc-test/src/column_test.cpp | 56 +-
.../cpp/odbc-test/src/connection_info_test.cpp | 72 +-
.../cpp/odbc-test/src/queries_test.cpp | 8 +
.../platforms/cpp/odbc-test/src/row_test.cpp | 16 +-
.../odbc-test/src/sql_test_suite_fixture.cpp | 6 +-
.../ignite/odbc/app/application_data_buffer.h | 6 +-
.../cpp/odbc/include/ignite/odbc/column.h | 2 +-
.../cpp/odbc/include/ignite/odbc/common_types.h | 350 +-
.../ignite/odbc/config/connection_info.h | 2 +-
.../cpp/odbc/include/ignite/odbc/connection.h | 18 +-
.../ignite/odbc/diagnostic/diagnosable.h | 4 +-
.../odbc/diagnostic/diagnosable_adapter.h | 8 +-
.../ignite/odbc/diagnostic/diagnostic_record.h | 4 +-
.../odbc/diagnostic/diagnostic_record_storage.h | 8 +-
.../cpp/odbc/include/ignite/odbc/environment.h | 10 +-
.../cpp/odbc/include/ignite/odbc/message.h | 56 +-
.../ignite/odbc/query/column_metadata_query.h | 10 +-
.../odbc/include/ignite/odbc/query/data_query.h | 23 +-
.../ignite/odbc/query/foreign_keys_query.h | 8 +-
.../ignite/odbc/query/primary_keys_query.h | 8 +-
.../cpp/odbc/include/ignite/odbc/query/query.h | 32 +-
.../ignite/odbc/query/special_columns_query.h | 8 +-
.../ignite/odbc/query/table_metadata_query.h | 10 +-
.../include/ignite/odbc/query/type_info_query.h | 8 +-
.../cpp/odbc/include/ignite/odbc/row.h | 2 +-
.../cpp/odbc/include/ignite/odbc/statement.h | 52 +-
.../odbc/system/ui/dsn_configuration_window.h | 35 +-
.../cpp/odbc/include/ignite/odbc/type_traits.h | 91 +-
.../ignite/odbc/system/ui/custom_window.h | 12 +-
.../odbc/os/win/src/system/ui/custom_window.cpp | 4 +-
.../src/system/ui/dsn_configuration_window.cpp | 42 +-
.../cpp/odbc/os/win/src/system_dsn.cpp | 2 +-
.../odbc/src/app/application_data_buffer.cpp | 386 +-
.../platforms/cpp/odbc/src/app/parameter.cpp | 6 +-
modules/platforms/cpp/odbc/src/column.cpp | 14 +-
modules/platforms/cpp/odbc/src/common_types.cpp | 54 +-
.../cpp/odbc/src/config/connection_info.cpp | 12 +-
modules/platforms/cpp/odbc/src/connection.cpp | 74 +-
.../odbc/src/diagnostic/diagnosable_adapter.cpp | 4 +-
.../odbc/src/diagnostic/diagnostic_record.cpp | 46 +-
.../diagnostic/diagnostic_record_storage.cpp | 78 +-
modules/platforms/cpp/odbc/src/environment.cpp | 62 +-
modules/platforms/cpp/odbc/src/odbc.cpp | 20 +-
.../odbc/src/query/column_metadata_query.cpp | 123 +-
.../platforms/cpp/odbc/src/query/data_query.cpp | 102 +-
.../cpp/odbc/src/query/foreign_keys_query.cpp | 26 +-
.../cpp/odbc/src/query/primary_keys_query.cpp | 71 +-
.../odbc/src/query/special_columns_query.cpp | 26 +-
.../cpp/odbc/src/query/table_metadata_query.cpp | 81 +-
.../cpp/odbc/src/query/type_info_query.cpp | 231 +-
modules/platforms/cpp/odbc/src/row.cpp | 4 +-
modules/platforms/cpp/odbc/src/statement.cpp | 258 +-
modules/platforms/cpp/odbc/src/type_traits.cpp | 46 +-
.../Apache.Ignite.Core.Tests.csproj | 1 -
.../Binary/BinaryBuilderSelfTest.cs | 4 +-
.../Binary/BinaryDynamicRegistrationTest.cs | 11 +-
.../Binary/BinaryEqualityComparerTest.cs | 220 +-
.../Binary/BinarySelfTest.cs | 4 +-
.../Affinity/AffinityFunctionSpringTest.cs | 6 +-
.../Cache/Affinity/AffinityFunctionTest.cs | 92 +-
.../Cache/CacheAbstractTest.cs | 17 +-
.../Cache/CacheConfigurationTest.cs | 40 +-
.../Cache/CacheMetricsTest.cs | 96 +-
.../Cache/CacheSwapSpaceTest.cs | 122 -
.../Cache/Query/CacheDmlQueriesTest.cs | 13 +-
.../Cache/Query/CacheLinqTest.cs | 3 +-
.../Continuous/ContinuousQueryAbstractTest.cs | 41 +-
.../Cache/Store/CacheStoreTest.cs | 20 +-
.../Compute/ComputeApiTest.cs | 8 +-
.../Config/Cache/Affinity/affinity-function.xml | 4 +-
.../Config/native-client-test-cache.xml | 5 -
.../Apache.Ignite.Core.Tests/EventsTest.cs | 38 +-
.../IgniteConfigurationSerializerTest.cs | 54 +-
.../IgniteConfigurationTest.cs | 29 +-
.../Apache.Ignite.Core.Tests/TestUtils.cs | 21 +
.../Apache.Ignite.Core.csproj | 12 +-
.../Binary/BinaryArrayEqualityComparer.cs | 160 -
.../Binary/BinaryConfiguration.cs | 24 +-
.../Binary/BinaryTypeConfiguration.cs | 14 -
.../Cache/Affinity/Fair/FairAffinityFunction.cs | 32 -
.../Cache/Affinity/Fair/Package-Info.cs | 26 -
.../Cache/Affinity/IAffinityFunction.cs | 3 +-
.../Apache.Ignite.Core/Cache/CachePeekMode.cs | 7 +-
.../Cache/Configuration/CacheConfiguration.cs | 130 +-
.../Cache/Configuration/CacheMemoryMode.cs | 60 -
.../Apache.Ignite.Core/Cache/ICacheMetrics.cs | 80 -
.../Apache.Ignite.Core/Events/EventReader.cs | 1 -
.../Apache.Ignite.Core/Events/EventType.cs | 57 -
.../Apache.Ignite.Core/Events/SwapSpaceEvent.cs | 51 -
.../Apache.Ignite.Core/IgniteConfiguration.cs | 60 +-
.../IgniteConfigurationSection.xsd | 106 +-
.../Impl/Binary/BinaryArrayEqualityComparer.cs | 159 +
.../Binary/BinaryEqualityComparerSerializer.cs | 100 +-
.../Impl/Binary/BinaryFieldEqualityComparer.cs | 138 -
.../Impl/Binary/BinaryFullTypeDescriptor.cs | 20 -
.../Impl/Binary/BinaryObject.cs | 4 +-
.../Impl/Binary/BinaryObjectBuilder.cs | 7 +-
.../Binary/BinarySurrogateTypeDescriptor.cs | 16 +-
.../Impl/Binary/BinaryUtils.cs | 18 +-
.../Impl/Binary/BinaryWriter.cs | 6 +-
.../Impl/Binary/IBinaryEqualityComparer.cs | 63 -
.../Impl/Binary/IBinaryTypeDescriptor.cs | 5 -
.../Impl/Binary/Marshaller.cs | 36 +-
.../Affinity/AffinityFunctionSerializer.cs | 18 +-
.../Impl/Cache/CacheMetricsImpl.cs | 70 -
.../Impl/SwapSpace/SwapSpaceSerializer.cs | 99 -
.../SwapSpace/File/FileSwapSpaceSpi.cs | 105 -
.../SwapSpace/ISwapSpaceSpi.cs | 35 -
.../Datagrid/MultiTieredCacheExample.cs | 26 +-
.../schedule/IgniteScheduleProcessor.java | 2 +-
.../processors/schedule/ScheduleFutureImpl.java | 20 -
.../spark/JavaStandaloneIgniteRDDSelfTest.java | 41 +-
.../org/apache/ignite/spark/IgniteRDDSpec.scala | 84 +-
.../org/apache/ignite/IgniteSpringBean.java | 38 +-
.../ant/beautifier/GridJavadocAntTask.java | 18 +-
.../ignite/visor/commands/VisorConsole.scala | 1 -
.../commands/cache/VisorCacheCommand.scala | 54 +-
.../commands/cache/VisorCacheSwapCommand.scala | 145 -
.../config/VisorConfigurationCommand.scala | 1 -
.../commands/disco/VisorDiscoveryCommand.scala | 2 +-
.../commands/events/VisorEventsCommand.scala | 8 +-
.../cswap/VisorCacheSwapCommandSpec.scala | 89 -
.../testsuites/VisorConsoleSelfTestSuite.scala | 2 -
.../ignite/console/demo/AgentClusterDemo.java | 3 -
.../internal/websession/WebSessionSelfTest.java | 4 +
modules/yardstick/README.txt | 2 -
.../config/benchmark-atomic-win.properties | 8 +-
.../config/benchmark-atomic.properties | 6 -
.../config/benchmark-client-mode.properties | 9 -
.../yardstick/config/benchmark-h2.properties | 56 +
.../config/benchmark-multicast.properties | 9 -
.../yardstick/config/benchmark-mysql.properties | 56 +
.../yardstick/config/benchmark-pgsql.properties | 57 +
.../config/benchmark-query-win.properties | 5 +-
.../yardstick/config/benchmark-query.properties | 3 -
.../config/benchmark-tx-win.properties | 6 +-
.../yardstick/config/benchmark-tx.properties | 4 -
modules/yardstick/config/benchmark.properties | 11 +-
modules/yardstick/config/h2-schema.sql | 11 +
modules/yardstick/config/ignite-base-config.xml | 85 -
.../config/ignite-base-load-config.xml | 91 -
.../config/ignite-cache-load-config.xml | 5 -
.../config/ignite-failover-base-config.xml | 43 -
.../ignite-int-max-values-offheap-config.xml | 89 -
.../ignite-int-max-values-onheap-config.xml | 1 -
.../ignite-int-max-values-swap-config.xml | 93 -
.../config/ignite-localhost-config.xml | 6 +
.../yardstick/config/ignite-store-config.xml | 2 -
modules/yardstick/config/mysql-schema.sql | 11 +
modules/yardstick/config/pgsql-schema.sql | 18 +
.../test-max-int-values-offheap.properties | 65 -
.../config/test-max-int-values-swap.properties | 64 -
modules/yardstick/pom.xml | 14 +
.../yardstick/IgniteAbstractBenchmark.java | 8 +-
.../yardstick/IgniteBenchmarkArguments.java | 78 +-
.../ignite/yardstick/IgniteBenchmarkUtils.java | 7 +-
.../org/apache/ignite/yardstick/IgniteNode.java | 23 +-
.../yardstick/cache/IgniteGetBenchmark.java | 5 +-
.../cache/IgniteGetOffHeapBenchmark.java | 32 -
.../cache/IgniteGetOffHeapValuesBenchmark.java | 32 -
.../cache/IgniteIoTestAbstractBenchmark.java | 61 +
.../cache/IgniteIoTestSendAllBenchmark.java | 32 +
.../cache/IgniteIoTestSendRandomBenchmark.java | 35 +
.../yardstick/cache/IgnitePutAllBenchmark.java | 95 +-
.../cache/IgnitePutAllTxBenchmark.java | 43 +-
.../cache/IgnitePutGetOffHeapBenchmark.java | 32 -
.../IgnitePutGetOffHeapValuesBenchmark.java | 32 -
.../cache/IgnitePutGetTxOffHeapBenchmark.java | 32 -
.../IgnitePutGetTxOffHeapValuesBenchmark.java | 32 -
.../cache/IgnitePutOffHeapBenchmark.java | 32 -
.../cache/IgnitePutOffHeapValuesBenchmark.java | 32 -
.../IgnitePutRandomValueSizeBenchmark.java | 2 +-
.../cache/IgnitePutTxOffHeapBenchmark.java | 32 -
.../IgnitePutTxOffHeapValuesBenchmark.java | 32 -
.../IgniteSqlQueryJoinOffHeapBenchmark.java | 32 -
.../cache/IgniteSqlQueryOffHeapBenchmark.java | 32 -
.../IgniteSqlQueryPutOffHeapBenchmark.java | 32 -
...IgniteAtomicOffHeapInvokeRetryBenchmark.java | 31 -
.../IgniteAtomicOffHeapRetriesBenchmark.java | 31 -
...ransactionalOffHeapInvokeRetryBenchmark.java | 33 -
...ransactionalOffHeapWriteInvokeBenchmark.java | 37 -
...eTransactionalOffHeapWriteReadBenchmark.java | 32 -
.../cache/jdbc/JdbcAbstractBenchmark.java | 163 +
.../yardstick/cache/jdbc/JdbcPutBenchmark.java | 89 +
.../cache/jdbc/JdbcPutGetBenchmark.java | 62 +
.../jdbc/JdbcPutIndexedValue8Benchmark.java | 104 +
.../cache/jdbc/JdbcSqlQueryBenchmark.java | 94 +
.../cache/jdbc/JdbcSqlQueryJoinBenchmark.java | 111 +
.../IgniteCacheRandomOperationBenchmark.java | 7 -
parent/pom.xml | 4 +
pom.xml | 1 +
scripts/git-remoteless-branches.sh | 35 +
1588 files changed, 77785 insertions(+), 49918 deletions(-)
----------------------------------------------------------------------
[02/50] [abbrv] ignite git commit: Fix for C++
Posted by sb...@apache.org.
Fix for C++
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/50f9f161
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/50f9f161
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/50f9f161
Branch: refs/heads/ignite-4929
Commit: 50f9f1612d6f2b3d2f9ee1a2bd4cac3402673753
Parents: 06cee57
Author: Igor Sapego <is...@gridgain.com>
Authored: Tue Apr 11 21:51:30 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Tue Apr 11 21:51:30 2017 +0300
----------------------------------------------------------------------
.../cpp/core-test/src/continuous_query_test.cpp | 11 ++++++---
.../core/include/ignite/impl/module_manager.h | 26 ++++++++++++++++++++
.../examples/include/ignite/examples/person.h | 1 -
3 files changed, 33 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
index e09b403..2d1a2ee 100644
--- a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp
@@ -373,6 +373,13 @@ void CheckEvents(Cache<int, TestEntry>& cache, Listener<int, TestEntry>& lsnr)
lsnr.CheckNextEvent(1, TestEntry(20), boost::none);
}
+IGNITE_EXPORTED_CALL void IgniteModuleInit0(ignite::IgniteBindingContext& context)
+{
+ IgniteBinding binding = context.GetBingding();
+
+ binding.RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >();
+}
+
BOOST_FIXTURE_TEST_SUITE(ContinuousQueryTestSuite, ContinuousQueryTestSuiteFixture)
BOOST_AUTO_TEST_CASE(TestBasic)
@@ -679,8 +686,6 @@ BOOST_AUTO_TEST_CASE(TestPublicPrivateConstantsConsistence)
BOOST_AUTO_TEST_CASE(TestFilterSingleNode)
{
- node.GetBinding().RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >();
-
Listener<int, TestEntry> lsnr;
RangeFilter<int, TestEntry> filter(100, 150);
@@ -726,8 +731,6 @@ BOOST_AUTO_TEST_CASE(TestFilterMultipleNodes)
Ignite node3 = ignite_test::StartNode("cache-query-continuous.xml", "node-03");
#endif
- node.GetBinding().RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >();
-
Listener<int, TestEntry> lsnr;
RangeFilter<int, TestEntry> filter(100, 150);
http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/core/include/ignite/impl/module_manager.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/module_manager.h b/modules/platforms/cpp/core/include/ignite/impl/module_manager.h
index 55e6943..1f9783e 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/module_manager.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/module_manager.h
@@ -19,6 +19,7 @@
#define _IGNITE_IMPL_MODULE_MANAGER
#include <vector>
+#include <sstream>
#include <ignite/common/common.h>
#include <ignite/common/dynamic_load_os.h>
@@ -30,6 +31,11 @@
*/
#define IGNITE_MODULE_INIT_CALLBACK_NAME "IgniteModuleInit"
+/**
+ * Max number of additional init callbacks
+ */
+#define IGNITE_MODULE_ADDITIONAL_INIT_CALLBACKS_MAX_NUM 100
+
#define IGNITE_EXPORTED_CALL \
extern "C" IGNITE_IMPORT_EXPORT
@@ -102,6 +108,16 @@ namespace ignite
if (callback)
callback(bindingContext);
+
+ for (int i = 0; i < IGNITE_MODULE_ADDITIONAL_INIT_CALLBACKS_MAX_NUM; ++i)
+ {
+ ModuleInitCallback* callback0 = GetAdditionalModuleInitCallback(module, i);
+
+ if (!callback0)
+ break;
+
+ callback0(bindingContext);
+ }
}
private:
@@ -119,6 +135,16 @@ namespace ignite
module.FindSymbol(IGNITE_MODULE_INIT_CALLBACK_NAME));
}
+ static ModuleInitCallback* GetAdditionalModuleInitCallback(Module& module, int num)
+ {
+ std::stringstream tmp;
+
+ tmp << IGNITE_MODULE_INIT_CALLBACK_NAME << num;
+
+ return reinterpret_cast<ModuleInitCallback*>(
+ module.FindSymbol(tmp.str()));
+ }
+
/** Collection of loaded modules. */
std::vector<Module> loadedModules;
http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/examples/include/ignite/examples/person.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/include/ignite/examples/person.h b/modules/platforms/cpp/examples/include/ignite/examples/person.h
index 86c51c8..64693a9 100644
--- a/modules/platforms/cpp/examples/include/ignite/examples/person.h
+++ b/modules/platforms/cpp/examples/include/ignite/examples/person.h
@@ -79,7 +79,6 @@ namespace ignite
IGNITE_BINARY_GET_TYPE_ID_AS_HASH(Person)
IGNITE_BINARY_GET_TYPE_NAME_AS_IS(Person)
IGNITE_BINARY_GET_FIELD_ID_AS_HASH
- IGNITE_BINARY_GET_HASH_CODE_ZERO(Person)
IGNITE_BINARY_IS_NULL_FALSE(Person)
IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
[08/50] [abbrv] ignite git commit: .NET: Fix code analysis
Posted by sb...@apache.org.
.NET: Fix code analysis
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0a69e45a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0a69e45a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0a69e45a
Branch: refs/heads/ignite-4929
Commit: 0a69e45a200febcc35913485da545c7aee6f0709
Parents: 7883668
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Apr 12 15:37:47 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Apr 12 15:37:47 2017 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs | 1 -
.../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs | 2 --
2 files changed, 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0a69e45a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs
index d342fa5..c36b9fd 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs
@@ -18,7 +18,6 @@
namespace Apache.Ignite.Core.Binary
{
using System;
- using System.Collections.Generic;
using Apache.Ignite.Core.Impl.Common;
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/0a69e45a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
index c8c904d..690a0a4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
@@ -256,8 +256,6 @@ namespace Apache.Ignite.Core.Impl.Binary
if (TypeId != that.TypeId)
return false;
- var desc = _marsh.GetDescriptor(true, TypeId);
-
return BinaryArrayEqualityComparer.Equals(this, that);
}
[26/50] [abbrv] ignite git commit: Merge master into
ignite-3477-master
Posted by sb...@apache.org.
Merge master into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/48494478
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/48494478
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/48494478
Branch: refs/heads/ignite-4929
Commit: 48494478f14eb76b731a483e868d5e1bc7c58bb7
Parents: 1218c41 d298e75
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:30:54 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:30:54 2017 +0300
----------------------------------------------------------------------
.../jmh/future/JmhFutureAdapterBenchmark.java | 145 +++
.../java/org/apache/ignite/IgniteCache.java | 265 ++--
.../rendezvous/RendezvousAffinityFunction.java | 283 ++--
.../ignite/internal/IgniteInternalFuture.java | 15 -
.../eventstorage/GridEventStorageManager.java | 341 ++---
.../cache/GridCacheCompoundFuture.java | 63 +
.../cache/GridCacheCompoundIdentityFuture.java | 63 +
.../processors/cache/GridCacheFuture.java | 15 +
.../cache/GridCacheFutureAdapter.java | 61 +
.../GridCachePartitionExchangeManager.java | 16 +
.../distributed/GridCacheTxRecoveryFuture.java | 9 +-
.../dht/CacheDistributedGetFutureAdapter.java | 4 +-
.../distributed/dht/GridDhtLockFuture.java | 33 +-
.../distributed/dht/GridDhtTxFinishFuture.java | 4 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 16 +-
.../dht/GridPartitionedSingleGetFuture.java | 4 +-
.../GridDhtAtomicAbstractUpdateFuture.java | 4 +-
.../GridNearAtomicAbstractUpdateFuture.java | 8 +-
.../GridNearAtomicSingleUpdateFuture.java | 24 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 24 +-
.../colocated/GridDhtColocatedLockFuture.java | 23 +-
.../GridDhtPartitionsExchangeFuture.java | 35 +-
.../distributed/near/GridNearLockFuture.java | 20 +-
...arOptimisticSerializableTxPrepareFuture.java | 2 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 9 +-
.../GridNearPessimisticTxPrepareFuture.java | 5 +-
.../near/GridNearTxFinishFuture.java | 13 +-
.../cache/distributed/near/GridNearTxLocal.java | 7 +-
.../near/GridNearTxPrepareFutureAdapter.java | 4 +-
.../cache/local/GridLocalLockFuture.java | 6 +-
.../query/GridCacheDistributedQueryFuture.java | 18 +-
.../query/GridCacheQueryFutureAdapter.java | 31 +-
.../transactions/IgniteTransactionsImpl.java | 4 +-
.../cache/transactions/TxDeadlockDetection.java | 5 +-
.../datastructures/GridCacheSemaphoreImpl.java | 12 +
.../platform/compute/PlatformCompute.java | 10 -
.../tcp/GridTcpMemcachedNioListener.java | 20 +-
.../util/future/GridCompoundFuture.java | 45 +-
.../util/future/GridFinishedFuture.java | 13 -
.../internal/util/future/GridFutureAdapter.java | 479 ++++---
.../internal/util/future/IgniteFutureImpl.java | 10 -
.../ignite/internal/util/lang/GridFunc.java | 1223 ++----------------
.../ignite/internal/util/lang/GridTupleV.java | 1 -
.../lang/gridfunc/AlwaysFalsePredicate.java | 46 +
.../util/lang/gridfunc/AlwaysTruePredicate.java | 46 +
.../util/lang/gridfunc/AlwaysTrueReducer.java | 56 +
.../gridfunc/AtomicIntegerFactoryCallable.java | 40 +
.../gridfunc/CacheEntryGetValueClosure.java | 42 +
.../gridfunc/CacheEntryHasPeekPredicate.java | 41 +
.../lang/gridfunc/ClusterNodeGetIdClosure.java | 41 +
.../ConcurrentDequeFactoryCallable.java | 40 +
.../ConcurrentHashSetFactoryCallable.java | 40 +
.../gridfunc/ConcurrentMapFactoryCallable.java | 41 +
.../lang/gridfunc/ContainsNodeIdsPredicate.java | 52 +
.../util/lang/gridfunc/ContainsPredicate.java | 55 +
.../gridfunc/EntryByKeyEvaluationPredicate.java | 53 +
.../gridfunc/EqualsClusterNodeIdPredicate.java | 51 +
.../util/lang/gridfunc/EqualsUuidPredicate.java | 50 +
.../lang/gridfunc/FlatCollectionWrapper.java | 66 +
.../util/lang/gridfunc/FlatIterator.java | 104 ++
.../util/lang/gridfunc/HasEqualIdPredicate.java | 51 +
.../lang/gridfunc/HasNotEqualIdPredicate.java | 51 +
.../util/lang/gridfunc/IdentityClosure.java | 39 +
.../util/lang/gridfunc/IntSumReducer.java | 51 +
.../util/lang/gridfunc/IsAllPredicate.java | 52 +
.../util/lang/gridfunc/IsNotAllPredicate.java | 52 +
.../util/lang/gridfunc/IsNotNullPredicate.java | 44 +
.../util/lang/gridfunc/LongSumReducer.java | 51 +
.../util/lang/gridfunc/MapFactoryCallable.java | 41 +
.../util/lang/gridfunc/MultipleIterator.java | 106 ++
.../util/lang/gridfunc/NoOpClosure.java | 39 +
.../lang/gridfunc/NotContainsPredicate.java | 54 +
.../util/lang/gridfunc/NotEqualPredicate.java | 53 +
.../lang/gridfunc/PredicateCollectionView.java | 78 ++
.../util/lang/gridfunc/PredicateMapView.java | 121 ++
.../util/lang/gridfunc/PredicateSetView.java | 153 +++
.../lang/gridfunc/ReadOnlyCollectionView.java | 95 ++
.../lang/gridfunc/ReadOnlyCollectionView2X.java | 100 ++
.../lang/gridfunc/RunnableWrapperClosure.java | 51 +
.../util/lang/gridfunc/SetFactoryCallable.java | 41 +
.../util/lang/gridfunc/StringConcatReducer.java | 79 ++
.../util/lang/gridfunc/ToStringClosure.java | 42 +
.../lang/gridfunc/TransformCollectionView.java | 79 ++
.../gridfunc/TransformFilteringIterator.java | 138 ++
.../util/lang/gridfunc/TransformMapView.java | 168 +++
.../util/lang/gridfunc/TransformMapView2.java | 165 +++
.../util/lang/gridfunc/package-info.java | 22 +
.../org/apache/ignite/lang/IgniteFuture.java | 15 -
.../TransactionDeadlockException.java | 4 +-
.../transactions/TransactionException.java | 80 ++
.../TransactionHeuristicException.java | 4 +-
.../TransactionOptimisticException.java | 4 +-
.../TransactionRollbackException.java | 4 +-
.../TransactionTimeoutException.java | 4 +-
...inityFunctionFastPowerOfTwoHashSelfTest.java | 17 -
...ndezvousAffinityFunctionSimpleBenchmark.java | 1100 ++++++++++++++++
...ousAffinityFunctionStandardHashSelfTest.java | 17 -
.../IgniteClientReconnectCacheTest.java | 16 +-
.../internal/binary/BinaryEnumsSelfTest.java | 2 +
.../cache/CacheKeepBinaryTransactionTest.java | 121 ++
.../GridCacheOrderedPreloadingSelfTest.java | 48 +-
.../GridCachePartitionedAffinitySpreadTest.java | 169 ---
...SemaphoreFailoverSafeReleasePermitsTest.java | 9 +-
...dCachePartitionedQueueEntryMoveSelfTest.java | 2 +-
.../near/GridCacheNearTxForceKeyTest.java | 6 +-
...cheRebalancingPartitionDistributionTest.java | 2 +-
.../datastreamer/DataStreamerImplSelfTest.java | 36 -
...gniteServiceConfigVariationsFullApiTest.java | 9 +-
.../IgniteServiceDynamicCachesSelfTest.java | 24 +-
.../util/future/IgniteFutureImplTest.java | 38 -
.../ignite/testframework/GridTestNode.java | 12 +-
.../testsuites/IgniteCacheTestSuite5.java | 2 +
.../external/HadoopExternalTaskExecutor.java | 2 +-
...PartitionOnAffinityRunAtomicCacheOpTest.java | 46 +-
.../h2/GridIndexingSpiAbstractSelfTest.java | 2 -
.../Binary/BinaryBuilderSelfTest.cs | 4 +-
.../Binary/BinaryDynamicRegistrationTest.cs | 11 +-
.../Binary/BinarySelfTest.cs | 4 +-
.../IgniteConfigurationSerializerTest.cs | 15 +-
.../Binary/BinaryConfiguration.cs | 24 +-
.../IgniteConfigurationSection.xsd | 8 +-
.../Binary/BinarySurrogateTypeDescriptor.cs | 10 +-
.../Impl/Binary/BinaryUtils.cs | 8 +-
.../Impl/Binary/Marshaller.cs | 14 +-
.../processors/schedule/ScheduleFutureImpl.java | 20 -
125 files changed, 5727 insertions(+), 2458 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 47cd9fe,1a7c2c6..388a434
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@@ -38,7 -38,7 +38,8 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CacheLockCandidates;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
+ import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 4f75480,23d7657..4faa475
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@@ -27,8 -27,8 +27,9 @@@ import org.apache.ignite.IgniteCheckedE
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.NodeStoppingException;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
+ import org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture;
import org.apache.ignite.internal.processors.cache.GridCacheFuture;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping;
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 70fa1d1,964d423..6e7b324
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@@ -42,7 -42,7 +42,8 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.CacheInvokeEntry;
import org.apache.ignite.internal.processors.cache.CacheLockCandidates;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
+ import org.apache.ignite.internal.processors.cache.GridCacheCompoundFuture;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 46fb30c,8512298..4442b3a
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@@ -208,9 -202,8 +208,9 @@@ public final class GridDhtColocatedLock
this.filter = filter;
this.skipStore = skipStore;
this.keepBinary = keepBinary;
+ this.recovery = recovery;
- ignoreInterrupts(true);
+ ignoreInterrupts();
threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 103bd49,55aca2a..f6827ab
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@@ -187,11 -171,8 +187,8 @@@ public class GridDhtPartitionsExchangeF
@GridToStringInclude
private volatile IgniteInternalFuture<?> partReleaseFut;
- /** */
- private final Object mux = new Object();
-
/** Logger. */
- private IgniteLogger log;
+ private final IgniteLogger log;
/** Dynamic cache change requests. */
private Collection<DynamicCacheChangeRequest> reqs;
@@@ -1446,10 -1216,10 +1443,10 @@@
if (updateSingleMap) {
try {
- updatePartitionSingleMap(msg);
+ updatePartitionSingleMap(node, msg);
}
finally {
- synchronized (mux) {
+ synchronized (this) {
assert pendingSingleUpdates > 0;
pendingSingleUpdates--;
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index eb953d9,8de01c9..b94c014
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@@ -214,9 -208,8 +214,9 @@@ public final class GridNearLockFuture e
this.filter = filter;
this.skipStore = skipStore;
this.keepBinary = keepBinary;
+ this.recovery = recovery;
- ignoreInterrupts(true);
+ ignoreInterrupts();
threadId = tx == null ? Thread.currentThread().getId() : tx.threadId();
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSemaphoreImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
index 0000000,3e5bae9..16f8e97
mode 000000,100644..100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
@@@ -1,0 -1,1100 +1,1100 @@@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package org.apache.ignite.cache.affinity.rendezvous;
+
+ import java.io.Externalizable;
+ import java.io.ObjectInput;
+ import java.io.ObjectOutput;
+ import java.io.Serializable;
+ import java.security.MessageDigest;
+ import java.security.NoSuchAlgorithmException;
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Comparator;
+ import org.apache.ignite.Ignite;
+ import org.apache.ignite.IgniteCheckedException;
+ import org.apache.ignite.IgniteException;
+ import org.apache.ignite.IgniteLogger;
+ import org.apache.ignite.cache.affinity.AffinityFunction;
+ import org.apache.ignite.cache.affinity.AffinityFunctionContext;
+ import org.apache.ignite.cache.affinity.AffinityNodeHashResolver;
-import org.apache.ignite.cache.affinity.fair.FairAffinityFunction;
+ import org.apache.ignite.cluster.ClusterNode;
+ import org.apache.ignite.configuration.CacheConfiguration;
+ import org.apache.ignite.configuration.IgniteConfiguration;
+ import org.apache.ignite.events.DiscoveryEvent;
+ import org.apache.ignite.events.EventType;
+ import org.apache.ignite.internal.IgniteNodeAttributes;
+ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+ import org.apache.ignite.internal.processors.affinity.GridAffinityFunctionContextImpl;
+ import org.apache.ignite.internal.processors.cache.GridCacheUtils;
+ import org.apache.ignite.internal.util.typedef.F;
+ import org.apache.ignite.internal.util.typedef.internal.A;
+ import org.apache.ignite.internal.util.typedef.internal.LT;
+ import org.apache.ignite.internal.util.typedef.internal.U;
+ import org.apache.ignite.lang.IgniteBiPredicate;
+ import org.apache.ignite.lang.IgniteBiTuple;
+ import org.apache.ignite.resources.IgniteInstanceResource;
+ import org.apache.ignite.resources.LoggerResource;
+ import org.apache.ignite.testframework.GridTestNode;
+ import org.apache.ignite.testframework.GridTestUtils;
+ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+ import java.io.IOException;
+ import java.io.PrintStream;
+ import java.nio.file.FileSystems;
+ import java.nio.file.Files;
+ import java.util.ArrayList;
+ import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.List;
+ import java.util.Map;
+ import java.util.UUID;
+ import java.util.concurrent.atomic.AtomicInteger;
+ import org.jetbrains.annotations.NotNull;
+ import org.jetbrains.annotations.Nullable;
+
+ /**
+ * Simple benchmarks, compatibility test and distribution check utils for affinity functions.
+ * Needs to check changes at the {@link RendezvousAffinityFunction}.
+ */
+ public class RendezvousAffinityFunctionSimpleBenchmark extends GridCommonAbstractTest {
+ /** MAC prefix. */
+ private static final String MAC_PREF = "MAC";
+
+ /** Ignite. */
+ private static Ignite ignite;
+
+ /** Max experiments. */
+ private static final int MAX_EXPERIMENTS = 200;
+
+ /** Max experiments. */
+ private TopologyModificationMode mode = TopologyModificationMode.CHANGE_LAST_NODE;
+
+ /** {@inheritDoc} */
+ @Override protected long getTestTimeout() {
+ return 3 * 3600 * 1000;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ ignite = startGrid();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @param nodesCnt Count of nodes to generate.
+ * @return Nodes list.
+ */
+ private List<ClusterNode> createBaseNodes(int nodesCnt) {
+ List<ClusterNode> nodes = new ArrayList<>(nodesCnt);
+
+ for (int i = 0; i < nodesCnt; i++) {
+ GridTestNode node = new GridTestNode(UUID.randomUUID());
+
+ // two neighbours nodes
+ node.setAttribute(IgniteNodeAttributes.ATTR_MACS, MAC_PREF + i / 2);
+
+ nodes.add(node);
+ }
+ return nodes;
+ }
+
+ /**
+ * Modify the topology by remove the last / add new node.
+ *
+ * @param nodes Topology.
+ * @param prevAssignment Previous afinity.
+ * @param iter Number of iteration.
+ * @param backups Backups count.
+ * @return Affinity context.
+ */
+ private GridAffinityFunctionContextImpl nodesModificationChangeLast(List<ClusterNode> nodes,
+ List<List<ClusterNode>> prevAssignment, int iter, int backups) {
+ DiscoveryEvent discoEvt;
+
+ discoEvt = iter % 2 == 0 ? addNode(nodes, iter) : removeNode(nodes, nodes.size() - 1);
+
+ return new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment, discoEvt, new AffinityTopologyVersion(nodes.size()), backups);
+ }
+
+ /**
+ * @param nodes Topology.
+ * @param idx Index of node to remove.
+ * @return Discovery event.
+ */
+ @NotNull private DiscoveryEvent removeNode(List<ClusterNode> nodes, int idx) {
+ return new DiscoveryEvent(nodes.get(0), "", EventType.EVT_NODE_LEFT, nodes.remove(idx));
+ }
+
+ /**
+ * Modify the topology by remove the first node / add new node
+ *
+ * @param nodes Topology.
+ * @param prevAssignment Previous affinity.
+ * @param iter Number of iteration.
+ * @param backups Backups count.
+ * @return Affinity context.
+ */
+ private GridAffinityFunctionContextImpl nodesModificationChangeFirst(List<ClusterNode> nodes,
+ List<List<ClusterNode>> prevAssignment, int iter, int backups) {
+ DiscoveryEvent discoEvt;
+
+ discoEvt = iter % 2 == 0 ? addNode(nodes, iter) : removeNode(nodes, 0);
+
+ return new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment, discoEvt, new AffinityTopologyVersion(nodes.size()), backups);
+ }
+
+ /**
+ * @param nodes Topology.
+ * @param iter Iteration count.
+ * @return Discovery event.
+ */
+ @NotNull private DiscoveryEvent addNode(List<ClusterNode> nodes, int iter) {
+ GridTestNode node = new GridTestNode(UUID.randomUUID());
+
+ // two neighbours nodes
+ node.setAttribute(IgniteNodeAttributes.ATTR_MACS, MAC_PREF + "_add_" + iter / 4);
+
+ nodes.add(node);
+
+ return new DiscoveryEvent(nodes.get(0), "", EventType.EVT_NODE_JOINED, node);
+ }
+
+ /**
+ *
+ * @param aff Affinity function.
+ * @param nodes Topology.
+ * @param iter Number of iteration.
+ * @param prevAssignment Previous affinity assignment.
+ * @param backups Backups count.
+ * @return Tuple with affinity and time spend of the affinity calculation.
+ */
+ private IgniteBiTuple<Long, List<List<ClusterNode>>> assignPartitions(AffinityFunction aff,
+ List<ClusterNode> nodes, List<List<ClusterNode>> prevAssignment, int backups, int iter) {
+
+ GridAffinityFunctionContextImpl ctx = null;
+ switch (mode) {
+ case CHANGE_LAST_NODE:
+ ctx = nodesModificationChangeLast(nodes, prevAssignment, iter, backups);
+ break;
+ case CHANGE_FIRST_NODE:
+ ctx = nodesModificationChangeFirst(nodes, prevAssignment, iter, backups);
+ break;
+
+ case ADD:
+ ctx = new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment, addNode(nodes, iter), new AffinityTopologyVersion(nodes.size()), backups);
+ break;
+
+ case REMOVE_RANDOM:
+ ctx = new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment, removeNode(nodes, nodes.size() - 1),
+ new AffinityTopologyVersion(nodes.size()), backups);
+ break;
+
+ case NONE:
+ ctx = new GridAffinityFunctionContextImpl(nodes,
+ prevAssignment,
+ new DiscoveryEvent(nodes.get(0), "", EventType.EVT_NODE_JOINED, nodes.get(nodes.size() - 1)),
+ new AffinityTopologyVersion(nodes.size()), backups);
+ break;
+
+ }
+
+ long start = System.currentTimeMillis();
+
+ List<List<ClusterNode>> assignments = aff.assignPartitions(ctx);
+
+ return F.t(System.currentTimeMillis() - start, assignments);
+ }
+
+ /**
+ * @param lst List pf measures.
+ * @return Average of measures.
+ */
+ private double average(Collection<Long> lst) {
+ if (lst.isEmpty())
+ return 0;
+
+ long sum = 0;
+
+ for (long l : lst)
+ sum += l;
+
+ return (double)sum / lst.size();
+ }
+
+ /**
+ * @param lst List pf measures.
+ * @param avg Average of the measures.
+ * @return Variance of the measures.
+ */
+ private double variance(Collection<Long> lst, double avg) {
+ if (lst.isEmpty())
+ return 0;
+
+ long sum = 0;
+
+ for (long l : lst)
+ sum += (l - avg) * (l - avg);
+
+ return Math.sqrt((double)sum / lst.size());
+ }
+
+ /**
+ * The table with count of partitions on node:
+ *
+ * column 0 - primary partitions counts
+ * column 1 - backup#0 partitions counts
+ * etc
+ *
+ * Rows correspond to the nodes.
+ *
+ * @param lst Affinity result.
+ * @param nodes Topology.
+ * @return Frequency distribution: counts of partitions on node.
+ */
+ private static List<List<Integer>> freqDistribution(List<List<ClusterNode>> lst, Collection<ClusterNode> nodes) {
+ List<Map<ClusterNode, AtomicInteger>> nodeMaps = new ArrayList<>();
+
+ int backups = lst.get(0).size();
+
+ for (int i = 0; i < backups; ++i) {
+ Map<ClusterNode, AtomicInteger> map = new HashMap<>();
+
+ for (List<ClusterNode> l : lst) {
+ ClusterNode node = l.get(i);
+
+ if (!map.containsKey(node))
+ map.put(node, new AtomicInteger(1));
+ else
+ map.get(node).incrementAndGet();
+ }
+
+ nodeMaps.add(map);
+ }
+
+ List<List<Integer>> byNodes = new ArrayList<>(nodes.size());
+ for (ClusterNode node : nodes) {
+ List<Integer> byBackups = new ArrayList<>(backups);
+
+ for (int j = 0; j < backups; ++j) {
+ if (nodeMaps.get(j).get(node) == null)
+ byBackups.add(0);
+ else
+ byBackups.add(nodeMaps.get(j).get(node).get());
+ }
+
+ byNodes.add(byBackups);
+ }
+ return byNodes;
+ }
+
+ /**
+ * @param byNodes Frequency distribution.
+ * @param suffix Label suffix.
+ * @throws IOException On error.
+ */
+ private void printDistribution(Collection<List<Integer>> byNodes, String suffix) throws IOException {
+ int nodes = byNodes.size();
+
+ try (PrintStream ps = new PrintStream(Files.newOutputStream(FileSystems.getDefault()
+ .getPath(String.format("%03d", nodes) + suffix)))) {
+
+ for (List<Integer> byNode : byNodes) {
+ for (int w : byNode)
+ ps.print(String.format("%05d ", w));
+
+ ps.println("");
+ }
+ }
+ }
+
+ /**
+ * Chi-square test of the distribution with uniform distribution.
+ *
+ * @param byNodes Distribution.
+ * @param parts Partitions count.
+ * @param goldenNodeWeight Weight of according the uniform distribution.
+ * @return Chi-square test.
+ */
+ private double chiSquare(List<List<Integer>> byNodes, int parts, double goldenNodeWeight) {
+ double sum = 0;
+
+ for (List<Integer> byNode : byNodes) {
+ double w = (double)byNode.get(0) / parts;
+
+ sum += (goldenNodeWeight - w) * (goldenNodeWeight - w) / goldenNodeWeight;
+ }
+ return sum;
+ }
+
+ /**
+ * @throws IOException On error.
+ */
+ public void testDistribution() throws IOException {
+ AffinityFunction aff0 = new RendezvousAffinityFunction(true, 1024);
+
+ AffinityFunction aff1 = new RendezvousAffinityFunctionOld(true, 1024);
+
+ GridTestUtils.setFieldValue(aff1, "ignite", ignite);
+
+ affinityDistribution(aff0, aff1);
+ }
+
+ /**
+ *
+ * @param aff0 Affinity function to compare.
+ * @param aff1 Affinity function to compare.
+ */
+ private void affinityDistribution(AffinityFunction aff0, AffinityFunction aff1) {
+ int[] nodesCnts = {5, 64, 100, 128, 200, 256, 300, 400, 500, 600};
+
+ for (int nodesCnt : nodesCnts) {
+ List<ClusterNode> nodes0 = createBaseNodes(nodesCnt);
+ List<ClusterNode> nodes1 = createBaseNodes(nodesCnt);
+
+ assignPartitions(aff0, nodes0, null, 2, 0).get2();
+ List<List<ClusterNode>> lst0 = assignPartitions(aff0, nodes0, null, 2, 1).get2();
+
+ assignPartitions(aff1, nodes1, null, 2, 0).get2();
+ List<List<ClusterNode>> lst1 = assignPartitions(aff1, nodes1, null, 2, 1).get2();
+
+ List<List<Integer>> dist0 = freqDistribution(lst0, nodes0);
+ List<List<Integer>> dist1 = freqDistribution(lst1, nodes1);
+
+ info(String.format("Chi^2. Test %d nodes. %s: %f; %s: %f;",
+ nodesCnt,
+ aff0.getClass().getSimpleName(),
+ chiSquare(dist0, aff0.partitions(), 1.0 / nodesCnt),
+ aff1.getClass().getSimpleName(),
+ chiSquare(dist1, aff0.partitions(), 1.0 / nodesCnt)));
+
+ try {
+ printDistribution(dist0, "." + aff0.getClass().getSimpleName());
+ printDistribution(dist1, "." + aff1.getClass().getSimpleName());
+ }
+ catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ public void testAffinityBenchmarkAdd() {
+ mode = TopologyModificationMode.ADD;
+
+ AffinityFunction aff0 = new RendezvousAffinityFunctionOld(true, 1024);
+
+ GridTestUtils.setFieldValue(aff0, "ignite", ignite);
+
+ affinityBenchmark(aff0, new RendezvousAffinityFunction(true, 1024));
+ }
+
+ /**
+ *
+ */
+ public void testAffinityBenchmarkChangeLast() {
+ mode = TopologyModificationMode.CHANGE_LAST_NODE;
+
+ AffinityFunction aff0 = new RendezvousAffinityFunctionOld(true, 1024);
+
+ GridTestUtils.setFieldValue(aff0, "ignite", ignite);
+
+ affinityBenchmark(aff0, new RendezvousAffinityFunction(true, 1024));
+ }
+
+ /**
+ * @param aff0 Affinity function. to compare.
+ * @param aff1 Affinity function. to compare.
+ */
+ private void affinityBenchmark(AffinityFunction aff0, AffinityFunction aff1) {
+ int[] nodesCnts = {100, 4, 100, 200, 300, 400, 500, 600};
+
+ final int backups = 2;
+
+ for (int nodesCnt : nodesCnts) {
+ List<ClusterNode> nodes0 = createBaseNodes(nodesCnt);
+ List<ClusterNode> nodes1 = createBaseNodes(nodesCnt);
+
+ List<Long> times0 = new ArrayList<>(MAX_EXPERIMENTS);
+ List<Long> times1 = new ArrayList<>(MAX_EXPERIMENTS);
+
+ List<List<ClusterNode>> prevAssignment =
+ assignPartitions(aff0, nodes0, null, backups, 0).get2();
+
+ for (int i = 0; i < MAX_EXPERIMENTS; ++i) {
+ IgniteBiTuple<Long, List<List<ClusterNode>>> aa
+ = assignPartitions(aff0, nodes0, prevAssignment, backups, i);
+
+ prevAssignment = aa.get2();
+
+ times0.add(aa.get1());
+ }
+
+ prevAssignment = assignPartitions(aff1, nodes1, null, backups, 0).get2();
+
+ for (int i = 0; i < MAX_EXPERIMENTS; ++i) {
+ IgniteBiTuple<Long, List<List<ClusterNode>>> aa
+ = assignPartitions(aff1, nodes1, prevAssignment, backups, i);
+
+ prevAssignment = aa.get2();
+
+ times1.add(aa.get1());
+ }
+
+ double avr0 = average(times0);
+ double var0 = variance(times0, avr0);
+
+ double avr1 = average(times1);
+ double var1 = variance(times1, avr1);
+
+ info(String.format("Test %d nodes. %s: %.1f ms +/- %.3f ms; %s: %.1f ms +/- %.3f ms;",
+ nodesCnt,
+ aff0.getClass().getSimpleName(),
+ avr0, var0,
+ aff1.getClass().getSimpleName(),
+ avr1, var1));
+ }
+ }
+
+ /**
+ *
+ * @param affOld Old affinity.
+ * @param affNew New affinity/
+ * @return Count of partitions to migrate.
+ */
+ private int countPartitionsToMigrate(List<List<ClusterNode>> affOld, List<List<ClusterNode>> affNew) {
+ if (affOld == null || affNew == null)
+ return 0;
+
+ assertEquals(affOld.size(), affNew.size());
+
+ int diff = 0;
+ for (int i = 0; i < affOld.size(); ++i) {
+ Collection<ClusterNode> s0 = new HashSet<>(affOld.get(i));
+ Iterable<ClusterNode> s1 = new HashSet<>(affNew.get(i));
+
+ for (ClusterNode n : s1) {
+ if (!s0.contains(n))
+ ++diff;
+ }
+ }
+
+ return diff;
+ }
+
+ /**
+ *
+ */
+ public void testPartitionsMigrate() {
+ int[] nodesCnts = {2, 3, 10, 64, 100, 200, 300, 400, 500, 600};
+
+ final int backups = 2;
+
+ AffinityFunction aff0 = new RendezvousAffinityFunction(true, 256);
- AffinityFunction aff1 = new FairAffinityFunction(true, 256);
++ // TODO choose another affinity function to compare.
++ AffinityFunction aff1 = new RendezvousAffinityFunction(true, 256);
+
+ for (int nodesCnt : nodesCnts) {
+ List<ClusterNode> nodes0 = createBaseNodes(nodesCnt);
+ List<ClusterNode> nodes1 = createBaseNodes(nodesCnt);
+
+ List<List<ClusterNode>> affPrev = null;
+
+ int diffCnt0 = 0;
+
+ affPrev = assignPartitions(aff0, nodes0, null, backups, 0).get2();
+ for (int i = 0; i < MAX_EXPERIMENTS; ++i) {
+ List<List<ClusterNode>> affCur = assignPartitions(aff0, nodes0, affPrev, backups, i).get2();
+ diffCnt0 += countPartitionsToMigrate(affPrev, affCur);
+ affPrev = affCur;
+ }
+
+ affPrev = assignPartitions(aff1, nodes1, null, backups, 0).get2();
+ int diffCnt1 = 0;
+ for (int i = 0; i < MAX_EXPERIMENTS; ++i) {
+ List<List<ClusterNode>> affCur = assignPartitions(aff1, nodes1, affPrev, backups, i).get2();
+ diffCnt1 += countPartitionsToMigrate(affPrev, affCur);
+ affPrev = affCur;
+ }
+
+ double goldenChangeAffinity = (double)aff1.partitions() / nodesCnt * (backups + 1);
+ info(String.format("Test %d nodes. Golden: %.1f; %s: %.1f; %s: %.1f;",
+ nodesCnt, goldenChangeAffinity,
+ aff0.getClass().getSimpleName(),
+ (double)diffCnt0 / (MAX_EXPERIMENTS - 1),
+ aff1.getClass().getSimpleName(),
+ (double)diffCnt1 / (MAX_EXPERIMENTS - 1)));
+ }
+ }
+
+ /**
+ *
+ */
+ public void _testAffinityCompatibility() {
+ mode = TopologyModificationMode.ADD;
+
+ AffinityFunction aff0 = new RendezvousAffinityFunction(true, 1024);
+
+ // Use the full copy of the old implementaion of the RendezvousAffinityFunction to check the compatibility.
+ AffinityFunction aff1 = new RendezvousAffinityFunctionOld(true, 1024);
+ GridTestUtils.setFieldValue(aff1, "ignite", ignite);
+
+ affinityCompatibility(aff0, aff1);
+ }
+
+ /**
+ * @param aff0 Affinity function to compare.
+ * @param aff1 Affinity function to compare.
+ */
+ private void affinityCompatibility(AffinityFunction aff0, AffinityFunction aff1) {
+ int[] nodesCnts = {64, 100, 200, 300, 400, 500, 600};
+
+ final int backups = 2;
+
+ mode = TopologyModificationMode.NONE;
+
+ for (int nodesCnt : nodesCnts) {
+ List<ClusterNode> nodes = createBaseNodes(nodesCnt);
+
+ List<List<ClusterNode>> assignment0 = assignPartitions(aff0, nodes, null, backups, 0).get2();
+
+ List<List<ClusterNode>> assignment1 = assignPartitions(aff1, nodes, null, backups, 0).get2();
+
+ assertEquals (assignment0, assignment1);
+ }
+ }
+
+ /**
+ *
+ */
+ private enum TopologyModificationMode {
+ /** Change the last node. */
+ CHANGE_LAST_NODE,
+
+ /** Change the first node. */
+ CHANGE_FIRST_NODE,
+
+ /** Add. */
+ ADD,
+
+ /** Remove random. */
+ REMOVE_RANDOM,
+
+ /** Do nothing*/
+ NONE
+ }
+
+ /**
+ * Full copy of the old implementation of the RendezvousAffinityFunction to check compatibility and performance.
+ */
+ private static class RendezvousAffinityFunctionOld implements AffinityFunction, Externalizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Default number of partitions. */
+ public static final int DFLT_PARTITION_COUNT = 1024;
+
+ /** Comparator. */
+ private static final Comparator<IgniteBiTuple<Long, ClusterNode>> COMPARATOR = new HashComparator();
+
+ /** Thread local message digest. */
+ private ThreadLocal<MessageDigest> digest = new ThreadLocal<MessageDigest>() {
+ @Override protected MessageDigest initialValue() {
+ try {
+ return MessageDigest.getInstance("MD5");
+ }
+ catch (NoSuchAlgorithmException e) {
+ assert false : "Should have failed in constructor";
+
+ throw new IgniteException("Failed to obtain message digest (digest was available in constructor)", e);
+ }
+ }
+ };
+
+ /** Number of partitions. */
+ private int parts;
+
+ /** Exclude neighbors flag. */
+ private boolean exclNeighbors;
+
+ /** Exclude neighbors warning. */
+ private transient boolean exclNeighborsWarn;
+
+ /** Optional backup filter. First node is primary, second node is a node being tested. */
+ private IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter;
+
+ /** Optional affinity backups filter. The first node is a node being tested,
+ * the second is a list of nodes that are already assigned for a given partition (the first node in the list
+ * is primary). */
+ private IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter;
+
+ /** Hash ID resolver. */
+ private AffinityNodeHashResolver hashIdRslvr = null;
+
+ /** Ignite instance. */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** Logger instance. */
+ @LoggerResource
+ private transient IgniteLogger log;
+
+ /**
+ * Empty constructor with all defaults.
+ */
+ public RendezvousAffinityFunctionOld() {
+ this(false);
+ }
+
+ /**
+ * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other
+ * and specified number of backups.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
+ * of each other.
+ */
+ public RendezvousAffinityFunctionOld(boolean exclNeighbors) {
+ this(exclNeighbors, DFLT_PARTITION_COUNT);
+ }
+
+ /**
+ * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other,
+ * and specified number of backups and partitions.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
+ * of each other.
+ * @param parts Total number of partitions.
+ */
+ public RendezvousAffinityFunctionOld(boolean exclNeighbors, int parts) {
+ this(exclNeighbors, parts, null);
+ }
+
+ /**
+ * Initializes optional counts for replicas and backups.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param parts Total number of partitions.
+ * @param backupFilter Optional back up filter for nodes. If provided, backups will be selected
+ * from all nodes that pass this filter. First argument for this filter is primary node, and second
+ * argument is node being tested.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ */
+ public RendezvousAffinityFunctionOld(int parts, @Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+ this(false, parts, backupFilter);
+ }
+
+ /**
+ * Private constructor.
+ *
+ * @param exclNeighbors Exclude neighbors flag.
+ * @param parts Partitions count.
+ * @param backupFilter Backup filter.
+ */
+ private RendezvousAffinityFunctionOld(boolean exclNeighbors, int parts,
+ IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+ A.ensure(parts > 0, "parts > 0");
+
+ this.exclNeighbors = exclNeighbors;
+ this.parts = parts;
+ this.backupFilter = backupFilter;
+
+ try {
+ MessageDigest.getInstance("MD5");
+ }
+ catch (NoSuchAlgorithmException e) {
+ throw new IgniteException("Failed to obtain MD5 message digest instance.", e);
+ }
+ }
+
+ /**
+ * Gets total number of key partitions. To ensure that all partitions are
+ * equally distributed across all nodes, please make sure that this
+ * number is significantly larger than a number of nodes. Also, partition
+ * size should be relatively small. Try to avoid having partitions with more
+ * than quarter million keys.
+ * <p>
+ * Note that for fully replicated caches this method should always
+ * return {@code 1}.
+ *
+ * @return Total partition count.
+ */
+ public int getPartitions() {
+ return parts;
+ }
+
+ /**
+ * Sets total number of partitions.
+ *
+ * @param parts Total number of partitions.
+ */
+ public void setPartitions(int parts) {
+ A.ensure(parts <= CacheConfiguration.MAX_PARTITIONS_COUNT, "parts <= " + CacheConfiguration.MAX_PARTITIONS_COUNT);
+
+ this.parts = parts;
+ }
+
+ /**
+ * Gets hash ID resolver for nodes. This resolver is used to provide
+ * alternate hash ID, other than node ID.
+ * <p>
+ * Node IDs constantly change when nodes get restarted, which causes them to
+ * be placed on different locations in the hash ring, and hence causing
+ * repartitioning. Providing an alternate hash ID, which survives node restarts,
+ * puts node on the same location on the hash ring, hence minimizing required
+ * repartitioning.
+ *
+ * @return Hash ID resolver.
+ */
+ @Deprecated
+ public AffinityNodeHashResolver getHashIdResolver() {
+ return hashIdRslvr;
+ }
+
+ /**
+ * Sets hash ID resolver for nodes. This resolver is used to provide
+ * alternate hash ID, other than node ID.
+ * <p>
+ * Node IDs constantly change when nodes get restarted, which causes them to
+ * be placed on different locations in the hash ring, and hence causing
+ * repartitioning. Providing an alternate hash ID, which survives node restarts,
+ * puts node on the same location on the hash ring, hence minimizing required
+ * repartitioning.
+ *
+ * @param hashIdRslvr Hash ID resolver.
+ *
+ * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead.
+ */
+ @Deprecated
+ public void setHashIdResolver(AffinityNodeHashResolver hashIdRslvr) {
+ this.hashIdRslvr = hashIdRslvr;
+ }
+
+ /**
+ * Gets optional backup filter. If not {@code null}, backups will be selected
+ * from all nodes that pass this filter. First node passed to this filter is primary node,
+ * and second node is a node being tested.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @return Optional backup filter.
+ */
+ @Nullable public IgniteBiPredicate<ClusterNode, ClusterNode> getBackupFilter() {
+ return backupFilter;
+ }
+
+ /**
+ * Sets optional backup filter. If provided, then backups will be selected from all
+ * nodes that pass this filter. First node being passed to this filter is primary node,
+ * and second node is a node being tested.
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param backupFilter Optional backup filter.
+ * @deprecated Use {@code affinityBackupFilter} instead.
+ */
+ @Deprecated
+ public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+ this.backupFilter = backupFilter;
+ }
+
+ /**
+ * Gets optional backup filter. If not {@code null}, backups will be selected
+ * from all nodes that pass this filter. First node passed to this filter is a node being tested,
+ * and the second parameter is a list of nodes that are already assigned for a given partition (primary node is
+ * the first in the list).
+ * <p>
+ * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @return Optional backup filter.
+ */
+ @Nullable public IgniteBiPredicate<ClusterNode, List<ClusterNode>> getAffinityBackupFilter() {
+ return affinityBackupFilter;
+ }
+
+ /**
+ * Sets optional backup filter. If provided, then backups will be selected from all
+ * nodes that pass this filter. First node being passed to this filter is a node being tested,
+ * and the second parameter is a list of nodes that are already assigned for a given partition (primary node is
+ * the first in the list).
+ * <p>
+ * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param affinityBackupFilter Optional backup filter.
+ */
+ public void setAffinityBackupFilter(@Nullable IgniteBiPredicate<ClusterNode,
+ List<ClusterNode>> affinityBackupFilter) {
+ this.affinityBackupFilter = affinityBackupFilter;
+ }
+
+ /**
+ * Checks flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @return {@code True} if nodes residing on the same host may not act as backups of each other.
+ */
+ public boolean isExcludeNeighbors() {
+ return exclNeighbors;
+ }
+
+ /**
+ * Sets flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
+ * <p>
+ * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups of each other.
+ */
+ public void setExcludeNeighbors(boolean exclNeighbors) {
+ this.exclNeighbors = exclNeighbors;
+ }
+
+ /**
+ * Resolves node hash.
+ *
+ * @param node Cluster node;
+ * @return Node hash.
+ */
+ public Object resolveNodeHash(ClusterNode node) {
+ if (hashIdRslvr != null)
+ return hashIdRslvr.resolve(node);
+ else
+ return node.consistentId();
+ }
+
+ /**
+ * Returns collection of nodes (primary first) for specified partition.
+ *
+ * @param d Message digest.
+ * @param part Partition.
+ * @param nodes Nodes.
+ * @param nodesHash Serialized nodes hashes.
+ * @param backups Number of backups.
+ * @param neighborhoodCache Neighborhood.
+ * @return Assignment.
+ */
+ public List<ClusterNode> assignPartition(MessageDigest d,
+ int part,
+ List<ClusterNode> nodes,
+ Map<ClusterNode, byte[]> nodesHash,
+ int backups,
+ @Nullable Map<UUID, Collection<ClusterNode>> neighborhoodCache) {
+ if (nodes.size() <= 1)
+ return nodes;
+
+ if (d == null)
+ d = digest.get();
+
+ List<IgniteBiTuple<Long, ClusterNode>> lst = new ArrayList<>(nodes.size());
+
+ try {
+ for (int i = 0; i < nodes.size(); i++) {
+ ClusterNode node = nodes.get(i);
+
+ byte[] nodeHashBytes = nodesHash.get(node);
+
+ if (nodeHashBytes == null) {
+ Object nodeHash = resolveNodeHash(node);
+
+ byte[] nodeHashBytes0 = U.marshal(ignite.configuration().getMarshaller(), nodeHash);
+
+ // Add 4 bytes for partition bytes.
+ nodeHashBytes = new byte[nodeHashBytes0.length + 4];
+
+ System.arraycopy(nodeHashBytes0, 0, nodeHashBytes, 4, nodeHashBytes0.length);
+
+ nodesHash.put(node, nodeHashBytes);
+ }
+
+ U.intToBytes(part, nodeHashBytes, 0);
+
+ d.reset();
+
+ byte[] bytes = d.digest(nodeHashBytes);
+
+ long hash =
+ (bytes[0] & 0xFFL)
+ | ((bytes[1] & 0xFFL) << 8)
+ | ((bytes[2] & 0xFFL) << 16)
+ | ((bytes[3] & 0xFFL) << 24)
+ | ((bytes[4] & 0xFFL) << 32)
+ | ((bytes[5] & 0xFFL) << 40)
+ | ((bytes[6] & 0xFFL) << 48)
+ | ((bytes[7] & 0xFFL) << 56);
+
+ lst.add(F.t(hash, node));
+ }
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+
+ Collections.sort(lst, COMPARATOR);
+
+ int primaryAndBackups = backups == Integer.MAX_VALUE ? nodes.size() : Math.min(backups + 1, nodes.size());
+
+ List<ClusterNode> res = new ArrayList<>(primaryAndBackups);
+
+ ClusterNode primary = lst.get(0).get2();
+
+ res.add(primary);
+
+ // Select backups.
+ if (backups > 0) {
+ for (int i = 1; i < lst.size() && res.size() < primaryAndBackups; i++) {
+ IgniteBiTuple<Long, ClusterNode> next = lst.get(i);
+
+ ClusterNode node = next.get2();
+
+ if (exclNeighbors) {
+ Collection<ClusterNode> allNeighbors = GridCacheUtils.neighborsForNodes(neighborhoodCache, res);
+
+ if (!allNeighbors.contains(node))
+ res.add(node);
+ }
+ else if (affinityBackupFilter != null && affinityBackupFilter.apply(node, res))
+ res.add(next.get2());
+ else if (backupFilter != null && backupFilter.apply(primary, node))
+ res.add(next.get2());
+ else if (affinityBackupFilter == null && backupFilter == null)
+ res.add(next.get2());
+ }
+ }
+
+ if (res.size() < primaryAndBackups && nodes.size() >= primaryAndBackups && exclNeighbors) {
+ // Need to iterate again in case if there are no nodes which pass exclude neighbors backups criteria.
+ for (int i = 1; i < lst.size() && res.size() < primaryAndBackups; i++) {
+ IgniteBiTuple<Long, ClusterNode> next = lst.get(i);
+
+ ClusterNode node = next.get2();
+
+ if (!res.contains(node))
+ res.add(next.get2());
+ }
+
+ if (!exclNeighborsWarn) {
+ LT.warn(log, "Affinity function excludeNeighbors property is ignored " +
+ "because topology has no enough nodes to assign backups.");
+
+ exclNeighborsWarn = true;
+ }
+ }
+
+ assert res.size() <= primaryAndBackups;
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void reset() {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partitions() {
+ return parts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partition(Object key) {
+ if (key == null)
+ throw new IllegalArgumentException("Null key is passed for a partition calculation. " +
+ "Make sure that an affinity key that is used is initialized properly.");
+
+ return U.safeAbs(key.hashCode() % parts);
+ }
+
+ /** {@inheritDoc} */
+ @Override public List<List<ClusterNode>> assignPartitions(AffinityFunctionContext affCtx) {
+ List<List<ClusterNode>> assignments = new ArrayList<>(parts);
+
+ Map<UUID, Collection<ClusterNode>> neighborhoodCache = exclNeighbors ?
+ GridCacheUtils.neighbors(affCtx.currentTopologySnapshot()) : null;
+
+ MessageDigest d = digest.get();
+
+ List<ClusterNode> nodes = affCtx.currentTopologySnapshot();
+
+ Map<ClusterNode, byte[]> nodesHash = U.newHashMap(nodes.size());
+
+ for (int i = 0; i < parts; i++) {
+ List<ClusterNode> partAssignment = assignPartition(d,
+ i,
+ nodes,
+ nodesHash,
+ affCtx.backups(),
+ neighborhoodCache);
+
+ assignments.add(partAssignment);
+ }
+
+ return assignments;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void removeNode(UUID nodeId) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeInt(parts);
+ out.writeBoolean(exclNeighbors);
+ out.writeObject(hashIdRslvr);
+ out.writeObject(backupFilter);
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ parts = in.readInt();
+ exclNeighbors = in.readBoolean();
+ hashIdRslvr = (AffinityNodeHashResolver)in.readObject();
+ backupFilter = (IgniteBiPredicate<ClusterNode, ClusterNode>)in.readObject();
+ }
+
+ /**
+ *
+ */
+ private static class HashComparator implements Comparator<IgniteBiTuple<Long, ClusterNode>>, Serializable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** {@inheritDoc} */
+ @Override public int compare(IgniteBiTuple<Long, ClusterNode> o1, IgniteBiTuple<Long, ClusterNode> o2) {
+ return o1.get1() < o2.get1() ? -1 : o1.get1() > o2.get1() ? 1 :
+ o1.get2().id().compareTo(o2.get2().id());
+ }
+ }
+ }
+ }
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDynamicCachesSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
index 3e79da0,0716c20..7baea2e
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
@@@ -18,11 -18,7 +18,12 @@@
package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
+import org.apache.ignite.GridCacheAffinityBackupsSelfTest;
+import org.apache.ignite.IgniteCacheAffinitySelfTest;
+import org.apache.ignite.cache.affinity.AffinityClientNodeSelfTest;
+import org.apache.ignite.cache.affinity.AffinityHistoryCleanupTest;
+import org.apache.ignite.cache.affinity.local.LocalAffinityFunctionTest;
+ import org.apache.ignite.internal.processors.cache.CacheKeepBinaryTransactionTest;
import org.apache.ignite.internal.processors.cache.CacheNearReaderUpdateTest;
import org.apache.ignite.internal.processors.cache.CacheRebalancingSelfTest;
import org.apache.ignite.internal.processors.cache.CacheSerializableTransactionsTest;
@@@ -58,10 -53,12 +59,11 @@@ public class IgniteCacheTestSuite5 exte
suite.addTestSuite(IgniteCacheStoreCollectionTest.class);
suite.addTestSuite(IgniteCacheWriteBehindNoUpdateSelfTest.class);
suite.addTestSuite(IgniteCachePutStackOverflowSelfTest.class);
- suite.addTestSuite(GridCacheSwapSpaceSpiConsistencySelfTest.class);
+ suite.addTestSuite(CacheKeepBinaryTransactionTest.class);
suite.addTestSuite(CacheLateAffinityAssignmentTest.class);
- suite.addTestSuite(CacheLateAffinityAssignmentFairAffinityTest.class);
suite.addTestSuite(CacheLateAffinityAssignmentNodeJoinValidationTest.class);
+ suite.addTestSuite(IgniteActiveOnStartNodeJoinValidationSelfTest.class);
suite.addTestSuite(EntryVersionConsistencyReadThroughTest.class);
suite.addTestSuite(IgniteCacheSyncRebalanceModeSelfTest.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinarySurrogateTypeDescriptor.cs
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/48494478/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
index 61439b1,1dae576..f47cbe2
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
@@@ -497,8 -505,8 +497,8 @@@ namespace Apache.Ignite.Core.Impl.Binar
var ser = GetSerializer(_cfg, null, type, typeId, null, null, _log);
desc = desc == null
- ? new BinaryFullTypeDescriptor(type, typeId, typeName, true, _cfg.DefaultNameMapper,
- _cfg.DefaultIdMapper, ser, false, null, type.IsEnum, registered)
+ ? new BinaryFullTypeDescriptor(type, typeId, typeName, true, _cfg.NameMapper,
- _cfg.IdMapper, ser, false, null, type.IsEnum, null, registered)
++ _cfg.IdMapper, ser, false, null, type.IsEnum, registered)
: new BinaryFullTypeDescriptor(desc, type, ser, registered);
if (RegistrationDisabled)
[04/50] [abbrv] ignite git commit: IGNITE-4200: Added copying of the
C++ binaries.
Posted by sb...@apache.org.
IGNITE-4200: Added copying of the C++ binaries.
(cherry picked from commit 8b3860f)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6d12bd4b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6d12bd4b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6d12bd4b
Branch: refs/heads/ignite-4929
Commit: 6d12bd4b9fbded5e5862b5c3d89b05a5ddd11755
Parents: 5fbbc37
Author: Igor Sapego <is...@gridgain.com>
Authored: Tue Mar 21 17:54:51 2017 +0300
Committer: dkarachentsev <dk...@gridgain.com>
Committed: Wed Apr 12 12:53:19 2017 +0300
----------------------------------------------------------------------
assembly/release-fabric-base.xml | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6d12bd4b/assembly/release-fabric-base.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric-base.xml b/assembly/release-fabric-base.xml
index d7aa0a2..97222c9 100644
--- a/assembly/release-fabric-base.xml
+++ b/assembly/release-fabric-base.xml
@@ -179,6 +179,12 @@
<outputDirectory>/platforms/cpp/docs</outputDirectory>
</fileSet>
+ <!-- Move CPP binaries. -->
+ <fileSet>
+ <directory>modules/platforms/cpp/bin</directory>
+ <outputDirectory>/platforms/cpp/bin</outputDirectory>
+ </fileSet>
+
<!-- Other files. -->
<fileSet>
<directory>bin</directory>
[18/50] [abbrv] ignite git commit: ClientReconnectMessage id
shouldn't be saved for lastMsgId on client side
Posted by sb...@apache.org.
ClientReconnectMessage id shouldn't be saved for lastMsgId on client side
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a563ba05
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a563ba05
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a563ba05
Branch: refs/heads/ignite-4929
Commit: a563ba0556d940cc3665973b6098758786db72c1
Parents: 6bb4c81
Author: Sergey Chugunov <se...@gmail.com>
Authored: Wed Apr 12 13:41:09 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Thu Apr 13 12:48:36 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a563ba05/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 6c7c220..34ee414 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -1842,7 +1842,9 @@ class ClientImpl extends TcpDiscoveryImpl {
spi.stats.onMessageProcessingFinished(msg);
- if (spi.ensured(msg) && state == CONNECTED)
+ if (spi.ensured(msg)
+ && state == CONNECTED
+ && !(msg instanceof TcpDiscoveryClientReconnectMessage))
lastMsgId = msg.id();
}
[29/50] [abbrv] ignite git commit: IGNITE-3477 - Fixing flaky full
API suite
Posted by sb...@apache.org.
IGNITE-3477 - Fixing flaky full API suite
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8d2b020c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8d2b020c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8d2b020c
Branch: refs/heads/ignite-4929
Commit: 8d2b020c7068a000c2eeaa5096e24cdf8937125d
Parents: 1469f28
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:36:54 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:36:54 2017 +0300
----------------------------------------------------------------------
.../processors/cache/H2CacheStoreStrategy.java | 35 ++++++++++++++++----
1 file changed, 28 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8d2b020c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
index 0167b7d..72b049b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/H2CacheStoreStrategy.java
@@ -54,6 +54,9 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
/** Pool to get {@link Connection}s from. */
private final JdbcConnectionPool dataSrc;
+ /** */
+ private final int port;
+
/** Script that creates CACHE table. */
private static final String CREATE_CACHE_TABLE =
"create table if not exists CACHE(k binary not null, v binary not null, PRIMARY KEY(k));";
@@ -75,9 +78,14 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
* @throws IgniteCheckedException If failed.
*/
public H2CacheStoreStrategy() throws IgniteCheckedException {
+ Server srv = null;
+
try {
- Server.createTcpServer().start();
- dataSrc = H2CacheStoreSessionListenerFactory.createDataSource();
+ srv = Server.createTcpServer().start();
+
+ port = srv.getPort();
+
+ dataSrc = H2CacheStoreSessionListenerFactory.createDataSource(port);
try (Connection conn = connection()) {
RunScript.execute(conn, new StringReader(CREATE_CACHE_TABLE));
@@ -86,7 +94,8 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
}
}
catch (SQLException e) {
- throw new IgniteCheckedException(e);
+ throw new IgniteCheckedException("Failed to set up cache store strategy" +
+ (srv == null ? "" : ": " + srv.getStatus()), e);
}
}
@@ -242,7 +251,7 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
/** {@inheritDoc} */
@Override public void updateCacheConfiguration(CacheConfiguration<Object, Object> cfg) {
- cfg.setCacheStoreSessionListenerFactories(new H2CacheStoreSessionListenerFactory());
+ cfg.setCacheStoreSessionListenerFactories(new H2CacheStoreSessionListenerFactory(port));
}
/** {@inheritDoc} */
@@ -260,11 +269,23 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
/** Serializable {@link Factory} producing H2 backed {@link CacheStoreSessionListener}s. */
public static class H2CacheStoreSessionListenerFactory implements Factory<CacheStoreSessionListener> {
+ /** */
+ private int port;
+
+ /**
+ * @param port Port.
+ */
+ public H2CacheStoreSessionListenerFactory(int port) {
+ this.port = port;
+ }
+
/**
* @return Connection pool
*/
- static JdbcConnectionPool createDataSource() {
- JdbcConnectionPool pool = JdbcConnectionPool.create("jdbc:h2:tcp://localhost/mem:TestDb;LOCK_MODE=0", "sa", "");
+ static JdbcConnectionPool createDataSource(int port) {
+ JdbcConnectionPool pool = JdbcConnectionPool.create("jdbc:h2:tcp://localhost:" + port +
+ "/mem:TestDb;LOCK_MODE=0", "sa", "");
+
pool.setMaxConnections(Integer.getInteger("H2_JDBC_CONNECTIONS", 100));
return pool;
}
@@ -272,7 +293,7 @@ public class H2CacheStoreStrategy implements TestCacheStoreStrategy {
/** {@inheritDoc} */
@Override public CacheStoreSessionListener create() {
CacheJdbcStoreSessionListener lsnr = new CacheJdbcStoreSessionListener();
- lsnr.setDataSource(createDataSource());
+ lsnr.setDataSource(createDataSource(port));
return lsnr;
}
}
[25/50] [abbrv] ignite git commit: Merge remote-tracking branch
'professional/ignite-3477-master' into ignite-3477-master
Posted by sb...@apache.org.
Merge remote-tracking branch 'professional/ignite-3477-master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c31de278
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c31de278
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c31de278
Branch: refs/heads/ignite-4929
Commit: c31de2783d66eec7ae7237fc6ca1fbbfa7c1fb3b
Parents: 81a0f9a a563ba0
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Thu Apr 13 16:16:22 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Thu Apr 13 16:16:22 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[12/50] [abbrv] ignite git commit: Merge remote-tracking branch
'upstream/ignite-3477-master' into ignite-3477-master
Posted by sb...@apache.org.
Merge remote-tracking branch 'upstream/ignite-3477-master' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5839f481
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5839f481
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5839f481
Branch: refs/heads/ignite-4929
Commit: 5839f481b7ff755bc68a521014ae308ac675baec
Parents: 21dcef2 0a69e45
Author: Igor Sapego <is...@gridgain.com>
Authored: Wed Apr 12 15:46:27 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Wed Apr 12 15:46:27 2017 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs | 1 -
.../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs | 2 --
2 files changed, 3 deletions(-)
----------------------------------------------------------------------
[24/50] [abbrv] ignite git commit: ignite-3477-master fix
IgniteCacheQueryNodeRestartDistributedJoinSelfTest
Posted by sb...@apache.org.
ignite-3477-master fix IgniteCacheQueryNodeRestartDistributedJoinSelfTest
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/81a0f9a7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/81a0f9a7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/81a0f9a7
Branch: refs/heads/ignite-4929
Commit: 81a0f9a711e5893f4ae172b9e49b65d191b179a1
Parents: 6bb4c81
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Thu Apr 13 16:15:43 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Thu Apr 13 16:15:43 2017 +0300
----------------------------------------------------------------------
...cheQueryNodeRestartDistributedJoinSelfTest.java | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/81a0f9a7/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
index 8367b2c..4f20078 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
@@ -36,6 +36,21 @@ import java.util.concurrent.atomic.AtomicIntegerArray;
* Test for distributed queries with node restarts.
*/
public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCacheQueryAbstractDistributedJoinSelfTest {
+ /** Total nodes. */
+ private int totalNodes = 6;
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ if (totalNodes > GRID_CNT) {
+ for (int i = GRID_CNT; i < totalNodes; i++)
+ startGrid(i);
+ }
+ else
+ totalNodes = GRID_CNT;
+ }
+
/**
* @throws Exception If failed.
*/
@@ -61,7 +76,7 @@ public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCa
final int nodeLifeTime = 4000;
final int logFreq = 100;
- final AtomicIntegerArray locks = new AtomicIntegerArray(GRID_CNT);
+ final AtomicIntegerArray locks = new AtomicIntegerArray(totalNodes);
SqlFieldsQuery qry0 ;
[32/50] [abbrv] ignite git commit: IGNITE-3477 - Removed obsolete file
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2c4ef9ee/leak.patch
----------------------------------------------------------------------
diff --git a/leak.patch b/leak.patch
deleted file mode 100644
index f618073..0000000
--- a/leak.patch
+++ /dev/null
@@ -1,10521 +0,0 @@
-From 3c9e3786a21ec7c8919de9c29bc04d2e3561846c Mon Sep 17 00:00:00 2001
-From: Igor Seliverstov <gv...@gmail.com>
-Date: Wed, 15 Feb 2017 13:41:08 +0300
-Subject: [PATCH 01/41] IGNITE-4694 Add tests to check there are no memory
- leaks in PageMemory
-
----
- .../processors/database/IgniteDbAbstractTest.java | 360 +++++++++++++++++++++
- .../database/IgniteDbMemoryLeakAbstractTest.java | 84 +++++
- .../database/IgniteDbMemoryLeakIndexedTest.java | 85 +++++
- .../IgniteDbMemoryLeakLargeObjectsTest.java | 95 ++++++
- .../database/IgniteDbMemoryLeakLargePagesTest.java | 90 ++++++
- .../database/IgniteDbMemoryLeakTest.java | 85 +++++
- .../IgniteDbMemoryLeakWithExpirationTest.java | 92 ++++++
- .../database/IgniteDbPutGetAbstractTest.java | 347 +-------------------
- 8 files changed, 903 insertions(+), 335 deletions(-)
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
- create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-new file mode 100644
-index 0000000..3bc7004
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-@@ -0,0 +1,360 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+package org.apache.ignite.internal.processors.database;
-+
-+import org.apache.ignite.cache.CacheAtomicityMode;
-+import org.apache.ignite.cache.CacheRebalanceMode;
-+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-+import org.apache.ignite.cache.affinity.AffinityFunction;
-+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-+import org.apache.ignite.cache.query.annotations.QuerySqlField;
-+import org.apache.ignite.configuration.CacheConfiguration;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.processors.cache.database.tree.BPlusTree;
-+import org.apache.ignite.internal.util.typedef.internal.S;
-+import org.apache.ignite.internal.util.typedef.internal.U;
-+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
-+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
-+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-+
-+import java.io.Serializable;
-+import java.util.Arrays;
-+import java.util.Random;
-+
-+/**
-+ *
-+ */
-+public abstract class IgniteDbAbstractTest extends GridCommonAbstractTest {
-+ /** */
-+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-+
-+ /**
-+ * @return Node count.
-+ */
-+ protected abstract int gridCount();
-+
-+ /**
-+ * @return {@code True} if indexing is enabled.
-+ */
-+ protected abstract boolean indexingEnabled();
-+
-+ /** {@inheritDoc} */
-+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-+ IgniteConfiguration cfg = super.getConfiguration(gridName);
-+
-+ MemoryConfiguration dbCfg = new MemoryConfiguration();
-+
-+ dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
-+
-+ if (isLargePage())
-+ dbCfg.setPageSize(16 * 1024);
-+ else
-+ dbCfg.setPageSize(1024);
-+
-+
-+ dbCfg.setPageCacheSize(200 * 1024 * 1024);
-+
-+ configure(dbCfg);
-+
-+ cfg.setMemoryConfiguration(dbCfg);
-+
-+ CacheConfiguration ccfg = new CacheConfiguration();
-+
-+ if (indexingEnabled())
-+ ccfg.setIndexedTypes(Integer.class, DbValue.class);
-+
-+ ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-+ ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-+ ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
-+ ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
-+
-+ CacheConfiguration ccfg2 = new CacheConfiguration("non-primitive");
-+
-+ if (indexingEnabled())
-+ ccfg2.setIndexedTypes(DbKey.class, DbValue.class);
-+
-+ ccfg2.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-+ ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-+ ccfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
-+ ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
-+
-+ CacheConfiguration ccfg3 = new CacheConfiguration("large");
-+
-+ if (indexingEnabled())
-+ ccfg3.setIndexedTypes(Integer.class, LargeDbValue.class);
-+
-+ ccfg3.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-+ ccfg3.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-+ ccfg3.setRebalanceMode(CacheRebalanceMode.SYNC);
-+ ccfg3.setAffinity(new RendezvousAffinityFunction(false, 32));
-+
-+ CacheConfiguration ccfg4 = new CacheConfiguration("tiny");
-+
-+ ccfg4.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-+ ccfg4.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-+ ccfg4.setRebalanceMode(CacheRebalanceMode.SYNC);
-+ ccfg4.setAffinity(new RendezvousAffinityFunction(false, 32));
-+
-+ final AffinityFunction aff = new RendezvousAffinityFunction(1, null);
-+
-+ ccfg4.setAffinity(aff);
-+
-+ cfg.setCacheConfiguration(ccfg, ccfg2, ccfg3, ccfg4);
-+
-+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-+
-+ discoSpi.setIpFinder(IP_FINDER);
-+
-+ cfg.setDiscoverySpi(discoSpi);
-+ cfg.setMarshaller(null);
-+
-+ configure(cfg);
-+
-+ return cfg;
-+ }
-+
-+ protected void configure(IgniteConfiguration cfg){
-+ //NOP
-+ }
-+
-+ protected void configure(MemoryConfiguration mCfg){
-+ //NOP
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override protected void beforeTest() throws Exception {
-+ deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-+
-+ long seed = 1464583813940L; // System.currentTimeMillis();
-+
-+ info("Seed: " + seed + "L");
-+
-+ BPlusTree.rnd = new Random(seed);
-+
-+ startGrids(gridCount());
-+
-+ awaitPartitionMapExchange();
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override protected void afterTest() throws Exception {
-+ BPlusTree.rnd = null;
-+
-+ stopAllGrids();
-+
-+ deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-+ }
-+
-+ /**
-+ * @return {@code True} if use large page.
-+ */
-+ protected boolean isLargePage() {
-+ return false;
-+ }
-+
-+ /**
-+ *
-+ */
-+ static class DbKey implements Serializable {
-+ /** */
-+ int val;
-+
-+ /**
-+ * @param val Value.
-+ */
-+ DbKey(int val) {
-+ this.val = val;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public boolean equals(Object o) {
-+ if (this == o)
-+ return true;
-+
-+ if (o == null || !(o instanceof DbKey))
-+ return false;
-+
-+ DbKey key = (DbKey)o;
-+
-+ return val == key.val;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public int hashCode() {
-+ return val;
-+ }
-+ }
-+
-+ /**
-+ *
-+ */
-+ static class LargeDbKey implements Serializable {
-+ /** */
-+ int val;
-+
-+ /** */
-+ byte[] data;
-+
-+ /**
-+ * @param val Value.
-+ * @param size Key payload size.
-+ */
-+ LargeDbKey(int val, int size) {
-+ this.val = val;
-+
-+ data = new byte[size];
-+
-+ Arrays.fill(data, (byte)val);
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public boolean equals(Object o) {
-+ if (this == o)
-+ return true;
-+
-+ if (o == null || !(o instanceof LargeDbKey))
-+ return false;
-+
-+ LargeDbKey key = (LargeDbKey)o;
-+
-+ return val == key.val && Arrays.equals(data, key.data);
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public int hashCode() {
-+ return val + Arrays.hashCode(data);
-+ }
-+ }
-+
-+ /**
-+ *
-+ */
-+ static class DbValue implements Serializable {
-+ /** */
-+ @QuerySqlField(index = true)
-+ int iVal;
-+
-+ /** */
-+ @QuerySqlField(index = true)
-+ String sVal;
-+
-+ /** */
-+ @QuerySqlField
-+ long lVal;
-+
-+
-+
-+ /**
-+ * @param iVal Integer value.
-+ * @param sVal String value.
-+ * @param lVal Long value.
-+ */
-+ DbValue(int iVal, String sVal, long lVal) {
-+ this.iVal = iVal;
-+ this.sVal = sVal;
-+ this.lVal = lVal;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public boolean equals(Object o) {
-+ if (this == o)
-+ return true;
-+
-+ if (o == null || getClass() != o.getClass())
-+ return false;
-+
-+ DbValue dbVal = (DbValue)o;
-+
-+ return iVal == dbVal.iVal && lVal == dbVal.lVal &&
-+ !(sVal != null ? !sVal.equals(dbVal.sVal) : dbVal.sVal != null);
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public int hashCode() {
-+ int res = iVal;
-+
-+ res = 31 * res + (sVal != null ? sVal.hashCode() : 0);
-+ res = 31 * res + (int)(lVal ^ (lVal >>> 32));
-+
-+ return res;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public String toString() {
-+ return S.toString(DbValue.class, this);
-+ }
-+ }
-+
-+ /**
-+ *
-+ */
-+ static class LargeDbValue {
-+ /** */
-+ @QuerySqlField(index = true)
-+ String str1;
-+
-+ /** */
-+ @QuerySqlField(index = true)
-+ String str2;
-+
-+ /** */
-+ int[] arr;
-+
-+ /**
-+ * @param str1 String 1.
-+ * @param str2 String 2.
-+ * @param arr Big array.
-+ */
-+ LargeDbValue(final String str1, final String str2, final int[] arr) {
-+ this.str1 = str1;
-+ this.str2 = str2;
-+ this.arr = arr;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public boolean equals(final Object o) {
-+ if (this == o) return true;
-+ if (o == null || getClass() != o.getClass()) return false;
-+
-+ final LargeDbValue that = (LargeDbValue) o;
-+
-+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
-+ if (str2 != null ? !str2.equals(that.str2) : that.str2 != null) return false;
-+
-+ return Arrays.equals(arr, that.arr);
-+
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public int hashCode() {
-+ int res = str1 != null ? str1.hashCode() : 0;
-+
-+ res = 31 * res + (str2 != null ? str2.hashCode() : 0);
-+ res = 31 * res + Arrays.hashCode(arr);
-+
-+ return res;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override public String toString() {
-+ return S.toString(LargeDbValue.class, this);
-+ }
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-new file mode 100644
-index 0000000..6a5d039
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-@@ -0,0 +1,84 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+package org.apache.ignite.internal.processors.database;
-+
-+import org.apache.ignite.Ignite;
-+import org.apache.ignite.IgniteCompute;
-+import org.apache.ignite.compute.ComputeTaskFuture;
-+import org.apache.ignite.internal.IgniteEx;
-+import org.apache.ignite.lang.IgniteRunnable;
-+import org.apache.ignite.resources.IgniteInstanceResource;
-+
-+import java.util.concurrent.TimeUnit;
-+
-+/**
-+ *
-+ */
-+public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
-+
-+ /** Test duration in seconds*/
-+ protected abstract int duration();
-+
-+ @Override
-+ protected long getTestTimeout() {
-+ return duration() * 1200;
-+ }
-+
-+ /** */
-+ protected abstract void operation(IgniteEx ig);
-+
-+ /** */
-+ public void testMemoryLeak() throws Exception {
-+
-+ final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-+
-+ int tasksCount = Runtime.getRuntime().availableProcessors() * 4;
-+
-+ IgniteCompute compute = grid(0).compute().withAsync();
-+
-+ ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCount];
-+
-+ for (int i = 0; i < tasksCount; i++) {
-+ compute.run(new IgniteRunnable() {
-+ @IgniteInstanceResource
-+ private Ignite ig;
-+
-+ @Override
-+ public void run() {
-+ int i = 0;
-+ while (System.nanoTime() < end) {
-+ operation((IgniteEx) ig);
-+
-+ if(i++ == 100) {
-+ check((IgniteEx) ig);
-+ i = 0;
-+ }
-+ }
-+ }
-+ });
-+
-+ futs[i] = compute.future();
-+ }
-+
-+ for (ComputeTaskFuture fut : futs) {
-+ fut.get();
-+ }
-+ }
-+
-+ protected void check(IgniteEx ig) {}
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-new file mode 100644
-index 0000000..4cd74d0
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-@@ -0,0 +1,85 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+package org.apache.ignite.internal.processors.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return true;
-+ }
-+
-+ protected void operation(IgniteEx ig){
-+ IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ DbKey key = new DbKey(rnd.nextInt(200_000));
-+
-+ DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 19100);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-new file mode 100644
-index 0000000..a4d88e1
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-@@ -0,0 +1,95 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+package org.apache.ignite.internal.processors.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakLargeObjectsTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ private final static int[] ARRAY;
-+ static {
-+ ARRAY = new int[1024];
-+ Random rnd = new Random();
-+ for (int i = 0; i < ARRAY.length; i++) {
-+ ARRAY[i] = rnd.nextInt();
-+ }
-+
-+ }
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(60 * 1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return false;
-+ }
-+
-+ protected void operation(IgniteEx ig){
-+ IgniteCache<Object, Object> cache = ig.cache("large");
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ LargeDbKey key = new LargeDbKey(rnd.nextInt(10_000), 1024);
-+
-+ LargeDbValue v0 = new LargeDbValue("test-value-1-" + rnd.nextInt(200), "test-value-2-" + rnd.nextInt(200), ARRAY);
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 50000);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-new file mode 100644
-index 0000000..bfa4aa9
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-@@ -0,0 +1,90 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+package org.apache.ignite.internal.processors.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakLargePagesTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(100 * 1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return false;
-+ }
-+
-+ @Override
-+ protected boolean isLargePage() {
-+ return true;
-+ }
-+
-+ protected void operation(IgniteEx ig){
-+ IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ DbKey key = new DbKey(rnd.nextInt(200_000));
-+
-+ DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 4600);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-new file mode 100644
-index 0000000..6af4e41
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-@@ -0,0 +1,85 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+package org.apache.ignite.internal.processors.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return false;
-+ }
-+
-+ protected void operation(IgniteEx ig){
-+ IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ DbKey key = new DbKey(rnd.nextInt(200_000));
-+
-+ DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 19100);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-new file mode 100644
-index 0000000..d9e3f34
---- /dev/null
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-@@ -0,0 +1,92 @@
-+/*
-+ * Licensed to the Apache Software Foundation (ASF) under one or more
-+ * contributor license agreements. See the NOTICE file distributed with
-+ * this work for additional information regarding copyright ownership.
-+ * The ASF licenses this file to You under the Apache License, Version 2.0
-+ * (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+package org.apache.ignite.internal.processors.database;
-+
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+
-+import javax.cache.expiry.CreatedExpiryPolicy;
-+import javax.cache.expiry.Duration;
-+import javax.cache.expiry.ExpiryPolicy;
-+import java.util.Random;
-+import java.util.concurrent.ThreadLocalRandom;
-+
-+import static java.util.concurrent.TimeUnit.MILLISECONDS;
-+
-+/**
-+ *
-+ */
-+public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakAbstractTest {
-+
-+ private static final ExpiryPolicy EXPIRY = new CreatedExpiryPolicy(new Duration(MILLISECONDS, 10L));
-+
-+ @Override
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ @Override
-+ protected int gridCount() {
-+ return 1;
-+ }
-+
-+ @Override
-+ protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-+
-+ @Override
-+ protected void configure(MemoryConfiguration mCfg) {
-+ mCfg.setPageCacheSize(1024 * 1024);
-+ }
-+
-+ @Override
-+ protected boolean indexingEnabled() {
-+ return false;
-+ }
-+
-+ protected void operation(IgniteEx ig) {
-+ IgniteCache<Object, Object> cache = ig.cache("non-primitive").withExpiryPolicy(EXPIRY);
-+ Random rnd = ThreadLocalRandom.current();
-+
-+ for (int i = 0; i < 1000; i++) {
-+ DbKey key = new DbKey(rnd.nextInt(200_000));
-+
-+ DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-+
-+ switch (rnd.nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, v0);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-+ }
-+
-+ @Override
-+ protected void check(IgniteEx ig) {
-+ long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-+
-+ assertTrue(pages < 10000);
-+ }
-+}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetAbstractTest.java
-index c7a07e3..228a262 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetAbstractTest.java
-@@ -17,175 +17,39 @@
-
- package org.apache.ignite.internal.processors.database;
-
--import java.io.Serializable;
--import java.util.Arrays;
--import java.util.HashMap;
--import java.util.HashSet;
--import java.util.LinkedHashMap;
--import java.util.List;
--import java.util.Map;
--import java.util.Random;
--import java.util.Set;
--import java.util.UUID;
--import java.util.concurrent.ThreadLocalRandom;
--import javax.cache.Cache;
- import org.apache.ignite.Ignite;
- import org.apache.ignite.IgniteCache;
- import org.apache.ignite.IgniteDataStreamer;
--import org.apache.ignite.cache.CacheAtomicityMode;
- import org.apache.ignite.cache.CachePeekMode;
--import org.apache.ignite.cache.CacheRebalanceMode;
--import org.apache.ignite.cache.CacheWriteSynchronizationMode;
- import org.apache.ignite.cache.affinity.Affinity;
--import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
--import org.apache.ignite.cache.affinity.AffinityFunction;
- import org.apache.ignite.cache.query.QueryCursor;
- import org.apache.ignite.cache.query.ScanQuery;
- import org.apache.ignite.cache.query.SqlFieldsQuery;
- import org.apache.ignite.cache.query.SqlQuery;
--import org.apache.ignite.cache.query.annotations.QuerySqlField;
--import org.apache.ignite.configuration.CacheConfiguration;
--import org.apache.ignite.configuration.MemoryConfiguration;
--import org.apache.ignite.configuration.IgniteConfiguration;
- import org.apache.ignite.internal.IgniteEx;
- import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
- import org.apache.ignite.internal.processors.cache.database.tree.BPlusTree;
- import org.apache.ignite.internal.util.GridRandom;
- import org.apache.ignite.internal.util.typedef.PA;
- import org.apache.ignite.internal.util.typedef.X;
--import org.apache.ignite.internal.util.typedef.internal.S;
--import org.apache.ignite.internal.util.typedef.internal.U;
--import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
--import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
--import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
- import org.apache.ignite.testframework.GridTestUtils;
--import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
- import org.junit.Assert;
-
-+import javax.cache.Cache;
-+import java.util.HashMap;
-+import java.util.HashSet;
-+import java.util.LinkedHashMap;
-+import java.util.List;
-+import java.util.Map;
-+import java.util.Random;
-+import java.util.Set;
-+import java.util.UUID;
-+import java.util.concurrent.ThreadLocalRandom;
-+
- /**
- *
- */
--public abstract class IgniteDbPutGetAbstractTest extends GridCommonAbstractTest {
-- /** */
-- private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
--
-- /**
-- * @return Node count.
-- */
-- protected abstract int gridCount();
--
-- /**
-- * @return {@code True} if indexing is enabled.
-- */
-- protected abstract boolean indexingEnabled();
--
-- /** {@inheritDoc} */
-- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-- IgniteConfiguration cfg = super.getConfiguration(gridName);
--
-- MemoryConfiguration dbCfg = new MemoryConfiguration();
--
-- if (isLargePage()) {
-- dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
--
-- dbCfg.setPageSize(16 * 1024);
--
-- dbCfg.setPageCacheSize(200 * 1024 * 1024);
-- }
-- else {
-- dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
--
-- dbCfg.setPageSize(1024);
--
-- dbCfg.setPageCacheSize(200 * 1024 * 1024);
-- }
--
-- cfg.setMemoryConfiguration(dbCfg);
--
-- CacheConfiguration ccfg = new CacheConfiguration();
--
-- if (indexingEnabled())
-- ccfg.setIndexedTypes(Integer.class, DbValue.class);
--
-- ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-- ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-- ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
-- ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
--
-- CacheConfiguration ccfg2 = new CacheConfiguration("non-primitive");
--
-- if (indexingEnabled())
-- ccfg2.setIndexedTypes(DbKey.class, DbValue.class);
--
-- ccfg2.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-- ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-- ccfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
-- ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
--
-- CacheConfiguration ccfg3 = new CacheConfiguration("large");
--
-- if (indexingEnabled())
-- ccfg3.setIndexedTypes(Integer.class, LargeDbValue.class);
--
-- ccfg3.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-- ccfg3.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-- ccfg3.setRebalanceMode(CacheRebalanceMode.SYNC);
-- ccfg3.setAffinity(new RendezvousAffinityFunction(false, 32));
--
-- CacheConfiguration ccfg4 = new CacheConfiguration("tiny");
--
-- ccfg4.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-- ccfg4.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-- ccfg4.setRebalanceMode(CacheRebalanceMode.SYNC);
-- ccfg4.setAffinity(new RendezvousAffinityFunction(false, 32));
--
-- final AffinityFunction aff = new RendezvousAffinityFunction(1, null);
--
-- ccfg4.setAffinity(aff);
--
-- cfg.setCacheConfiguration(ccfg, ccfg2, ccfg3, ccfg4);
--
-- TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
--
-- discoSpi.setIpFinder(IP_FINDER);
--
-- cfg.setDiscoverySpi(discoSpi);
-- cfg.setMarshaller(null);
--
-- return cfg;
-- }
--
-- /** {@inheritDoc} */
-- @Override protected void beforeTest() throws Exception {
-- deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
--
-- long seed = 1464583813940L; // System.currentTimeMillis();
--
-- info("Seed: " + seed + "L");
--
-- BPlusTree.rnd = new Random(seed);
--
-- startGrids(gridCount());
--
-- awaitPartitionMapExchange();
-- }
--
-- /** {@inheritDoc} */
-- @Override protected void afterTest() throws Exception {
-- BPlusTree.rnd = null;
--
-- stopAllGrids();
--
-- deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-- }
--
-- /**
-- * @return {@code True} if use large page.
-- */
-- protected boolean isLargePage() {
-- return false;
-- };
--
-+public abstract class IgniteDbPutGetAbstractTest extends IgniteDbAbstractTest {
- /**
- *
- */
-@@ -1349,191 +1213,4 @@ private void checkEmpty(final GridCacheAdapter internalCache, final Object key)
-
- assertNull(internalCache.peekEx(key));
- }
--
-- /**
-- *
-- */
-- private static class DbKey implements Serializable {
-- /** */
-- private int val;
--
-- /**
-- * @param val Value.
-- */
-- private DbKey(int val) {
-- this.val = val;
-- }
--
-- /** {@inheritDoc} */
-- @Override public boolean equals(Object o) {
-- if (this == o)
-- return true;
--
-- if (o == null || !(o instanceof DbKey))
-- return false;
--
-- DbKey key = (DbKey)o;
--
-- return val == key.val;
-- }
--
-- /** {@inheritDoc} */
-- @Override public int hashCode() {
-- return val;
-- }
-- }
--
-- /**
-- *
-- */
-- private static class LargeDbKey implements Serializable {
-- /** */
-- private int val;
--
-- /** */
-- private byte[] data;
--
-- /**
-- * @param val Value.
-- * @param size Key payload size.
-- */
-- private LargeDbKey(int val, int size) {
-- this.val = val;
--
-- data = new byte[size];
--
-- Arrays.fill(data, (byte)val);
-- }
--
-- /** {@inheritDoc} */
-- @Override public boolean equals(Object o) {
-- if (this == o)
-- return true;
--
-- if (o == null || !(o instanceof LargeDbKey))
-- return false;
--
-- LargeDbKey key = (LargeDbKey)o;
--
-- return val == key.val && Arrays.equals(data, key.data);
-- }
--
-- /** {@inheritDoc} */
-- @Override public int hashCode() {
-- return val + Arrays.hashCode(data);
-- }
-- }
--
-- /**
-- *
-- */
-- private static class DbValue implements Serializable {
-- /** */
-- @QuerySqlField(index = true)
-- private int iVal;
--
-- /** */
-- @QuerySqlField(index = true)
-- private String sVal;
--
-- /** */
-- @QuerySqlField
-- private long lVal;
--
-- /**
-- * @param iVal Integer value.
-- * @param sVal String value.
-- * @param lVal Long value.
-- */
-- public DbValue(int iVal, String sVal, long lVal) {
-- this.iVal = iVal;
-- this.sVal = sVal;
-- this.lVal = lVal;
-- }
--
-- /** {@inheritDoc} */
-- @Override public boolean equals(Object o) {
-- if (this == o)
-- return true;
--
-- if (o == null || getClass() != o.getClass())
-- return false;
--
-- DbValue dbVal = (DbValue)o;
--
-- return iVal == dbVal.iVal && lVal == dbVal.lVal &&
-- !(sVal != null ? !sVal.equals(dbVal.sVal) : dbVal.sVal != null);
-- }
--
-- /** {@inheritDoc} */
-- @Override public int hashCode() {
-- int res = iVal;
--
-- res = 31 * res + (sVal != null ? sVal.hashCode() : 0);
-- res = 31 * res + (int)(lVal ^ (lVal >>> 32));
--
-- return res;
-- }
--
-- /** {@inheritDoc} */
-- @Override public String toString() {
-- return S.toString(DbValue.class, this);
-- }
-- }
--
-- /**
-- *
-- */
-- private static class LargeDbValue {
-- /** */
-- @QuerySqlField(index = true)
-- private String str1;
--
-- /** */
-- @QuerySqlField(index = true)
-- private String str2;
--
-- /** */
-- private int[] arr;
--
-- /**
-- * @param str1 String 1.
-- * @param str2 String 2.
-- * @param arr Big array.
-- */
-- public LargeDbValue(final String str1, final String str2, final int[] arr) {
-- this.str1 = str1;
-- this.str2 = str2;
-- this.arr = arr;
-- }
--
-- /** {@inheritDoc} */
-- @Override public boolean equals(final Object o) {
-- if (this == o) return true;
-- if (o == null || getClass() != o.getClass()) return false;
--
-- final LargeDbValue that = (LargeDbValue) o;
--
-- if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
-- if (str2 != null ? !str2.equals(that.str2) : that.str2 != null) return false;
--
-- return Arrays.equals(arr, that.arr);
--
-- }
--
-- /** {@inheritDoc} */
-- @Override public int hashCode() {
-- int res = str1 != null ? str1.hashCode() : 0;
--
-- res = 31 * res + (str2 != null ? str2.hashCode() : 0);
-- res = 31 * res + Arrays.hashCode(arr);
--
-- return res;
-- }
--
-- /** {@inheritDoc} */
-- @Override public String toString() {
-- return S.toString(LargeDbValue.class, this);
-- }
-- }
- }
-
-From 8e12097f9094d7f155135ee2f4c9c33f5f7af9aa Mon Sep 17 00:00:00 2001
-From: sboikov <sb...@gridgain.com>
-Date: Wed, 15 Feb 2017 15:08:14 +0300
-Subject: [PATCH 02/41] ignite-4694 review
-
----
- .../database/IgniteDbMemoryLeakAbstractTest.java | 15 ++++++++-------
- .../database/IgniteDbMemoryLeakIndexedTest.java | 3 +++
- .../database/IgniteDbMemoryLeakLargeObjectsTest.java | 9 +++++----
- .../database/IgniteDbMemoryLeakLargePagesTest.java | 2 ++
- .../processors/database/IgniteDbMemoryLeakTest.java | 10 +++++++---
- .../database/IgniteDbMemoryLeakWithExpirationTest.java | 2 +-
- 6 files changed, 26 insertions(+), 15 deletions(-)
-
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-index 6a5d039..fc0e715 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-@@ -27,10 +27,10 @@
- import java.util.concurrent.TimeUnit;
-
- /**
-- *
-+ * TODO: fix javadoc warnings, code style.
- */
- public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
--
-+ // TODO: take duration from system property.
- /** Test duration in seconds*/
- protected abstract int duration();
-
-@@ -44,16 +44,18 @@ protected long getTestTimeout() {
-
- /** */
- public void testMemoryLeak() throws Exception {
-+ // TODO: take PageMemory max size is the same as we configured.
-
- final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-
-- int tasksCount = Runtime.getRuntime().availableProcessors() * 4;
-+ // TODO: use threads instead of compute or make sure there are enough threads in pool.
-+ int tasksCnt = Runtime.getRuntime().availableProcessors() * 4;
-
- IgniteCompute compute = grid(0).compute().withAsync();
-
-- ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCount];
-+ ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCnt];
-
-- for (int i = 0; i < tasksCount; i++) {
-+ for (int i = 0; i < tasksCnt; i++) {
- compute.run(new IgniteRunnable() {
- @IgniteInstanceResource
- private Ignite ig;
-@@ -75,9 +77,8 @@ public void run() {
- futs[i] = compute.future();
- }
-
-- for (ComputeTaskFuture fut : futs) {
-+ for (ComputeTaskFuture fut : futs)
- fut.get();
-- }
- }
-
- protected void check(IgniteEx ig) {}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-index 4cd74d0..db77131 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-@@ -51,6 +51,7 @@ protected void configure(MemoryConfiguration mCfg) {
- }
-
- @Override
-+ // TODO: move test to module ignite-indexing.
- protected boolean indexingEnabled() {
- return true;
- }
-@@ -64,6 +65,8 @@ protected void operation(IgniteEx ig){
-
- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-
-+ // TODO: also execute sql queries.
-+
- switch (rnd.nextInt(3)) {
- case 0:
- cache.getAndPut(key, v0);
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-index a4d88e1..2a6c8cd 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-@@ -29,15 +29,16 @@
- *
- */
- public class IgniteDbMemoryLeakLargeObjectsTest extends IgniteDbMemoryLeakAbstractTest {
--
-+ /** */
- private final static int[] ARRAY;
-+
- static {
- ARRAY = new int[1024];
-+
- Random rnd = new Random();
-- for (int i = 0; i < ARRAY.length; i++) {
-- ARRAY[i] = rnd.nextInt();
-- }
-
-+ for (int i = 0; i < ARRAY.length; i++)
-+ ARRAY[i] = rnd.nextInt();
- }
-
- @Override
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-index bfa4aa9..91c96af 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-@@ -47,6 +47,7 @@ protected void configure(IgniteConfiguration cfg) {
-
- @Override
- protected void configure(MemoryConfiguration mCfg) {
-+ // TODO: understand why such overhead with large pages.
- mCfg.setPageCacheSize(100 * 1024 * 1024);
- }
-
-@@ -60,6 +61,7 @@ protected boolean isLargePage() {
- return true;
- }
-
-+ // TODO: avoid copy/paste.
- protected void operation(IgniteEx ig){
- IgniteCache<Object, Object> cache = ig.cache("non-primitive");
- Random rnd = ThreadLocalRandom.current();
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-index 6af4e41..2b0ce1e 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-@@ -29,9 +29,8 @@
- *
- */
- public class IgniteDbMemoryLeakTest extends IgniteDbMemoryLeakAbstractTest {
--
-- @Override
-- protected int duration() {
-+ /** {@inheritDoc} */
-+ @Override protected int duration() {
- return 300;
- }
-
-@@ -64,12 +63,17 @@ protected void operation(IgniteEx ig){
-
- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
-
-+ // TODO: also execute scan query.
-+
- switch (rnd.nextInt(3)) {
- case 0:
- cache.getAndPut(key, v0);
-+ break;
-+
- case 1:
- cache.get(key);
- break;
-+
- case 2:
- cache.getAndRemove(key);
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-index d9e3f34..95fe8c8 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-@@ -34,7 +34,7 @@
- *
- */
- public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakAbstractTest {
--
-+ /** */
- private static final ExpiryPolicy EXPIRY = new CreatedExpiryPolicy(new Duration(MILLISECONDS, 10L));
-
- @Override
-
-From e70d990f14288cfc8fe211fa25631016d5708144 Mon Sep 17 00:00:00 2001
-From: Igor Seliverstov <gv...@gmail.com>
-Date: Wed, 15 Feb 2017 18:04:38 +0300
-Subject: [PATCH 03/41] IGNITE-4694 Add tests to check there are no memory
- leaks in PageMemory
-
----
- .../cache/IgniteCacheOffheapManagerImpl.java | 2 +-
- .../processors/database/IgniteDbAbstractTest.java | 6 +
- .../database/IgniteDbMemoryLeakAbstractTest.java | 172 ++++++++++++++++-----
- .../database/IgniteDbMemoryLeakIndexedTest.java | 65 +-------
- .../IgniteDbMemoryLeakLargeObjectsTest.java | 64 ++------
- .../database/IgniteDbMemoryLeakLargePagesTest.java | 67 ++------
- .../database/IgniteDbMemoryLeakTest.java | 63 ++------
- .../IgniteDbMemoryLeakWithExpirationTest.java | 58 +------
- 8 files changed, 182 insertions(+), 315 deletions(-)
-
-diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
-index 5df99b6..9becc99 100644
---- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
-+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
-@@ -897,7 +897,7 @@ public CacheDataStoreImpl(
- */
- private boolean canUpdateOldRow(@Nullable CacheDataRow oldRow, DataRow dataRow)
- throws IgniteCheckedException {
-- if (oldRow == null || indexingEnabled)
-+ if (oldRow == null || indexingEnabled || oldRow.expireTime() != dataRow.expireTime())
- return false;
-
- CacheObjectContext coCtx = cctx.cacheObjectContext();
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-index 3bc7004..9297cec 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java
-@@ -130,10 +130,16 @@
- return cfg;
- }
-
-+ /**
-+ * @param cfg IgniteConfiguration.
-+ */
- protected void configure(IgniteConfiguration cfg){
- //NOP
- }
-
-+ /**
-+ * @param mCfg MemoryConfiguration.
-+ */
- protected void configure(MemoryConfiguration mCfg){
- //NOP
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-index fc0e715..bca3af0 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-@@ -17,69 +17,157 @@
-
- package org.apache.ignite.internal.processors.database;
-
--import org.apache.ignite.Ignite;
--import org.apache.ignite.IgniteCompute;
--import org.apache.ignite.compute.ComputeTaskFuture;
--import org.apache.ignite.internal.IgniteEx;
--import org.apache.ignite.lang.IgniteRunnable;
--import org.apache.ignite.resources.IgniteInstanceResource;
--
-+import java.util.Random;
- import java.util.concurrent.TimeUnit;
-+import org.apache.ignite.IgniteCache;
-+import org.apache.ignite.configuration.IgniteConfiguration;
-+import org.apache.ignite.configuration.MemoryConfiguration;
-+import org.apache.ignite.internal.IgniteEx;
-+import org.apache.ignite.internal.util.GridRandom;
-+import org.jetbrains.annotations.NotNull;
-
- /**
-- * TODO: fix javadoc warnings, code style.
-+ * Base class for memory leaks tests.
- */
- public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
-- // TODO: take duration from system property.
-- /** Test duration in seconds*/
-- protected abstract int duration();
--
-- @Override
-- protected long getTestTimeout() {
-- return duration() * 1200;
-- }
-
- /** */
-- protected abstract void operation(IgniteEx ig);
-+ private volatile Exception ex = null;
-
- /** */
-- public void testMemoryLeak() throws Exception {
-- // TODO: take PageMemory max size is the same as we configured.
-+ private static final ThreadLocal<Random> THREAD_LOCAL_RANDOM = new ThreadLocal<>();
-
-- final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-+ /** {@inheritDoc} */
-+ @Override protected void configure(IgniteConfiguration cfg) {
-+ cfg.setMetricsLogFrequency(5000);
-+ }
-
-- // TODO: use threads instead of compute or make sure there are enough threads in pool.
-- int tasksCnt = Runtime.getRuntime().availableProcessors() * 4;
-+ /** {@inheritDoc} */
-+ @Override protected void configure(MemoryConfiguration mCfg) {
-+ int concLvl = Runtime.getRuntime().availableProcessors();
-
-- IgniteCompute compute = grid(0).compute().withAsync();
-+ mCfg.setConcurrencyLevel(concLvl);
-+ mCfg.setPageCacheSize(1024 * 1024 * concLvl); //minimal possible value
-+ }
-
-- ComputeTaskFuture[] futs = new ComputeTaskFuture[tasksCnt];
-+ /**
-+ * @return Test duration in seconds.
-+ */
-+ protected int duration() {
-+ return 300;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override protected int gridCount() {
-+ return 1;
-+ }
-+
-+ /** {@inheritDoc} */
-+ @Override protected boolean indexingEnabled() {
-+ return false;
-+ }
-
-- for (int i = 0; i < tasksCnt; i++) {
-- compute.run(new IgniteRunnable() {
-- @IgniteInstanceResource
-- private Ignite ig;
-+ /** {@inheritDoc} */
-+ @Override protected long getTestTimeout() {
-+ return (duration() + 1) * 1000;
-+ }
-
-- @Override
-- public void run() {
-- int i = 0;
-- while (System.nanoTime() < end) {
-- operation((IgniteEx) ig);
-+ /**
-+ * @param ig Ignite instance.
-+ * @return IgniteCache.
-+ */
-+ protected abstract IgniteCache<Object,Object> cache(IgniteEx ig);
-+
-+ /**
-+ * @return Cache key to perform an operation.
-+ */
-+ protected abstract Object key();
-+
-+ /**
-+ * @return Cache value to perform an operation.
-+ * @param key Cache key to perform an operation.
-+ */
-+ protected abstract Object value(Object key);
-+
-+ /**
-+ * @param cache IgniteCache.
-+ */
-+ protected void operation(IgniteCache<Object, Object> cache) {
-+ Object key = key();
-+ Object value = value(key);
-+
-+ switch (getRandom().nextInt(3)) {
-+ case 0:
-+ cache.getAndPut(key, value);
-+ case 1:
-+ cache.get(key);
-+ break;
-+ case 2:
-+ cache.getAndRemove(key);
-+ }
-+ }
-
-- if(i++ == 100) {
-- check((IgniteEx) ig);
-- i = 0;
-- }
-+ /**
-+ * @return Random.
-+ */
-+ @NotNull protected static Random getRandom() {
-+ Random rnd = THREAD_LOCAL_RANDOM.get();
-+
-+ if(rnd == null){
-+ rnd = new GridRandom();
-+ THREAD_LOCAL_RANDOM.set(rnd);
-+ }
-+
-+ return rnd;
-+ }
-+
-+ /**
-+ * @throws Exception If failed.
-+ */
-+ public void testMemoryLeak() throws Exception {
-+ final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-+
-+ final IgniteEx ignite = grid(0);
-+ final IgniteCache<Object, Object> cache = cache(ignite);
-+
-+ Runnable target = new Runnable() {
-+ @Override public void run() {
-+ while (ex == null && System.nanoTime() < end) {
-+ try {
-+ operation(cache);
-+ check(ignite);
-+ }
-+ catch (Exception e) {
-+ ex = e;
-+
-+ break;
- }
- }
-- });
-+ }
-+ };
-+
-+ Thread[] threads = new Thread[Runtime.getRuntime().availableProcessors()];
-
-- futs[i] = compute.future();
-+ for (int i = 0; i < threads.length; i++) {
-+ threads[i] = new Thread(target);
-+ threads[i].start();
- }
-
-- for (ComputeTaskFuture fut : futs)
-- fut.get();
-+ for (Thread thread : threads) {
-+ thread.join();
-+ }
-+
-+ if(ex != null){
-+ throw ex;
-+ }
- }
-
-- protected void check(IgniteEx ig) {}
-+ /**
-+ * Callback to check the current state
-+ *
-+ * @param ig Ignite instance
-+ * @throws Exception If failed.
-+ */
-+ protected void check(IgniteEx ig) throws Exception {
-+ }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-index db77131..acc6c2f 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-@@ -17,72 +17,13 @@
-
- package org.apache.ignite.internal.processors.database;
-
--import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
--import org.apache.ignite.configuration.MemoryConfiguration;
--import org.apache.ignite.internal.IgniteEx;
--
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
--
- /**
- *
- */
--public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakAbstractTest {
--
-- @Override
-- protected int duration() {
-- return 300;
-- }
--
-- @Override
-- protected int gridCount() {
-- return 1;
-- }
--
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
-- }
--
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- mCfg.setPageCacheSize(1024 * 1024);
-- }
-+public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakTest {
-
-- @Override
-- // TODO: move test to module ignite-indexing.
-- protected boolean indexingEnabled() {
-+ /** {@inheritDoc} */
-+ @Override protected boolean indexingEnabled() {
- return true;
- }
--
-- protected void operation(IgniteEx ig){
-- IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- DbKey key = new DbKey(rnd.nextInt(200_000));
--
-- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
--
-- // TODO: also execute sql queries.
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- case 1:
-- cache.get(key);
-- break;
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-- }
--
-- @Override
-- protected void check(IgniteEx ig) {
-- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
--
-- assertTrue(pages < 19100);
-- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-index 2a6c8cd..8943743 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-@@ -18,13 +18,8 @@
- package org.apache.ignite.internal.processors.database;
-
- import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
--import org.apache.ignite.configuration.MemoryConfiguration;
- import org.apache.ignite.internal.IgniteEx;
-
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
--
- /**
- *
- */
-@@ -35,62 +30,29 @@
- static {
- ARRAY = new int[1024];
-
-- Random rnd = new Random();
--
- for (int i = 0; i < ARRAY.length; i++)
-- ARRAY[i] = rnd.nextInt();
-- }
--
-- @Override
-- protected int duration() {
-- return 300;
-- }
--
-- @Override
-- protected int gridCount() {
-- return 1;
-+ ARRAY[i] = getRandom().nextInt();
- }
-
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
-+ /** {@inheritDoc} */
-+ @Override protected IgniteCache<Object, Object> cache(IgniteEx ig) {
-+ return ig.cache("non-primitive");
- }
-
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- mCfg.setPageCacheSize(60 * 1024 * 1024);
-+ /** {@inheritDoc} */
-+ @Override protected Object key() {
-+ return new DbKey(getRandom().nextInt(200_000));
- }
-
-- @Override
-- protected boolean indexingEnabled() {
-- return false;
-- }
--
-- protected void operation(IgniteEx ig){
-- IgniteCache<Object, Object> cache = ig.cache("large");
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- LargeDbKey key = new LargeDbKey(rnd.nextInt(10_000), 1024);
--
-- LargeDbValue v0 = new LargeDbValue("test-value-1-" + rnd.nextInt(200), "test-value-2-" + rnd.nextInt(200), ARRAY);
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- case 1:
-- cache.get(key);
-- break;
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-+ /** {@inheritDoc} */
-+ @Override protected Object value(Object key) {
-+ return new DbValue(((DbKey)key).val, "test-value-" + getRandom().nextInt(200), getRandom().nextInt(500));
- }
-
-- @Override
-- protected void check(IgniteEx ig) {
-+ /** {@inheritDoc} */
-+ @Override protected void check(IgniteEx ig) {
- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-
-- assertTrue(pages < 50000);
-+ assertTrue(pages < 20000);
- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-index 91c96af..8e4d0b4 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargePagesTest.java
-@@ -17,76 +17,31 @@
-
- package org.apache.ignite.internal.processors.database;
-
--import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
- import org.apache.ignite.configuration.MemoryConfiguration;
- import org.apache.ignite.internal.IgniteEx;
-
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
--
- /**
- *
- */
--public class IgniteDbMemoryLeakLargePagesTest extends IgniteDbMemoryLeakAbstractTest {
--
-- @Override
-- protected int duration() {
-- return 300;
-- }
-+public class IgniteDbMemoryLeakLargePagesTest extends IgniteDbMemoryLeakTest {
-
-- @Override
-- protected int gridCount() {
-- return 1;
-- }
-+ /** {@inheritDoc} */
-+ @Override protected void configure(MemoryConfiguration mCfg) {
-+ int concLvl = Runtime.getRuntime().availableProcessors();
-+ mCfg.setConcurrencyLevel(concLvl);
-+ mCfg.setPageCacheSize(1024 * 1024 * concLvl * 16);
-
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
- }
-
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- // TODO: understand why such overhead with large pages.
-- mCfg.setPageCacheSize(100 * 1024 * 1024);
-- }
--
-- @Override
-- protected boolean indexingEnabled() {
-- return false;
-- }
--
-- @Override
-- protected boolean isLargePage() {
-+ /** {@inheritDoc} */
-+ @Override protected boolean isLargePage() {
- return true;
- }
-
-- // TODO: avoid copy/paste.
-- protected void operation(IgniteEx ig){
-- IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- DbKey key = new DbKey(rnd.nextInt(200_000));
--
-- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- case 1:
-- cache.get(key);
-- break;
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-- }
--
-- @Override
-- protected void check(IgniteEx ig) {
-+ /** {@inheritDoc} */
-+ @Override protected void check(IgniteEx ig) {
- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-
-- assertTrue(pages < 4600);
-+ assertTrue(pages < 4000);
- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-index 2b0ce1e..81d831b 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakTest.java
-@@ -18,72 +18,31 @@
- package org.apache.ignite.internal.processors.database;
-
- import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
--import org.apache.ignite.configuration.MemoryConfiguration;
- import org.apache.ignite.internal.IgniteEx;
-
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
--
- /**
- *
- */
- public class IgniteDbMemoryLeakTest extends IgniteDbMemoryLeakAbstractTest {
- /** {@inheritDoc} */
-- @Override protected int duration() {
-- return 300;
-- }
--
-- @Override
-- protected int gridCount() {
-- return 1;
-- }
--
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
-- }
--
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- mCfg.setPageCacheSize(1024 * 1024);
-+ @Override protected IgniteCache<Object, Object> cache(IgniteEx ig) {
-+ return ig.cache("non-primitive");
- }
-
-- @Override
-- protected boolean indexingEnabled() {
-- return false;
-+ /** {@inheritDoc} */
-+ @Override protected Object key() {
-+ return new DbKey(getRandom().nextInt(200_000));
- }
-
-- protected void operation(IgniteEx ig){
-- IgniteCache<Object, Object> cache = ig.cache("non-primitive");
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- DbKey key = new DbKey(rnd.nextInt(200_000));
--
-- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
--
-- // TODO: also execute scan query.
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- break;
--
-- case 1:
-- cache.get(key);
-- break;
--
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-+ /** {@inheritDoc} */
-+ @Override protected Object value(Object key) {
-+ return new DbValue(((DbKey)key).val, "test-value-" + getRandom().nextInt(200), getRandom().nextInt(500));
- }
-
-- @Override
-- protected void check(IgniteEx ig) {
-+ /** {@inheritDoc} */
-+ @Override protected void check(IgniteEx ig) {
- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-
-- assertTrue(pages < 19100);
-+ assertTrue(pages < 20000);
- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-index 95fe8c8..a31ffb4 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakWithExpirationTest.java
-@@ -18,75 +18,31 @@
- package org.apache.ignite.internal.processors.database;
-
- import org.apache.ignite.IgniteCache;
--import org.apache.ignite.configuration.IgniteConfiguration;
- import org.apache.ignite.configuration.MemoryConfiguration;
- import org.apache.ignite.internal.IgniteEx;
-
- import javax.cache.expiry.CreatedExpiryPolicy;
- import javax.cache.expiry.Duration;
- import javax.cache.expiry.ExpiryPolicy;
--import java.util.Random;
--import java.util.concurrent.ThreadLocalRandom;
-
- import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
- /**
- *
- */
--public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakAbstractTest {
-+public class IgniteDbMemoryLeakWithExpirationTest extends IgniteDbMemoryLeakTest {
- /** */
- private static final ExpiryPolicy EXPIRY = new CreatedExpiryPolicy(new Duration(MILLISECONDS, 10L));
-
-- @Override
-- protected int duration() {
-- return 300;
-+ /** {@inheritDoc} */
-+ @Override protected IgniteCache<Object, Object> cache(IgniteEx ig) {
-+ return ig.cache("non-primitive").withExpiryPolicy(EXPIRY);
- }
-
-- @Override
-- protected int gridCount() {
-- return 1;
-- }
--
-- @Override
-- protected void configure(IgniteConfiguration cfg) {
-- cfg.setMetricsLogFrequency(5000);
-- }
--
-- @Override
-- protected void configure(MemoryConfiguration mCfg) {
-- mCfg.setPageCacheSize(1024 * 1024);
-- }
--
-- @Override
-- protected boolean indexingEnabled() {
-- return false;
-- }
--
-- protected void operation(IgniteEx ig) {
-- IgniteCache<Object, Object> cache = ig.cache("non-primitive").withExpiryPolicy(EXPIRY);
-- Random rnd = ThreadLocalRandom.current();
--
-- for (int i = 0; i < 1000; i++) {
-- DbKey key = new DbKey(rnd.nextInt(200_000));
--
-- DbValue v0 = new DbValue(key.val, "test-value-" + rnd.nextInt(200), rnd.nextInt(500));
--
-- switch (rnd.nextInt(3)) {
-- case 0:
-- cache.getAndPut(key, v0);
-- case 1:
-- cache.get(key);
-- break;
-- case 2:
-- cache.getAndRemove(key);
-- }
-- }
-- }
--
-- @Override
-- protected void check(IgniteEx ig) {
-+ /** {@inheritDoc} */
-+ @Override protected void check(IgniteEx ig) {
- long pages = ig.context().cache().context().database().pageMemory().loadedPages();
-
-- assertTrue(pages < 10000);
-+ assertTrue(pages < 7000);
- }
- }
-
-From 84c03e0c522abc90b2d91e514138eac08388abd2 Mon Sep 17 00:00:00 2001
-From: Igor Seliverstov <gv...@gmail.com>
-Date: Thu, 16 Feb 2017 13:41:51 +0300
-Subject: [PATCH 04/41] IGNITE-4694 Add tests to check there are no memory
- leaks in PageMemory (pending)
-
----
- .../database/IgniteDbMemoryLeakAbstractTest.java | 118 +++++++++++++++++----
- .../database/IgniteDbMemoryLeakIndexedTest.java | 29 -----
- .../IgniteDbMemoryLeakLargeObjectsTest.java | 16 +--
- .../database/IgniteDbMemoryLeakLargePagesTest.java | 13 +--
- .../database/IgniteDbMemoryLeakTest.java | 14 ++-
- .../IgniteDbMemoryLeakWithExpirationTest.java | 7 +-
- .../database/IgniteDbMemoryLeakIndexedTest.java | 42 ++++++++
- 7 files changed, 165 insertions(+), 74 deletions(-)
- delete mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
- create mode 100644 modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-index bca3af0..819405e 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
-@@ -30,13 +30,37 @@
- * Base class for memory leaks tests.
- */
- public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTest {
--
-+ /** */
-+ @SuppressWarnings("WeakerAccess") protected static final int CONCURRENCY_LEVEL = 8;
- /** */
- private volatile Exception ex = null;
-
- /** */
-+ private long warmUpEndTime;
-+
-+ /** */
-+ private long endTime;
-+
-+ /** */
-+ private long loadedPages = 0;
-+
-+ /** */
-+ private long delta = 0;
-+
-+ /** */
-+ private long probeCnt = 0;
-+
-+ /** */
- private static final ThreadLocal<Random> THREAD_LOCAL_RANDOM = new ThreadLocal<>();
-
-+ @Override protected void beforeTest() throws Exception {
-+ super.beforeTest();
-+
-+ long startTime = System.nanoTime();
-+ warmUpEndTime = startTime + TimeUnit.SECONDS.toNanos(warmUp());
-+ endTime = warmUpEndTime + TimeUnit.SECONDS.toNanos(duration());
-+ }
-+
- /** {@inheritDoc} */
- @Override protected void configure(IgniteConfiguration cfg) {
- cfg.setMetricsLogFrequency(5000);
-@@ -44,10 +68,7 @@
-
- /** {@inheritDoc} */
- @Override protected void configure(MemoryConfiguration mCfg) {
-- int concLvl = Runtime.getRuntime().availableProcessors();
--
-- mCfg.setConcurrencyLevel(concLvl);
-- mCfg.setPageCacheSize(1024 * 1024 * concLvl); //minimal possible value
-+ mCfg.setConcurrencyLevel(CONCURRENCY_LEVEL);
- }
-
- /**
-@@ -57,6 +78,13 @@ protected int duration() {
- return 300;
- }
-
-+ /**
-+ * @return Warm up duration.
-+ */
-+ @SuppressWarnings("WeakerAccess") protected int warmUp() {
-+ return 300;
-+ }
-+
- /** {@inheritDoc} */
- @Override protected int gridCount() {
- return 1;
-@@ -69,14 +97,14 @@ protected int duration() {
-
- /** {@inheritDoc} */
- @Override protected long getTestTimeout() {
-- return (duration() + 1) * 1000;
-+ return (warmUp() + duration() + 1) * 1000; // One extra second to stop all threads
- }
-
- /**
- * @param ig Ignite instance.
- * @return IgniteCache.
- */
-- protected abstract IgniteCache<Object,Object> cache(IgniteEx ig);
-+ protected abstract IgniteCache<Object, Object> cache(IgniteEx ig);
-
- /**
- * @return Cache key to perform an operation.
-@@ -84,8 +112,8 @@ protected int duration() {
- protected abstract Object key();
-
- /**
-- * @return Cache value to perform an operation.
- * @param key Cache key to perform an operation.
-+ * @return Cache value to perform an operation.
- */
- protected abstract Object value(Object key);
-
-@@ -99,8 +127,11 @@ protected void operation(IgniteCache<Object, Object> cache) {
- switch (getRandom().nextInt(3)) {
- case 0:
- cache.getAndPut(key, value);
-+
-+ break;
- case 1:
- cache.get(key);
-+
- break;
- case 2:
- cache.getAndRemove(key);
-@@ -113,7 +144,7 @@ protected void operation(IgniteCache<Object, Object> cache) {
- @NotNull protected static Random getRandom() {
- Random rnd = THREAD_LOCAL_RANDOM.get();
-
-- if(rnd == null){
-+ if (rnd == null) {
- rnd = new GridRandom();
- THREAD_LOCAL_RANDOM.set(rnd);
- }
-@@ -125,49 +156,96 @@ protected void operation(IgniteCache<Object, Object> cache) {
- * @throws Exception If failed.
- */
- public void testMemoryLeak() throws Exception {
-- final long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(duration());
-
- final IgniteEx ignite = grid(0);
- final IgniteCache<Object, Object> cache = cache(ignite);
-
- Runnable target = new Runnable() {
- @Override public void run() {
-- while (ex == null && System.nanoTime() < end) {
-+ while (ex == null && System.nanoTime() < endTime) {
- try {
- operation(cache);
-- check(ignite);
- }
- catch (Exception e) {
- ex = e;
--
- break;
- }
- }
- }
- };
-
-- Thread[] threads = new Thread[Runtime.getRuntime().availableProcessors()];
-+ Thread[] threads = new Thread[CONCURRENCY_LEVEL];
-+
-+ info("Warming up is started.");
-
- for (int i = 0; i < threads.length; i++) {
- threads[i] = new Thread(target);
- threads[i].start();
- }
-
-- for (Thread thread : threads) {
-- thread.join();
-+ Thread.sleep(TimeUnit.NANOSECONDS.toMillis(warmUpEndTime - System.nanoTime()));
-+
-+ info("Warming up is ended.");
-+
-+ while (System.nanoTime() < endTime) {
-+ try {
-+ check(ignite);
-+ }
-+ catch (Exception e) {
-+ ex = e;
-+
-+ break;
-+ }
-+
-+ Thread.sleep(TimeUnit.SECONDS.toMillis(5));
- }
-
-- if(ex != null){
-+ for (Thread thread : threads)
-+ thread.join();
-+
-+ if (ex != null)
- throw ex;
-- }
- }
-
- /**
-- * Callback to check the current state
-+ * Callback to check the current state.
- *
-- * @param ig Ignite instance
-+ * @param ig Ignite instance.
- * @throws Exception If failed.
- */
- protected void check(IgniteEx ig) throws Exception {
-+ long pagesActual = ig.context().cache().context().database().pageMemory().loadedPages();
-+ long pagesMax = pagesMax();
-+
-+ assertTrue(
-+ "Maximal allowed pages number is exceeded. [allowed=" + pagesMax + "; actual= " + pagesActual + "]",
-+ pagesActual <= pagesMax);
-+
-+ if (loadedPages > 0) {
-+ delta += pagesActual - loadedPages;
-+ int allowedDelta = pagesDelta();
-+
-+ if(probeCnt++ > 12) { // we need some statistic first. Minimal statistic is taken for a minute.
-+ long actualDelta = delta / probeCnt;
-+
-+ assertTrue(
-+ "Average growth pages in the number is more than expected. [allowed=" + allowedDelta + "; actual=" + actualDelta + "]",
-+ actualDelta <= allowedDelta);
-+ }
-+ }
-+
-+ loadedPages = pagesActual;
-+ }
-+
-+ /**
-+ * @return Maximal allowed pages number.
-+ */
-+ protected abstract long pagesMax();
-+
-+ /**
-+ * @return Expected average number of pages, on which their total number can grow per 5 seconds.
-+ */
-+ @SuppressWarnings("WeakerAccess") protected int pagesDelta() {
-+ return 5;
- }
- }
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-deleted file mode 100644
-index acc6c2f..0000000
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakIndexedTest.java
-+++ /dev/null
-@@ -1,29 +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.
-- */
--
--package org.apache.ignite.internal.processors.database;
--
--/**
-- *
-- */
--public class IgniteDbMemoryLeakIndexedTest extends IgniteDbMemoryLeakTest {
--
-- /** {@inheritDoc} */
-- @Override protected boolean indexingEnabled() {
-- return true;
-- }
--}
-diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-index 8943743..c1b1c9b 100644
---- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakLargeObjectsTest.java
-@@ -36,23 +36,25 @@
-
- /** {@inheritDoc} */
- @Override protected IgniteCache<Object, Object> cache(IgniteEx ig) {
-- return ig.cache("non-primitive");
-+ return ig.cache("large");
- }
-
- /** {@inheritDoc} */
- @Override protected Object key() {
-- return new DbKey(getRandom().nextInt(200_000));
-+ return new LargeDbKey(getRandom().nextInt(10_000), 1024);
- }
-
- /** {@inheritDoc} */
- @Override protected Object value(Object key) {
-- return new DbValue(((DbKey)key).val, "test-value-" + getRandom().nextInt(200), getRandom().nextInt(500));
-+ return new LargeDbValue("test-value-1-" + getRandom().nextInt(200), "test-value-2-" + getRandom().nextInt(200), ARRAY);
-
<TRUNCATED>
[38/50] [abbrv] ignite git commit: IGNITE-3581: Moved enums to
separate structs for C++
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc-test/src/column_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/column_test.cpp b/modules/platforms/cpp/odbc-test/src/column_test.cpp
index 66d0214..adc40c4 100644
--- a/modules/platforms/cpp/odbc-test/src/column_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/column_test.cpp
@@ -68,9 +68,9 @@ BOOST_AUTO_TEST_CASE(TestColumnShort)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_SIGNED_SHORT, &shortBuf, sizeof(shortBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_SIGNED_SHORT, &shortBuf, sizeof(shortBuf), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(TestColumnShort)
BOOST_REQUIRE(shortBuf == data);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -116,9 +116,9 @@ BOOST_AUTO_TEST_CASE(TestColumnString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(TestColumnString)
BOOST_REQUIRE(std::string(strBuf) == data);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -166,9 +166,9 @@ BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf[0], strBuf.size(), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_CHAR, &strBuf[0], strBuf.size(), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -178,7 +178,7 @@ BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
res.append(strBuf.c_str());
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
res.append(strBuf.c_str());
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -198,7 +198,7 @@ BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
res.append(strBuf.c_str());
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -248,9 +248,9 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
- BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column1.IsValid());
@@ -260,7 +260,7 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
BOOST_REQUIRE(std::string(strBuf) == data1);
- BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column1.IsValid());
@@ -268,7 +268,7 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
BOOST_REQUIRE(column1.GetUnreadDataLength() == 0);
- BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column2.IsValid());
@@ -278,7 +278,7 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
BOOST_REQUIRE(std::string(strBuf) == data2);
- BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column2.IsValid());
@@ -314,9 +314,9 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArray)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf[0], buf.size(), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_BINARY, &buf[0], buf.size(), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -326,7 +326,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArray)
BOOST_REQUIRE_EQUAL_COLLECTIONS(buf.begin(), buf.end(), data.begin(), data.end());
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -364,9 +364,9 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayHalfBuffer)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf[0], buf.size(), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_BINARY, &buf[0], buf.size(), &reslen, &offset);
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -378,7 +378,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayHalfBuffer)
result.reserve(data.size());
std::copy(buf.begin(), buf.end(), std::back_inserter(result));
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column.IsValid());
@@ -388,7 +388,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayHalfBuffer)
std::copy(buf.begin(), buf.end(), std::back_inserter(result));
- BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column.IsValid());
@@ -437,9 +437,9 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf, sizeof(buf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(type_traits::OdbcNativeType::AI_BINARY, &buf, sizeof(buf), &reslen, &offset);
- BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column1.IsValid());
@@ -449,7 +449,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
BOOST_REQUIRE_EQUAL_COLLECTIONS(buf, buf + reslen, data1.begin(), data1.end());
- BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column1.IsValid());
@@ -457,7 +457,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
BOOST_REQUIRE(column1.GetUnreadDataLength() == 0);
- BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(column2.IsValid());
@@ -467,7 +467,7 @@ BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
BOOST_REQUIRE_EQUAL_COLLECTIONS(buf, buf + reslen, data2.begin(), data2.end());
- BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SqlResult::AI_NO_DATA);
BOOST_REQUIRE(column2.IsValid());
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp b/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp
index dd8d1f6..c2fe4f8 100644
--- a/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/connection_info_test.cpp
@@ -38,181 +38,181 @@ BOOST_AUTO_TEST_CASE(TestConnectionInfoSupportedInfo)
ConnectionInfo info;
- SqlResult result;
+ SqlResult::Type result;
#ifdef SQL_DRIVER_NAME
result = info.GetInfo(SQL_DRIVER_NAME, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DRIVER_NAME
#ifdef SQL_DBMS_NAME
result = info.GetInfo(SQL_DBMS_NAME, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DBMS_NAME
#ifdef SQL_DRIVER_ODBC_VER
result = info.GetInfo(SQL_DRIVER_ODBC_VER, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DRIVER_ODBC_VER
#ifdef SQL_DBMS_VER
result = info.GetInfo(SQL_DBMS_VER, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DBMS_VER
#ifdef SQL_DRIVER_VER
result = info.GetInfo(SQL_DRIVER_VER, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DRIVER_VER
#ifdef SQL_COLUMN_ALIAS
result = info.GetInfo(SQL_COLUMN_ALIAS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_COLUMN_ALIAS
#ifdef SQL_IDENTIFIER_QUOTE_CHAR
result = info.GetInfo(SQL_IDENTIFIER_QUOTE_CHAR, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_IDENTIFIER_QUOTE_CHAR
#ifdef SQL_CATALOG_NAME_SEPARATOR
result = info.GetInfo(SQL_CATALOG_NAME_SEPARATOR, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CATALOG_NAME_SEPARATOR
#ifdef SQL_SPECIAL_CHARACTERS
result = info.GetInfo(SQL_SPECIAL_CHARACTERS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SPECIAL_CHARACTERS
#ifdef SQL_CATALOG_TERM
result = info.GetInfo(SQL_CATALOG_TERM, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CATALOG_TERM
#ifdef SQL_TABLE_TERM
result = info.GetInfo(SQL_TABLE_TERM, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TABLE_TERM
#ifdef SQL_SCHEMA_TERM
result = info.GetInfo(SQL_SCHEMA_TERM, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SCHEMA_TERM
#ifdef SQL_ASYNC_DBC_FUNCTIONS
result = info.GetInfo(SQL_ASYNC_DBC_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_ASYNC_DBC_FUNCTIONS
#ifdef SQL_GETDATA_EXTENSIONS
result = info.GetInfo(SQL_GETDATA_EXTENSIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_GETDATA_EXTENSIONS
#ifdef SQL_ODBC_INTERFACE_CONFORMANCE
result = info.GetInfo(SQL_ODBC_INTERFACE_CONFORMANCE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_ODBC_INTERFACE_CONFORMANCE
#ifdef SQL_SQL_CONFORMANCE
result = info.GetInfo(SQL_SQL_CONFORMANCE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SQL_CONFORMANCE
#ifdef SQL_CATALOG_USAGE
result = info.GetInfo(SQL_CATALOG_USAGE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CATALOG_USAGE
#ifdef SQL_SCHEMA_USAGE
result = info.GetInfo(SQL_SCHEMA_USAGE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SCHEMA_USAGE
#ifdef SQL_MAX_IDENTIFIER_LEN
result = info.GetInfo(SQL_MAX_IDENTIFIER_LEN, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_MAX_IDENTIFIER_LEN
#ifdef SQL_AGGREGATE_FUNCTIONS
result = info.GetInfo(SQL_AGGREGATE_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_AGGREGATE_FUNCTIONS
#ifdef SQL_AGGREGATE_FUNCTIONS
result = info.GetInfo(SQL_NUMERIC_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_AGGREGATE_FUNCTIONS
#ifdef SQL_STRING_FUNCTIONS
result = info.GetInfo(SQL_STRING_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_STRING_FUNCTIONS
#ifdef SQL_TIMEDATE_FUNCTIONS
result = info.GetInfo(SQL_TIMEDATE_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TIMEDATE_FUNCTIONS
#ifdef SQL_TIMEDATE_ADD_INTERVALS
result = info.GetInfo(SQL_TIMEDATE_ADD_INTERVALS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TIMEDATE_ADD_INTERVALS
#ifdef SQL_TIMEDATE_DIFF_INTERVALS
result = info.GetInfo(SQL_TIMEDATE_DIFF_INTERVALS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TIMEDATE_DIFF_INTERVALS
#ifdef SQL_DATETIME_LITERALS
result = info.GetInfo(SQL_DATETIME_LITERALS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_DATETIME_LITERALS
#ifdef SQL_SYSTEM_FUNCTIONS
result = info.GetInfo(SQL_SYSTEM_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_SYSTEM_FUNCTIONS
#ifdef SQL_CONVERT_FUNCTIONS
result = info.GetInfo(SQL_CONVERT_FUNCTIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CONVERT_FUNCTIONS
#ifdef SQL_OJ_CAPABILITIES
result = info.GetInfo(SQL_OJ_CAPABILITIES, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_OJ_CAPABILITIES
#ifdef SQL_POS_OPERATIONS
result = info.GetInfo(SQL_POS_OPERATIONS, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_POS_OPERATIONS
#ifdef SQL_MAX_CONCURRENT_ACTIVITIES
result = info.GetInfo(SQL_MAX_CONCURRENT_ACTIVITIES, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_MAX_CONCURRENT_ACTIVITIES
#ifdef SQL_CURSOR_COMMIT_BEHAVIOR
result = info.GetInfo(SQL_CURSOR_COMMIT_BEHAVIOR, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CURSOR_COMMIT_BEHAVIOR
#ifdef SQL_CURSOR_ROLLBACK_BEHAVIOR
result = info.GetInfo(SQL_CURSOR_ROLLBACK_BEHAVIOR, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_CURSOR_ROLLBACK_BEHAVIOR
#ifdef SQL_TXN_CAPABLE
result = info.GetInfo(SQL_TXN_CAPABLE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_TXN_CAPABLE
#ifdef SQL_QUOTED_IDENTIFIER_CASE
result = info.GetInfo(SQL_QUOTED_IDENTIFIER_CASE, buffer, sizeof(buffer), &reslen);
- BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(result == SqlResult::AI_SUCCESS);
#endif //SQL_QUOTED_IDENTIFIER_CASE
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc-test/src/row_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/row_test.cpp b/modules/platforms/cpp/odbc-test/src/row_test.cpp
index f38e9c5..c692291 100644
--- a/modules/platforms/cpp/odbc-test/src/row_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/row_test.cpp
@@ -84,20 +84,20 @@ void CheckRowData(Row& row, size_t rowIdx)
char bitBuf;
int* offset = 0;
- ApplicationDataBuffer appLongBuf(type_traits::IGNITE_ODBC_C_TYPE_SIGNED_LONG, &longBuf, sizeof(longBuf), &reslen, &offset);
- ApplicationDataBuffer appStrBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
- ApplicationDataBuffer appGuidBuf(type_traits::IGNITE_ODBC_C_TYPE_GUID, &guidBuf, sizeof(guidBuf), &reslen, &offset);
- ApplicationDataBuffer appBitBuf(type_traits::IGNITE_ODBC_C_TYPE_BIT, &bitBuf, sizeof(bitBuf), &reslen, &offset);
+ ApplicationDataBuffer appLongBuf(type_traits::OdbcNativeType::AI_SIGNED_LONG, &longBuf, sizeof(longBuf), &reslen, &offset);
+ ApplicationDataBuffer appStrBuf(type_traits::OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
+ ApplicationDataBuffer appGuidBuf(type_traits::OdbcNativeType::AI_GUID, &guidBuf, sizeof(guidBuf), &reslen, &offset);
+ ApplicationDataBuffer appBitBuf(type_traits::OdbcNativeType::AI_BIT, &bitBuf, sizeof(bitBuf), &reslen, &offset);
// Checking size.
BOOST_REQUIRE(row.GetSize() == 4);
// Checking 1st column.
- BOOST_REQUIRE(row.ReadColumnToBuffer(1, appLongBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(row.ReadColumnToBuffer(1, appLongBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(longBuf == rowIdx * 10);
// Checking 2nd column.
- BOOST_REQUIRE(row.ReadColumnToBuffer(2, appStrBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(row.ReadColumnToBuffer(2, appStrBuf) == SqlResult::AI_SUCCESS);
std::string strReal(strBuf, static_cast<size_t>(reslen));
std::string strExpected(GetStrColumnValue(rowIdx));
@@ -105,7 +105,7 @@ void CheckRowData(Row& row, size_t rowIdx)
BOOST_REQUIRE(strReal == strExpected);
// Checking 3rd column.
- BOOST_REQUIRE(row.ReadColumnToBuffer(3, appGuidBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(row.ReadColumnToBuffer(3, appGuidBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(guidBuf.Data1 == 0x2b218f63UL);
BOOST_REQUIRE(guidBuf.Data2 == 0x642aU);
@@ -121,7 +121,7 @@ void CheckRowData(Row& row, size_t rowIdx)
BOOST_REQUIRE(guidBuf.Data4[7] == 0x98 + rowIdx);
// Checking 4th column.
- BOOST_REQUIRE(row.ReadColumnToBuffer(4, appBitBuf) == SQL_RESULT_SUCCESS);
+ BOOST_REQUIRE(row.ReadColumnToBuffer(4, appBitBuf) == SqlResult::AI_SUCCESS);
BOOST_REQUIRE(bitBuf == rowIdx % 2);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h b/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h
index 31c2709..24461c2 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/app/application_data_buffer.h
@@ -57,7 +57,7 @@ namespace ignite
* @param reslen Resulting data length.
* @param offset Pointer to buffer and reslen offset pointer.
*/
- ApplicationDataBuffer(type_traits::IgniteSqlType type, void* buffer,
+ ApplicationDataBuffer(type_traits::OdbcNativeType::Type type, void* buffer,
SqlLen buflen, SqlLen* reslen, int** offset = 0);
/**
@@ -341,7 +341,7 @@ namespace ignite
*
* @return Buffer type.
*/
- type_traits::IgniteSqlType GetType() const
+ type_traits::OdbcNativeType::Type GetType() const
{
return type;
}
@@ -413,7 +413,7 @@ namespace ignite
T* ApplyOffset(T* ptr) const;
/** Underlying data type. */
- type_traits::IgniteSqlType type;
+ type_traits::OdbcNativeType::Type type;
/** Buffer pointer. */
void* buffer;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/column.h b/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
index 1297279..a8b8863 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/column.h
@@ -82,7 +82,7 @@ namespace ignite
* @param dataBuf Application data buffer.
* @return Operation result.
*/
- SqlResult ReadToBuffer(ignite::impl::binary::BinaryReaderImpl& reader,
+ SqlResult::Type ReadToBuffer(ignite::impl::binary::BinaryReaderImpl& reader,
app::ApplicationDataBuffer& dataBuf);
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
index 5d8901d..0a3b02f 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
@@ -21,10 +21,6 @@
#include <stdint.h>
#include "system/odbc_constants.h"
-#include <ignite/odbc/system/odbc_constants.h>
-
-#include <ignite/odbc/system/odbc_constants.h>
-
namespace ignite
{
namespace odbc
@@ -35,206 +31,218 @@ namespace ignite
/**
* SQL result.
*/
- enum SqlResult
+ struct SqlResult
{
- /** Success. */
- SQL_RESULT_SUCCESS,
+ enum Type
+ {
+ /** Success. */
+ AI_SUCCESS,
- /** Success with info. */
- SQL_RESULT_SUCCESS_WITH_INFO,
+ /** Success with info. */
+ AI_SUCCESS_WITH_INFO,
- /** Error. */
- SQL_RESULT_ERROR,
+ /** Error. */
+ AI_ERROR,
- /** No more data. */
- SQL_RESULT_NO_DATA,
+ /** No more data. */
+ AI_NO_DATA,
- /** No more data. */
- SQL_RESULT_NEED_DATA
+ /** No more data. */
+ AI_NEED_DATA
+ };
};
/**
* Provides detailed information about the cause of a warning or error.
*/
- enum SqlState
+ struct SqlState
{
- /** Undefined state. Internal, should never be exposed to user. */
- SQL_STATE_UNKNOWN,
-
- /** Output data has been truncated. */
- SQL_STATE_01004_DATA_TRUNCATED,
-
- /** Invalid connection string attribute. */
- SQL_STATE_01S00_INVALID_CONNECTION_STRING_ATTRIBUTE,
-
- /** Error in row. */
- SQL_STATE_01S01_ERROR_IN_ROW,
-
- /**
- * The driver did not support the specified value and
- * substituted a similar value.
- */
- SQL_STATE_01S02_OPTION_VALUE_CHANGED,
-
- /** String data, length mismatch. */
- SQL_STATE_22026_DATA_LENGTH_MISMATCH,
-
- /** Invalid cursor state. */
- SQL_STATE_24000_INVALID_CURSOR_STATE,
-
- /** Invalid descriptor index. */
- SQL_STATE_07009_INVALID_DESCRIPTOR_INDEX,
-
- /**
- * The driver was unable to establish a connection with the data
- * source.
- */
- SQL_STATE_08001_CANNOT_CONNECT,
-
- /**
- * The specified ConnectionHandle had already been used
- * to establish a connection with a data source, and the connection
- * was still open.
- */
- SQL_STATE_08002_ALREADY_CONNECTED,
-
- /** The connection specified was not open. */
- SQL_STATE_08003_NOT_CONNECTED,
-
- /**
- * An error occurred for which there was no specific SQLSTATE
- * and for which no implementation-specific SQLSTATE was defined.
- */
- SQL_STATE_HY000_GENERAL_ERROR,
-
- /**
- * The driver was unable to allocate memory for the specified
- * handle.
- */
- SQL_STATE_HY001_MEMORY_ALLOCATION,
-
- /**
- * The argument TargetType was neither a valid data type
- * nor SQL_C_DEFAULT
- */
- SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE,
-
- /** Invalid use of null pointer. */
- SQL_STATE_HY009_INVALID_USE_OF_NULL_POINTER,
-
- /** Function sequence error. */
- SQL_STATE_HY010_SEQUENCE_ERROR,
-
- /**
- * Invalid string or buffer length
- */
- SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH,
-
- /**
- * Option type was out of range.
- */
- SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE,
-
- /** Column type out of range. */
- SQL_STATE_HY097_COLUMN_TYPE_OUT_OF_RANGE,
-
- /** The value specified for the argument InputOutputType was invalid. */
- SQL_STATE_HY105_INVALID_PARAMETER_TYPE,
-
- /** The value specified for the argument FetchOrientation was invalid. */
- SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE,
-
- /**
- * The driver does not support the feature of ODBC behavior that
- * the application requested.
- */
- SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
-
- /**
- * The connection timeout period expired before the data source
- * responded to the request.
- */
- SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT,
-
- /**
- * Driver does not support this function.
- */
- SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED
+ enum Type
+ {
+ /** Undefined state. Internal, should never be exposed to user. */
+ UNKNOWN,
+
+ /** Output data has been truncated. */
+ S01004_DATA_TRUNCATED,
+
+ /** Invalid connection string attribute. */
+ S01S00_INVALID_CONNECTION_STRING_ATTRIBUTE,
+
+ /** Error in row. */
+ S01S01_ERROR_IN_ROW,
+
+ /**
+ * The driver did not support the specified value and
+ * substituted a similar value.
+ */
+ S01S02_OPTION_VALUE_CHANGED,
+
+ /** String data, length mismatch. */
+ S22026_DATA_LENGTH_MISMATCH,
+
+ /** Invalid cursor state. */
+ S24000_INVALID_CURSOR_STATE,
+
+ /** Invalid descriptor index. */
+ S07009_INVALID_DESCRIPTOR_INDEX,
+
+ /**
+ * The driver was unable to establish a connection with the data
+ * source.
+ */
+ S08001_CANNOT_CONNECT,
+
+ /**
+ * The specified ConnectionHandle had already been used
+ * to establish a connection with a data source, and the connection
+ * was still open.
+ */
+ S08002_ALREADY_CONNECTED,
+
+ /** The connection specified was not open. */
+ S08003_NOT_CONNECTED,
+
+ /**
+ * An error occurred for which there was no specific SQLSTATE
+ * and for which no implementation-specific SQLSTATE was defined.
+ */
+ SHY000_GENERAL_ERROR,
+
+ /**
+ * The driver was unable to allocate memory for the specified
+ * handle.
+ */
+ SHY001_MEMORY_ALLOCATION,
+
+ /**
+ * The argument TargetType was neither a valid data type
+ * nor SQL_C_DEFAULT
+ */
+ SHY003_INVALID_APPLICATION_BUFFER_TYPE,
+
+ /** Invalid use of null pointer. */
+ SHY009_INVALID_USE_OF_NULL_POINTER,
+
+ /** Function sequence error. */
+ SHY010_SEQUENCE_ERROR,
+
+ /**
+ * Invalid string or buffer length
+ */
+ SHY090_INVALID_STRING_OR_BUFFER_LENGTH,
+
+ /**
+ * Option type was out of range.
+ */
+ SHY092_OPTION_TYPE_OUT_OF_RANGE,
+
+ /** Column type out of range. */
+ SHY097_COLUMN_TYPE_OUT_OF_RANGE,
+
+ /** The value specified for the argument InputOutputType was invalid. */
+ SHY105_INVALID_PARAMETER_TYPE,
+
+ /** The value specified for the argument FetchOrientation was invalid. */
+ SHY106_FETCH_TYPE_OUT_OF_RANGE,
+
+ /**
+ * The driver does not support the feature of ODBC behavior that
+ * the application requested.
+ */
+ SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+
+ /**
+ * The connection timeout period expired before the data source
+ * responded to the request.
+ */
+ SHYT01_CONNECTIOIN_TIMEOUT,
+
+ /**
+ * Driver does not support this function.
+ */
+ SIM001_FUNCTION_NOT_SUPPORTED
+ };
};
/**
* Diagnostic field type.
*/
- enum DiagnosticField
+ struct DiagnosticField
{
- /** Field type is unknown to the driver. */
- IGNITE_SQL_DIAG_UNKNOWN,
+ enum Type
+ {
+ /** Field type is unknown to the driver. */
+ UNKNOWN,
- /** Header record field: Count of rows in the cursor. */
- IGNITE_SQL_DIAG_HEADER_CURSOR_ROW_COUNT,
+ /** Header record field: Count of rows in the cursor. */
+ HEADER_CURSOR_ROW_COUNT,
- /**
- * Header record field: String that describes the SQL statement
- * that the underlying function executed.
- */
- IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION,
+ /**
+ * Header record field: String that describes the SQL statement
+ * that the underlying function executed.
+ */
+ HEADER_DYNAMIC_FUNCTION,
- /**
- * Header record field: Numeric code that describes the SQL
- * statement that was executed by the underlying function.
- */
- IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION_CODE,
+ /**
+ * Header record field: Numeric code that describes the SQL
+ * statement that was executed by the underlying function.
+ */
+ HEADER_DYNAMIC_FUNCTION_CODE,
- /** Header record field: Number of status records. */
- IGNITE_SQL_DIAG_HEADER_NUMBER,
+ /** Header record field: Number of status records. */
+ HEADER_NUMBER,
- /** Header record field: Last operation return code. */
- IGNITE_SQL_DIAG_HEADER_RETURNCODE,
+ /** Header record field: Last operation return code. */
+ HEADER_RETURNCODE,
- /** Header record field: Row count. */
- IGNITE_SQL_DIAG_HEADER_ROW_COUNT,
+ /** Header record field: Row count. */
+ HEADER_ROW_COUNT,
- /** Status record field: Class origin. */
- IGNITE_SQL_DIAG_STATUS_CLASS_ORIGIN,
+ /** Status record field: Class origin. */
+ STATUS_CLASS_ORIGIN,
- /** Status record field: Column number. */
- IGNITE_SQL_DIAG_STATUS_COLUMN_NUMBER,
+ /** Status record field: Column number. */
+ STATUS_COLUMN_NUMBER,
- /** Status record field: Connection name. */
- IGNITE_SQL_DIAG_STATUS_CONNECTION_NAME,
+ /** Status record field: Connection name. */
+ STATUS_CONNECTION_NAME,
- /** Status record field: Message text. */
- IGNITE_SQL_DIAG_STATUS_MESSAGE_TEXT,
+ /** Status record field: Message text. */
+ STATUS_MESSAGE_TEXT,
- /** Status record field: Native result code. */
- IGNITE_SQL_DIAG_STATUS_NATIVE,
+ /** Status record field: Native result code. */
+ STATUS_NATIVE,
- /** Status record field: Row number. */
- IGNITE_SQL_DIAG_STATUS_ROW_NUMBER,
+ /** Status record field: Row number. */
+ STATUS_ROW_NUMBER,
- /** Status record field: Server name. */
- IGNITE_SQL_DIAG_STATUS_SERVER_NAME,
+ /** Status record field: Server name. */
+ STATUS_SERVER_NAME,
- /** Status record field: SQLSTATE. */
- IGNITE_SQL_DIAG_STATUS_SQLSTATE,
+ /** Status record field: SQLSTATE. */
+ STATUS_SQLSTATE,
- /** Status record field: Subclass origin. */
- IGNITE_SQL_DIAG_STATUS_SUBCLASS_ORIGIN
+ /** Status record field: Subclass origin. */
+ STATUS_SUBCLASS_ORIGIN
+ };
};
/**
* Environment attribute.
*/
- enum EnvironmentAttribute
+ struct EnvironmentAttribute
{
- /** ODBC attribute is unknown to the driver. */
- IGNITE_SQL_ENV_ATTR_UNKNOWN,
+ enum Type
+ {
+ /** ODBC attribute is unknown to the driver. */
+ UNKNOWN,
- /** ODBC version. */
- IGNITE_SQL_ENV_ATTR_ODBC_VERSION,
+ /** ODBC version. */
+ ODBC_VERSION,
- /** Null-termination of strings. */
- IGNITE_SQL_ENV_ATTR_OUTPUT_NTS
+ /** Null-termination of strings. */
+ OUTPUT_NTS
+ };
};
/**
@@ -243,23 +251,23 @@ namespace ignite
* @param result Internal result type.
* @return ODBC result type.
*/
- int SqlResultToReturnCode(SqlResult result);
+ int SqlResultToReturnCode(SqlResult::Type result);
/**
- * Convert ODBC field type to internal DiagnosticField type value.
+ * Convert ODBC field type to internal DiagnosticField::Type type value.
*
* @param field ODBC field type.
- * @return Internal DiagnosticField type value.
+ * @return Internal DiagnosticField::Type type value.
*/
- DiagnosticField DiagnosticFieldToInternal(int16_t field);
+ DiagnosticField::Type DiagnosticFieldToInternal(int16_t field);
/**
- * Convert environment attribute to internal EnvironmentAttribute type value.
+ * Convert environment attribute to internal EnvironmentAttribute::Type type value.
*
* @param attr Environment attribute.
- * @return Internal EnvironmentAttribute type value.
+ * @return Internal EnvironmentAttribute::Type type value.
*/
- EnvironmentAttribute EnvironmentAttributeToInternal(int32_t attr);
+ EnvironmentAttribute::Type EnvironmentAttributeToInternal(int32_t attr);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
index d421952..c17d5ec 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
@@ -66,7 +66,7 @@ namespace ignite
* @param reslen Result value length pointer.
* @return True on success.
*/
- SqlResult GetInfo(InfoType type, void* buf, short buflen, short* reslen) const;
+ SqlResult::Type GetInfo(InfoType type, void* buf, short buflen, short* reslen) const;
private:
IGNITE_NO_COPY_ASSIGNMENT(ConnectionInfo);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h b/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h
index acf82ba..c3f27a2 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/connection.h
@@ -129,7 +129,7 @@ namespace ignite
* @param columnNum Associated column number.
* @return DiagnosticRecord associated with the instance.
*/
- static diagnostic::DiagnosticRecord CreateStatusRecord(SqlState sqlState,
+ static diagnostic::DiagnosticRecord CreateStatusRecord(SqlState::Type sqlState,
const std::string& message, int32_t rowNum = 0, int32_t columnNum = 0);
/**
@@ -172,7 +172,7 @@ namespace ignite
* @param connectStr Connection string.
* @return Operation result.
*/
- SqlResult InternalEstablish(const std::string& connectStr);
+ SqlResult::Type InternalEstablish(const std::string& connectStr);
/**
* Establish connection to ODBC server.
@@ -181,7 +181,7 @@ namespace ignite
* @param cfg Configuration.
* @return Operation result.
*/
- SqlResult InternalEstablish(const config::Configuration cfg);
+ SqlResult::Type InternalEstablish(const config::Configuration cfg);
/**
* Release established connection.
@@ -189,7 +189,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalRelease();
+ SqlResult::Type InternalRelease();
/**
* Get info of any type.
@@ -201,7 +201,7 @@ namespace ignite
* @param reslen Result value length pointer.
* @return Operation result.
*/
- SqlResult InternalGetInfo(config::ConnectionInfo::InfoType type, void* buf, short buflen, short* reslen);
+ SqlResult::Type InternalGetInfo(config::ConnectionInfo::InfoType type, void* buf, short buflen, short* reslen);
/**
* Create statement associated with the connection.
@@ -210,7 +210,7 @@ namespace ignite
* @param Pointer to valid instance on success and NULL on failure.
* @return Operation result.
*/
- SqlResult InternalCreateStatement(Statement*& statement);
+ SqlResult::Type InternalCreateStatement(Statement*& statement);
/**
* Perform transaction commit on all the associated connections.
@@ -218,7 +218,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalTransactionCommit();
+ SqlResult::Type InternalTransactionCommit();
/**
* Perform transaction rollback on all the associated connections.
@@ -226,7 +226,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalTransactionRollback();
+ SqlResult::Type InternalTransactionRollback();
/**
* Receive specified number of bytes.
@@ -251,7 +251,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult MakeRequestHandshake();
+ SqlResult::Type MakeRequestHandshake();
/**
* Constructor.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h
index 6937fcc..4eb1a38 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable.h
@@ -62,7 +62,7 @@ namespace ignite
* @param rowNum Associated row number.
* @param columnNum Associated column number.
*/
- virtual void AddStatusRecord(SqlState sqlState, const std::string& message,
+ virtual void AddStatusRecord(SqlState::Type sqlState, const std::string& message,
int32_t rowNum, int32_t columnNum) = 0;
/**
@@ -71,7 +71,7 @@ namespace ignite
* @param sqlState SQL state.
* @param message Message.
*/
- virtual void AddStatusRecord(SqlState sqlState, const std::string& message) = 0;
+ virtual void AddStatusRecord(SqlState::Type sqlState, const std::string& message) = 0;
protected:
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h
index 548eecd..45f47f0 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnosable_adapter.h
@@ -22,12 +22,12 @@
#define IGNITE_ODBC_API_CALL(...) \
diagnosticRecords.Reset(); \
- SqlResult result = (__VA_ARGS__); \
+ SqlResult::Type result = (__VA_ARGS__); \
diagnosticRecords.SetHeaderRecord(result)
#define IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS \
diagnosticRecords.Reset(); \
- diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS)
+ diagnosticRecords.SetHeaderRecord(SqlResult::AI_SUCCESS)
namespace ignite
{
@@ -79,7 +79,7 @@ namespace ignite
* @param rowNum Associated row number.
* @param columnNum Associated column number.
*/
- virtual void AddStatusRecord(SqlState sqlState, const std::string& message,
+ virtual void AddStatusRecord(SqlState::Type sqlState, const std::string& message,
int32_t rowNum, int32_t columnNum);
/**
@@ -88,7 +88,7 @@ namespace ignite
* @param sqlState SQL state.
* @param message Message.
*/
- virtual void AddStatusRecord(SqlState sqlState, const std::string& message);
+ virtual void AddStatusRecord(SqlState::Type sqlState, const std::string& message);
protected:
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h
index 80d5090..18cc93a 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h
@@ -53,7 +53,7 @@ namespace ignite
* @param rowNum Associated row number.
* @param columnNum Associated column number.
*/
- DiagnosticRecord(SqlState sqlState, const std::string& message,
+ DiagnosticRecord(SqlState::Type sqlState, const std::string& message,
const std::string& connectionName, const std::string& serverName,
int32_t rowNum = 0, int32_t columnNum = 0);
@@ -142,7 +142,7 @@ namespace ignite
private:
/** SQL state diagnostic code. */
- SqlState sqlState;
+ SqlState::Type sqlState;
/** An informational message on the error or warning. */
std::string message;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h
index b45bb7d..9a816da 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record_storage.h
@@ -64,7 +64,7 @@ namespace ignite
*
* @param retCode Operation return code.
*/
- void SetHeaderRecord(SqlResult result);
+ void SetHeaderRecord(SqlResult::Type result);
/**
* Add status record to diagnostic records.
@@ -83,7 +83,7 @@ namespace ignite
*
* @return Result of the last operation.
*/
- SqlResult GetOperaionResult() const;
+ SqlResult::Type GetOperaionResult() const;
/**
* Get return code of the last operation.
@@ -169,7 +169,7 @@ namespace ignite
* @param buffer Buffer to put data to.
* @return Operation result.
*/
- SqlResult GetField(int32_t recNum, DiagnosticField field, app::ApplicationDataBuffer& buffer) const;
+ SqlResult::Type GetField(int32_t recNum, DiagnosticField::Type field, app::ApplicationDataBuffer& buffer) const;
private:
IGNITE_NO_COPY_ASSIGNMENT(DiagnosticRecordStorage);
@@ -196,7 +196,7 @@ namespace ignite
* Operation result. This field is mapped to "Return code" header
* record field.
*/
- SqlResult result;
+ SqlResult::Type result;
/**
* Header record field. The number of rows affected by an insert,
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h b/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h
index 0c8af64..3eeade6 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/environment.h
@@ -86,7 +86,7 @@ namespace ignite
* @return Pointer to valid instance on success or NULL on failure.
* @return Operation result.
*/
- SqlResult InternalCreateConnection(Connection*& connection);
+ SqlResult::Type InternalCreateConnection(Connection*& connection);
/**
* Perform transaction commit on all the associated connections.
@@ -94,7 +94,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalTransactionCommit();
+ SqlResult::Type InternalTransactionCommit();
/**
* Perform transaction rollback on all the associated connections.
@@ -102,7 +102,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalTransactionRollback();
+ SqlResult::Type InternalTransactionRollback();
/**
* Set attribute.
@@ -113,7 +113,7 @@ namespace ignite
* @param len Value length if the attribute is of string type.
* @return Operation result.
*/
- SqlResult InternalSetAttribute(int32_t attr, void* value, int32_t len);
+ SqlResult::Type InternalSetAttribute(int32_t attr, void* value, int32_t len);
/**
* Get attribute.
@@ -123,7 +123,7 @@ namespace ignite
* @param buffer Buffer to put value to.
* @return Operation result.
*/
- SqlResult InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer);
+ SqlResult::Type InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer);
/** ODBC version. */
int32_t odbcVersion;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/message.h b/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
index 7061fc9..60b2d9b 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
@@ -34,28 +34,34 @@ namespace ignite
{
namespace odbc
{
- enum RequestType
+ struct RequestType
{
- REQUEST_TYPE_HANDSHAKE = 1,
+ enum Type
+ {
+ HANDSHAKE = 1,
- REQUEST_TYPE_EXECUTE_SQL_QUERY = 2,
+ EXECUTE_SQL_QUERY = 2,
- REQUEST_TYPE_FETCH_SQL_QUERY = 3,
+ FETCH_SQL_QUERY = 3,
- REQUEST_TYPE_CLOSE_SQL_QUERY = 4,
+ CLOSE_SQL_QUERY = 4,
- REQUEST_TYPE_GET_COLUMNS_METADATA = 5,
+ GET_COLUMNS_METADATA = 5,
- REQUEST_TYPE_GET_TABLES_METADATA = 6,
+ GET_TABLES_METADATA = 6,
- REQUEST_TYPE_GET_PARAMS_METADATA = 7
+ GET_PARAMS_METADATA = 7
+ };
};
- enum ResponseStatus
+ struct ResponseStatus
{
- RESPONSE_STATUS_SUCCESS = 0,
+ enum Type
+ {
+ SUCCESS = 0,
- RESPONSE_STATUS_FAILED = 1
+ FAILED = 1
+ };
};
/**
@@ -93,7 +99,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_HANDSHAKE);
+ writer.WriteInt8(RequestType::HANDSHAKE);
writer.WriteInt64(version);
@@ -148,7 +154,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_EXECUTE_SQL_QUERY);
+ writer.WriteInt8(RequestType::EXECUTE_SQL_QUERY);
utility::WriteString(writer, cache);
utility::WriteString(writer, sql);
@@ -213,7 +219,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_CLOSE_SQL_QUERY);
+ writer.WriteInt8(RequestType::CLOSE_SQL_QUERY);
writer.WriteInt64(queryId);
}
@@ -255,7 +261,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_FETCH_SQL_QUERY);
+ writer.WriteInt8(RequestType::FETCH_SQL_QUERY);
writer.WriteInt64(queryId);
writer.WriteInt32(pageSize);
}
@@ -303,7 +309,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_GET_COLUMNS_METADATA);
+ writer.WriteInt8(RequestType::GET_COLUMNS_METADATA);
utility::WriteString(writer, schema);
utility::WriteString(writer, table);
@@ -359,7 +365,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_GET_TABLES_METADATA);
+ writer.WriteInt8(RequestType::GET_TABLES_METADATA);
utility::WriteString(writer, catalog);
utility::WriteString(writer, schema);
@@ -390,10 +396,8 @@ namespace ignite
/**
* Constructor.
*
- * @param catalog Catalog search pattern.
- * @param schema Schema search pattern.
- * @param table Table search pattern.
- * @param tableTypes Table types search pattern.
+ * @param cacheName Cache name.
+ * @param sqlQuery SQL query itself.
*/
QueryGetParamsMetaRequest(const std::string& cacheName, const std::string& sqlQuery) :
cacheName(cacheName),
@@ -416,7 +420,7 @@ namespace ignite
*/
void Write(ignite::impl::binary::BinaryWriterImpl& writer) const
{
- writer.WriteInt8(REQUEST_TYPE_GET_PARAMS_METADATA);
+ writer.WriteInt8(RequestType::GET_PARAMS_METADATA);
utility::WriteString(writer, cacheName);
utility::WriteString(writer, sqlQuery);
@@ -431,7 +435,7 @@ namespace ignite
};
/**
- * Query close response.
+ * General response.
*/
class Response
{
@@ -439,7 +443,7 @@ namespace ignite
/**
* Constructor.
*/
- Response() : status(RESPONSE_STATUS_FAILED), error()
+ Response() : status(ResponseStatus::FAILED), error()
{
// No-op.
}
@@ -460,7 +464,7 @@ namespace ignite
{
status = reader.ReadInt8();
- if (status == RESPONSE_STATUS_SUCCESS)
+ if (status == ResponseStatus::SUCCESS)
ReadOnSuccess(reader);
else
utility::ReadString(reader, error);;
@@ -486,7 +490,7 @@ namespace ignite
protected:
/**
- * Read data if response status is RESPONSE_STATUS_SUCCESS.
+ * Read data if response status is ResponseStatus::SUCCESS.
*/
virtual void ReadOnSuccess(ignite::impl::binary::BinaryReaderImpl&)
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h
index 85a9474..878a4be 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/column_metadata_query.h
@@ -59,7 +59,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -73,7 +73,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -82,14 +82,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
@@ -113,7 +113,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult MakeRequestGetColumnsMeta();
+ SqlResult::Type MakeRequestGetColumnsMeta();
/** Connection associated with the statement. */
Connection& connection;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h
index 68bb877..ade8fb0 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/data_query.h
@@ -58,7 +58,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -73,7 +73,7 @@ namespace ignite
* @param columnBindings Application buffers to put data to.
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -82,14 +82,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
- * @return True on success.
+ * @return Result.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
@@ -124,21 +124,28 @@ namespace ignite
*
* @return True on success.
*/
- SqlResult MakeRequestExecute();
+ SqlResult::Type MakeRequestExecute();
/**
* Make query close request.
*
* @return True on success.
*/
- SqlResult MakeRequestClose();
+ SqlResult::Type MakeRequestClose();
/**
* Make data fetch request and use response to set internal state.
*
* @return True on success.
*/
- SqlResult MakeRequestFetch();
+ SqlResult::Type MakeRequestFetch();
+
+ /**
+ * Close query.
+ *
+ * @return Result.
+ */
+ SqlResult::Type InternalClose();
/** Connection associated with the statement. */
Connection& connection;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h
index 0fb1e5f..7d60728 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/foreign_keys_query.h
@@ -60,7 +60,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -74,7 +74,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -83,14 +83,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h
index 5cb7b6e..65bac33 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/primary_keys_query.h
@@ -57,7 +57,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -71,7 +71,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -80,14 +80,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h
index 40be1ed..4959eaf 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/query.h
@@ -33,14 +33,11 @@ namespace ignite
{
namespace query
{
- /**
- * Query.
- */
- class Query
+ /** Query type. */
+ struct QueryType
{
- public:
- /** Query type. */
- enum Type {
+ enum Type
+ {
/** Column metadata query type. */
COLUMN_METADATA,
@@ -62,7 +59,14 @@ namespace ignite
/** Type info query type. */
TYPE_INFO
};
+ };
+ /**
+ * Query.
+ */
+ class Query
+ {
+ public:
/**
* Destructor.
*/
@@ -76,7 +80,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute() = 0;
+ virtual SqlResult::Type Execute() = 0;
/**
* Fetch next result row to application buffers.
@@ -84,7 +88,7 @@ namespace ignite
* @param columnBindings Application buffers to put data to.
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings) = 0;
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings) = 0;
/**
* Get data of the specified column in the result set.
@@ -93,14 +97,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer) = 0;
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer) = 0;
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close() = 0;
+ virtual SqlResult::Type Close() = 0;
/**
* Get column metadata.
@@ -128,7 +132,7 @@ namespace ignite
*
* @return Query type.
*/
- Type GetType() const
+ QueryType::Type GetType() const
{
return type;
}
@@ -137,7 +141,7 @@ namespace ignite
/**
* Constructor.
*/
- Query(diagnostic::Diagnosable& diag, Type type) :
+ Query(diagnostic::Diagnosable& diag, QueryType::Type type) :
diag(diag),
type(type)
{
@@ -148,7 +152,7 @@ namespace ignite
diagnostic::Diagnosable& diag;
/** Query type. */
- Type type;
+ QueryType::Type type;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h
index 1d2f339..0f6660f 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/special_columns_query.h
@@ -58,7 +58,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Fetch next result row to application buffers.
@@ -66,7 +66,7 @@ namespace ignite
* @param columnBindings Application buffers to put data to.
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -75,14 +75,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Get column metadata.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h
index 6322435..cef963c 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/table_metadata_query.h
@@ -60,7 +60,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -74,7 +74,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -83,14 +83,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
@@ -114,7 +114,7 @@ namespace ignite
*
* @return True on success.
*/
- SqlResult MakeRequestGetTablesMeta();
+ SqlResult::Type MakeRequestGetTablesMeta();
/** Connection associated with the statement. */
Connection& connection;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h b/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h
index d337d03..22b291a 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/query/type_info_query.h
@@ -50,7 +50,7 @@ namespace ignite
*
* @return True on success.
*/
- virtual SqlResult Execute();
+ virtual SqlResult::Type Execute();
/**
* Get column metadata.
@@ -64,7 +64,7 @@ namespace ignite
*
* @return Operation result.
*/
- virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+ virtual SqlResult::Type FetchNextRow(app::ColumnBindingMap& columnBindings);
/**
* Get data of the specified column in the result set.
@@ -73,14 +73,14 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ virtual SqlResult::Type GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
* Close query.
*
* @return True on success.
*/
- virtual SqlResult Close();
+ virtual SqlResult::Type Close();
/**
* Check if data is available.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/row.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/row.h b/modules/platforms/cpp/odbc/include/ignite/odbc/row.h
index 888432e..9c0c117 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/row.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/row.h
@@ -61,7 +61,7 @@ namespace ignite
* @param dataBuf Application data buffer.
* @return True on success.
*/
- SqlResult ReadColumnToBuffer(uint16_t columnIdx, app::ApplicationDataBuffer& dataBuf);
+ SqlResult::Type ReadColumnToBuffer(uint16_t columnIdx, app::ApplicationDataBuffer& dataBuf);
/**
* Move to next row.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
index 596fc66..09122c3 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
@@ -393,7 +393,7 @@ namespace ignite
* @param strLengthOrIndicator Pointer to the length/indicator buffer.
* @return Operation result.
*/
- SqlResult InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator);
+ SqlResult::Type InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator);
/**
* Bind parameter.
@@ -429,7 +429,7 @@ namespace ignite
* @param resLen A pointer to a buffer for the parameter's length.
* @return Operation result.
*/
- SqlResult InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+ SqlResult::Type InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen);
/**
@@ -441,7 +441,7 @@ namespace ignite
* @param valueLen Value length.
* @return Operation result.
*/
- SqlResult InternalSetAttribute(int attr, void* value, SQLINTEGER valueLen);
+ SqlResult::Type InternalSetAttribute(int attr, void* value, SQLINTEGER valueLen);
/**
* Get statement attribute.
@@ -453,7 +453,7 @@ namespace ignite
* @param valueLen Resulting value length.
* @return Operation result.
*/
- SqlResult InternalGetAttribute(int attr, void* buf, SQLINTEGER bufLen, SQLINTEGER* valueLen);
+ SqlResult::Type InternalGetAttribute(int attr, void* buf, SQLINTEGER bufLen, SQLINTEGER* valueLen);
/**
* Get value of the column in the result set.
@@ -462,7 +462,7 @@ namespace ignite
* @param buffer Buffer to put column data to.
* @return Operation result.
*/
- SqlResult InternalGetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+ SqlResult::Type InternalGetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
/**
@@ -470,7 +470,7 @@ namespace ignite
* @param option indicates what needs to be freed
* @return Operation result.
*/
- SqlResult InternalFreeResources(int16_t option);
+ SqlResult::Type InternalFreeResources(int16_t option);
/**
* Close statement.
@@ -478,7 +478,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalClose();
+ SqlResult::Type InternalClose();
/**
* Prepare SQL query.
@@ -486,7 +486,7 @@ namespace ignite
* @param query SQL query.
* @return Operation result.
*/
- SqlResult InternalPrepareSqlQuery(const std::string& query);
+ SqlResult::Type InternalPrepareSqlQuery(const std::string& query);
/**
* Execute SQL query.
@@ -494,14 +494,14 @@ namespace ignite
* @param query SQL query.
* @return Operation result.
*/
- SqlResult InternalExecuteSqlQuery(const std::string& query);
+ SqlResult::Type InternalExecuteSqlQuery(const std::string& query);
/**
* Execute SQL query.
*
* @return Operation result.
*/
- SqlResult InternalExecuteSqlQuery();
+ SqlResult::Type InternalExecuteSqlQuery();
/**
* Fetch query result row with offset
@@ -509,14 +509,14 @@ namespace ignite
* @param offset Fetch offset
* @return Operation result.
*/
- SqlResult InternalFetchScroll(int16_t orientation, int64_t offset);
+ SqlResult::Type InternalFetchScroll(int16_t orientation, int64_t offset);
/**
* Fetch query result row.
*
* @return Operation result.
*/
- SqlResult InternalFetchRow();
+ SqlResult::Type InternalFetchRow();
/**
* Get number of columns in the result set.
@@ -524,7 +524,7 @@ namespace ignite
* @param res Columns number.
* @return Operation result.
*/
- SqlResult InternalGetColumnNumber(int32_t &res);
+ SqlResult::Type InternalGetColumnNumber(int32_t &res);
/**
* Get columns metadata.
@@ -534,7 +534,7 @@ namespace ignite
* @param column Column search pattern.
* @return Operation result.
*/
- SqlResult InternalExecuteGetColumnsMetaQuery(const std::string& schema,
+ SqlResult::Type InternalExecuteGetColumnsMetaQuery(const std::string& schema,
const std::string& table, const std::string& column);
/**
@@ -546,7 +546,7 @@ namespace ignite
* @param tableType Table type search pattern.
* @return Operation result.
*/
- SqlResult InternalExecuteGetTablesMetaQuery(const std::string& catalog,
+ SqlResult::Type InternalExecuteGetTablesMetaQuery(const std::string& catalog,
const std::string& schema, const std::string& table,
const std::string& tableType);
@@ -561,7 +561,7 @@ namespace ignite
* @param foreignTable Foreign key table name.
* @return Operation result.
*/
- SqlResult InternalExecuteGetForeignKeysQuery(const std::string& primaryCatalog,
+ SqlResult::Type InternalExecuteGetForeignKeysQuery(const std::string& primaryCatalog,
const std::string& primarySchema, const std::string& primaryTable,
const std::string& foreignCatalog, const std::string& foreignSchema,
const std::string& foreignTable);
@@ -574,7 +574,7 @@ namespace ignite
* @param table Table name.
* @return Operation result.
*/
- SqlResult InternalExecuteGetPrimaryKeysQuery(const std::string& catalog,
+ SqlResult::Type InternalExecuteGetPrimaryKeysQuery(const std::string& catalog,
const std::string& schema, const std::string& table);
/**
@@ -589,7 +589,7 @@ namespace ignite
* that can have a NULL value.
* @return Operation result.
*/
- SqlResult InternalExecuteSpecialColumnsQuery(int16_t type,
+ SqlResult::Type InternalExecuteSpecialColumnsQuery(int16_t type,
const std::string& catalog, const std::string& schema,
const std::string& table, int16_t scope, int16_t nullable);
@@ -599,7 +599,7 @@ namespace ignite
* @param sqlType SQL type for which to return info or SQL_ALL_TYPES.
* @return Operation result.
*/
- SqlResult InternalExecuteGetTypeInfoQuery(int16_t sqlType);
+ SqlResult::Type InternalExecuteGetTypeInfoQuery(int16_t sqlType);
/**
* Next results.
@@ -608,7 +608,7 @@ namespace ignite
*
* @return Operation result.
*/
- SqlResult InternalNextResults();
+ SqlResult::Type InternalNextResults();
/**
* Get column attribute.
@@ -621,7 +621,7 @@ namespace ignite
* @param numbuf Numeric value buffer.
* @return Operation result.
*/
- SqlResult InternalGetColumnAttribute(uint16_t colIdx, uint16_t attrId,
+ SqlResult::Type InternalGetColumnAttribute(uint16_t colIdx, uint16_t attrId,
char* strbuf, int16_t buflen, int16_t* reslen, SqlLen* numbuf);
/**
@@ -630,7 +630,7 @@ namespace ignite
* @param rowCnt Number of rows affected by the statement.
* @return Operation result.
*/
- SqlResult InternalAffectedRows(int64_t& rowCnt);
+ SqlResult::Type InternalAffectedRows(int64_t& rowCnt);
/**
* Select next parameter data for which is required.
@@ -638,7 +638,7 @@ namespace ignite
* @param paramPtr Pointer to param id stored here.
* @return Operation result.
*/
- SqlResult InternalSelectParam(void** paramPtr);
+ SqlResult::Type InternalSelectParam(void** paramPtr);
/**
* Puts data for previously selected parameter or column.
@@ -647,7 +647,7 @@ namespace ignite
* @param len Data length.
* @return Operation result.
*/
- SqlResult InternalPutData(void* data, SqlLen len);
+ SqlResult::Type InternalPutData(void* data, SqlLen len);
/**
* Get type info of the parameter of the prepared statement.
@@ -659,13 +659,13 @@ namespace ignite
* @param nullable - Nullability flag.
* @return Operation result.
*/
- SqlResult InternalDescribeParam(int16_t paramNum, int16_t* dataType,
+ SqlResult::Type InternalDescribeParam(int16_t paramNum, int16_t* dataType,
SqlUlen* paramSize, int16_t* decimalDigits, int16_t* nullable);
/**
* Make request to data source to update parameters metadata.
*/
- SqlResult UpdateParamsMeta();
+ SqlResult::Type UpdateParamsMeta();
/**
* Constructor.
[05/50] [abbrv] ignite git commit: IGNITE-3477 - Removed extra
partition eviction attempts
Posted by sb...@apache.org.
IGNITE-3477 - Removed extra partition eviction attempts
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/78836682
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/78836682
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/78836682
Branch: refs/heads/ignite-4929
Commit: 78836682d85b4faf4ecd1631758f6c4a2e26bd77
Parents: 50f9f16
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Wed Apr 12 13:27:39 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Wed Apr 12 13:27:39 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/GridDhtLocalPartition.java | 2 +-
.../cache/distributed/dht/preloader/GridDhtPreloader.java | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/78836682/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 44fd905..6b4c2ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -624,7 +624,7 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
if (markForDestroy())
finishDestroy(updateSeq);
}
- else
+ else if (partState == RENTING || shouldBeRenting())
cctx.preloader().evictPartitionAsync(this);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/78836682/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index c033b93..517f04a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -47,6 +47,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffini
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateRequest;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
@@ -72,6 +73,7 @@ import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING;
+import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.OWNING;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.RENTING;
import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap;
@@ -790,7 +792,9 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
try {
part.tryEvict();
- if (part.state() == RENTING || part.shouldBeRenting())
+ GridDhtPartitionState state = part.state();
+
+ if (state == RENTING || ((state == MOVING || state == OWNING) && part.shouldBeRenting()))
partsToEvict.push(part);
}
catch (Throwable ex) {
[23/50] [abbrv] ignite git commit: ignite-4946
GridCacheP2PUndeploySelfTest became failed
Posted by sb...@apache.org.
ignite-4946 GridCacheP2PUndeploySelfTest became failed
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d298e756
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d298e756
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d298e756
Branch: refs/heads/ignite-4929
Commit: d298e75610e192ef1ca17fb9e678bd83db64e1a4
Parents: e922dda
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Thu Apr 13 15:52:20 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu Apr 13 15:52:20 2017 +0300
----------------------------------------------------------------------
.../eventstorage/GridEventStorageManager.java | 341 ++++++++++---------
1 file changed, 187 insertions(+), 154 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d298e756/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
index d49463e..bb57c4b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.EventListener;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
@@ -33,6 +34,7 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteEvents;
import org.apache.ignite.IgniteException;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.events.DiscoveryEvent;
@@ -80,10 +82,7 @@ import static org.apache.ignite.internal.managers.communication.GridIoPolicy.PUB
*/
public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi> {
/** Local event listeners. */
- private final ConcurrentMap<Integer, Set<GridLocalEventListener>> lsnrs = new ConcurrentHashMap8<>();
-
- /** Internal discovery listeners. */
- private final ConcurrentMap<Integer, Set<DiscoveryEventListener>> discoLsnrs = new ConcurrentHashMap8<>();
+ private final ConcurrentMap<Integer, Set<EventListener>> lsnrs = new ConcurrentHashMap8<>();
/** Busy lock to control activity of threads. */
private final ReadWriteLock busyLock = new ReentrantReadWriteLock();
@@ -205,7 +204,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
@Override public void printMemoryStats() {
int lsnrsCnt = 0;
- for (Set<GridLocalEventListener> lsnrs0 : lsnrs.values())
+ for (Set<EventListener> lsnrs0 : lsnrs.values())
lsnrsCnt += lsnrs0.size();
X.println(">>>");
@@ -254,7 +253,6 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
msgLsnr = null;
lsnrs.clear();
- discoLsnrs.clear();
stopped = true;
}
@@ -296,6 +294,26 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
* @param evt Event to record.
*/
public void record(Event evt) {
+ record0(evt);
+ }
+
+ /**
+ * Records discovery events.
+ *
+ * @param evt Event to record.
+ * @param discoCache Discovery cache.
+ */
+ public void record(DiscoveryEvent evt, DiscoCache discoCache) {
+ record0(evt, discoCache);
+ }
+
+ /**
+ * Records event if it's recordable.
+ *
+ * @param evt Event to record.
+ * @param params Additional parameters.
+ */
+ private void record0(Event evt, Object... params) {
assert evt != null;
if (!enterBusy())
@@ -319,31 +337,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
}
if (isRecordable(type))
- notifyListeners(evt);
- }
- finally {
- leaveBusy();
- }
- }
-
- /**
- * Records discovery events.
- *
- * @param evt Event to record.
- * @param discoCache Discovery cache.
- */
- public void record(DiscoveryEvent evt, DiscoCache discoCache) {
- assert evt != null;
-
- if (!enterBusy())
- return;
-
- try {
- // Notify internal discovery listeners first.
- notifyDiscoveryListeners(evt, discoCache);
-
- // Notify all other registered listeners.
- record(evt);
+ notifyListeners(lsnrs.get(evt.type()), evt, params);
}
finally {
leaveBusy();
@@ -593,6 +587,8 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
* @param types Event types to subscribe listener for.
*/
public void addLocalEventListener(IgnitePredicate<? extends Event> lsnr, int[] types) {
+ assert lsnr != null;
+
try {
ctx.resource().injectGeneric(lsnr);
}
@@ -600,7 +596,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
throw new IgniteException("Failed to inject resources to event listener: " + lsnr, e);
}
- addLocalEventListener(new UserListenerWrapper(lsnr), types);
+ addEventListener(new UserListenerWrapper(lsnr), types);
}
/**
@@ -616,20 +612,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
assert types != null;
assert types.length > 0;
- if (!enterBusy())
- return;
-
- try {
- for (int t : types) {
- getOrCreate(lsnrs, t).add(lsnr);
-
- if (!isRecordable(t))
- U.warn(log, "Added listener for disabled event type: " + U.gridEventName(t));
- }
- }
- finally {
- leaveBusy();
- }
+ addEventListener(new LocalListenerWrapper(lsnr), types);
}
/**
@@ -642,27 +625,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
public void addLocalEventListener(GridLocalEventListener lsnr, int type, @Nullable int... types) {
assert lsnr != null;
- if (!enterBusy())
- return;
-
- try {
- getOrCreate(lsnrs, type).add(lsnr);
-
- if (!isRecordable(type))
- U.warn(log, "Added listener for disabled event type: " + U.gridEventName(type));
-
- if (types != null) {
- for (int t : types) {
- getOrCreate(lsnrs, t).add(lsnr);
-
- if (!isRecordable(t))
- U.warn(log, "Added listener for disabled event type: " + U.gridEventName(t));
- }
- }
- }
- finally {
- leaveBusy();
- }
+ addEventListener(new LocalListenerWrapper(lsnr), type, types);
}
/**
@@ -678,12 +641,40 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
assert types != null;
assert types.length > 0;
+ addEventListener(new DiscoveryListenerWrapper(lsnr), types);
+ }
+
+ /**
+ * Adds discovery event listener.
+ *
+ * @param lsnr Listener to add.
+ * @param type Event type to subscribe listener for.
+ * @param types Additional event types to subscribe listener for.
+ */
+ public void addDiscoveryEventListener(DiscoveryEventListener lsnr, int type, @Nullable int... types) {
+ assert lsnr != null;
+
+ addEventListener(new DiscoveryListenerWrapper(lsnr), type, types);
+ }
+
+ /**
+ * Adds local event listener. Note that this method specifically disallow an empty
+ * array of event type to prevent accidental subscription for all system event that
+ * may lead to a drastic performance decrease.
+ *
+ * @param lsnr Listener to add.
+ * @param types Event types to subscribe listener for.
+ */
+ private void addEventListener(EventListener lsnr, int[] types) {
if (!enterBusy())
return;
try {
for (int t : types) {
- getOrCreate(discoLsnrs, t).add(lsnr);
+ getOrCreate(lsnrs, t).add(lsnr);
+
+ if (!isRecordable(t))
+ U.warn(log, "Added listener for disabled event type: " + U.gridEventName(t));
}
}
finally {
@@ -692,24 +683,28 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
}
/**
- * Adds discovery event listener.
+ * Adds local event listener.
*
* @param lsnr Listener to add.
* @param type Event type to subscribe listener for.
* @param types Additional event types to subscribe listener for.
*/
- public void addDiscoveryEventListener(DiscoveryEventListener lsnr, int type, @Nullable int... types) {
- assert lsnr != null;
-
+ private void addEventListener(EventListener lsnr, int type, @Nullable int... types) {
if (!enterBusy())
return;
try {
- getOrCreate(discoLsnrs, type).add(lsnr);
+ getOrCreate(lsnrs, type).add(lsnr);
+
+ if (!isRecordable(type))
+ U.warn(log, "Added listener for disabled event type: " + U.gridEventName(type));
if (types != null) {
for (int t : types) {
- getOrCreate(discoLsnrs, t).add(lsnr);
+ getOrCreate(lsnrs, t).add(lsnr);
+
+ if (!isRecordable(t))
+ U.warn(log, "Added listener for disabled event type: " + U.gridEventName(t));
}
}
}
@@ -718,6 +713,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
}
}
+
/**
* @param lsnrs Listeners map.
* @param type Event type.
@@ -749,7 +745,9 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
* @return Returns {@code true} if removed.
*/
public boolean removeLocalEventListener(IgnitePredicate<? extends Event> lsnr, @Nullable int... types) {
- return removeLocalEventListener(new UserListenerWrapper(lsnr), types);
+ assert lsnr != null;
+
+ return removeEventListener(new UserListenerWrapper(lsnr), types);
}
/**
@@ -763,33 +761,21 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
public boolean removeLocalEventListener(GridLocalEventListener lsnr, @Nullable int... types) {
assert lsnr != null;
- boolean found = false;
-
- if (F.isEmpty(types)) {
- for (Set<GridLocalEventListener> set : lsnrs.values())
- if (set.remove(lsnr))
- found = true;
- }
- else {
- assert types != null;
-
- for (int type : types) {
- Set<GridLocalEventListener> set = lsnrs.get(type);
-
- if (set != null && set.remove(lsnr))
- found = true;
- }
- }
-
- if (lsnr instanceof UserListenerWrapper)
- {
- IgnitePredicate p = ((UserListenerWrapper)lsnr).listener();
+ return removeEventListener(new LocalListenerWrapper(lsnr), types);
+ }
- if (p instanceof PlatformEventFilterListener)
- ((PlatformEventFilterListener)p).onClose();
- }
+ /**
+ * Removes listener for specified events, if any. If no event types provided - it
+ * remove the listener for all its registered events.
+ *
+ * @param lsnr Listener.
+ * @param types Event types.
+ * @return Returns {@code true} if removed.
+ */
+ public boolean removeDiscoveryEventListener(DiscoveryEventListener lsnr, @Nullable int... types) {
+ assert lsnr != null;
- return found;
+ return removeEventListener(new DiscoveryListenerWrapper(lsnr), types);
}
/**
@@ -800,13 +786,13 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
* @param types Event types.
* @return Returns {@code true} if removed.
*/
- public boolean removeDiscoveryEventListener(DiscoveryEventListener lsnr, @Nullable int... types) {
+ private boolean removeEventListener(EventListener lsnr, @Nullable int[] types) {
assert lsnr != null;
boolean found = false;
if (F.isEmpty(types)) {
- for (Set<DiscoveryEventListener> set : discoLsnrs.values())
+ for (Set<EventListener> set : lsnrs.values())
if (set.remove(lsnr))
found = true;
}
@@ -814,13 +800,21 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
assert types != null;
for (int type : types) {
- Set<DiscoveryEventListener> set = discoLsnrs.get(type);
+ Set<EventListener> set = lsnrs.get(type);
if (set != null && set.remove(lsnr))
found = true;
}
}
+ if (lsnr instanceof UserListenerWrapper)
+ {
+ IgnitePredicate p = ((UserListenerWrapper)lsnr).listener();
+
+ if (p instanceof PlatformEventFilterListener)
+ ((PlatformEventFilterListener)p).onClose();
+ }
+
return found;
}
@@ -884,62 +878,18 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
}
/**
- * @param evt Event to notify about.
- */
- private void notifyListeners(Event evt) {
- assert evt != null;
-
- notifyListeners(lsnrs.get(evt.type()), evt);
- }
-
- /**
* @param set Set of listeners.
* @param evt Grid event.
*/
- private void notifyListeners(@Nullable Collection<GridLocalEventListener> set, Event evt) {
+ private void notifyListeners(@Nullable Collection<EventListener> set, Event evt, Object[] params) {
assert evt != null;
if (!F.isEmpty(set)) {
assert set != null;
- for (GridLocalEventListener lsnr : set) {
+ for (EventListener lsnr : set) {
try {
- lsnr.onEvent(evt);
- }
- catch (Throwable e) {
- U.error(log, "Unexpected exception in listener notification for event: " + evt, e);
-
- if (e instanceof Error)
- throw (Error)e;
- }
- }
- }
- }
-
- /**
- * @param evt Discovery event
- * @param cache Discovery cache.
- */
- private void notifyDiscoveryListeners(DiscoveryEvent evt, DiscoCache cache) {
- assert evt != null;
-
- notifyDiscoveryListeners(discoLsnrs.get(evt.type()), evt, cache);
- }
-
- /**
- * @param set Set of listeners.
- * @param evt Discovery event.
- * @param cache Discovery cache.
- */
- private void notifyDiscoveryListeners(@Nullable Collection<DiscoveryEventListener> set, DiscoveryEvent evt, DiscoCache cache) {
- assert evt != null;
-
- if (!F.isEmpty(set)) {
- assert set != null;
-
- for (DiscoveryEventListener lsnr : set) {
- try {
- lsnr.onEvent(evt, cache);
+ ((ListenerWrapper)lsnr).onEvent(evt, params);
}
catch (Throwable e) {
U.error(log, "Unexpected exception in listener notification for event: " + evt, e);
@@ -1337,10 +1287,93 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
}
}
+ /** */
+ private abstract static class ListenerWrapper implements EventListener {
+ abstract void onEvent(Event evt, Object[] params);
+ }
+
+ /**
+ * Wraps local listener
+ */
+ private static final class LocalListenerWrapper extends ListenerWrapper {
+ /** */
+ private final GridLocalEventListener lsnr;
+
+ /**
+ * @param lsnr Listener.
+ */
+ private LocalListenerWrapper(GridLocalEventListener lsnr) {
+ this.lsnr = lsnr;
+ }
+
+ /** {@inheritDoc} */
+ @Override void onEvent(Event evt, Object[] params) {
+ lsnr.onEvent(evt);
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ LocalListenerWrapper wrapper = (LocalListenerWrapper)o;
+
+ return lsnr.equals(wrapper.lsnr);
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return lsnr.hashCode();
+ }
+ }
+
+ /**
+ * Wraps discovery local listener
+ */
+ private static final class DiscoveryListenerWrapper extends ListenerWrapper {
+ /** */
+ private final DiscoveryEventListener lsnr;
+
+ /**
+ * @param lsnr Listener.
+ */
+ private DiscoveryListenerWrapper(DiscoveryEventListener lsnr) {
+ this.lsnr = lsnr;
+ }
+
+ /** {@inheritDoc} */
+ @Override void onEvent(Event evt, Object[] params) {
+ // No checks there since only DiscoveryManager produses DiscoveryEvents
+ // and it uses an overloaded method with additional parameters
+ lsnr.onEvent((DiscoveryEvent)evt, (DiscoCache)params[0]);
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ DiscoveryListenerWrapper wrapper = (DiscoveryListenerWrapper)o;
+
+ return lsnr.equals(wrapper.lsnr);
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return lsnr.hashCode();
+ }
+ }
+
/**
- * Wraps user listener predicate provided via {@link org.apache.ignite.IgniteEvents#localListen(org.apache.ignite.lang.IgnitePredicate, int...)}.
+ * Wraps user listener predicate provided via {@link IgniteEvents#localListen(IgnitePredicate, int...)}.
*/
- private class UserListenerWrapper implements GridLocalEventListener {
+ private final class UserListenerWrapper extends ListenerWrapper {
/** */
private final IgnitePredicate<Event> lsnr;
@@ -1359,9 +1392,9 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
}
/** {@inheritDoc} */
- @Override public void onEvent(Event evt) {
+ @Override void onEvent(Event evt, Object[] params) {
if (!lsnr.apply(evt))
- removeLocalEventListener(this);
+ removeEventListener(this, null);
}
/** {@inheritDoc} */
[31/50] [abbrv] ignite git commit: Merge branch 'ignite-3477-master'
of https://git-wip-us.apache.org/repos/asf/ignite into ignite-3477-master
Posted by sb...@apache.org.
Merge branch 'ignite-3477-master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/00d63a8a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/00d63a8a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/00d63a8a
Branch: refs/heads/ignite-4929
Commit: 00d63a8a960680749920b32d12462717037026e3
Parents: 10485a0 4310583
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:37:47 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:37:47 2017 +0300
----------------------------------------------------------------------
examples/pom-standalone-lgpl.xml | 6 ++++++
examples/pom-standalone.xml | 6 ++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
[16/50] [abbrv] ignite git commit: ignite-3477-master fix hibernate
class description
Posted by sb...@apache.org.
ignite-3477-master fix hibernate class description
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5489acea
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5489acea
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5489acea
Branch: refs/heads/ignite-4929
Commit: 5489acea248acd40d2f916b31ced361afa778aa2
Parents: b066f60
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Thu Apr 13 11:26:00 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Thu Apr 13 11:26:00 2017 +0300
----------------------------------------------------------------------
.../org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java | 2 +-
.../org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5489acea/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java
----------------------------------------------------------------------
diff --git a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java
index 2922f7f..ecad0b6 100644
--- a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java
+++ b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyTransformer.java
@@ -18,7 +18,7 @@
package org.apache.ignite.cache.hibernate;
/**
- *
+ * An interface for transforming hibernate keys to Ignite keys.
*/
public interface HibernateKeyTransformer {
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/5489acea/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java
----------------------------------------------------------------------
diff --git a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java
index 3f2b97f..ff52124 100644
--- a/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java
+++ b/modules/hibernate5/src/main/java/org/apache/ignite/cache/hibernate/HibernateKeyWrapper.java
@@ -24,7 +24,7 @@ import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
/**
- *
+ * Hibernate cache key wrapper.
*/
public class HibernateKeyWrapper {
/** Key. */
[35/50] [abbrv] ignite git commit: IGNITE-3581: Moved enums to
separate structs for C++
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/statement.cpp b/modules/platforms/cpp/odbc/src/statement.cpp
index 2395d66..99ec42e 100644
--- a/modules/platforms/cpp/odbc/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/src/statement.cpp
@@ -56,24 +56,24 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalBindColumn(columnIdx, targetType, targetValue, bufferLength, strLengthOrIndicator));
}
- SqlResult Statement::InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator)
+ SqlResult::Type Statement::InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator)
{
using namespace odbc::type_traits;
- IgniteSqlType driverType = ToDriverType(targetType);
+ OdbcNativeType::Type driverType = ToDriverType(targetType);
- if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
+ if (driverType == OdbcNativeType::AI_UNSUPPORTED)
{
- AddStatusRecord(odbc::SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE, "The argument TargetType was not a valid data type.");
+ AddStatusRecord(odbc::SqlState::SHY003_INVALID_APPLICATION_BUFFER_TYPE, "The argument TargetType was not a valid data type.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (bufferLength < 0)
{
- AddStatusRecord(odbc::SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH,
+ AddStatusRecord(odbc::SqlState::SHY090_INVALID_STRING_OR_BUFFER_LENGTH,
"The value specified for the argument BufferLength was less than 0.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (targetValue || strLengthOrIndicator)
@@ -85,7 +85,7 @@ namespace ignite
else
SafeUnbindColumn(columnIdx);
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Statement::SafeBindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer)
@@ -124,20 +124,20 @@ namespace ignite
return res;
}
- SqlResult Statement::InternalGetColumnNumber(int32_t &res)
+ SqlResult::Type Statement::InternalGetColumnNumber(int32_t &res)
{
const meta::ColumnMetaVector* meta = GetMeta();
if (!meta)
{
- AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query is not executed.");
+ AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query is not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
res = static_cast<int32_t>(meta->size());
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Statement::BindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
@@ -146,7 +146,7 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalBindParameter(paramIdx, ioType, bufferType, paramSqlType, columnSize, decDigits, buffer, bufferLen, resLen));
}
- SqlResult Statement::InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+ SqlResult::Type Statement::InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen)
{
using namespace odbc::type_traits;
@@ -157,36 +157,36 @@ namespace ignite
if (paramIdx == 0)
{
- AddStatusRecord(SQL_STATE_24000_INVALID_CURSOR_STATE,
+ AddStatusRecord(SqlState::S24000_INVALID_CURSOR_STATE,
"The value specified for the argument ParameterNumber was less than 1.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (ioType != SQL_PARAM_INPUT)
{
- AddStatusRecord(SQL_STATE_HY105_INVALID_PARAMETER_TYPE,
+ AddStatusRecord(SqlState::SHY105_INVALID_PARAMETER_TYPE,
"The value specified for the argument InputOutputType was not SQL_PARAM_INPUT.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (!IsSqlTypeSupported(paramSqlType))
{
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Data type is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- IgniteSqlType driverType = ToDriverType(bufferType);
+ OdbcNativeType::Type driverType = ToDriverType(bufferType);
- if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
+ if (driverType == OdbcNativeType::AI_UNSUPPORTED)
{
- AddStatusRecord(odbc::SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE,
+ AddStatusRecord(odbc::SqlState::SHY003_INVALID_APPLICATION_BUFFER_TYPE,
"The argument TargetType was not a valid data type.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (buffer)
@@ -200,7 +200,7 @@ namespace ignite
else
SafeUnbindParameter(paramIdx);
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Statement::SafeBindParameter(uint16_t paramIdx, const app::Parameter& param)
@@ -225,7 +225,7 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalSetAttribute(attr, value, valueLen));
}
- SqlResult Statement::InternalSetAttribute(int attr, void* value, SQLINTEGER valueLen)
+ SqlResult::Type Statement::InternalSetAttribute(int attr, void* value, SQLINTEGER valueLen)
{
switch (attr)
{
@@ -237,10 +237,10 @@ namespace ignite
if (val != 1)
{
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Fetching of more than one row by call is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
break;
@@ -276,14 +276,14 @@ namespace ignite
default:
{
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Specified attribute is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Statement::GetAttribute(int attr, void* buf, SQLINTEGER bufLen, SQLINTEGER* valueLen)
@@ -291,13 +291,13 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalGetAttribute(attr, buf, bufLen, valueLen));
}
- SqlResult Statement::InternalGetAttribute(int attr, void* buf, SQLINTEGER bufLen, SQLINTEGER* valueLen)
+ SqlResult::Type Statement::InternalGetAttribute(int attr, void* buf, SQLINTEGER bufLen, SQLINTEGER* valueLen)
{
if (!buf)
{
- AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Data buffer is NULL.");
+ AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, "Data buffer is NULL.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
switch (attr)
@@ -361,14 +361,14 @@ namespace ignite
default:
{
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Specified attribute is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
uint16_t Statement::GetParametersNumber()
@@ -395,18 +395,18 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalGetColumnData(columnIdx, buffer));
}
- SqlResult Statement::InternalGetColumnData(uint16_t columnIdx,
+ SqlResult::Type Statement::InternalGetColumnData(uint16_t columnIdx,
app::ApplicationDataBuffer& buffer)
{
if (!currentQuery.get())
{
- AddStatusRecord(SQL_STATE_24000_INVALID_CURSOR_STATE,
+ AddStatusRecord(SqlState::S24000_INVALID_CURSOR_STATE,
"Cursor is not in the open state.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- SqlResult res = currentQuery->GetColumn(columnIdx, buffer);
+ SqlResult::Type res = currentQuery->GetColumn(columnIdx, buffer);
return res;
}
@@ -416,7 +416,7 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalPrepareSqlQuery(query));
}
- SqlResult Statement::InternalPrepareSqlQuery(const std::string& query)
+ SqlResult::Type Statement::InternalPrepareSqlQuery(const std::string& query)
{
if (currentQuery.get())
currentQuery->Close();
@@ -426,7 +426,7 @@ namespace ignite
// Resetting parameters types as we are changing the query.
paramTypes.clear();
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Statement::ExecuteSqlQuery(const std::string& query)
@@ -434,11 +434,11 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalExecuteSqlQuery(query));
}
- SqlResult Statement::InternalExecuteSqlQuery(const std::string& query)
+ SqlResult::Type Statement::InternalExecuteSqlQuery(const std::string& query)
{
- SqlResult result = InternalPrepareSqlQuery(query);
+ SqlResult::Type result = InternalPrepareSqlQuery(query);
- if (result != SQL_RESULT_SUCCESS)
+ if (result != SqlResult::AI_SUCCESS)
return result;
return InternalExecuteSqlQuery();
@@ -449,13 +449,13 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalExecuteSqlQuery());
}
- SqlResult Statement::InternalExecuteSqlQuery()
+ SqlResult::Type Statement::InternalExecuteSqlQuery()
{
if (!currentQuery.get())
{
- AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query is not prepared.");
+ AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query is not prepared.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
bool paramDataReady = true;
@@ -471,7 +471,7 @@ namespace ignite
}
if (!paramDataReady)
- return SQL_RESULT_NEED_DATA;
+ return SqlResult::AI_NEED_DATA;
return currentQuery->Execute();
}
@@ -482,7 +482,7 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalExecuteGetColumnsMetaQuery(schema, table, column));
}
- SqlResult Statement::InternalExecuteGetColumnsMetaQuery(const std::string& schema,
+ SqlResult::Type Statement::InternalExecuteGetColumnsMetaQuery(const std::string& schema,
const std::string& table, const std::string& column)
{
if (currentQuery.get())
@@ -506,7 +506,7 @@ namespace ignite
catalog, schema, table, tableType));
}
- SqlResult Statement::InternalExecuteGetTablesMetaQuery(const std::string& catalog,
+ SqlResult::Type Statement::InternalExecuteGetTablesMetaQuery(const std::string& catalog,
const std::string& schema, const std::string& table, const std::string& tableType)
{
if (currentQuery.get())
@@ -527,7 +527,7 @@ namespace ignite
primarySchema, primaryTable, foreignCatalog, foreignSchema, foreignTable));
}
- SqlResult Statement::InternalExecuteGetForeignKeysQuery(const std::string& primaryCatalog,
+ SqlResult::Type Statement::InternalExecuteGetForeignKeysQuery(const std::string& primaryCatalog,
const std::string& primarySchema, const std::string& primaryTable,
const std::string& foreignCatalog, const std::string& foreignSchema,
const std::string& foreignTable)
@@ -547,7 +547,7 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalExecuteGetPrimaryKeysQuery(catalog, schema, table));
}
- SqlResult Statement::InternalExecuteGetPrimaryKeysQuery(const std::string& catalog,
+ SqlResult::Type Statement::InternalExecuteGetPrimaryKeysQuery(const std::string& catalog,
const std::string& schema, const std::string& table)
{
if (currentQuery.get())
@@ -567,16 +567,16 @@ namespace ignite
catalog, schema, table, scope, nullable));
}
- SqlResult Statement::InternalExecuteSpecialColumnsQuery(int16_t type,
+ SqlResult::Type Statement::InternalExecuteSpecialColumnsQuery(int16_t type,
const std::string& catalog, const std::string& schema,
const std::string& table, int16_t scope, int16_t nullable)
{
if (type != SQL_BEST_ROWID && type != SQL_ROWVER)
{
- AddStatusRecord(SQL_STATE_HY097_COLUMN_TYPE_OUT_OF_RANGE,
+ AddStatusRecord(SqlState::SHY097_COLUMN_TYPE_OUT_OF_RANGE,
"An invalid IdentifierType value was specified.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (currentQuery.get())
@@ -593,14 +593,14 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalExecuteGetTypeInfoQuery(sqlType));
}
- SqlResult Statement::InternalExecuteGetTypeInfoQuery(int16_t sqlType)
+ SqlResult::Type Statement::InternalExecuteGetTypeInfoQuery(int16_t sqlType)
{
if (!type_traits::IsSqlTypeSupported(sqlType))
{
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Data type is not supported.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (currentQuery.get())
@@ -616,15 +616,15 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalFreeResources(option));
}
- SqlResult Statement::InternalFreeResources(int16_t option)
+ SqlResult::Type Statement::InternalFreeResources(int16_t option)
{
switch (option)
{
case SQL_DROP:
{
- AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Deprecated, call SQLFreeHandle instead");
+ AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, "Deprecated, call SQLFreeHandle instead");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
case SQL_CLOSE:
@@ -648,11 +648,11 @@ namespace ignite
default:
{
- AddStatusRecord(SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE, "The value specified for the argument Option was invalid");
- return SQL_RESULT_ERROR;
+ AddStatusRecord(SqlState::SHY092_OPTION_TYPE_OUT_OF_RANGE, "The value specified for the argument Option was invalid");
+ return SqlResult::AI_ERROR;
}
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Statement::Close()
@@ -660,14 +660,14 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalClose());
}
- SqlResult Statement::InternalClose()
+ SqlResult::Type Statement::InternalClose()
{
if (!currentQuery.get())
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
- SqlResult result = currentQuery->Close();
+ SqlResult::Type result = currentQuery->Close();
- if (result == SQL_RESULT_SUCCESS)
+ if (result == SqlResult::AI_SUCCESS)
currentQuery.reset();
return result;
@@ -678,14 +678,14 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalFetchScroll(orientation, offset));
}
- SqlResult Statement::InternalFetchScroll(int16_t orientation, int64_t offset)
+ SqlResult::Type Statement::InternalFetchScroll(int16_t orientation, int64_t offset)
{
UNREFERENCED_PARAMETER(offset);
if (orientation != SQL_FETCH_NEXT)
{
- AddStatusRecord(SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE, "The value specified for the argument FetchOrientation was not SQL_FETCH_NEXT.");
- return SQL_RESULT_ERROR;
+ AddStatusRecord(SqlState::SHY106_FETCH_TYPE_OUT_OF_RANGE, "The value specified for the argument FetchOrientation was not SQL_FETCH_NEXT.");
+ return SqlResult::AI_ERROR;
}
return InternalFetchRow();
@@ -696,22 +696,22 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalFetchRow());
}
- SqlResult Statement::InternalFetchRow()
+ SqlResult::Type Statement::InternalFetchRow()
{
if (rowsFetched)
*rowsFetched = 0;
if (!currentQuery.get())
{
- AddStatusRecord(SQL_STATE_24000_INVALID_CURSOR_STATE,
+ AddStatusRecord(SqlState::S24000_INVALID_CURSOR_STATE,
"Cursor is not in the open state.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- SqlResult res = currentQuery->FetchNextRow(columnBindings);
+ SqlResult::Type res = currentQuery->FetchNextRow(columnBindings);
- if (res == SQL_RESULT_SUCCESS)
+ if (res == SqlResult::AI_SUCCESS)
{
if (rowsFetched)
*rowsFetched = 1;
@@ -741,14 +741,14 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalNextResults());
}
- SqlResult Statement::InternalNextResults()
+ SqlResult::Type Statement::InternalNextResults()
{
if (!currentQuery.get())
- return SQL_RESULT_NO_DATA;
+ return SqlResult::AI_NO_DATA;
- SqlResult result = currentQuery->Close();
+ SqlResult::Type result = currentQuery->Close();
- return result == SQL_RESULT_SUCCESS ? SQL_RESULT_NO_DATA : result;
+ return result == SqlResult::AI_SUCCESS ? SqlResult::AI_NO_DATA : result;
}
void Statement::GetColumnAttribute(uint16_t colIdx, uint16_t attrId,
@@ -758,7 +758,7 @@ namespace ignite
strbuf, buflen, reslen, numbuf));
}
- SqlResult Statement::InternalGetColumnAttribute(uint16_t colIdx,
+ SqlResult::Type Statement::InternalGetColumnAttribute(uint16_t colIdx,
uint16_t attrId, char* strbuf, int16_t buflen, int16_t* reslen,
SqlLen* numbuf)
{
@@ -766,17 +766,17 @@ namespace ignite
if (!meta)
{
- AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query is not executed.");
+ AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query is not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (colIdx > meta->size() + 1 || colIdx < 1)
{
- AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR,
+ AddStatusRecord(SqlState::SHY000_GENERAL_ERROR,
"Column index is out of range.", 0, colIdx);
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
const meta::ColumnMeta& columnMeta = meta->at(colIdx - 1);
@@ -803,13 +803,13 @@ namespace ignite
if (!found)
{
- AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ AddStatusRecord(SqlState::SHYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
"Unknown attribute.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
int64_t Statement::AffectedRows()
@@ -821,18 +821,18 @@ namespace ignite
return rowCnt;
}
- SqlResult Statement::InternalAffectedRows(int64_t& rowCnt)
+ SqlResult::Type Statement::InternalAffectedRows(int64_t& rowCnt)
{
if (!currentQuery.get())
{
- AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query is not executed.");
+ AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query is not executed.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
rowCnt = currentQuery->AffectedRows();
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Statement::SetRowsFetchedPtr(size_t* ptr)
@@ -860,21 +860,21 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalSelectParam(paramPtr));
}
- SqlResult Statement::InternalSelectParam(void** paramPtr)
+ SqlResult::Type Statement::InternalSelectParam(void** paramPtr)
{
if (!paramPtr)
{
- AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR,
+ AddStatusRecord(SqlState::SHY000_GENERAL_ERROR,
"Invalid parameter: ValuePtrPtr is null.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (!currentQuery.get())
{
- AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query is not prepared.");
+ AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query is not prepared.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
app::ParameterBindingMap::iterator it;
@@ -885,11 +885,11 @@ namespace ignite
if (it != paramBindings.end() && !it->second.IsDataReady())
{
- AddStatusRecord(SQL_STATE_22026_DATA_LENGTH_MISMATCH,
+ AddStatusRecord(SqlState::S22026_DATA_LENGTH_MISMATCH,
"Less data was sent for a parameter than was specified with "
"the StrLen_or_IndPtr argument in SQLBindParameter.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
}
@@ -904,14 +904,14 @@ namespace ignite
currentParamIdx = paramIdx;
- return SQL_RESULT_NEED_DATA;
+ return SqlResult::AI_NEED_DATA;
}
}
- SqlResult res = currentQuery->Execute();
+ SqlResult::Type res = currentQuery->Execute();
- if (res != SQL_RESULT_SUCCESS)
- res = SQL_RESULT_SUCCESS_WITH_INFO;
+ if (res != SqlResult::AI_SUCCESS)
+ res = SqlResult::AI_SUCCESS_WITH_INFO;
return res;
}
@@ -921,40 +921,40 @@ namespace ignite
IGNITE_ODBC_API_CALL(InternalPutData(data, len));
}
- SqlResult Statement::InternalPutData(void* data, SqlLen len)
+ SqlResult::Type Statement::InternalPutData(void* data, SqlLen len)
{
if (!data && len != 0 && len != SQL_DEFAULT_PARAM && len != SQL_NULL_DATA)
{
- AddStatusRecord(SQL_STATE_HY009_INVALID_USE_OF_NULL_POINTER,
+ AddStatusRecord(SqlState::SHY009_INVALID_USE_OF_NULL_POINTER,
"Invalid parameter: DataPtr is null StrLen_or_Ind is not 0, "
"SQL_DEFAULT_PARAM, or SQL_NULL_DATA.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
if (currentParamIdx == 0)
{
- AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR,
+ AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR,
"Parameter is not selected with the SQLParamData.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
app::ParameterBindingMap::iterator it = paramBindings.find(currentParamIdx);
if (it == paramBindings.end())
{
- AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR,
+ AddStatusRecord(SqlState::SHY000_GENERAL_ERROR,
"Selected parameter has been unbound.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
app::Parameter& param = it->second;
param.PutData(data, len);
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
void Statement::DescribeParam(int16_t paramNum, int16_t* dataType,
@@ -964,22 +964,22 @@ namespace ignite
dataType, paramSize, decimalDigits, nullable));
}
- SqlResult Statement::InternalDescribeParam(int16_t paramNum, int16_t* dataType,
+ SqlResult::Type Statement::InternalDescribeParam(int16_t paramNum, int16_t* dataType,
SqlUlen* paramSize, int16_t* decimalDigits, int16_t* nullable)
{
query::Query *qry = currentQuery.get();
if (!qry)
{
- AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query is not prepared.");
+ AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query is not prepared.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- if (qry->GetType() != query::Query::DATA)
+ if (qry->GetType() != query::QueryType::DATA)
{
- AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query is not SQL data query.");
+ AddStatusRecord(SqlState::SHY010_SEQUENCE_ERROR, "Query is not SQL data query.");
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
int8_t type = 0;
@@ -991,9 +991,9 @@ namespace ignite
if (!type)
{
- SqlResult res = UpdateParamsMeta();
+ SqlResult::Type res = UpdateParamsMeta();
- if (res != SQL_RESULT_SUCCESS)
+ if (res != SqlResult::AI_SUCCESS)
return res;
if (paramNum < 1 || static_cast<size_t>(paramNum) > paramTypes.size())
@@ -1014,15 +1014,15 @@ namespace ignite
if (nullable)
*nullable = type_traits::BinaryTypeNullability(type);
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
- SqlResult Statement::UpdateParamsMeta()
+ SqlResult::Type Statement::UpdateParamsMeta()
{
query::Query *qry0 = currentQuery.get();
assert(qry0 != 0);
- assert(qry0->GetType() == query::Query::DATA);
+ assert(qry0->GetType() == query::QueryType::DATA);
query::DataQuery* qry = static_cast<query::DataQuery*>(qry0);
@@ -1038,18 +1038,18 @@ namespace ignite
}
catch (const IgniteError& err)
{
- AddStatusRecord(SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT, err.GetText());
+ AddStatusRecord(SqlState::SHYT01_CONNECTIOIN_TIMEOUT, err.GetText());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
- if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
+ if (rsp.GetStatus() != ResponseStatus::SUCCESS)
{
LOG_MSG("Error: " << rsp.GetError());
- AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
+ AddStatusRecord(SqlState::SHY000_GENERAL_ERROR, rsp.GetError());
- return SQL_RESULT_ERROR;
+ return SqlResult::AI_ERROR;
}
paramTypes = rsp.GetTypeIds();
@@ -1059,7 +1059,7 @@ namespace ignite
LOG_MSG("[" << i << "] Parameter type: " << paramTypes[i]);
}
- return SQL_RESULT_SUCCESS;
+ return SqlResult::AI_SUCCESS;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc/src/type_traits.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/type_traits.cpp b/modules/platforms/cpp/odbc/src/type_traits.cpp
index e4ce10f..bff21d1 100644
--- a/modules/platforms/cpp/odbc/src/type_traits.cpp
+++ b/modules/platforms/cpp/odbc/src/type_traits.cpp
@@ -187,7 +187,7 @@ namespace ignite
bool IsApplicationTypeSupported(int16_t type)
{
- return ToDriverType(type) != IGNITE_ODBC_C_TYPE_UNSUPPORTED;
+ return ToDriverType(type) != OdbcNativeType::AI_UNSUPPORTED;
}
bool IsSqlTypeSupported(int16_t type)
@@ -296,75 +296,75 @@ namespace ignite
return -1;
}
- IgniteSqlType ToDriverType(int16_t type)
+ OdbcNativeType::Type ToDriverType(int16_t type)
{
switch (type)
{
case SQL_C_CHAR:
- return IGNITE_ODBC_C_TYPE_CHAR;
+ return OdbcNativeType::AI_CHAR;
case SQL_C_WCHAR:
- return IGNITE_ODBC_C_TYPE_WCHAR;
+ return OdbcNativeType::AI_WCHAR;
case SQL_C_SSHORT:
case SQL_C_SHORT:
- return IGNITE_ODBC_C_TYPE_SIGNED_SHORT;
+ return OdbcNativeType::AI_SIGNED_SHORT;
case SQL_C_USHORT:
- return IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT;
+ return OdbcNativeType::AI_UNSIGNED_SHORT;
case SQL_C_SLONG:
case SQL_C_LONG:
- return IGNITE_ODBC_C_TYPE_SIGNED_LONG;
+ return OdbcNativeType::AI_SIGNED_LONG;
case SQL_C_ULONG:
- return IGNITE_ODBC_C_TYPE_UNSIGNED_LONG;
+ return OdbcNativeType::AI_UNSIGNED_LONG;
case SQL_C_FLOAT:
- return IGNITE_ODBC_C_TYPE_FLOAT;
+ return OdbcNativeType::AI_FLOAT;
case SQL_C_DOUBLE:
- return IGNITE_ODBC_C_TYPE_DOUBLE;
+ return OdbcNativeType::AI_DOUBLE;
case SQL_C_BIT:
- return IGNITE_ODBC_C_TYPE_BIT;
+ return OdbcNativeType::AI_BIT;
case SQL_C_STINYINT:
case SQL_C_TINYINT:
- return IGNITE_ODBC_C_TYPE_SIGNED_TINYINT;
+ return OdbcNativeType::AI_SIGNED_TINYINT;
case SQL_C_UTINYINT:
- return IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT;
+ return OdbcNativeType::AI_UNSIGNED_TINYINT;
case SQL_C_SBIGINT:
- return IGNITE_ODBC_C_TYPE_SIGNED_BIGINT;
+ return OdbcNativeType::AI_SIGNED_BIGINT;
case SQL_C_UBIGINT:
- return IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT;
+ return OdbcNativeType::AI_UNSIGNED_BIGINT;
case SQL_C_BINARY:
- return IGNITE_ODBC_C_TYPE_BINARY;
+ return OdbcNativeType::AI_BINARY;
case SQL_C_TYPE_DATE:
- return IGNITE_ODBC_C_TYPE_TDATE;
+ return OdbcNativeType::AI_TDATE;
case SQL_C_TYPE_TIME:
- return IGNITE_ODBC_C_TYPE_TTIME;
+ return OdbcNativeType::AI_TTIME;
case SQL_C_TYPE_TIMESTAMP:
- return IGNITE_ODBC_C_TYPE_TTIMESTAMP;
+ return OdbcNativeType::AI_TTIMESTAMP;
case SQL_C_NUMERIC:
- return IGNITE_ODBC_C_TYPE_NUMERIC;
+ return OdbcNativeType::AI_NUMERIC;
case SQL_C_GUID:
- return IGNITE_ODBC_C_TYPE_GUID;
+ return OdbcNativeType::AI_GUID;
case SQL_C_DEFAULT:
- return IGNITE_ODBC_C_TYPE_DEFAULT;
+ return OdbcNativeType::AI_DEFAULT;
default:
- return IGNITE_ODBC_C_TYPE_UNSUPPORTED;
+ return OdbcNativeType::AI_UNSUPPORTED;
}
}
[46/50] [abbrv] ignite git commit: .NET: Fix TestDistributedJoins
Posted by sb...@apache.org.
.NET: Fix TestDistributedJoins
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/428f66d3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/428f66d3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/428f66d3
Branch: refs/heads/ignite-4929
Commit: 428f66d38a661dd3bbbb578e976917daeee7adac
Parents: d7c0b52
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Apr 14 10:17:23 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Apr 14 10:17:23 2017 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/428f66d3/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs
index dfd644d..0b2bb3e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs
@@ -1355,8 +1355,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
var res = persons.Join(roles, person => person.Key - PersonCount, role => role.Key, (person, role) => role)
.ToArray();
- Assert.Greater(res.Length, 0);
- Assert.Less(res.Length, RoleCount);
+ Assert.AreEqual(res.Length, RoleCount);
// Test distributed join: returns complete results
persons = personCache.AsCacheQueryable(new QueryOptions {EnableDistributedJoins = true});
[11/50] [abbrv] ignite git commit: Merge-related fixes
Posted by sb...@apache.org.
Merge-related fixes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/21dcef20
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/21dcef20
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/21dcef20
Branch: refs/heads/ignite-4929
Commit: 21dcef207f7bc2beab7fa50a4346b2a33fd34611
Parents: 5f72451
Author: Igor Sapego <is...@gridgain.com>
Authored: Wed Apr 12 15:43:10 2017 +0300
Committer: Igor Sapego <is...@gridgain.com>
Committed: Wed Apr 12 15:43:10 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/21dcef20/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index 6f9b401..b94b464 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@ -110,11 +110,8 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridCachePar
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheRendezvousAffinityClientSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheStoreUpdateTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridPartitionedBackupLoadSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridNearOffheapCacheStoreUpdateTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridPartitionedBackupLoadSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.NearCacheSyncUpdateTest;
import org.apache.ignite.internal.processors.cache.distributed.near.NoneRebalanceModeSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedEvictionSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedJobExecutionTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicBasicStoreSelfTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalAtomicGetAndTransformStoreSelfTest;
@@ -178,7 +175,6 @@ public class IgniteCacheTestSuite2 extends TestSuite {
suite.addTest(new TestSuite(RendezvousAffinityFunctionExcludeNeighborsSelfTest.class));
suite.addTest(new TestSuite(RendezvousAffinityFunctionFastPowerOfTwoHashSelfTest.class));
suite.addTest(new TestSuite(RendezvousAffinityFunctionStandardHashSelfTest.class));
- suite.addTest(new TestSuite(FairAffinityFunctionExcludeNeighborsSelfTest.class));
suite.addTest(new TestSuite(GridCacheRendezvousAffinityClientSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedProjectionAffinitySelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedBasicOpSelfTest.class));
[21/50] [abbrv] ignite git commit: ignite-4681 Apply new future
adapter
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
index 4b8915c..7ad7c31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
@@ -85,9 +85,6 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
private Iterator<R> iter;
/** */
- protected final Object mux = new Object();
-
- /** */
private IgniteUuid timeoutId = IgniteUuid.randomUuid();
/** */
@@ -215,7 +212,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
Collection<R> res = null;
while (res == null) {
- synchronized (mux) {
+ synchronized (this) {
res = queue.poll();
}
@@ -228,10 +225,10 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
if (waitTime <= 0)
break;
- synchronized (mux) {
+ synchronized (this) {
try {
if (queue.isEmpty() && !isDone())
- mux.wait(waitTime);
+ wait(waitTime);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
@@ -273,7 +270,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
while (it == null || !it.hasNext()) {
Collection<R> c;
- synchronized (mux) {
+ synchronized (this) {
it = iter;
if (it != null && it.hasNext())
@@ -301,10 +298,10 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
break;
}
- synchronized (mux) {
+ synchronized (this) {
try {
if (queue.isEmpty() && !isDone())
- mux.wait(waitTime);
+ wait(waitTime);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
@@ -332,7 +329,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
*/
@SuppressWarnings({"unchecked"})
protected void enqueue(Collection<?> col) {
- assert Thread.holdsLock(mux);
+ assert Thread.holdsLock(this);
queue.add((Collection<R>)col);
@@ -351,7 +348,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
Collection<Object> dedupCol = new ArrayList<>(col.size());
- synchronized (mux) {
+ synchronized (this) {
for (Object o : col)
if (!(o instanceof Map.Entry) || keys.add(((Map.Entry<K, V>)o).getKey()))
dedupCol.add(o);
@@ -377,7 +374,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
try {
if (err != null)
- synchronized (mux) {
+ synchronized (this) {
enqueue(Collections.emptyList());
onDone(nodeId != null ?
@@ -387,7 +384,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
onPage(nodeId, true);
- mux.notifyAll();
+ notifyAll();
}
else {
if (data == null)
@@ -397,7 +394,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
data = cctx.unwrapBinariesIfNeeded((Collection<Object>)data, qry.query().keepBinary());
- synchronized (mux) {
+ synchronized (this) {
enqueue(data);
if (qry.query().keepAll())
@@ -409,7 +406,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
clear();
}
- mux.notifyAll();
+ notifyAll();
}
}
}
@@ -426,14 +423,14 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
* @param e Error.
*/
private void onPageError(@Nullable UUID nodeId, Throwable e) {
- synchronized (mux) {
+ synchronized (this) {
enqueue(Collections.emptyList());
onPage(nodeId, true);
onDone(e);
- mux.notifyAll();
+ notifyAll();
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetection.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetection.java
index 67d00ea..1cf7809 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockDetection.java
@@ -214,9 +214,6 @@ public class TxDeadlockDetection {
/** Timed out flag. */
private volatile boolean timedOut;
- /** Mutex. */
- private final Object mux = new Object();
-
/**
* @param cctx Context.
* @param txId Tx ID.
@@ -521,7 +518,7 @@ public class TxDeadlockDetection {
* @param val Value.
*/
private boolean compareAndSet(UUID exp, UUID val) {
- synchronized (mux) {
+ synchronized (this) {
if (Objects.equals(curNodeId, exp)) {
curNodeId = val;
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
index 2b2a78a..6012625 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
@@ -383,16 +383,6 @@ public class PlatformCompute extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override public long startTime() {
- return fut.startTime();
- }
-
- /** {@inheritDoc} */
- @Override public long duration() {
- return fut.duration();
- }
-
- /** {@inheritDoc} */
@Override public void listen(final IgniteInClosure lsnr) {
fut.listen(new IgniteInClosure<IgniteInternalFuture>() {
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpMemcachedNioListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpMemcachedNioListener.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpMemcachedNioListener.java
index 71eca65..c1334e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpMemcachedNioListener.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpMemcachedNioListener.java
@@ -31,11 +31,11 @@ import org.apache.ignite.internal.processors.rest.request.GridRestCacheRequest;
import org.apache.ignite.internal.processors.rest.request.GridRestRequest;
import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
import org.apache.ignite.internal.util.lang.GridTuple3;
+import org.apache.ignite.internal.util.lang.IgniteClosure2X;
import org.apache.ignite.internal.util.nio.GridNioFuture;
import org.apache.ignite.internal.util.nio.GridNioServerListenerAdapter;
import org.apache.ignite.internal.util.nio.GridNioSession;
import org.apache.ignite.internal.util.typedef.C2;
-import org.apache.ignite.internal.util.typedef.CIX1;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.jetbrains.annotations.Nullable;
@@ -178,11 +178,11 @@ public class GridTcpMemcachedNioListener extends GridNioServerListenerAdapter<Gr
return null;
}
- IgniteInternalFuture<GridRestResponse> f = hnd.handleAsync(createRestRequest(req, cmd.get1()));
-
- f.listen(new CIX1<IgniteInternalFuture<GridRestResponse>>() {
- @Override public void applyx(IgniteInternalFuture<GridRestResponse> f) throws IgniteCheckedException {
- GridRestResponse restRes = f.get();
+ return new GridEmbeddedFuture<>(new IgniteClosure2X<GridRestResponse, Exception, GridRestResponse>() {
+ @Override public GridRestResponse applyx(GridRestResponse restRes,
+ Exception ex) throws IgniteCheckedException {
+ if(ex != null)
+ throw U.cast(ex);
// Handle 'Stat' command (special case because several packets are included in response).
if (cmd.get1() == CACHE_METRICS) {
@@ -237,7 +237,7 @@ public class GridTcpMemcachedNioListener extends GridNioServerListenerAdapter<Gr
else
res.status(FAILURE);
- if (cmd.get3())
+ if (cmd.get3() == Boolean.TRUE)
res.key(req.key());
if (restRes.getSuccessStatus() == GridRestResponse.STATUS_SUCCESS && res.addData() &&
@@ -246,10 +246,10 @@ public class GridTcpMemcachedNioListener extends GridNioServerListenerAdapter<Gr
sendResponse(ses, res);
}
- }
- });
- return f;
+ return restRes;
+ }
+ }, hnd.handleAsync(createRestRequest(req, cmd.get1())));
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
index 96f3797..3e08cd9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
@@ -57,9 +57,6 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
private static final AtomicIntegerFieldUpdater<GridCompoundFuture> LSNR_CALLS_UPD =
AtomicIntegerFieldUpdater.newUpdater(GridCompoundFuture.class, "lsnrCalls");
- /** Sync object */
- protected final Object sync = new Object();
-
/** Possible values: null (no future), IgniteInternalFuture instance (single future) or List of futures */
private volatile Object futs;
@@ -146,7 +143,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
throw e;
}
- LSNR_CALLS_UPD.incrementAndGet(GridCompoundFuture.this);
+ LSNR_CALLS_UPD.incrementAndGet(this);
checkComplete();
}
@@ -169,16 +166,14 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
* @return Collection of futures.
*/
@SuppressWarnings("unchecked")
- public final Collection<IgniteInternalFuture<T>> futures() {
- synchronized (sync) {
- if (futs == null)
- return Collections.emptyList();
+ public synchronized final Collection<IgniteInternalFuture<T>> futures() {
+ if (futs == null)
+ return Collections.emptyList();
- if (futs instanceof IgniteInternalFuture)
- return Collections.singletonList((IgniteInternalFuture<T>)futs);
+ if (futs instanceof IgniteInternalFuture)
+ return Collections.singletonList((IgniteInternalFuture<T>)futs);
- return new ArrayList<>((Collection<IgniteInternalFuture<T>>)futs);
- }
+ return new ArrayList<>((Collection<IgniteInternalFuture<T>>)futs);
}
/**
@@ -200,7 +195,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
*/
@SuppressWarnings("ForLoopReplaceableByForEach")
protected final boolean hasPending() {
- synchronized (sync) {
+ synchronized (this) {
int size = futuresCountNoLock();
// Avoid iterator creation and collection copy.
@@ -224,7 +219,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
public final void add(IgniteInternalFuture<T> fut) {
assert fut != null;
- synchronized (sync) {
+ synchronized (this) {
if (futs == null)
futs = fut;
else if (futs instanceof IgniteInternalFuture) {
@@ -254,10 +249,8 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
/**
* Clear futures.
*/
- protected final void clear() {
- synchronized (sync) {
- futs = null;
- }
+ protected synchronized final void clear() {
+ futs = null;
}
/**
@@ -307,7 +300,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
*/
@SuppressWarnings("unchecked")
protected final IgniteInternalFuture<T> future(int idx) {
- assert Thread.holdsLock(sync);
+ assert Thread.holdsLock(this);
assert futs != null && idx >= 0 && idx < futuresCountNoLock();
if (futs instanceof IgniteInternalFuture) {
@@ -324,7 +317,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
*/
@SuppressWarnings("unchecked")
protected final int futuresCountNoLock() {
- assert Thread.holdsLock(sync);
+ assert Thread.holdsLock(this);
if (futs == null)
return 0;
@@ -338,19 +331,15 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R> implements Ig
/**
* @return Futures size.
*/
- private int futuresCount() {
- synchronized (sync) {
- return futuresCountNoLock();
- }
+ private synchronized int futuresCount() {
+ return futuresCountNoLock();
}
/**
* @return {@code True} if has at least one future.
*/
- protected final boolean hasFutures() {
- synchronized (sync) {
- return futs != null;
- }
+ protected synchronized final boolean hasFutures() {
+ return futs != null;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
index dc63adc..b149035 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
@@ -43,9 +43,6 @@ public class GridFinishedFuture<T> implements IgniteInternalFuture<T> {
/** Complete value. */
private final Object res;
- /** Start time. */
- private final long startTime = U.currentTimeMillis();
-
/**
* Creates finished future with complete value.
*/
@@ -84,16 +81,6 @@ public class GridFinishedFuture<T> implements IgniteInternalFuture<T> {
}
/** {@inheritDoc} */
- @Override public long startTime() {
- return startTime;
- }
-
- /** {@inheritDoc} */
- @Override public long duration() {
- return 0;
- }
-
- /** {@inheritDoc} */
@Override public boolean cancel() {
return false;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
index 723dff7..323babd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
@@ -17,10 +17,10 @@
package org.apache.ignite.internal.util.future;
-import java.util.Arrays;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.AbstractQueuedSynchronizer;
+import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+import java.util.concurrent.locks.LockSupport;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.IgniteFutureCancelledCheckedException;
@@ -28,7 +28,6 @@ import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
-import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -39,79 +38,100 @@ import org.jetbrains.annotations.Nullable;
/**
* Future adapter.
*/
-public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements IgniteInternalFuture<R> {
- /** */
- private static final long serialVersionUID = 0L;
+public class GridFutureAdapter<R> implements IgniteInternalFuture<R> {
+ /** Done state representation. */
+ private static final String DONE = "DONE";
/** Initial state. */
- private static final int INIT = 0;
+ private static final Node INIT = new Node(null);
/** Cancelled state. */
- private static final int CANCELLED = 1;
-
- /** Done state. */
- private static final int DONE = 2;
-
- /** */
- private static final byte ERR = 1;
+ private static final Object CANCELLED = new Object();
/** */
- private static final byte RES = 2;
+ private static final AtomicReferenceFieldUpdater<GridFutureAdapter, Object> stateUpdater =
+ AtomicReferenceFieldUpdater.newUpdater(GridFutureAdapter.class, Object.class, "state");
- /** */
- private byte resFlag;
+ /*
+ * https://bugs.openjdk.java.net/browse/JDK-8074773
+ */
+ static {
+ @SuppressWarnings("unused")
+ Class<?> ensureLoaded = LockSupport.class;
+ }
- /** Result. */
- @GridToStringInclude(sensitive = true)
- private Object res;
+ /**
+ * Stack node.
+ */
+ private static final class Node {
+ /** */
+ private final Object val;
- /** Future start time. */
- private final long startTime = U.currentTimeMillis();
+ /** */
+ private volatile Node next;
- /** Future end time. */
- private volatile long endTime;
+ /**
+ * @param val Node value.
+ */
+ Node(Object val) {
+ this.val = val;
+ }
+ }
/** */
- private boolean ignoreInterrupts;
+ private static final class ErrorWrapper {
+ /** */
+ private final Throwable error;
- /** */
- @GridToStringExclude
- private IgniteInClosure<? super IgniteInternalFuture<R>> lsnr;
+ /**
+ * @param error Error.
+ */
+ ErrorWrapper(Throwable error) {
+ this.error = error;
+ }
- /** {@inheritDoc} */
- @Override public long startTime() {
- return startTime;
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return String.valueOf(error);
+ }
}
- /** {@inheritDoc} */
- @Override public long duration() {
- long endTime = this.endTime;
-
- return endTime == 0 ? U.currentTimeMillis() - startTime : endTime - startTime;
- }
+ /** */
+ private boolean ignoreInterrupts;
- /**
- * @param ignoreInterrupts Ignore interrupts flag.
- */
- public void ignoreInterrupts(boolean ignoreInterrupts) {
- this.ignoreInterrupts = ignoreInterrupts;
- }
+ /** */
+ @GridToStringExclude
+ private volatile Object state = INIT;
/**
- * @return Future end time.
+ * Determines whether the future will ignore interrupts.
*/
- public long endTime() {
- return endTime;
+ public void ignoreInterrupts() {
+ ignoreInterrupts = true;
}
/** {@inheritDoc} */
@Override public Throwable error() {
- return (resFlag == ERR) ? (Throwable)res : null;
+ Object state0 = state;
+
+ if (state0 != null && state0.getClass() == ErrorWrapper.class)
+ return ((ErrorWrapper)state0).error;
+
+ return null;
}
/** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
@Override public R result() {
- return resFlag == RES ? (R)res : null;
+ Object state0 = state;
+
+ if(state0 == null || // It is DONE state
+ (state0.getClass() != Node.class && // It is not INIT state
+ state0.getClass() != ErrorWrapper.class && // It is not FAILED
+ state0 != CANCELLED)) // It is not CANCELLED
+ return (R)state0;
+
+ return null;
}
/** {@inheritDoc} */
@@ -135,14 +155,7 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
A.ensure(timeout >= 0, "timeout cannot be negative: " + timeout);
A.notNull(unit, "unit");
- try {
- return get0(unit.toNanos(timeout));
- }
- catch (InterruptedException e) {
- Thread.currentThread().interrupt();
-
- throw new IgniteInterruptedCheckedException("Got interrupted while waiting for future to complete.", e);
- }
+ return get0(unit.toNanos(timeout));
}
/**
@@ -153,79 +166,190 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
* @throws IgniteCheckedException If failed.
*/
private R get0(boolean ignoreInterrupts) throws IgniteCheckedException {
+ if (isDone() || !registerWaiter(Thread.currentThread()))
+ return resolve();
+
+ boolean interrupted = false;
+
try {
- if (endTime == 0) {
- if (ignoreInterrupts)
- acquireShared(0);
- else
- acquireSharedInterruptibly(0);
- }
+ while (true) {
+ LockSupport.park();
- if (getState() == CANCELLED)
- throw new IgniteFutureCancelledCheckedException("Future was cancelled: " + this);
+ if (Thread.interrupted()) {
+ interrupted = true;
- assert resFlag != 0;
+ if (!ignoreInterrupts) {
+ unregisterWaiter(Thread.currentThread());
- if (resFlag == ERR)
- throw U.cast((Throwable)res);
+ throw new IgniteInterruptedCheckedException("Got interrupted while waiting for future to complete.");
+ }
+ }
- return (R)res;
+ if (isDone())
+ return resolve();
+ }
}
- catch (InterruptedException e) {
- Thread.currentThread().interrupt();
-
- throw new IgniteInterruptedCheckedException(e);
+ finally {
+ if (interrupted)
+ Thread.currentThread().interrupt();
}
}
/**
* @param nanosTimeout Timeout (nanoseconds).
* @return Result.
- * @throws InterruptedException If interrupted.
* @throws IgniteFutureTimeoutCheckedException If timeout reached before computation completed.
* @throws IgniteCheckedException If error occurred.
*/
- @Nullable protected R get0(long nanosTimeout) throws InterruptedException, IgniteCheckedException {
- if (endTime == 0 && !tryAcquireSharedNanos(0, nanosTimeout))
- throw new IgniteFutureTimeoutCheckedException("Timeout was reached before computation completed.");
+ @Nullable private R get0(long nanosTimeout) throws IgniteCheckedException {
+ if (isDone() || !registerWaiter(Thread.currentThread()))
+ return resolve();
+
+ long deadlineNanos = System.nanoTime() + nanosTimeout;
+
+ boolean interrupted = false;
+
+ try {
+ long nanosTimeout0 = nanosTimeout;
+
+ while (nanosTimeout0 > 0) {
+ LockSupport.parkNanos(nanosTimeout0);
+
+ nanosTimeout0 = deadlineNanos - System.nanoTime();
+
+ if (Thread.interrupted()) {
+ interrupted = true;
+
+ if (!ignoreInterrupts) {
+ unregisterWaiter(Thread.currentThread());
+
+ throw new IgniteInterruptedCheckedException("Got interrupted while waiting for future to complete.");
+ }
+ }
+
+ if (isDone())
+ return resolve();
+ }
+ }
+ finally {
+ if (interrupted)
+ Thread.currentThread().interrupt();
+ }
+
+ unregisterWaiter(Thread.currentThread());
- if (getState() == CANCELLED)
+ throw new IgniteFutureTimeoutCheckedException("Timeout was reached before computation completed.");
+ }
+
+ /**
+ * Resolves the value to result or exception.
+ *
+ * @return Result.
+ * @throws IgniteCheckedException If resolved to exception.
+ */
+ @SuppressWarnings("unchecked")
+ private R resolve() throws IgniteCheckedException {
+ if(state == CANCELLED)
throw new IgniteFutureCancelledCheckedException("Future was cancelled: " + this);
- assert resFlag != 0;
+ if(state == null || state.getClass() != ErrorWrapper.class)
+ return (R)state;
+
+ throw U.cast(((ErrorWrapper)state).error);
+ }
+
+ /**
+ * @param waiter Waiter to register.
+ * @return {@code True} if was registered successfully.
+ */
+ private boolean registerWaiter(Object waiter) {
+ Node node = null;
+
+ while (true) {
+ final Object oldState = state;
+
+ if (isDone(oldState))
+ return false;
+
+ if(node == null)
+ node = new Node(waiter);
- if (resFlag == ERR)
- throw U.cast((Throwable)res);
+ if(oldState != INIT && oldState.getClass() == Node.class)
+ node.next = (Node)oldState;
- return (R)res;
+ if (compareAndSetState(oldState, node))
+ return true;
+ }
}
- /** {@inheritDoc} */
- @Override public void listen(IgniteInClosure<? super IgniteInternalFuture<R>> lsnr0) {
- assert lsnr0 != null;
+ /**
+ * @param waiter Waiter to unregister.
+ */
+ private void unregisterWaiter(Thread waiter) {
+ Node prev = null;
+ Object cur = state;
- boolean done = isDone();
+ while (cur != null) {
+ if(cur.getClass() != Node.class)
+ return;
+
+ Object curWaiter = ((Node)cur).val;
+ Node next = ((Node)cur).next;
- if (!done) {
- synchronized (this) {
- done = isDone(); // Double check.
+ if (curWaiter == waiter) {
+ if (prev == null) {
+ Object n = next == null ? INIT : next;
- if (!done) {
- if (lsnr == null)
- lsnr = lsnr0;
- else if (lsnr instanceof ArrayListener)
- ((ArrayListener)lsnr).add(lsnr0);
- else
- lsnr = (IgniteInClosure)new ArrayListener<IgniteInternalFuture>(lsnr, lsnr0);
+ cur = compareAndSetState(cur, n) ? null : state;
+ }
+ else {
+ prev.next = next;
- return;
+ cur = null;
}
}
+ else {
+ prev = (Node)cur;
+
+ cur = next;
+ }
+ }
+ }
+
+ /**
+ * @param exp Expected state.
+ * @param newState New state.
+ * @return {@code True} if success
+ */
+ private boolean compareAndSetState(Object exp, Object newState) {
+ return stateUpdater.compareAndSet(this, exp, newState);
+ }
+
+ /**
+ * @param head Head of waiters stack.
+ */
+ @SuppressWarnings("unchecked")
+ private void unblockAll(Node head) {
+ while (head != null) {
+ unblock(head.val);
+ head = head.next;
}
+ }
- assert done;
+ /**
+ * @param waiter Waiter to unblock
+ */
+ private void unblock(Object waiter) {
+ if(waiter instanceof Thread)
+ LockSupport.unpark((Thread)waiter);
+ else
+ notifyListener((IgniteInClosure<? super IgniteInternalFuture<R>>)waiter);
+ }
- notifyListener(lsnr0);
+ /** {@inheritDoc} */
+ @Override public void listen(IgniteInClosure<? super IgniteInternalFuture<R>> lsnr) {
+ if (!registerWaiter(lsnr))
+ notifyListener(lsnr);
}
/** {@inheritDoc} */
@@ -240,27 +364,14 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
}
/**
- * Notifies all registered listeners.
+ * @return Logger instance.
*/
- private void notifyListeners() {
- IgniteInClosure<? super IgniteInternalFuture<R>> lsnr0;
-
- synchronized (this) {
- lsnr0 = lsnr;
-
- if (lsnr0 == null)
- return;
-
- lsnr = null;
- }
-
- assert lsnr0 != null;
-
- notifyListener(lsnr0);
+ @Nullable public IgniteLogger logger() {
+ return null;
}
/**
- * Notifies single listener.
+ * Notifies listener.
*
* @param lsnr Listener.
*/
@@ -293,22 +404,29 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
/** {@inheritDoc} */
@Override public boolean isDone() {
- // Don't check for "valid" here, as "done" flag can be read
- // even in invalid state.
- return endTime != 0;
+ return isDone(state);
+ }
+
+ /**
+ * @param state State to check.
+ * @return {@code True} if future is done.
+ */
+ private boolean isDone(Object state) {
+ return state == null || state.getClass() != Node.class;
}
/**
- * @return Checks is future is completed with exception.
+ * @return {@code True} if future is completed with exception.
*/
public boolean isFailed() {
- // Must read endTime first.
- return endTime != 0 && resFlag == ERR;
+ Object state0 = state;
+
+ return state0 != null && state0.getClass() == ErrorWrapper.class;
}
/** {@inheritDoc} */
@Override public boolean isCancelled() {
- return getState() == CANCELLED;
+ return state == CANCELLED;
}
/**
@@ -361,32 +479,22 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
* @param cancel {@code True} if future is being cancelled.
* @return {@code True} if result was set by this call.
*/
- private boolean onDone(@Nullable R res, @Nullable Throwable err, boolean cancel) {
- boolean notify = false;
+ protected boolean onDone(@Nullable R res, @Nullable Throwable err, boolean cancel) {
+ Object newState = cancel ? CANCELLED : err != null ? new ErrorWrapper(err) : res;
- try {
- if (compareAndSetState(INIT, cancel ? CANCELLED : DONE)) {
- if (err != null) {
- resFlag = ERR;
- this.res = err;
- }
- else {
- resFlag = RES;
- this.res = res;
- }
+ while (true) {
+ final Object oldState = state;
- notify = true;
+ if (isDone(oldState))
+ return false;
- releaseShared(0);
+ if (compareAndSetState(oldState, newState)) {
+
+ if(oldState != INIT)
+ unblockAll((Node)oldState);
return true;
}
-
- return false;
- }
- finally {
- if (notify)
- notifyListeners();
}
}
@@ -400,75 +508,26 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
}
/** {@inheritDoc} */
- @Override protected final int tryAcquireShared(int ignore) {
- return endTime != 0 ? 1 : -1;
- }
-
- /** {@inheritDoc} */
- @Override protected final boolean tryReleaseShared(int ignore) {
- endTime = U.currentTimeMillis();
-
- // Always signal after setting final done status.
- return true;
- }
-
- /**
- * @return String representation of state.
- */
- private String state() {
- int s = getState();
-
- return s == INIT ? "INIT" : s == CANCELLED ? "CANCELLED" : "DONE";
- }
+ @SuppressWarnings("StringEquality")
+ @Override public String toString() {
+ Object state0 = state;
- /**
- * @return Logger instance.
- */
- @Nullable public IgniteLogger logger() {
- return null;
- }
+ String stateStr = stateStr(state0);
+ String resStr = stateStr == DONE ? String.valueOf(state0) : null;
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(GridFutureAdapter.class, this, "state", state());
+ return S.toString(
+ GridFutureAdapter.class, this,
+ "state", stateStr, false,
+ "res", resStr, true,
+ "hash", System.identityHashCode(this), false);
}
/**
- *
+ * @param s State.
+ * @return State string representation.
*/
- private static class ArrayListener<R> implements IgniteInClosure<IgniteInternalFuture<R>> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private IgniteInClosure<? super IgniteInternalFuture<R>>[] arr;
-
- /**
- * @param lsnrs Listeners.
- */
- private ArrayListener(IgniteInClosure... lsnrs) {
- this.arr = lsnrs;
- }
-
- /** {@inheritDoc} */
- @Override public void apply(IgniteInternalFuture<R> fut) {
- for (int i = 0; i < arr.length; i++)
- arr[i].apply(fut);
- }
-
- /**
- * @param lsnr Listener.
- */
- void add(IgniteInClosure<? super IgniteInternalFuture<R>> lsnr) {
- arr = Arrays.copyOf(arr, arr.length + 1);
-
- arr[arr.length - 1] = lsnr;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(ArrayListener.class, this, "arrSize", arr.length);
- }
+ private String stateStr(Object s) {
+ return s == CANCELLED ? "CANCELLED" : s != null && s.getClass() == Node.class ? "INIT" : DONE;
}
/**
@@ -476,22 +535,12 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer implements
*/
private static class ChainFuture<R, T> extends GridFutureAdapter<T> {
/** */
- private static final long serialVersionUID = 0L;
-
- /** */
private GridFutureAdapter<R> fut;
/** */
private IgniteClosure<? super IgniteInternalFuture<R>, T> doneCb;
/**
- *
- */
- public ChainFuture() {
- // No-op.
- }
-
- /**
* @param fut Future.
* @param doneCb Closure.
* @param cbExec Optional executor to run callback.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
index 7d74154..08fae96 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
@@ -53,16 +53,6 @@ public class IgniteFutureImpl<V> implements IgniteFuture<V> {
}
/** {@inheritDoc} */
- @Override public long startTime() {
- return fut.startTime();
- }
-
- /** {@inheritDoc} */
- @Override public long duration() {
- return fut.duration();
- }
-
- /** {@inheritDoc} */
@Override public boolean isCancelled() {
return fut.isCancelled();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java
index df1ab88..6519ec8 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java
@@ -95,21 +95,6 @@ public interface IgniteFuture<V> {
public boolean isDone();
/**
- * Gets start time for this future.
- *
- * @return Start time for this future.
- */
- public long startTime();
-
- /**
- * Gets duration in milliseconds between start of the future and current time if future
- * is not finished, or between start and finish of this future.
- *
- * @return Time in milliseconds this future has taken to execute.
- */
- public long duration();
-
- /**
* Registers listener closure to be asynchronously notified whenever future completes.
*
* @param lsnr Listener closure to register. If not provided - this method is no-op.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java
index dd710c4..7562fe5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOrderedPreloadingSelfTest.java
@@ -17,17 +17,24 @@
package org.apache.ignite.internal.processors.cache;
+import java.util.HashMap;
+import java.util.Map;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.events.CacheRebalancingEvent;
+import org.apache.ignite.events.Event;
+import org.apache.ignite.events.EventType;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jsr166.ConcurrentHashMap8;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -44,10 +51,13 @@ public class GridCacheOrderedPreloadingSelfTest extends GridCommonAbstractTest {
private static final int GRID_CNT = 4;
/** First cache name. */
- public static final String FIRST_CACHE_NAME = "first";
+ private static final String FIRST_CACHE_NAME = "first";
/** Second cache name. */
- public static final String SECOND_CACHE_NAME = "second";
+ private static final String SECOND_CACHE_NAME = "second";
+
+ /** Grid name attribute. */
+ private static final String GRID_NAME_ATTR = "org.apache.ignite.ignite.name";
/** First cache mode. */
private CacheMode firstCacheMode;
@@ -55,6 +65,17 @@ public class GridCacheOrderedPreloadingSelfTest extends GridCommonAbstractTest {
/** Second cache mode. */
private CacheMode secondCacheMode;
+ /** Caches rebalance finish times. */
+ private ConcurrentHashMap8<Integer, ConcurrentHashMap8<String, Long>> times;
+
+ @Override protected void beforeTest() throws Exception {
+ super.beforeTestsStarted();
+ times = new ConcurrentHashMap8<>();
+
+ for (int i = 0; i < GRID_CNT; i++)
+ times.put(i, new ConcurrentHashMap8<String, Long>());
+ }
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
@@ -69,6 +90,17 @@ public class GridCacheOrderedPreloadingSelfTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(discoSpi);
+ Map<IgnitePredicate<? extends Event>, int[]> listeners = new HashMap<>();
+
+ listeners.put(new IgnitePredicate<CacheRebalancingEvent>() {
+ @Override public boolean apply(CacheRebalancingEvent event) {
+ times.get(gridIdx(event)).putIfAbsent(event.cacheName(), event.timestamp());
+ return true;
+ }
+ }, new int[]{EventType.EVT_CACHE_REBALANCE_STOPPED});
+
+ cfg.setLocalEventListeners(listeners);
+
return cfg;
}
@@ -85,7 +117,6 @@ public class GridCacheOrderedPreloadingSelfTest extends GridCommonAbstractTest {
cfg.setCacheMode(cacheMode);
cfg.setRebalanceOrder(preloadOrder);
cfg.setRebalanceMode(ASYNC);
-
return cfg;
}
@@ -150,11 +181,20 @@ public class GridCacheOrderedPreloadingSelfTest extends GridCommonAbstractTest {
fut1.get();
fut2.get();
- assertTrue("[i=" + i + ", fut1=" + fut1 + ", fut2=" + fut2 + ']', fut1.endTime() <= fut2.endTime());
+ long firstSyncTime = times.get(i).get(FIRST_CACHE_NAME);
+ long secondSyncTime = times.get(i).get(SECOND_CACHE_NAME);
+ assertTrue(
+ FIRST_CACHE_NAME + " [syncTime=" + firstSyncTime + "], "
+ + SECOND_CACHE_NAME + " [syncTime=" + secondSyncTime + "]",
+ firstSyncTime <= secondSyncTime);
}
}
finally {
stopAllGrids();
}
}
+
+ private int gridIdx(Event event) {
+ return getTestIgniteInstanceIndex((String)event.node().attributes().get(GRID_NAME_ATTR));
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
index c1cc51e..1e5b9a8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
@@ -44,27 +44,13 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
assertFalse(fut.isDone());
- assertTrue(fut.startTime() > 0);
-
U.sleep(100);
- assertTrue(fut.duration() > 0);
-
fut0.onDone("test");
assertEquals("test", fut.get());
assertTrue(fut.isDone());
-
- assertTrue(fut.duration() > 0);
-
- long dur0 = fut.duration();
-
- U.sleep(100);
-
- assertEquals(dur0, fut.duration());
-
- assertEquals("test", fut.get());
}
/**
@@ -77,12 +63,8 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
assertFalse(fut.isDone());
- assertTrue(fut.startTime() > 0);
-
U.sleep(100);
- assertTrue(fut.duration() > 0);
-
IgniteCheckedException err0 = new IgniteCheckedException("test error");
fut0.onDone(err0);
@@ -99,14 +81,6 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
assertTrue(fut.isDone());
- assertTrue(fut.duration() > 0);
-
- long dur0 = fut.duration();
-
- U.sleep(100);
-
- assertEquals(dur0, fut.duration());
-
err = (IgniteException)GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override public Void call() throws Exception {
fut.get();
@@ -268,12 +242,8 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
assertFalse(chained.isDone());
- assertTrue(chained.startTime() > 0);
-
U.sleep(100);
- assertTrue(chained.duration() > 0);
-
final AtomicInteger lsnrCnt = new AtomicInteger();
chained.listen(new CI1<IgniteFuture<Integer>>() {
@@ -288,14 +258,6 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
assertTrue(chained.isDone());
- assertTrue(chained.duration() > 0);
-
- long dur0 = chained.duration();
-
- U.sleep(100);
-
- assertEquals(dur0, chained.duration());
-
assertEquals(10, (int)chained.get());
assertEquals(1, lsnrCnt.get());
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
index c8263ff..6c338c8 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
@@ -964,7 +964,7 @@ public class HadoopExternalTaskExecutor extends HadoopTaskExecutorAdapter {
if (err == null) {
if (log.isDebugEnabled())
log.debug("Initialized child process for external task execution [jobId=" + jobId +
- ", desc=" + desc + ", initTime=" + duration() + ']');
+ ", desc=" + desc + ']');
}
else
U.error(log, "Failed to initialize child process for external task execution [jobId=" + jobId +
http://git-wip-us.apache.org/repos/asf/ignite/blob/e922dda6/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
----------------------------------------------------------------------
diff --git a/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java b/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
index 71bbb84..bc3d40d 100644
--- a/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
+++ b/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
@@ -404,16 +404,6 @@ class ScheduleFutureImpl<R> implements SchedulerFuture<R> {
}
/** {@inheritDoc} */
- @Override public long startTime() {
- return stats.getCreateTime();
- }
-
- /** {@inheritDoc} */
- @Override public long duration() {
- return stats.getTotalExecutionTime() + stats.getTotalIdleTime();
- }
-
- /** {@inheritDoc} */
@Override public String pattern() {
return pat;
}
@@ -776,16 +766,6 @@ class ScheduleFutureImpl<R> implements SchedulerFuture<R> {
}
/** {@inheritDoc} */
- @Override public long startTime() {
- return ref.startTime();
- }
-
- /** {@inheritDoc} */
- @Override public long duration() {
- return ref.duration();
- }
-
- /** {@inheritDoc} */
@Override public String id() {
return ref.id();
}
[09/50] [abbrv] ignite git commit: ignite-3477-master more info for
investigation
Posted by sb...@apache.org.
ignite-3477-master more info for investigation
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2b6826e1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2b6826e1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2b6826e1
Branch: refs/heads/ignite-4929
Commit: 2b6826e13deff5b174ad6188f6fd636e455c93d4
Parents: 3a62833
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 15:39:47 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 15:39:47 2017 +0300
----------------------------------------------------------------------
.../processors/cache/transactions/IgniteTxHandler.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2b6826e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index 099a4ae..153ad04 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -1167,7 +1167,11 @@ public class IgniteTxHandler {
else
sendReply(nodeId, req, true, null);
- assert req.txState() != null || (ctx.tm().tx(req.version()) == null && ctx.tm().nearTx(req.version()) == null) : req;
+ IgniteInternalTx tx0 = ctx.tm().tx(req.version());
+
+ IgniteInternalTx nearTx0 = ctx.tm().nearTx(req.version());
+
+ assert req.txState() != null || (tx0 == null && nearTx0 == null) : req + " tx=" + tx0 + " nearTx=" + nearTx0;
}
/**
[28/50] [abbrv] ignite git commit: Examples compilation
Posted by sb...@apache.org.
Examples compilation
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/43105832
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/43105832
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/43105832
Branch: refs/heads/ignite-4929
Commit: 4310583298baf9fa371064b29eb17ab73d5f47db
Parents: 4849447
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Apr 13 16:35:34 2017 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Apr 13 16:35:34 2017 +0300
----------------------------------------------------------------------
examples/pom-standalone-lgpl.xml | 6 ++++++
examples/pom-standalone.xml | 6 ++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/43105832/examples/pom-standalone-lgpl.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone-lgpl.xml b/examples/pom-standalone-lgpl.xml
index 16fe125..d9e630b 100644
--- a/examples/pom-standalone-lgpl.xml
+++ b/examples/pom-standalone-lgpl.xml
@@ -72,6 +72,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-spring-data</artifactId>
+ <version>to_be_replaced_by_ignite_version</version>
+ </dependency>
+
+ <dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<artifactId>spymemcached</artifactId>
<version>2.7.3</version>
http://git-wip-us.apache.org/repos/asf/ignite/blob/43105832/examples/pom-standalone.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone.xml b/examples/pom-standalone.xml
index fe6ab21..fe559f8 100644
--- a/examples/pom-standalone.xml
+++ b/examples/pom-standalone.xml
@@ -72,6 +72,12 @@
</dependency>
<dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-spring-data</artifactId>
+ <version>to_be_replaced_by_ignite_version</version>
+ </dependency>
+
+ <dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<artifactId>spymemcached</artifactId>
<version>2.7.3</version>
[33/50] [abbrv] ignite git commit: IGNITE-3477 - Removed obsolete file
Posted by sb...@apache.org.
IGNITE-3477 - Removed obsolete file
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2c4ef9ee
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2c4ef9ee
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2c4ef9ee
Branch: refs/heads/ignite-4929
Commit: 2c4ef9ee351d0366a9020392527f59e3fc10622c
Parents: 00d63a8
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 17:35:24 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 17:35:24 2017 +0300
----------------------------------------------------------------------
leak.patch | 10521 ------------------------------------------------------
1 file changed, 10521 deletions(-)
----------------------------------------------------------------------
[39/50] [abbrv] ignite git commit: IGNITE-3581: Moved enums to
separate structs for C++
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core-test/src/transactions_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/transactions_test.cpp b/modules/platforms/cpp/core-test/src/transactions_test.cpp
index 3bf1ac6..68ab78a 100644
--- a/modules/platforms/cpp/core-test/src/transactions_test.cpp
+++ b/modules/platforms/cpp/core-test/src/transactions_test.cpp
@@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(TransactionRollbackOnly)
tx.Close();
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ROLLED_BACK, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ROLLED_BACK, tx.GetState());
BOOST_CHECK(tx.IsRollbackOnly());
BOOST_CHECK_EQUAL(1, cache.Get(1));
@@ -207,55 +207,55 @@ BOOST_AUTO_TEST_CASE(TransactionAttributes)
Transaction tx = transactions.GetTx();
BOOST_REQUIRE(!tx.IsValid());
- tx = transactions.TxStart(IGNITE_TX_CONCURRENCY_OPTIMISTIC,
- IGNITE_TX_ISOLATION_SERIALIZABLE, 1000, 100);
+ tx = transactions.TxStart(TransactionConcurrency::OPTIMISTIC,
+ TransactionIsolation::SERIALIZABLE, 1000, 100);
BOOST_REQUIRE(transactions.GetTx().IsValid());
- BOOST_CHECK_EQUAL(IGNITE_TX_CONCURRENCY_OPTIMISTIC, tx.GetConcurrency());
- BOOST_CHECK_EQUAL(IGNITE_TX_ISOLATION_SERIALIZABLE, tx.GetIsolation());
+ BOOST_CHECK_EQUAL(TransactionConcurrency::OPTIMISTIC, tx.GetConcurrency());
+ BOOST_CHECK_EQUAL(TransactionIsolation::SERIALIZABLE, tx.GetIsolation());
BOOST_CHECK_EQUAL(1000, tx.GetTimeout());
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ACTIVE, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ACTIVE, tx.GetState());
tx.Commit();
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_COMMITTED, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::COMMITTED, tx.GetState());
tx = transactions.GetTx();
BOOST_CHECK(!tx.IsValid());
- tx = transactions.TxStart(IGNITE_TX_CONCURRENCY_PESSIMISTIC,
- IGNITE_TX_ISOLATION_READ_COMMITTED, 2000, 10);
+ tx = transactions.TxStart(TransactionConcurrency::PESSIMISTIC,
+ TransactionIsolation::READ_COMMITTED, 2000, 10);
BOOST_REQUIRE(transactions.GetTx().IsValid());
- BOOST_CHECK_EQUAL(IGNITE_TX_CONCURRENCY_PESSIMISTIC, tx.GetConcurrency());
- BOOST_CHECK_EQUAL(IGNITE_TX_ISOLATION_READ_COMMITTED, tx.GetIsolation());
+ BOOST_CHECK_EQUAL(TransactionConcurrency::PESSIMISTIC, tx.GetConcurrency());
+ BOOST_CHECK_EQUAL(TransactionIsolation::READ_COMMITTED, tx.GetIsolation());
BOOST_CHECK_EQUAL(2000, tx.GetTimeout());
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ACTIVE, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ACTIVE, tx.GetState());
tx.Rollback();
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ROLLED_BACK, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ROLLED_BACK, tx.GetState());
tx = transactions.GetTx();
BOOST_CHECK(!tx.IsValid());
- tx = transactions.TxStart(IGNITE_TX_CONCURRENCY_OPTIMISTIC,
- IGNITE_TX_ISOLATION_REPEATABLE_READ, 3000, 0);
+ tx = transactions.TxStart(TransactionConcurrency::OPTIMISTIC,
+ TransactionIsolation::REPEATABLE_READ, 3000, 0);
BOOST_REQUIRE(transactions.GetTx().IsValid());
- BOOST_CHECK_EQUAL(IGNITE_TX_CONCURRENCY_OPTIMISTIC, tx.GetConcurrency());
- BOOST_CHECK_EQUAL(IGNITE_TX_ISOLATION_REPEATABLE_READ, tx.GetIsolation());
+ BOOST_CHECK_EQUAL(TransactionConcurrency::OPTIMISTIC, tx.GetConcurrency());
+ BOOST_CHECK_EQUAL(TransactionIsolation::REPEATABLE_READ, tx.GetIsolation());
BOOST_CHECK_EQUAL(3000, tx.GetTimeout());
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ACTIVE, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ACTIVE, tx.GetState());
tx.Close();
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ROLLED_BACK, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ROLLED_BACK, tx.GetState());
tx = transactions.GetTx();
@@ -531,7 +531,7 @@ BOOST_AUTO_TEST_CASE(TransactionRollbackOnlyNe)
if (!err.GetCode() == IgniteError::IGNITE_SUCCESS)
BOOST_ERROR(err.GetText());
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ROLLED_BACK, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ROLLED_BACK, tx.GetState());
BOOST_CHECK(tx.IsRollbackOnly());
BOOST_CHECK_EQUAL(1, cache.Get(1));
@@ -553,64 +553,64 @@ BOOST_AUTO_TEST_CASE(TransactionAttributesNe)
Transaction tx = transactions.GetTx();
BOOST_REQUIRE(!tx.IsValid());
- tx = transactions.TxStart(IGNITE_TX_CONCURRENCY_OPTIMISTIC,
- IGNITE_TX_ISOLATION_SERIALIZABLE, 1000, 100, err);
+ tx = transactions.TxStart(TransactionConcurrency::OPTIMISTIC,
+ TransactionIsolation::SERIALIZABLE, 1000, 100, err);
if (!err.GetCode() == IgniteError::IGNITE_SUCCESS)
BOOST_ERROR(err.GetText());
BOOST_REQUIRE(transactions.GetTx().IsValid());
- BOOST_CHECK_EQUAL(IGNITE_TX_CONCURRENCY_OPTIMISTIC, tx.GetConcurrency());
- BOOST_CHECK_EQUAL(IGNITE_TX_ISOLATION_SERIALIZABLE, tx.GetIsolation());
+ BOOST_CHECK_EQUAL(TransactionConcurrency::OPTIMISTIC, tx.GetConcurrency());
+ BOOST_CHECK_EQUAL(TransactionIsolation::SERIALIZABLE, tx.GetIsolation());
BOOST_CHECK_EQUAL(1000, tx.GetTimeout());
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ACTIVE, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ACTIVE, tx.GetState());
tx.Commit();
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_COMMITTED, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::COMMITTED, tx.GetState());
tx = transactions.GetTx();
BOOST_CHECK(!tx.IsValid());
- tx = transactions.TxStart(IGNITE_TX_CONCURRENCY_PESSIMISTIC,
- IGNITE_TX_ISOLATION_READ_COMMITTED, 2000, 10, err);
+ tx = transactions.TxStart(TransactionConcurrency::PESSIMISTIC,
+ TransactionIsolation::READ_COMMITTED, 2000, 10, err);
if (!err.GetCode() == IgniteError::IGNITE_SUCCESS)
BOOST_ERROR(err.GetText());
BOOST_REQUIRE(transactions.GetTx().IsValid());
- BOOST_CHECK_EQUAL(IGNITE_TX_CONCURRENCY_PESSIMISTIC, tx.GetConcurrency());
- BOOST_CHECK_EQUAL(IGNITE_TX_ISOLATION_READ_COMMITTED, tx.GetIsolation());
+ BOOST_CHECK_EQUAL(TransactionConcurrency::PESSIMISTIC, tx.GetConcurrency());
+ BOOST_CHECK_EQUAL(TransactionIsolation::READ_COMMITTED, tx.GetIsolation());
BOOST_CHECK_EQUAL(2000, tx.GetTimeout());
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ACTIVE, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ACTIVE, tx.GetState());
tx.Rollback();
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ROLLED_BACK, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ROLLED_BACK, tx.GetState());
tx = transactions.GetTx();
BOOST_CHECK(!tx.IsValid());
- tx = transactions.TxStart(IGNITE_TX_CONCURRENCY_OPTIMISTIC,
- IGNITE_TX_ISOLATION_REPEATABLE_READ, 3000, 0, err);
+ tx = transactions.TxStart(TransactionConcurrency::OPTIMISTIC,
+ TransactionIsolation::REPEATABLE_READ, 3000, 0, err);
if (!err.GetCode() == IgniteError::IGNITE_SUCCESS)
BOOST_ERROR(err.GetText());
BOOST_REQUIRE(transactions.GetTx().IsValid());
- BOOST_CHECK_EQUAL(IGNITE_TX_CONCURRENCY_OPTIMISTIC, tx.GetConcurrency());
- BOOST_CHECK_EQUAL(IGNITE_TX_ISOLATION_REPEATABLE_READ, tx.GetIsolation());
+ BOOST_CHECK_EQUAL(TransactionConcurrency::OPTIMISTIC, tx.GetConcurrency());
+ BOOST_CHECK_EQUAL(TransactionIsolation::REPEATABLE_READ, tx.GetIsolation());
BOOST_CHECK_EQUAL(3000, tx.GetTimeout());
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ACTIVE, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ACTIVE, tx.GetState());
tx.Close();
- BOOST_CHECK_EQUAL(IGNITE_TX_STATE_ROLLED_BACK, tx.GetState());
+ BOOST_CHECK_EQUAL(TransactionState::ROLLED_BACK, tx.GetState());
tx = transactions.GetTx();
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/cache/cache.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/cache.h b/modules/platforms/cpp/core/include/ignite/cache/cache.h
index 33fffc8..e37e806 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/cache.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/cache.h
@@ -95,7 +95,7 @@ namespace ignite
/**
* Checks whether this cache contains no key-value mappings.
- * Semantically equals to Cache.Size(IGNITE_PEEK_MODE_PRIMARY) == 0.
+ * Semantically equals to Cache.Size(CachePeekMode::PRIMARY) == 0.
*
* This method should only be used on the valid instance.
*
@@ -114,7 +114,7 @@ namespace ignite
/**
* Checks whether this cache contains no key-value mappings.
- * Semantically equals to Cache.Size(IGNITE_PEEK_MODE_PRIMARY) == 0.
+ * Semantically equals to Cache.Size(CachePeekMode::PRIMARY) == 0.
*
* This method should only be used on the valid instance.
*
@@ -1256,7 +1256,7 @@ namespace ignite
*/
int32_t LocalSize()
{
- return LocalSize(IGNITE_PEEK_MODE_ALL);
+ return LocalSize(CachePeekMode::ALL);
}
/**
@@ -1269,7 +1269,7 @@ namespace ignite
*/
int32_t LocalSize(IgniteError& err)
{
- return LocalSize(IGNITE_PEEK_MODE_ALL, err);
+ return LocalSize(CachePeekMode::ALL, err);
}
/**
@@ -1315,7 +1315,7 @@ namespace ignite
*/
int32_t Size()
{
- return Size(ignite::cache::IGNITE_PEEK_MODE_ALL);
+ return Size(ignite::cache::CachePeekMode::ALL);
}
/**
@@ -1329,7 +1329,7 @@ namespace ignite
*/
int32_t Size(IgniteError& err)
{
- return Size(ignite::cache::IGNITE_PEEK_MODE_ALL, err);
+ return Size(ignite::cache::CachePeekMode::ALL, err);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h b/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h
index ef9d031..7edaecb 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h
@@ -30,45 +30,48 @@ namespace ignite
/**
* Enumeration of all supported cache peek modes.
*/
- enum CachePeekMode
+ struct CachePeekMode
{
- /**
- * Peeks into all available cache storages.
- */
- IGNITE_PEEK_MODE_ALL = 0x01,
+ enum Type
+ {
+ /**
+ * Peeks into all available cache storages.
+ */
+ ALL = 0x01,
- /**
- * Peek into near cache only (don't peek into partitioned cache).
- * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
- */
- IGNITE_PEEK_MODE_NEAR = 0x02,
+ /**
+ * Peek into near cache only (don't peek into partitioned cache).
+ * In case of LOCAL cache, behaves as CachePeekMode::ALL mode.
+ */
+ NEAR_CACHE = 0x02,
- /**
- * Peek value from primary copy of partitioned cache only (skip near cache).
- * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
- */
- IGNITE_PEEK_MODE_PRIMARY = 0x04,
+ /**
+ * Peek value from primary copy of partitioned cache only (skip near cache).
+ * In case of LOCAL cache, behaves as CachePeekMode::ALL mode.
+ */
+ PRIMARY = 0x04,
- /**
- * Peek value from backup copies of partitioned cache only (skip near cache).
- * In case of LOCAL cache, behaves as IGNITE_PEEK_MODE_ALL mode.
- */
- IGNITE_PEEK_MODE_BACKUP = 0x08,
+ /**
+ * Peek value from backup copies of partitioned cache only (skip near cache).
+ * In case of LOCAL cache, behaves as CachePeekMode::ALL mode.
+ */
+ BACKUP = 0x08,
- /**
- * Peeks value from the on-heap storage only.
- */
- IGNITE_PEEK_MODE_ONHEAP = 0x10,
+ /**
+ * Peeks value from the on-heap storage only.
+ */
+ ONHEAP = 0x10,
- /**
- * Peeks value from the off-heap storage only, without loading off-heap value into cache.
- */
- IGNITE_PEEK_MODE_OFFHEAP = 0x20,
+ /**
+ * Peeks value from the off-heap storage only, without loading off-heap value into cache.
+ */
+ OFFHEAP = 0x20,
- /**
- * Peeks value from the swap storage only, without loading swapped value into cache.
- */
- IGNITE_PEEK_MODE_SWAP = 0x40
+ /**
+ * Peeks value from the swap storage only, without loading swapped value into cache.
+ */
+ SWAP = 0x40
+ };
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/ignite_binding.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite_binding.h b/modules/platforms/cpp/core/include/ignite/ignite_binding.h
index 70bdedb..344bdf6 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite_binding.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite_binding.h
@@ -84,7 +84,7 @@ namespace ignite
if (im)
{
- im->RegisterCallback(impl::IgniteBindingImpl::CACHE_ENTRY_PROCESSOR_APPLY,
+ im->RegisterCallback(impl::IgniteBindingImpl::CallbackType::CACHE_ENTRY_PROCESSOR_APPLY,
binary::BinaryType<P>::GetTypeId(), impl::binding::ListenerApply<P, typename P::KeyType,
typename P::ValueType, typename P::ReturnType, typename P::ArgumentType>, err);
}
@@ -110,7 +110,7 @@ namespace ignite
if (im)
{
- im->RegisterCallback(impl::IgniteBindingImpl::CACHE_ENTRY_FILTER_CREATE,
+ im->RegisterCallback(impl::IgniteBindingImpl::CallbackType::CACHE_ENTRY_FILTER_CREATE,
typeId, impl::binding::FilterCreate<F>);
}
else
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/impl/bindings.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/bindings.h b/modules/platforms/cpp/core/include/ignite/impl/bindings.h
index ce77672..c1ada12 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/bindings.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/bindings.h
@@ -75,13 +75,13 @@ namespace ignite
V value;
bool exists = reader.TryReadObject<V>(value);
- cache::MutableCacheEntryState entryState;
+ cache::MutableCacheEntryState::Type entryState;
R res = procHolder.template Process<R, K, V>(key, value, exists, entryState);
writer.WriteInt8(static_cast<int8_t>(entryState));
- if (entryState == cache::ENTRY_STATE_VALUE_SET)
+ if (entryState == cache::MutableCacheEntryState::VALUE_SET)
writer.WriteTopObject(value);
writer.WriteTopObject(res);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/impl/cache/cache_entry_processor_holder.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/cache/cache_entry_processor_holder.h b/modules/platforms/cpp/core/include/ignite/impl/cache/cache_entry_processor_holder.h
index decbaa9..a821407 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/cache/cache_entry_processor_holder.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/cache/cache_entry_processor_holder.h
@@ -31,22 +31,25 @@ namespace ignite
/**
* Mutable Cache entry state.
*/
- enum MutableCacheEntryState
+ struct MutableCacheEntryState
{
- /** No changes have been committed to entry. */
- ENTRY_STATE_INTACT = 0,
+ enum Type
+ {
+ /** No changes have been committed to entry. */
+ INTACT = 0,
- /** Value of the entry has been changed. */
- ENTRY_STATE_VALUE_SET = 1,
+ /** Value of the entry has been changed. */
+ VALUE_SET = 1,
- /** Entry has been removed from cache. */
- ENTRY_STATE_VALUE_REMOVED = 2,
+ /** Entry has been removed from cache. */
+ VALUE_REMOVED = 2,
- /** Error occured. Represented in portable form. */
- ENTRY_STATE_ERR_PORTABLE = 3,
+ /** Error occured. Represented in binary form. */
+ ERR_BINARY = 3,
- /** Error occured. Represented in string form. */
- ENTRY_STATE_ERR_STRING = 4
+ /** Error occured. Represented in string form. */
+ ERR_STRING = 4
+ };
};
/**
@@ -59,17 +62,17 @@ namespace ignite
* @return Cache entry state.
*/
template<typename V>
- MutableCacheEntryState GetMutableCacheEntryState(const V& valueBefore, bool existsBefore,
- const V& valueAfter, bool existsAfter)
+ MutableCacheEntryState::Type GetMutableCacheEntryState(const V& valueBefore, bool existsBefore,
+ const V& valueAfter, bool existsAfter)
{
if ((!existsBefore && existsAfter) ||
(existsBefore && existsAfter && !(valueBefore == valueAfter)))
- return ENTRY_STATE_VALUE_SET;
+ return MutableCacheEntryState::VALUE_SET;
if (existsBefore && !existsAfter)
- return ENTRY_STATE_VALUE_REMOVED;
+ return MutableCacheEntryState::VALUE_REMOVED;
- return ENTRY_STATE_INTACT;
+ return MutableCacheEntryState::INTACT;
}
/**
@@ -147,7 +150,7 @@ namespace ignite
* @return Result of the processing.
*/
template<typename R, typename K, typename V>
- R Process(const K& key, V& value, bool exists, MutableCacheEntryState &state)
+ R Process(const K& key, V& value, bool exists, MutableCacheEntryState::Type &state)
{
typedef ignite::cache::MutableCacheEntry<K, V> Entry;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/impl/ignite_binding_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/ignite_binding_impl.h b/modules/platforms/cpp/core/include/ignite/impl/ignite_binding_impl.h
index 7b20c50..a99855a 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/ignite_binding_impl.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/ignite_binding_impl.h
@@ -43,13 +43,16 @@ namespace ignite
typedef int64_t(Callback)(binary::BinaryReaderImpl&, binary::BinaryWriterImpl&, IgniteEnvironment&);
public:
- enum CallbackType
+ struct CallbackType
{
- CACHE_ENTRY_PROCESSOR_APPLY = 1,
+ enum Type
+ {
+ CACHE_ENTRY_PROCESSOR_APPLY = 1,
- CACHE_ENTRY_FILTER_CREATE = 2,
+ CACHE_ENTRY_FILTER_CREATE = 2,
- CACHE_ENTRY_FILTER_APPLY = 3,
+ CACHE_ENTRY_FILTER_APPLY = 3,
+ };
};
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/impl/interop/interop_target.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/interop/interop_target.h b/modules/platforms/cpp/core/include/ignite/impl/interop/interop_target.h
index 0d32561..f9b2b7f 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/interop/interop_target.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/interop/interop_target.h
@@ -36,16 +36,19 @@ namespace ignite
/**
* Operation result.
*/
- enum OperationResult
+ struct OperationResult
{
- /** Null. */
- ResultNull = 0,
+ enum Type
+ {
+ /** Null. */
+ AI_NULL = 0,
- /** Success. */
- ResultSuccess = 1,
+ /** Success. */
+ AI_SUCCESS = 1,
- /** Error. */
- ResultError = -1
+ /** Error. */
+ AI_ERROR = -1
+ };
};
/**
@@ -65,7 +68,7 @@ namespace ignite
* Internal out operation.
*
* @param opType Operation type.
- * @param outOp Input.
+ * @param inOp Input.
* @param err Error.
* @return Result.
*/
@@ -129,7 +132,7 @@ namespace ignite
* @param err Error.
* @return Operation result.
*/
- OperationResult InStreamOutLong(int32_t opType, InteropMemory& outInMem, IgniteError& err);
+ OperationResult::Type InStreamOutLong(int32_t opType, InteropMemory& outInMem, IgniteError& err);
/**
* Internal out-in operation.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/impl/transactions/transaction_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/transactions/transaction_impl.h b/modules/platforms/cpp/core/include/ignite/impl/transactions/transaction_impl.h
index 6889c62..959a6de 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/transactions/transaction_impl.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/transactions/transaction_impl.h
@@ -128,7 +128,7 @@ namespace ignite
* @param err Error.
* @return Current state.
*/
- TransactionState GetState(IgniteError& err);
+ TransactionState::Type GetState(IgniteError& err);
/**
* Get concurrency.
@@ -206,7 +206,7 @@ namespace ignite
int32_t txSize;
/** Transaction state. */
- TransactionState state;
+ TransactionState::Type state;
/** Closed flag. */
bool closed;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h b/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h
index 651c64f..ba754c5 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/transactions/transactions_impl.h
@@ -72,7 +72,7 @@ namespace ignite
* @param err Error.
* @return Resulting state.
*/
- TransactionState TxCommit(int64_t id, IgniteError& err);
+ TransactionState::Type TxCommit(int64_t id, IgniteError& err);
/**
* Rollback Transaction.
@@ -81,7 +81,7 @@ namespace ignite
* @param err Error.
* @return Resulting state.
*/
- TransactionState TxRollback(int64_t id, IgniteError& err);
+ TransactionState::Type TxRollback(int64_t id, IgniteError& err);
/**
* Close Transaction.
@@ -90,7 +90,7 @@ namespace ignite
* @param err Error.
* @return Resulting state.
*/
- TransactionState TxClose(int64_t id, IgniteError& err);
+ TransactionState::Type TxClose(int64_t id, IgniteError& err);
/**
* Make transaction into rollback-only.
@@ -110,7 +110,7 @@ namespace ignite
* @param id Transaction ID.
* @return Resulting state.
*/
- TransactionState TxState(int64_t id, IgniteError& err);
+ TransactionState::Type TxState(int64_t id, IgniteError& err);
/**
* Get metrics.
@@ -127,7 +127,7 @@ namespace ignite
* @param state Integer constant state.
* @return TransactionState constant.
*/
- TransactionState ToTransactionState(int state);
+ TransactionState::Type ToTransactionState(int state);
IGNITE_NO_COPY_ASSIGNMENT(TransactionsImpl)
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/transactions/transaction.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/transactions/transaction.h b/modules/platforms/cpp/core/include/ignite/transactions/transaction.h
index b51a42c..b42a253 100644
--- a/modules/platforms/cpp/core/include/ignite/transactions/transaction.h
+++ b/modules/platforms/cpp/core/include/ignite/transactions/transaction.h
@@ -202,7 +202,7 @@ namespace ignite
*
* @throw IgniteError class instance in case of failure.
*/
- TransactionState GetState();
+ TransactionState::Type GetState();
/**
* Get current state.
@@ -214,7 +214,7 @@ namespace ignite
* @param err Error.
* @return Transaction state.
*/
- TransactionState GetState(IgniteError& err);
+ TransactionState::Type GetState(IgniteError& err);
/**
* Get concurrency.
@@ -223,9 +223,9 @@ namespace ignite
*
* @return Concurrency.
*/
- TransactionConcurrency GetConcurrency() const
+ TransactionConcurrency::Type GetConcurrency() const
{
- return static_cast<TransactionConcurrency>(impl.Get()->GetConcurrency());
+ return static_cast<TransactionConcurrency::Type>(impl.Get()->GetConcurrency());
}
/**
@@ -235,9 +235,9 @@ namespace ignite
*
* @return Isolation.
*/
- TransactionIsolation GetIsolation() const
+ TransactionIsolation::Type GetIsolation() const
{
- return static_cast<TransactionIsolation>(impl.Get()->GetIsolation());
+ return static_cast<TransactionIsolation::Type>(impl.Get()->GetIsolation());
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h b/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h
index 8b25d3a..069574f 100644
--- a/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h
+++ b/modules/platforms/cpp/core/include/ignite/transactions/transaction_consts.h
@@ -30,113 +30,122 @@ namespace ignite
/**
* Transaction concurrency control model.
*/
- enum TransactionConcurrency
+ struct TransactionConcurrency
{
- /**
- * Optimistic concurrency model. In this mode all cache operations
- * are not distributed to other nodes until Transaction::Commit()
- * is called. In this mode one @c 'PREPARE' message will be sent to
- * participating cache nodes to start acquiring per-transaction
- * locks, and once all nodes reply @c 'OK', a one-way @c 'COMMIT'
- * message is sent without waiting for reply.
- *
- * Note that in this mode, optimistic failures are only possible in
- * conjunction with ::IGNITE_TX_ISOLATION_SERIALIZABLE isolation
- * level. In all other cases, optimistic transactions will never
- * fail optimistically and will always be identically ordered on all
- * participating grid nodes.
- */
- IGNITE_TX_CONCURRENCY_OPTIMISTIC = 0,
-
- /**
- * Pessimistic concurrency model. In this mode a lock is acquired
- * on all cache operations with exception of read operations in
- * ::IGNITE_TX_ISOLATION_READ_COMMITTED mode. All optional filters
- * passed into cache operations will be evaluated after successful
- * lock acquisition. Whenever Transaction::Commit() is called, a
- * single one-way @c 'COMMIT' message is sent to participating cache
- * nodes without waiting for reply. Note that there is no reason for
- * distributed @c 'PREPARE' step, as all locks have been already
- * acquired.
- */
- IGNITE_TX_CONCURRENCY_PESSIMISTIC = 1
+ enum Type
+ {
+ /**
+ * Optimistic concurrency model. In this mode all cache operations
+ * are not distributed to other nodes until Transaction::Commit()
+ * is called. In this mode one @c 'PREPARE' message will be sent to
+ * participating cache nodes to start acquiring per-transaction
+ * locks, and once all nodes reply @c 'OK', a one-way @c 'COMMIT'
+ * message is sent without waiting for reply.
+ *
+ * Note that in this mode, optimistic failures are only possible in
+ * conjunction with ::IGNITE_TX_ISOLATION_SERIALIZABLE isolation
+ * level. In all other cases, optimistic transactions will never
+ * fail optimistically and will always be identically ordered on all
+ * participating grid nodes.
+ */
+ OPTIMISTIC = 0,
+
+ /**
+ * Pessimistic concurrency model. In this mode a lock is acquired
+ * on all cache operations with exception of read operations in
+ * ::IGNITE_TX_ISOLATION_READ_COMMITTED mode. All optional filters
+ * passed into cache operations will be evaluated after successful
+ * lock acquisition. Whenever Transaction::Commit() is called, a
+ * single one-way @c 'COMMIT' message is sent to participating cache
+ * nodes without waiting for reply. Note that there is no reason for
+ * distributed @c 'PREPARE' step, as all locks have been already
+ * acquired.
+ */
+ PESSIMISTIC = 1
+ };
};
/**
* Defines different cache transaction isolation levels.
*/
- enum TransactionIsolation
+ struct TransactionIsolation
{
- /**
- * Read committed isolation level. This isolation level means that
- * always a committed value will be provided for read operations.
- * With this isolation level values are always read from cache
- * global memory or persistent store every time a value is accessed.
- * In other words, if the same key is accessed more than once within
- * the same transaction, it may have different value every time
- * since global cache memory may be updated concurrently by other
- * threads.
- */
- IGNITE_TX_ISOLATION_READ_COMMITTED = 0,
-
- /**
- * Repeatable read isolation level. This isolation level means that
- * if a value was read once within transaction, then all consecutive
- * reads will provide the same in-transaction value. With this
- * isolation level accessed values are stored within in-transaction
- * memory, so consecutive access to the same key within the same
- * transaction will always return the value that was previously read
- * or updated within this transaction. If concurrency is
- * ::IGNITE_TX_CONCURRENCY_PESSIMISTIC, then a lock on the key will
- * be acquired prior to accessing the value.
- */
- IGNITE_TX_ISOLATION_REPEATABLE_READ = 1,
-
- /**
- * Serializable isolation level. This isolation level means that all
- * transactions occur in a completely isolated fashion, as if all
- * transactions in the system had executed serially, one after the
- * other. Read access with this level happens the same way as with
- * ::IGNITE_TX_ISOLATION_REPEATABLE_READ level. However, in
- * ::IGNITE_TX_CONCURRENCY_OPTIMISTIC mode, if some transactions
- * cannot be serially isolated from each other, then one winner will
- * be picked and the other transactions in conflict will result in
- * IgniteError being thrown.
- */
- IGNITE_TX_ISOLATION_SERIALIZABLE = 2
+ enum Type
+ {
+ /**
+ * Read committed isolation level. This isolation level means that
+ * always a committed value will be provided for read operations.
+ * With this isolation level values are always read from cache
+ * global memory or persistent store every time a value is accessed.
+ * In other words, if the same key is accessed more than once within
+ * the same transaction, it may have different value every time
+ * since global cache memory may be updated concurrently by other
+ * threads.
+ */
+ READ_COMMITTED = 0,
+
+ /**
+ * Repeatable read isolation level. This isolation level means that
+ * if a value was read once within transaction, then all consecutive
+ * reads will provide the same in-transaction value. With this
+ * isolation level accessed values are stored within in-transaction
+ * memory, so consecutive access to the same key within the same
+ * transaction will always return the value that was previously read
+ * or updated within this transaction. If concurrency is
+ * ::IGNITE_TX_CONCURRENCY_PESSIMISTIC, then a lock on the key will
+ * be acquired prior to accessing the value.
+ */
+ REPEATABLE_READ = 1,
+
+ /**
+ * Serializable isolation level. This isolation level means that all
+ * transactions occur in a completely isolated fashion, as if all
+ * transactions in the system had executed serially, one after the
+ * other. Read access with this level happens the same way as with
+ * ::IGNITE_TX_ISOLATION_REPEATABLE_READ level. However, in
+ * ::IGNITE_TX_CONCURRENCY_OPTIMISTIC mode, if some transactions
+ * cannot be serially isolated from each other, then one winner will
+ * be picked and the other transactions in conflict will result in
+ * IgniteError being thrown.
+ */
+ SERIALIZABLE = 2
+ };
};
/**
* Cache transaction state.
*/
- enum TransactionState
+ struct TransactionState
{
- /** %Transaction started. */
- IGNITE_TX_STATE_ACTIVE,
+ enum Type
+ {
+ /** %Transaction started. */
+ ACTIVE,
- /** %Transaction validating. */
- IGNITE_TX_STATE_PREPARING,
+ /** %Transaction validating. */
+ PREPARING,
- /** %Transaction validation succeeded. */
- IGNITE_TX_STATE_PREPARED,
+ /** %Transaction validation succeeded. */
+ PREPARED,
- /** %Transaction is marked for rollback. */
- IGNITE_TX_STATE_MARKED_ROLLBACK,
+ /** %Transaction is marked for rollback. */
+ MARKED_ROLLBACK,
- /** %Transaction commit started (validating finished). */
- IGNITE_TX_STATE_COMMITTING,
+ /** %Transaction commit started (validating finished). */
+ COMMITTING,
- /** %Transaction commit succeeded. */
- IGNITE_TX_STATE_COMMITTED,
+ /** %Transaction commit succeeded. */
+ COMMITTED,
- /** %Transaction rollback started (validation failed). */
- IGNITE_TX_STATE_ROLLING_BACK,
+ /** %Transaction rollback started (validation failed). */
+ ROLLING_BACK,
- /** %Transaction rollback succeeded. */
- IGNITE_TX_STATE_ROLLED_BACK,
+ /** %Transaction rollback succeeded. */
+ ROLLED_BACK,
- /** %Transaction rollback failed or is otherwise unknown state. */
- IGNITE_TX_STATE_UNKNOWN
+ /** %Transaction rollback failed or is otherwise unknown state. */
+ UNKNOWN
+ };
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/include/ignite/transactions/transactions.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/transactions/transactions.h b/modules/platforms/cpp/core/include/ignite/transactions/transactions.h
index 98282bd..579dcd2 100644
--- a/modules/platforms/cpp/core/include/ignite/transactions/transactions.h
+++ b/modules/platforms/cpp/core/include/ignite/transactions/transactions.h
@@ -108,8 +108,8 @@ namespace ignite
* @param isolation Isolation.
* @return New transaction instance.
*/
- Transaction TxStart(TransactionConcurrency concurrency,
- TransactionIsolation isolation);
+ Transaction TxStart(TransactionConcurrency::Type concurrency,
+ TransactionIsolation::Type isolation);
/**
* Starts new transaction with the specified concurrency and
@@ -120,8 +120,8 @@ namespace ignite
* @param err Error.
* @return New transaction instance.
*/
- Transaction TxStart(TransactionConcurrency concurrency,
- TransactionIsolation isolation, IgniteError& err);
+ Transaction TxStart(TransactionConcurrency::Type concurrency,
+ TransactionIsolation::Type isolation, IgniteError& err);
/**
* Starts transaction with specified isolation, concurrency,
@@ -134,8 +134,8 @@ namespace ignite
* (may be approximate).
* @return New transaction instance.
*/
- Transaction TxStart(TransactionConcurrency concurrency,
- TransactionIsolation isolation, int64_t timeout,
+ Transaction TxStart(TransactionConcurrency::Type concurrency,
+ TransactionIsolation::Type isolation, int64_t timeout,
int32_t txSize);
/**
@@ -149,8 +149,8 @@ namespace ignite
* @param err Error.
* @return New transaction instance.
*/
- Transaction TxStart(TransactionConcurrency concurrency,
- TransactionIsolation isolation, int64_t timeout,
+ Transaction TxStart(TransactionConcurrency::Type concurrency,
+ TransactionIsolation::Type isolation, int64_t timeout,
int32_t txSize, IgniteError& err);
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp b/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
index 73c96fd..36c42a1 100644
--- a/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
@@ -36,13 +36,16 @@ namespace ignite
{
namespace binary
{
- enum Operation
+ struct Operation
{
- /** Operation: metadata get. */
- OP_GET_META = 1,
+ enum Type
+ {
+ /** Operation: metadata get. */
+ GET_META = 1,
- /** Operation: metadata update. */
- OP_PUT_META = 3
+ /** Operation: metadata update. */
+ PUT_META = 3
+ };
};
BinaryTypeUpdaterImpl::BinaryTypeUpdaterImpl(IgniteEnvironment& env, jobject javaRef) :
@@ -97,7 +100,7 @@ namespace ignite
out.Synchronize();
- long long res = env.Context()->TargetInStreamOutLong(javaRef, OP_PUT_META, mem.Get()->PointerLong(), &jniErr);
+ long long res = env.Context()->TargetInStreamOutLong(javaRef, Operation::PUT_META, mem.Get()->PointerLong(), &jniErr);
IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
@@ -118,7 +121,7 @@ namespace ignite
out.Synchronize();
- env.Context()->TargetInStreamOutStream(javaRef, OP_GET_META,
+ env.Context()->TargetInStreamOutStream(javaRef, Operation::GET_META,
outMem.Get()->PointerLong(), inMem.Get()->PointerLong(), &jniErr);
IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/impl/cache/query/continuous/continuous_query_handle_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/cache/query/continuous/continuous_query_handle_impl.cpp b/modules/platforms/cpp/core/src/impl/cache/query/continuous/continuous_query_handle_impl.cpp
index b15183b..f98d674 100644
--- a/modules/platforms/cpp/core/src/impl/cache/query/continuous/continuous_query_handle_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/cache/query/continuous/continuous_query_handle_impl.cpp
@@ -33,11 +33,14 @@ namespace ignite
{
namespace continuous
{
- enum Command
+ struct Command
{
- GET_INITIAL_QUERY = 0,
+ enum Type
+ {
+ GET_INITIAL_QUERY = 0,
- CLOSE = 1
+ CLOSE = 1
+ };
};
ContinuousQueryHandleImpl::ContinuousQueryHandleImpl(SP_IgniteEnvironment env, int64_t handle, jobject javaRef) :
@@ -52,7 +55,7 @@ namespace ignite
ContinuousQueryHandleImpl::~ContinuousQueryHandleImpl()
{
- env.Get()->Context()->TargetInLongOutLong(javaRef, CLOSE, 0);
+ env.Get()->Context()->TargetInLongOutLong(javaRef, Command::CLOSE, 0);
JniContext::Release(javaRef);
@@ -73,7 +76,7 @@ namespace ignite
JniErrorInfo jniErr;
- jobject res = env.Get()->Context()->TargetOutObject(javaRef, GET_INITIAL_QUERY, &jniErr);
+ jobject res = env.Get()->Context()->TargetOutObject(javaRef, Command::GET_INITIAL_QUERY, &jniErr);
IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/impl/cluster/cluster_group_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/cluster/cluster_group_impl.cpp b/modules/platforms/cpp/core/src/impl/cluster/cluster_group_impl.cpp
index d30c321..1bddeac 100644
--- a/modules/platforms/cpp/core/src/impl/cluster/cluster_group_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/cluster/cluster_group_impl.cpp
@@ -26,9 +26,12 @@ namespace ignite
{
namespace cluster
{
- enum Command
+ struct Command
{
- FOR_SERVERS = 23
+ enum Type
+ {
+ FOR_SERVERS = 23
+ };
};
ClusterGroupImpl::ClusterGroupImpl(SP_IgniteEnvironment env, jobject javaRef) :
@@ -46,7 +49,7 @@ namespace ignite
{
JniErrorInfo jniErr;
- jobject res = InOpObject(FOR_SERVERS, err);
+ jobject res = InOpObject(Command::FOR_SERVERS, err);
if (jniErr.code != java::IGNITE_JNI_ERR_SUCCESS)
return SP_ClusterGroupImpl();
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/impl/ignite_environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/ignite_environment.cpp b/modules/platforms/cpp/core/src/impl/ignite_environment.cpp
index 8457bbb..2231003 100644
--- a/modules/platforms/cpp/core/src/impl/ignite_environment.cpp
+++ b/modules/platforms/cpp/core/src/impl/ignite_environment.cpp
@@ -42,16 +42,19 @@ namespace ignite
/**
* Callback codes.
*/
- enum CallbackOp
+ struct OperationCallback
{
- CACHE_INVOKE = 8,
- CONTINUOUS_QUERY_LISTENER_APPLY = 18,
- CONTINUOUS_QUERY_FILTER_CREATE = 19,
- CONTINUOUS_QUERY_FILTER_APPLY = 20,
- CONTINUOUS_QUERY_FILTER_RELEASE = 21,
- REALLOC = 36,
- ON_START = 49,
- ON_STOP = 50
+ enum Type
+ {
+ CACHE_INVOKE = 8,
+ CONTINUOUS_QUERY_LISTENER_APPLY = 18,
+ CONTINUOUS_QUERY_FILTER_CREATE = 19,
+ CONTINUOUS_QUERY_FILTER_APPLY = 20,
+ CONTINUOUS_QUERY_FILTER_RELEASE = 21,
+ REALLOC = 36,
+ ON_START = 49,
+ ON_STOP = 50
+ };
};
/**
@@ -68,14 +71,14 @@ namespace ignite
switch (type)
{
- case ON_STOP:
+ case OperationCallback::ON_STOP:
{
delete env;
break;
}
- case CONTINUOUS_QUERY_LISTENER_APPLY:
+ case OperationCallback::CONTINUOUS_QUERY_LISTENER_APPLY:
{
SharedPointer<InteropMemory> mem = env->Get()->GetMemory(val);
@@ -84,7 +87,7 @@ namespace ignite
break;
}
- case CONTINUOUS_QUERY_FILTER_CREATE:
+ case OperationCallback::CONTINUOUS_QUERY_FILTER_CREATE:
{
SharedPointer<InteropMemory> mem = env->Get()->GetMemory(val);
@@ -93,7 +96,7 @@ namespace ignite
break;
}
- case CONTINUOUS_QUERY_FILTER_APPLY:
+ case OperationCallback::CONTINUOUS_QUERY_FILTER_APPLY:
{
SharedPointer<InteropMemory> mem = env->Get()->GetMemory(val);
@@ -102,13 +105,13 @@ namespace ignite
break;
}
- case CONTINUOUS_QUERY_FILTER_RELEASE:
+ case OperationCallback::CONTINUOUS_QUERY_FILTER_RELEASE:
{
// No-op.
break;
}
- case CACHE_INVOKE:
+ case OperationCallback::CACHE_INVOKE:
{
SharedPointer<InteropMemory> mem = env->Get()->GetMemory(val);
@@ -143,14 +146,14 @@ namespace ignite
switch (type)
{
- case ON_START:
+ case OperationCallback::ON_START:
{
env->Get()->OnStartCallback(val1, reinterpret_cast<jobject>(arg));
break;
}
- case REALLOC:
+ case OperationCallback::REALLOC:
{
SharedPointer<InteropMemory> mem = env->Get()->GetMemory(val1);
@@ -363,7 +366,7 @@ namespace ignite
bool invoked = false;
int64_t res = binding.Get()->InvokeCallback(invoked,
- IgniteBindingImpl::CACHE_ENTRY_FILTER_CREATE, filterId, reader, writer);
+ IgniteBindingImpl::CallbackType::CACHE_ENTRY_FILTER_CREATE, filterId, reader, writer);
if (!invoked)
{
@@ -424,7 +427,8 @@ namespace ignite
bool invoked = false;
- binding.Get()->InvokeCallback(invoked, IgniteBindingImpl::CACHE_ENTRY_PROCESSOR_APPLY, procId, reader, writer);
+ binding.Get()->InvokeCallback(invoked,
+ IgniteBindingImpl::CallbackType::CACHE_ENTRY_PROCESSOR_APPLY, procId, reader, writer);
if (!invoked)
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp b/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp
index 3904dfa..b0932e7 100644
--- a/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp
+++ b/modules/platforms/cpp/core/src/impl/interop/interop_target.cpp
@@ -186,18 +186,18 @@ namespace ignite
IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
- if (jniErr.code == IGNITE_JNI_ERR_SUCCESS && res == ResultSuccess)
+ if (jniErr.code == IGNITE_JNI_ERR_SUCCESS && res == OperationResult::AI_SUCCESS)
ReadFrom(outInMem.Get(), outOp);
- else if (res == ResultNull)
+ else if (res == OperationResult::AI_NULL)
outOp.SetNull();
- else if (res == ResultError)
+ else if (res == OperationResult::AI_ERROR)
ReadError(outInMem.Get(), err);
else
assert(false);
}
}
- InteropTarget::OperationResult InteropTarget::InStreamOutLong(int32_t opType,
+ InteropTarget::OperationResult::Type InteropTarget::InStreamOutLong(int32_t opType,
InteropMemory& outInMem, IgniteError& err)
{
JniErrorInfo jniErr;
@@ -210,10 +210,10 @@ namespace ignite
IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err);
- return static_cast<OperationResult>(res);
+ return static_cast<OperationResult::Type>(res);
}
- return ResultError;
+ return OperationResult::AI_ERROR;
}
int64_t InteropTarget::OutInOpLong(int32_t opType, int64_t val, IgniteError& err)
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp b/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp
index 63b3b6b..852b7d7 100644
--- a/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/transactions/transaction_impl.cpp
@@ -37,7 +37,7 @@ namespace ignite
isolation(isolation),
timeout(timeout),
txSize(txSize),
- state(IGNITE_TX_STATE_UNKNOWN),
+ state(TransactionState::UNKNOWN),
closed(false)
{
// No-op.
@@ -97,7 +97,7 @@ namespace ignite
return;
}
- TransactionState newState = txs.Get()->TxCommit(id, err);
+ TransactionState::Type newState = txs.Get()->TxCommit(id, err);
if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
{
@@ -118,7 +118,7 @@ namespace ignite
return;
}
- TransactionState newState = txs.Get()->TxRollback(id, err);
+ TransactionState::Type newState = txs.Get()->TxRollback(id, err);
if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
{
@@ -139,7 +139,7 @@ namespace ignite
return;
}
- TransactionState newState = txs.Get()->TxClose(id, err);
+ TransactionState::Type newState = txs.Get()->TxClose(id, err);
if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
{
@@ -165,14 +165,14 @@ namespace ignite
bool TransactionImpl::IsRollbackOnly(IgniteError& err)
{
- TransactionState state0 = GetState(err);
+ TransactionState::Type state0 = GetState(err);
- return state0 == IGNITE_TX_STATE_MARKED_ROLLBACK ||
- state0 == IGNITE_TX_STATE_ROLLING_BACK ||
- state0 == IGNITE_TX_STATE_ROLLED_BACK;
+ return state0 == TransactionState::MARKED_ROLLBACK ||
+ state0 == TransactionState::ROLLING_BACK ||
+ state0 == TransactionState::ROLLED_BACK;
}
- TransactionState TransactionImpl::GetState(IgniteError& err)
+ TransactionState::Type TransactionImpl::GetState(IgniteError& err)
{
common::concurrent::CsLockGuard guard(accessLock);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp b/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp
index 79f58c5..133b375 100644
--- a/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/transactions/transactions_impl.cpp
@@ -30,24 +30,34 @@ namespace ignite
/**
* Transaction opertion.
*/
- enum Operation
+ struct Operation
{
- /** Get metrics. */
- OP_METRICS = 2,
- /** Start tx. */
- OP_START = 3,
- /** Commit. */
- OP_COMMIT = 4,
- /** Rollback. */
- OP_ROLLBACK = 5,
- /** Close tx. */
- OP_CLOSE = 6,
- /** Get tx state. */
- OP_STATE = 7,
- /** Set rollback-only mode. */
- OP_SET_ROLLBACK_ONLY = 8,
- /** Reset metrics. */
- OP_RESET_METRICS = 11,
+ enum Type
+ {
+ /** Get metrics. */
+ METRICS = 2,
+
+ /** Start tx. */
+ START = 3,
+
+ /** Commit. */
+ COMMIT = 4,
+
+ /** Rollback. */
+ ROLLBACK = 5,
+
+ /** Close tx. */
+ CLOSE = 6,
+
+ /** Get tx state. */
+ STATE = 7,
+
+ /** Set rollback-only mode. */
+ SET_ROLLBACK_ONLY = 8,
+
+ /** Reset metrics. */
+ RESET_METRICS = 11,
+ };
};
TransactionsImpl::TransactionsImpl(SP_IgniteEnvironment env, jobject javaRef) :
@@ -148,34 +158,34 @@ namespace ignite
InTransactionStartOperation inOp(concurrency, isolation, timeout, txSize);
OutTransactionStartOperation outOp;
- OutInOp(OP_START, inOp, outOp, err);
+ OutInOp(Operation::START, inOp, outOp, err);
return outOp.Get();
}
- TransactionsImpl::TransactionState TransactionsImpl::TxCommit(int64_t id, IgniteError& err)
+ TransactionState::Type TransactionsImpl::TxCommit(int64_t id, IgniteError& err)
{
JniErrorInfo jniErr;
- int state = static_cast<int>(OutInOpLong(OP_COMMIT, id, err));
+ int state = static_cast<int>(OutInOpLong(Operation::COMMIT, id, err));
return ToTransactionState(state);
}
- TransactionsImpl::TransactionState TransactionsImpl::TxRollback(int64_t id, IgniteError& err)
+ TransactionState::Type TransactionsImpl::TxRollback(int64_t id, IgniteError& err)
{
JniErrorInfo jniErr;
- int state = static_cast<int>(OutInOpLong(OP_ROLLBACK, id, err));
+ int state = static_cast<int>(OutInOpLong(Operation::ROLLBACK, id, err));
return ToTransactionState(state);
}
- TransactionsImpl::TransactionState TransactionsImpl::TxClose(int64_t id, IgniteError& err)
+ TransactionState::Type TransactionsImpl::TxClose(int64_t id, IgniteError& err)
{
JniErrorInfo jniErr;
- int state = static_cast<int>(OutInOpLong(OP_CLOSE, id, err));
+ int state = static_cast<int>(OutInOpLong(Operation::CLOSE, id, err));
return ToTransactionState(state);
}
@@ -184,16 +194,16 @@ namespace ignite
{
JniErrorInfo jniErr;
- bool rollbackOnly = OutInOpLong(OP_SET_ROLLBACK_ONLY, id, err) == 1;
+ bool rollbackOnly = OutInOpLong(Operation::SET_ROLLBACK_ONLY, id, err) == 1;
return rollbackOnly;
}
- TransactionsImpl::TransactionState TransactionsImpl::TxState(int64_t id, IgniteError& err)
+ TransactionState::Type TransactionsImpl::TxState(int64_t id, IgniteError& err)
{
JniErrorInfo jniErr;
- int state = static_cast<int>(OutInOpLong(OP_STATE, id, err));
+ int state = static_cast<int>(OutInOpLong(Operation::STATE, id, err));
return ToTransactionState(state);
}
@@ -248,32 +258,32 @@ namespace ignite
{
OutTransactionMetricsOperation op;
- InOp(OP_METRICS, op, err);
+ InOp(Operation::METRICS, op, err);
if (err.GetCode() == IgniteError::IGNITE_SUCCESS)
return op.Get();
- return ignite::transactions::TransactionMetrics();
+ return TransactionMetrics();
}
- TransactionsImpl::TransactionState TransactionsImpl::ToTransactionState(int state)
+ TransactionState::Type TransactionsImpl::ToTransactionState(int state)
{
using namespace ignite::transactions;
switch (state)
{
- case IGNITE_TX_STATE_ACTIVE:
- case IGNITE_TX_STATE_PREPARING:
- case IGNITE_TX_STATE_PREPARED:
- case IGNITE_TX_STATE_MARKED_ROLLBACK:
- case IGNITE_TX_STATE_COMMITTING:
- case IGNITE_TX_STATE_COMMITTED:
- case IGNITE_TX_STATE_ROLLING_BACK:
- case IGNITE_TX_STATE_ROLLED_BACK:
- case IGNITE_TX_STATE_UNKNOWN:
- return static_cast<TransactionState>(state);
+ case TransactionState::ACTIVE:
+ case TransactionState::PREPARING:
+ case TransactionState::PREPARED:
+ case TransactionState::MARKED_ROLLBACK:
+ case TransactionState::COMMITTING:
+ case TransactionState::COMMITTED:
+ case TransactionState::ROLLING_BACK:
+ case TransactionState::ROLLED_BACK:
+ case TransactionState::UNKNOWN:
+ return static_cast<TransactionState::Type>(state);
default:
- return IGNITE_TX_STATE_UNKNOWN;
+ return TransactionState::UNKNOWN;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/transactions/transaction.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/transactions/transaction.cpp b/modules/platforms/cpp/core/src/transactions/transaction.cpp
index 59e2d4a..469fea9 100644
--- a/modules/platforms/cpp/core/src/transactions/transaction.cpp
+++ b/modules/platforms/cpp/core/src/transactions/transaction.cpp
@@ -172,18 +172,18 @@ namespace ignite
return false;
}
- TransactionState Transaction::GetState()
+ TransactionState::Type Transaction::GetState()
{
IgniteError err;
- TransactionState res = GetState(err);
+ TransactionState::Type res = GetState(err);
IgniteError::ThrowIfNeeded(err);
return res;
}
- TransactionState Transaction::GetState(IgniteError& err)
+ TransactionState::Type Transaction::GetState(IgniteError& err)
{
err = IgniteError();
@@ -197,7 +197,7 @@ namespace ignite
"Instance is not usable (did you check for error?).");
}
- return IGNITE_TX_STATE_UNKNOWN;
+ return TransactionState::UNKNOWN;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/core/src/transactions/transactions.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/transactions/transactions.cpp b/modules/platforms/cpp/core/src/transactions/transactions.cpp
index 081f97a..4c1ea70 100644
--- a/modules/platforms/cpp/core/src/transactions/transactions.cpp
+++ b/modules/platforms/cpp/core/src/transactions/transactions.cpp
@@ -66,12 +66,12 @@ namespace ignite
Transaction Transactions::TxStart(IgniteError& err)
{
- return TxStart(IGNITE_TX_CONCURRENCY_PESSIMISTIC,
- IGNITE_TX_ISOLATION_READ_COMMITTED, 0, 0, err);
+ return TxStart(TransactionConcurrency::PESSIMISTIC,
+ TransactionIsolation::READ_COMMITTED, 0, 0, err);
}
- Transaction Transactions::TxStart(TransactionConcurrency concurrency,
- TransactionIsolation isolation)
+ Transaction Transactions::TxStart(TransactionConcurrency::Type concurrency,
+ TransactionIsolation::Type isolation)
{
IgniteError err;
@@ -82,14 +82,14 @@ namespace ignite
return tx;
}
- Transaction Transactions::TxStart(TransactionConcurrency concurrency,
- TransactionIsolation isolation, IgniteError& err)
+ Transaction Transactions::TxStart(TransactionConcurrency::Type concurrency,
+ TransactionIsolation::Type isolation, IgniteError& err)
{
return TxStart(concurrency, isolation, 0, 0, err);
}
- Transaction Transactions::TxStart(TransactionConcurrency concurrency,
- TransactionIsolation isolation, int64_t timeout, int32_t txSize)
+ Transaction Transactions::TxStart(TransactionConcurrency::Type concurrency,
+ TransactionIsolation::Type isolation, int64_t timeout, int32_t txSize)
{
IgniteError err;
@@ -101,8 +101,8 @@ namespace ignite
return tx;
}
- Transaction Transactions::TxStart(TransactionConcurrency concurrency,
- TransactionIsolation isolation, int64_t timeout, int32_t txSize,
+ Transaction Transactions::TxStart(TransactionConcurrency::Type concurrency,
+ TransactionIsolation::Type isolation, int64_t timeout, int32_t txSize,
IgniteError& err)
{
err = IgniteError();
http://git-wip-us.apache.org/repos/asf/ignite/blob/7e106cd0/modules/platforms/cpp/odbc-test/src/application_data_buffer_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/application_data_buffer_test.cpp b/modules/platforms/cpp/odbc-test/src/application_data_buffer_test.cpp
index cca1dad..4454066 100644
--- a/modules/platforms/cpp/odbc-test/src/application_data_buffer_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/application_data_buffer_test.cpp
@@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(TestPutIntToString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, buffer, sizeof(buffer), &reslen, &offset);
appBuf.PutInt8(12);
BOOST_CHECK(!strcmp(buffer, "12"));
@@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE(TestPutFloatToString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, buffer, sizeof(buffer), &reslen, &offset);
appBuf.PutFloat(12.42f);
BOOST_CHECK(!strcmp(buffer, "12.42"));
@@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE(TestPutGuidToString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, buffer, sizeof(buffer), &reslen, &offset);
ignite::Guid guid(0x1da1ef8f39ff4d62ULL, 0x8b72e8e9f3371801ULL);
@@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE(TestPutBinaryToString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, buffer, sizeof(buffer), &reslen, &offset);
uint8_t binary[] = { 0x21, 0x84, 0xF4, 0xDC, 0x01, 0x00, 0xFF, 0xF0 };
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToString)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, buffer, sizeof(buffer), &reslen, &offset);
std::string testString("Test string");
@@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToWstring)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_WCHAR, buffer, sizeof(buffer), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_WCHAR, buffer, sizeof(buffer), &reslen, &offset);
std::string testString("Test string");
@@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToLong)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_LONG, &numBuf, sizeof(numBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_SIGNED_LONG, &numBuf, sizeof(numBuf), &reslen, &offset);
appBuf.PutString("424242424");
BOOST_CHECK(numBuf == 424242424L);
@@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToTiny)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_TINYINT, &numBuf, sizeof(numBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_SIGNED_TINYINT, &numBuf, sizeof(numBuf), &reslen, &offset);
appBuf.PutString("12");
BOOST_CHECK(numBuf == 12);
@@ -196,7 +196,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToFloat)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_FLOAT, &numBuf, sizeof(numBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_FLOAT, &numBuf, sizeof(numBuf), &reslen, &offset);
appBuf.PutString("12.21");
BOOST_CHECK_CLOSE_FRACTION(numBuf, 12.21, FLOAT_PRECISION);
@@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE(TestPutIntToFloat)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_FLOAT, &numBuf, sizeof(numBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_FLOAT, &numBuf, sizeof(numBuf), &reslen, &offset);
appBuf.PutInt8(5);
BOOST_CHECK_CLOSE_FRACTION(numBuf, 5.0, FLOAT_PRECISION);
@@ -238,7 +238,7 @@ BOOST_AUTO_TEST_CASE(TestPutFloatToShort)
SqlLen reslen = 0;
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_SHORT, &numBuf, sizeof(numBuf), &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_SIGNED_SHORT, &numBuf, sizeof(numBuf), &reslen, &offset);
appBuf.PutDouble(5.42);
BOOST_CHECK(numBuf == 5);
@@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(TestPutDecimalToDouble)
double numBuf;
SqlLen reslen = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &numBuf, sizeof(numBuf), &reslen, 0);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_DOUBLE, &numBuf, sizeof(numBuf), &reslen, 0);
common::Decimal decimal;
@@ -287,7 +287,7 @@ BOOST_AUTO_TEST_CASE(TestPutDecimalToLong)
long numBuf;
SqlLen reslen = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_LONG, &numBuf, sizeof(numBuf), &reslen, 0);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_SIGNED_LONG, &numBuf, sizeof(numBuf), &reslen, 0);
common::Decimal decimal;
@@ -314,7 +314,7 @@ BOOST_AUTO_TEST_CASE(TestPutDecimalToString)
char strBuf[64];
SqlLen reslen = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
common::Decimal decimal;
@@ -341,7 +341,7 @@ BOOST_AUTO_TEST_CASE(TestPutDecimalToNumeric)
SQL_NUMERIC_STRUCT buf;
SqlLen reslen = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_NUMERIC, &buf, sizeof(buf), &reslen, 0);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_NUMERIC, &buf, sizeof(buf), &reslen, 0);
common::Decimal decimal;
@@ -392,7 +392,7 @@ BOOST_AUTO_TEST_CASE(TestPutDateToString)
char strBuf[64] = { 0 };
SqlLen reslen = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
Date date = common::MakeDateGmt(1999, 2, 22);
@@ -409,7 +409,7 @@ BOOST_AUTO_TEST_CASE(TestPutDateToDate)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TDATE, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TDATE, &buf, sizeof(buf), &reslen, &offsetPtr);
Date date = common::MakeDateGmt(1984, 5, 27);
@@ -429,7 +429,7 @@ BOOST_AUTO_TEST_CASE(TestPutDateToTimestamp)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
Date date = common::MakeDateGmt(1984, 5, 27);
@@ -449,7 +449,7 @@ BOOST_AUTO_TEST_CASE(TestPutTimeToString)
char strBuf[64] = { 0 };
SqlLen reslen = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
Time time = common::MakeTimeGmt(7, 15, 0);
@@ -466,7 +466,7 @@ BOOST_AUTO_TEST_CASE(TestPutTimeToTime)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TTIME, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TTIME, &buf, sizeof(buf), &reslen, &offsetPtr);
Time time = common::MakeTimeGmt(23, 51, 1);
@@ -482,7 +482,7 @@ BOOST_AUTO_TEST_CASE(TestPutTimestampToString)
char strBuf[64] = { 0 };
SqlLen reslen = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
Timestamp date = common::MakeTimestampGmt(2018, 11, 1, 17, 45, 59);
@@ -499,7 +499,7 @@ BOOST_AUTO_TEST_CASE(TestPutTimestampToDate)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TDATE, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TDATE, &buf, sizeof(buf), &reslen, &offsetPtr);
Timestamp ts = common::MakeTimestampGmt(2004, 8, 14, 6, 34, 51, 573948623);
@@ -518,7 +518,7 @@ BOOST_AUTO_TEST_CASE(TestPutTimestampToTime)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TTIME, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TTIME, &buf, sizeof(buf), &reslen, &offsetPtr);
Timestamp ts = common::MakeTimestampGmt(2004, 8, 14, 6, 34, 51, 573948623);
@@ -537,7 +537,7 @@ BOOST_AUTO_TEST_CASE(TestPutTimestampToTimestamp)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
Timestamp ts = common::MakeTimestampGmt(2004, 8, 14, 6, 34, 51, 573948623);
@@ -557,7 +557,7 @@ BOOST_AUTO_TEST_CASE(TestGetGuidFromString)
char buffer[] = "1da1ef8f-39ff-4d62-8b72-e8e9f3371801";
SqlLen reslen = sizeof(buffer) - 1;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer) - 1, &reslen, 0);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, buffer, sizeof(buffer) - 1, &reslen, 0);
ignite::Guid guid = appBuf.GetGuid();
@@ -570,7 +570,7 @@ BOOST_AUTO_TEST_CASE(TestGetStringFromLong)
SqlLen reslen = sizeof(numBuf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_LONG, &numBuf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_SIGNED_LONG, &numBuf, reslen, &reslen, &offset);
std::string res = appBuf.GetString(32);
@@ -589,7 +589,7 @@ BOOST_AUTO_TEST_CASE(TestGetStringFromDouble)
SqlLen reslen = sizeof(numBuf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &numBuf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_DOUBLE, &numBuf, reslen, &reslen, &offset);
std::string res = appBuf.GetString(32);
@@ -608,7 +608,7 @@ BOOST_AUTO_TEST_CASE(TestGetStringFromString)
SqlLen reslen = sizeof(buf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &buf, reslen, &reslen, &offset);
std::string res = appBuf.GetString(reslen);
@@ -621,7 +621,7 @@ BOOST_AUTO_TEST_CASE(TestGetFloatFromUshort)
SqlLen reslen = sizeof(numBuf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT, &numBuf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_UNSIGNED_SHORT, &numBuf, reslen, &reslen, &offset);
float resFloat = appBuf.GetFloat();
@@ -638,7 +638,7 @@ BOOST_AUTO_TEST_CASE(TestGetFloatFromString)
SqlLen reslen = sizeof(buf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &buf, reslen, &reslen, &offset);
float resFloat = appBuf.GetFloat();
@@ -655,7 +655,7 @@ BOOST_AUTO_TEST_CASE(TestGetFloatFromFloat)
SqlLen reslen = sizeof(buf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_FLOAT, &buf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_FLOAT, &buf, reslen, &reslen, &offset);
float resFloat = appBuf.GetFloat();
@@ -672,7 +672,7 @@ BOOST_AUTO_TEST_CASE(TestGetFloatFromDouble)
SqlLen reslen = sizeof(buf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &buf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_DOUBLE, &buf, reslen, &reslen, &offset);
float resFloat = appBuf.GetFloat();
@@ -689,7 +689,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntFromString)
SqlLen reslen = sizeof(buf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &buf, reslen, &reslen, &offset);
int64_t resInt64 = appBuf.GetInt64();
@@ -714,7 +714,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntFromFloat)
SqlLen reslen = sizeof(buf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_FLOAT, &buf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_FLOAT, &buf, reslen, &reslen, &offset);
int64_t resInt64 = appBuf.GetInt64();
@@ -739,7 +739,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntFromDouble)
SqlLen reslen = sizeof(buf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &buf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_DOUBLE, &buf, reslen, &reslen, &offset);
int64_t resInt64 = appBuf.GetInt64();
@@ -764,7 +764,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntFromBigint)
SqlLen reslen = sizeof(buf);
int* offset = 0;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT, &buf, reslen, &reslen, &offset);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_UNSIGNED_BIGINT, &buf, reslen, &reslen, &offset);
int64_t resInt64 = appBuf.GetInt64();
@@ -799,7 +799,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntWithOffset)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT, &buf[0].val, sizeof(buf[0].val), &buf[0].reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_UNSIGNED_BIGINT, &buf[0].val, sizeof(buf[0].val), &buf[0].reslen, &offsetPtr);
int64_t val = appBuf.GetInt64();
@@ -834,7 +834,7 @@ BOOST_AUTO_TEST_CASE(TestSetStringWithOffset)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf[0].val, sizeof(buf[0].val), &buf[0].reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &buf[0].val, sizeof(buf[0].val), &buf[0].reslen, &offsetPtr);
appBuf.PutString("Hello Ignite!");
@@ -869,7 +869,7 @@ BOOST_AUTO_TEST_CASE(TestGetDateFromString)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf[0], sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &buf[0], sizeof(buf), &reslen, &offsetPtr);
Date date = appBuf.GetDate();
@@ -895,7 +895,7 @@ BOOST_AUTO_TEST_CASE(TestGetTimeFromString)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf[0], sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &buf[0], sizeof(buf), &reslen, &offsetPtr);
Time time = appBuf.GetTime();
@@ -921,7 +921,7 @@ BOOST_AUTO_TEST_CASE(TestGetTimestampFromString)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf[0], sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_CHAR, &buf[0], sizeof(buf), &reslen, &offsetPtr);
Timestamp date = appBuf.GetTimestamp();
@@ -952,7 +952,7 @@ BOOST_AUTO_TEST_CASE(TestGetDateFromDate)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TDATE, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TDATE, &buf, sizeof(buf), &reslen, &offsetPtr);
Date date = appBuf.GetDate();
@@ -983,7 +983,7 @@ BOOST_AUTO_TEST_CASE(TestGetTimestampFromDate)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TDATE, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TDATE, &buf, sizeof(buf), &reslen, &offsetPtr);
Timestamp ts = appBuf.GetTimestamp();
@@ -1014,7 +1014,7 @@ BOOST_AUTO_TEST_CASE(TestGetTimestampFromTime)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TTIME, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TTIME, &buf, sizeof(buf), &reslen, &offsetPtr);
Time time = appBuf.GetTime();
@@ -1049,7 +1049,7 @@ BOOST_AUTO_TEST_CASE(TestGetTimestampFromTimestamp)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
Timestamp ts = appBuf.GetTimestamp();
@@ -1085,7 +1085,7 @@ BOOST_AUTO_TEST_CASE(TestGetDateFromTimestamp)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
Date date = appBuf.GetDate();
@@ -1120,7 +1120,7 @@ BOOST_AUTO_TEST_CASE(TestGetTimeFromTimestamp)
int offset = 0;
int* offsetPtr = &offset;
- ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
+ ApplicationDataBuffer appBuf(OdbcNativeType::AI_TTIMESTAMP, &buf, sizeof(buf), &reslen, &offsetPtr);
Time time = appBuf.GetTime();
[07/50] [abbrv] ignite git commit: Merge branch
'ignite-3477-master-apache' into ignite-3477-master
Posted by sb...@apache.org.
Merge branch 'ignite-3477-master-apache' into ignite-3477-master
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3a62833a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3a62833a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3a62833a
Branch: refs/heads/ignite-4929
Commit: 3a62833adb72ca3b0998b0df5c7026196dfd943d
Parents: 5cded42 3e5e1f0
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 15:08:50 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 15:08:50 2017 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheContext.java | 2 -
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../dht/atomic/GridDhtAtomicCache.java | 37 +++++----
.../IgniteCacheTopologySafeGetSelfTest.java | 2 +-
.../cpp/core-test/src/continuous_query_test.cpp | 11 ++-
.../core/include/ignite/impl/module_manager.h | 26 ++++++
.../examples/include/ignite/examples/person.h | 1 -
.../Cache/CacheMetricsTest.cs | 86 +++++++++-----------
.../Apache.Ignite.Core/Cache/ICacheMetrics.cs | 80 ------------------
.../Impl/Cache/CacheMetricsImpl.cs | 70 ----------------
10 files changed, 92 insertions(+), 225 deletions(-)
----------------------------------------------------------------------
[47/50] [abbrv] ignite git commit: .NET: Fix metrics test
(IGNITE-3018)
Posted by sb...@apache.org.
.NET: Fix metrics test (IGNITE-3018)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/40347eda
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/40347eda
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/40347eda
Branch: refs/heads/ignite-4929
Commit: 40347eda88de4c48a2c0535e50a91c5bff683105
Parents: 428f66d
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Apr 14 10:40:04 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Apr 14 10:40:04 2017 +0300
----------------------------------------------------------------------
.../Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/40347eda/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
index d1d6c7b..d12afd2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
@@ -25,6 +25,7 @@ namespace Apache.Ignite.Core.Tests.Cache
using Apache.Ignite.Core.Impl;
using Apache.Ignite.Core.Impl.Cache;
using NUnit.Framework;
+ using System.Linq;
/// <summary>
/// Tests cache metrics propagation.
@@ -212,7 +213,8 @@ namespace Apache.Ignite.Core.Tests.Cache
{
func2 = func2 ?? func;
- var localCache = Ignition.GetIgnite().CreateCache<int, int>(new CacheConfiguration(cacheName)
+ var localIgnite = Ignition.GetIgnite();
+ var localCache = localIgnite.CreateCache<int, int>(new CacheConfiguration(cacheName)
{
EnableStatistics = true
});
@@ -222,9 +224,12 @@ namespace Apache.Ignite.Core.Tests.Cache
Assert.IsTrue(localCache.GetConfiguration().EnableStatistics);
Assert.IsTrue(remoteCache.GetConfiguration().EnableStatistics);
- localCache.Put(1, 1);
- localCache.Get(1);
-
+ var aff = localIgnite.GetAffinity(cacheName);
+ var localNode = localIgnite.GetCluster().GetLocalNode();
+ var localKey = Enumerable.Range(1, 10000).First(x => aff.IsPrimary(localNode, x));
+
+ localCache.Put(localKey, 1);
+ localCache.Get(localKey);
// Wait for metrics to propagate.
Thread.Sleep(TcpDiscoverySpi.DefaultHeartbeatFrequency);
[49/50] [abbrv] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-4929
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/5609b76a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5609b76a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5609b76a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetRequest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5609b76a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index b95d3a6,d3b39bd..5cba0cf
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@@ -1405,23 -1404,15 +1407,21 @@@ public abstract class IgniteTxAdapter e
final boolean keepBinary = txEntry.keepBinary();
- CacheObject cacheVal = txEntry.hasValue() ? txEntry.value() :
- txEntry.cached().innerGet(
+ CacheObject cacheVal;
+
+ if (txEntry.hasValue())
+ cacheVal = txEntry.value();
+ else if (txEntry.hasOldValue())
+ cacheVal = txEntry.oldValue();
+ else {
+ cacheVal = txEntry.cached().innerGet(
null,
this,
- /*swap*/false,
/*read through*/false,
/*metrics*/metrics,
/*event*/recordEvt,
- /*temporary*/true,
/*subjId*/subjId,
- /**closure name */recordEvt ? F.first(txEntry.entryProcessors()).get1() : null,
+ /*closure name */recordEvt ? F.first(txEntry.entryProcessors()).get1() : null,
resolveTaskName(),
null,
keepBinary);
http://git-wip-us.apache.org/repos/asf/ignite/blob/5609b76a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5609b76a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5609b76a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index 28e2cec,b94b464..7ab3c37
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@@ -42,8 -41,7 +41,8 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.IgniteCacheIncrementTxTest;
import org.apache.ignite.internal.processors.cache.IgniteCachePartitionMapUpdateTest;
import org.apache.ignite.internal.processors.cache.IgniteDynamicCacheAndNodeStop;
+import org.apache.ignite.internal.processors.cache.IgniteOnePhaseCommitInvokeTest;
- import org.apache.ignite.internal.processors.cache.OffheapCacheOnClientsTest;
+ import org.apache.ignite.internal.processors.cache.MemoryPolicyConfigValidationTest;
import org.apache.ignite.internal.processors.cache.distributed.CacheLoadingConcurrentGridStartSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.CacheLoadingConcurrentGridStartSelfTestAllowOverwrite;
import org.apache.ignite.internal.processors.cache.distributed.CacheLockReleaseNodeLeaveTest;
@@@ -280,11 -261,7 +262,9 @@@ public class IgniteCacheTestSuite2 exte
suite.addTest(new TestSuite(CacheConcurrentReadThroughTest.class));
suite.addTest(new TestSuite(GridNearCacheStoreUpdateTest.class));
- suite.addTest(new TestSuite(GridNearOffheapCacheStoreUpdateTest.class));
+ suite.addTest(new TestSuite(IgniteOnePhaseCommitInvokeTest.class));
+
return suite;
}
}
[44/50] [abbrv] ignite git commit: Merge branch 'ignite-1.9.1-p1'
Posted by sb...@apache.org.
Merge branch 'ignite-1.9.1-p1'
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3f541676
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3f541676
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3f541676
Branch: refs/heads/ignite-4929
Commit: 3f541676e208b3bfaf13346a60e8508c68767772
Parents: 922b258 6d12bd4
Author: dkarachentsev <dk...@gridgain.com>
Authored: Fri Apr 14 09:45:14 2017 +0300
Committer: dkarachentsev <dk...@gridgain.com>
Committed: Fri Apr 14 09:45:14 2017 +0300
----------------------------------------------------------------------
assembly/release-fabric-base.xml | 6 +
.../binary/builder/BinaryBuilderReader.java | 8 +
.../managers/communication/GridIoManager.java | 12 +-
.../dht/atomic/GridDhtAtomicCache.java | 25 ++-
.../util/nio/GridNioBackPressureControl.java | 39 ++++-
.../util/nio/GridNioMessageTracker.java | 7 +
.../mutabletest/GridBinaryTestClasses.java | 9 +
.../CacheAtomicPrimarySyncBackPressureTest.java | 167 +++++++++++++++++++
.../testsuites/IgniteCacheTestSuite4.java | 3 +
9 files changed, 262 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3f541676/assembly/release-fabric-base.xml
----------------------------------------------------------------------
diff --cc assembly/release-fabric-base.xml
index c3bad39,97222c9..b374ab4
--- a/assembly/release-fabric-base.xml
+++ b/assembly/release-fabric-base.xml
@@@ -172,16 -178,10 +172,22 @@@
<directory>modules/clients/target/cppdoc/html</directory>
<outputDirectory>/platforms/cpp/docs</outputDirectory>
</fileSet>
+
+ <!-- Move CPP binaries. -->
+ <fileSet>
+ <directory>modules/platforms/cpp/bin</directory>
+ <outputDirectory>/platforms/cpp/bin</outputDirectory>
+ </fileSet>
+
+ <!-- Move CPP binaries. -->
+ <fileSet>
+ <directory>modules/platforms/cpp/bin</directory>
++ <outputDirectory>/platforms/cpp/bin</outputDirectory>
++ </fileSet>
+
+ <!-- Move CPP binaries. -->
+ <fileSet>
+ <directory>modules/platforms/cpp/bin</directory>
<outputDirectory>/platforms/cpp/bin</outputDirectory>
</fileSet>
http://git-wip-us.apache.org/repos/asf/ignite/blob/3f541676/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3f541676/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3f541676/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 6bcd6c2,da16e74..2810327
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@@ -99,15 -100,20 +101,18 @@@ import org.apache.ignite.internal.util.
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiTuple;
import org.apache.ignite.lang.IgniteClosure;
+ import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.lang.IgniteOutClosure;
+ import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.security.SecurityPermission;
import org.apache.ignite.transactions.TransactionIsolation;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_ATOMIC_DEFERRED_ACK_BUFFER_SIZE;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_ATOMIC_DEFERRED_ACK_TIMEOUT;
-import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.CLOCK;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_ASYNC;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
import static org.apache.ignite.internal.processors.cache.GridCacheOperation.DELETE;
import static org.apache.ignite.internal.processors.cache.GridCacheOperation.TRANSFORM;
import static org.apache.ignite.internal.processors.cache.GridCacheOperation.UPDATE;
@@@ -1870,15 -1905,33 +1875,33 @@@ public class GridDhtAtomicCache<K, V> e
res.returnValue(retVal);
- if (dhtFut != null)
- if (req.writeSynchronizationMode() != FULL_ASYNC)
- req.cleanup(!node.isLocal());
-
+ if (dhtFut != null) {
+ if (req.writeSynchronizationMode() == PRIMARY_SYNC
+ // To avoid deadlock disable back-pressure for sender data node.
+ && !ctx.discovery().cacheAffinityNode(ctx.discovery().node(nodeId), ctx.name())
+ && !dhtFut.isDone()) {
+ final IgniteRunnable tracker = GridNioBackPressureControl.threadTracker();
+
+ if (tracker != null && tracker instanceof GridNioMessageTracker) {
+ ((GridNioMessageTracker)tracker).onMessageReceived();
+
+ dhtFut.listen(new IgniteInClosure<IgniteInternalFuture<Void>>() {
+ @Override public void apply(IgniteInternalFuture<Void> fut) {
+ ((GridNioMessageTracker)tracker).onMessageProcessed();
+ }
+ });
+ }
+ }
+
- ctx.mvcc().addAtomicFuture(dhtFut.version(), dhtFut);
+ ctx.mvcc().addAtomicFuture(dhtFut.id(), dhtFut);
+ }
}
- else
+ else {
// Should remap all keys.
remap = true;
+
+ res.remapTopologyVersion(top.topologyVersion());
+ }
}
finally {
top.readUnlock();
http://git-wip-us.apache.org/repos/asf/ignite/blob/3f541676/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
[06/50] [abbrv] ignite git commit: Merge remote-tracking branch
'origin/ignite-3477-master' into ignite-3477-master-apache
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-3477-master' into ignite-3477-master-apache
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3e5e1f01
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3e5e1f01
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3e5e1f01
Branch: refs/heads/ignite-4929
Commit: 3e5e1f01af8eb68cd69d7c1922c07fe367777ae7
Parents: 81e7538 7883668
Author: Dmitriy Govorukhin <dg...@gridgain.com>
Authored: Wed Apr 12 15:07:44 2017 +0300
Committer: Dmitriy Govorukhin <dg...@gridgain.com>
Committed: Wed Apr 12 15:07:44 2017 +0300
----------------------------------------------------------------------
.../configuration/DataPageEvictionMode.java | 16 +++-
.../MemoryPolicyConfiguration.java | 18 ++--
.../processors/cache/GridCacheContext.java | 2 -
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../dht/preloader/GridDhtPreloader.java | 6 +-
.../core/src/test/config/spring-multicache.xml | 16 ++++
.../IgniteCacheTopologySafeGetSelfTest.java | 2 +-
.../paged/PageEvictionAbstractTest.java | 4 +-
.../paged/PageEvictionMultinodeTest.java | 4 +-
.../paged/PageEvictionReadThroughTest.java | 2 +-
.../cpp/core-test/src/continuous_query_test.cpp | 11 ++-
.../core/include/ignite/impl/module_manager.h | 26 ++++++
.../examples/include/ignite/examples/person.h | 1 -
.../Cache/CacheMetricsTest.cs | 86 +++++++++-----------
.../Apache.Ignite.Core/Cache/ICacheMetrics.cs | 80 ------------------
.../Impl/Cache/CacheMetricsImpl.cs | 60 --------------
16 files changed, 125 insertions(+), 211 deletions(-)
----------------------------------------------------------------------