You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/11/16 08:55:06 UTC
[1/6] ignite git commit: IGNITE-1847: WIP.
Repository: ignite
Updated Branches:
refs/heads/ignite-1816 bb46df113 -> 3f2320e2b
IGNITE-1847: WIP.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/65edfbcf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/65edfbcf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/65edfbcf
Branch: refs/heads/ignite-1816
Commit: 65edfbcfd2db1effcc7bed734423940d5a20670a
Parents: cda4401
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Nov 11 13:29:28 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Nov 11 13:29:28 2015 +0300
----------------------------------------------------------------------
.../CacheObjectBinaryProcessorImpl.java | 44 +++++------
.../cache/portable/PortableMetaDataKey.java | 82 --------------------
.../cache/portable/PortableMetadataKey2.java | 82 ++++++++++++++++++++
3 files changed, 104 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/65edfbcf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
index 5e794d9..d765197 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
@@ -110,7 +110,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
private final boolean clientNode;
/** */
- private volatile IgniteCacheProxy<PortableMetaDataKey, BinaryMetadata> metaDataCache;
+ private volatile IgniteCacheProxy<PortableMetadataKey2, BinaryMetadata> metaDataCache;
/** */
private final ConcurrentHashMap8<Integer, BinaryTypeImpl> clientMetaDataCache;
@@ -120,7 +120,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
private static final long serialVersionUID = 0L;
@Override public boolean apply(GridCacheEntryEx e) {
- return e.key().value(e.context().cacheObjectContext(), false) instanceof PortableMetaDataKey;
+ return e.key().value(e.context().cacheObjectContext(), false) instanceof PortableMetadataKey2;
}
};
@@ -238,7 +238,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
GridCacheQueryManager qryMgr = metaDataCache.context().queries();
- CacheQuery<Map.Entry<PortableMetaDataKey, BinaryMetadata>> qry =
+ CacheQuery<Map.Entry<PortableMetadataKey2, BinaryMetadata>> qry =
qryMgr.createScanQuery(new MetaDataPredicate(), null, false);
qry.keepAll(false);
@@ -246,9 +246,9 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
qry.projection(ctx.cluster().get().forNode(oldestSrvNode));
try {
- CacheQueryFuture<Map.Entry<PortableMetaDataKey, BinaryMetadata>> fut = qry.execute();
+ CacheQueryFuture<Map.Entry<PortableMetadataKey2, BinaryMetadata>> fut = qry.execute();
- Map.Entry<PortableMetaDataKey, BinaryMetadata> next;
+ Map.Entry<PortableMetadataKey2, BinaryMetadata> next;
while ((next = fut.next()) != null) {
assert next.getKey() != null : next;
@@ -294,7 +294,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
* @param key Metadata key.
* @param newMeta Metadata.
*/
- private void addClientCacheMetaData(PortableMetaDataKey key, final BinaryMetadata newMeta) {
+ private void addClientCacheMetaData(PortableMetadataKey2 key, final BinaryMetadata newMeta) {
int key0 = key.typeId();
clientMetaDataCache.compute(key0,
@@ -460,7 +460,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
BinaryMetadata newMeta0 = ((BinaryTypeImpl)newMeta).metadata();
- final PortableMetaDataKey key = new PortableMetaDataKey(typeId);
+ final PortableMetadataKey2 key = new PortableMetadataKey2(typeId);
try {
BinaryMetadata oldMeta = metaDataCache.localPeek(key);
@@ -483,7 +483,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
if (clientNode)
return clientMetaDataCache.get(typeId);
else {
- BinaryMetadata meta = metaDataCache.localPeek(new PortableMetaDataKey(typeId));
+ BinaryMetadata meta = metaDataCache.localPeek(new PortableMetadataKey2(typeId));
return meta != null ? meta.wrap(portableCtx) : null;
}
@@ -497,16 +497,16 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
@Override public Map<Integer, BinaryType> metadata(Collection<Integer> typeIds)
throws BinaryObjectException {
try {
- Collection<PortableMetaDataKey> keys = new ArrayList<>(typeIds.size());
+ Collection<PortableMetadataKey2> keys = new ArrayList<>(typeIds.size());
for (Integer typeId : typeIds)
- keys.add(new PortableMetaDataKey(typeId));
+ keys.add(new PortableMetadataKey2(typeId));
- Map<PortableMetaDataKey, BinaryMetadata> meta = metaDataCache.getAll(keys);
+ Map<PortableMetadataKey2, BinaryMetadata> meta = metaDataCache.getAll(keys);
Map<Integer, BinaryType> res = U.newHashMap(meta.size());
- for (Map.Entry<PortableMetaDataKey, BinaryMetadata> e : meta.entrySet())
+ for (Map.Entry<PortableMetadataKey2, BinaryMetadata> e : meta.entrySet())
res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx));
return res;
@@ -527,10 +527,10 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
});
else {
return F.viewReadOnly(metaDataCache.entrySetx(metaPred),
- new C1<Cache.Entry<PortableMetaDataKey, BinaryMetadata>, BinaryType>() {
+ new C1<Cache.Entry<PortableMetadataKey2, BinaryMetadata>, BinaryType>() {
private static final long serialVersionUID = 0L;
- @Override public BinaryType apply(Cache.Entry<PortableMetaDataKey, BinaryMetadata> e) {
+ @Override public BinaryType apply(Cache.Entry<PortableMetadataKey2, BinaryMetadata> e) {
return e.getValue().wrap(portableCtx);
}
});
@@ -799,7 +799,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/**
*/
private static class MetaDataProcessor implements
- EntryProcessor<PortableMetaDataKey, BinaryMetadata, BinaryObjectException>, Externalizable {
+ EntryProcessor<PortableMetadataKey2, BinaryMetadata, BinaryObjectException>, Externalizable {
/** */
private static final long serialVersionUID = 0L;
@@ -829,7 +829,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public BinaryObjectException process(
- MutableEntry<PortableMetaDataKey, BinaryMetadata> entry,
+ MutableEntry<PortableMetadataKey2, BinaryMetadata> entry,
Object... args) {
try {
BinaryMetadata oldMeta = entry.getValue();
@@ -873,15 +873,15 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/**
*
*/
- class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetaDataKey, BinaryMetadata> {
+ class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetadataKey2, BinaryMetadata> {
/** {@inheritDoc} */
@Override public void onUpdated(
- Iterable<CacheEntryEvent<? extends PortableMetaDataKey, ? extends BinaryMetadata>> evts)
+ Iterable<CacheEntryEvent<? extends PortableMetadataKey2, ? extends BinaryMetadata>> evts)
throws CacheEntryListenerException {
- for (CacheEntryEvent<? extends PortableMetaDataKey, ? extends BinaryMetadata> evt : evts) {
+ for (CacheEntryEvent<? extends PortableMetadataKey2, ? extends BinaryMetadata> evt : evts) {
assert evt.getEventType() == EventType.CREATED || evt.getEventType() == EventType.UPDATED : evt;
- PortableMetaDataKey key = evt.getKey();
+ PortableMetadataKey2 key = evt.getKey();
final BinaryMetadata newMeta = evt.getValue();
@@ -906,7 +906,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public boolean evaluate(CacheEntryEvent<?, ?> evt) throws CacheEntryListenerException {
- return evt.getKey() instanceof PortableMetaDataKey;
+ return evt.getKey() instanceof PortableMetadataKey2;
}
/** {@inheritDoc} */
@@ -924,7 +924,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public boolean apply(Object key, Object val) {
- return key instanceof PortableMetaDataKey;
+ return key instanceof PortableMetadataKey2;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/65edfbcf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetaDataKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetaDataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetaDataKey.java
deleted file mode 100644
index 2a98778..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetaDataKey.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.portable;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Key for portable meta data.
- */
-class PortableMetaDataKey extends GridCacheUtilityKey<PortableMetaDataKey> implements Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private int typeId;
-
- /**
- * For {@link Externalizable}.
- */
- public PortableMetaDataKey() {
- // No-op.
- }
-
- /**
- * @param typeId Type ID.
- */
- PortableMetaDataKey(int typeId) {
- this.typeId = typeId;
- }
-
- /**
- * @return Type id.
- */
- public int typeId() {
- return typeId;
- }
-
- /** {@inheritDoc} */
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- out.writeInt(typeId);
- }
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- typeId = in.readInt();
- }
-
- /** {@inheritDoc} */
- @Override protected boolean equalsx(PortableMetaDataKey key) {
- return typeId == key.typeId;
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- return typeId;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(PortableMetaDataKey.class, this);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/65edfbcf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java
new file mode 100644
index 0000000..4c99b70
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java
@@ -0,0 +1,82 @@
+/*
+ * 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.portable;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Key for portable meta data.
+ */
+class PortableMetadataKey2 extends GridCacheUtilityKey<PortableMetadataKey2> implements Externalizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private int typeId;
+
+ /**
+ * For {@link Externalizable}.
+ */
+ public PortableMetadataKey2() {
+ // No-op.
+ }
+
+ /**
+ * @param typeId Type ID.
+ */
+ PortableMetadataKey2(int typeId) {
+ this.typeId = typeId;
+ }
+
+ /**
+ * @return Type id.
+ */
+ public int typeId() {
+ return typeId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeInt(typeId);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ typeId = in.readInt();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean equalsx(PortableMetadataKey2 key) {
+ return typeId == key.typeId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return typeId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(PortableMetadataKey2.class, this);
+ }
+}
\ No newline at end of file
[3/6] ignite git commit: IGNITE-1884 .Net: Fixed a bug when JNI local
ref couldn't be accessed from another thread.
Posted by vo...@apache.org.
IGNITE-1884 .Net: Fixed a bug when JNI local ref couldn't be accessed from another thread.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/25292c7e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/25292c7e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/25292c7e
Branch: refs/heads/ignite-1816
Commit: 25292c7ea6d006ec4dcb39516e4ff537ddac8951
Parents: 894057e
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Thu Nov 12 17:59:37 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Nov 12 17:59:37 2015 +0300
----------------------------------------------------------------------
modules/platforms/cpp/common/src/java.cpp | 110 ++++++++++++++++++-------
1 file changed, 79 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/25292c7e/modules/platforms/cpp/common/src/java.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/src/java.cpp b/modules/platforms/cpp/common/src/java.cpp
index 3a9f70b..002eb44 100644
--- a/modules/platforms/cpp/common/src/java.cpp
+++ b/modules/platforms/cpp/common/src/java.cpp
@@ -148,6 +148,32 @@ namespace ignite
delete[] errMsg;
}
+ /*
+ * Guard to ensure global reference cleanup.
+ */
+ class JniGlobalRefGuard
+ {
+ public:
+ JniGlobalRefGuard(JNIEnv *e, jobject obj) : env(e), ref(obj)
+ {
+ // No-op.
+ }
+
+ ~JniGlobalRefGuard()
+ {
+ env->DeleteGlobalRef(ref);
+ }
+
+ private:
+ /** Environment. */
+ JNIEnv* env;
+
+ /** Target reference. */
+ jobject ref;
+
+ IGNITE_NO_COPY_ASSIGNMENT(JniGlobalRefGuard)
+ };
+
const char* C_THROWABLE = "java/lang/Throwable";
JniMethod M_THROWABLE_GET_MESSAGE = JniMethod("getMessage", "()Ljava/lang/String;", false);
JniMethod M_THROWABLE_PRINT_STACK_TRACE = JniMethod("printStackTrace", "()V", false);
@@ -174,7 +200,7 @@ namespace ignite
JniMethod M_PLATFORM_PROCESSOR_SERVICES = JniMethod("services", "(Lorg/apache/ignite/internal/processors/platform/PlatformTarget;)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
JniMethod M_PLATFORM_PROCESSOR_EXTENSIONS = JniMethod("extensions", "()Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
JniMethod M_PLATFORM_PROCESSOR_ATOMIC_LONG = JniMethod("atomicLong", "(Ljava/lang/String;JZ)Lorg/apache/ignite/internal/processors/platform/PlatformTarget;", false);
-
+
const char* C_PLATFORM_TARGET = "org/apache/ignite/internal/processors/platform/PlatformTarget";
JniMethod M_PLATFORM_TARGET_IN_STREAM_OUT_LONG = JniMethod("inStreamOutLong", "(IJ)J", false);
JniMethod M_PLATFORM_TARGET_IN_STREAM_OUT_OBJECT = JniMethod("inStreamOutObject", "(IJ)Ljava/lang/Object;", false);
@@ -194,7 +220,7 @@ namespace ignite
JniMethod M_PLATFORM_CLUSTER_GRP_FOR_OLDEST = JniMethod("forOldest", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
JniMethod M_PLATFORM_CLUSTER_GRP_FOR_YOUNGEST = JniMethod("forYoungest", "()Lorg/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup;", false);
JniMethod M_PLATFORM_CLUSTER_GRP_RESET_METRICS = JniMethod("resetMetrics", "()V", false);
-
+
const char* C_PLATFORM_MESSAGING = "org/apache/ignite/internal/processors/platform/messaging/PlatformMessaging";
JniMethod M_PLATFORM_MESSAGING_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/messaging/PlatformMessaging;", false);
@@ -296,16 +322,16 @@ namespace ignite
JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_CREATE = JniMethod("messagingFilterCreate", "(JJ)J", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_APPLY = JniMethod("messagingFilterApply", "(JJJ)I", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_DESTROY = JniMethod("messagingFilterDestroy", "(JJ)V", true);
-
+
JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_CREATE = JniMethod("eventFilterCreate", "(JJ)J", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_APPLY = JniMethod("eventFilterApply", "(JJJ)I", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_DESTROY = JniMethod("eventFilterDestroy", "(JJ)V", true);
-
+
JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_INIT = JniMethod("serviceInit", "(JJ)J", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_EXECUTE = JniMethod("serviceExecute", "(JJJ)V", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_CANCEL = JniMethod("serviceCancel", "(JJJ)V", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_SERVICE_INVOKE_METHOD = JniMethod("serviceInvokeMethod", "(JJJJ)V", true);
-
+
JniMethod M_PLATFORM_CALLBACK_UTILS_CLUSTER_NODE_FILTER_APPLY = JniMethod("clusterNodeFilterApply", "(JJ)I", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_NODE_INFO = JniMethod("nodeInfo", "(JJ)V", true);
@@ -317,7 +343,7 @@ namespace ignite
JniMethod M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_OUT_LONG = JniMethod("extensionCallbackInLongOutLong", "(JIJ)J", true);
JniMethod M_PLATFORM_CALLBACK_UTILS_EXTENSION_CALLBACK_IN_LONG_LONG_OUT_LONG = JniMethod("extensionCallbackInLongLongOutLong", "(JIJJ)J", true);
-
+
const char* C_PLATFORM_UTILS = "org/apache/ignite/internal/processors/platform/utils/PlatformUtils";
JniMethod M_PLATFORM_UTILS_REALLOC = JniMethod("reallocate", "(JI)V", true);
JniMethod M_PLATFORM_UTILS_ERR_DATA = JniMethod("errorData", "(Ljava/lang/Throwable;)[B", true);
@@ -328,7 +354,7 @@ namespace ignite
JniMethod M_PLATFORM_IGNITION_ENVIRONMENT_POINTER = JniMethod("environmentPointer", "(Ljava/lang/String;)J", true);
JniMethod M_PLATFORM_IGNITION_STOP = JniMethod("stop", "(Ljava/lang/String;Z)Z", true);
JniMethod M_PLATFORM_IGNITION_STOP_ALL = JniMethod("stopAll", "(Z)V", true);
-
+
const char* C_PLATFORM_ABSTRACT_QRY_CURSOR = "org/apache/ignite/internal/processors/platform/cache/query/PlatformAbstractQueryCursor";
JniMethod M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER = JniMethod("iterator", "()V", false);
JniMethod M_PLATFORM_ABSTRACT_QRY_CURSOR_ITER_HAS_NEXT = JniMethod("iteratorHasNext", "()Z", false);
@@ -343,7 +369,7 @@ namespace ignite
JniMethod M_PLATFORM_EVENTS_STOP_LOCAL_LISTEN = JniMethod("stopLocalListen", "(J)Z", false);
JniMethod M_PLATFORM_EVENTS_LOCAL_LISTEN = JniMethod("localListen", "(JI)V", false);
JniMethod M_PLATFORM_EVENTS_IS_ENABLED = JniMethod("isEnabled", "(I)Z", false);
-
+
const char* C_PLATFORM_SERVICES = "org/apache/ignite/internal/processors/platform/services/PlatformServices";
JniMethod M_PLATFORM_SERVICES_WITH_ASYNC = JniMethod("withAsync", "()Lorg/apache/ignite/internal/processors/platform/services/PlatformServices;", false);
JniMethod M_PLATFORM_SERVICES_WITH_SERVER_KEEP_PORTABLE = JniMethod("withServerKeepPortable", "()Lorg/apache/ignite/internal/processors/platform/services/PlatformServices;", false);
@@ -418,7 +444,7 @@ namespace ignite
std::string res = std::string(resChars, *len);
delete[] resChars;
-
+
return res;
}
else
@@ -574,13 +600,13 @@ namespace ignite
m_PlatformDataStreamer_setPerNodeBufSize = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_PER_NODE_BUFFER_SIZE);
m_PlatformDataStreamer_getPerNodeParallelOps = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_GET_PER_NODE_PARALLEL_OPS);
m_PlatformDataStreamer_setPerNodeParallelOps = FindMethod(env, c_PlatformDataStreamer, M_PLATFORM_DATA_STREAMER_SET_PER_NODE_PARALLEL_OPS);
-
+
c_PlatformEvents = FindClass(env, C_PLATFORM_EVENTS);
m_PlatformEvents_withAsync = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_WITH_ASYNC);
m_PlatformEvents_stopLocalListen = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_STOP_LOCAL_LISTEN);
m_PlatformEvents_localListen = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_LOCAL_LISTEN);
m_PlatformEvents_isEnabled = FindMethod(env, c_PlatformEvents, M_PLATFORM_EVENTS_IS_ENABLED);
-
+
c_PlatformServices = FindClass(env, C_PLATFORM_SERVICES);
m_PlatformServices_withAsync = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_WITH_ASYNC);
m_PlatformServices_withServerKeepPortable = FindMethod(env, c_PlatformServices, M_PLATFORM_SERVICES_WITH_SERVER_KEEP_PORTABLE);
@@ -681,7 +707,7 @@ namespace ignite
// No-op.
}
- JniJvm::JniJvm(JavaVM* jvm, JniJavaMembers javaMembers, JniMembers members) :
+ JniJvm::JniJvm(JavaVM* jvm, JniJavaMembers javaMembers, JniMembers members) :
jvm(jvm), javaMembers(javaMembers), members(members)
{
// No-op.
@@ -719,7 +745,7 @@ namespace ignite
args.ignoreUnrecognized = 0;
jint res = JNI_CreateJavaVM(jvm, reinterpret_cast<void**>(env), &args);
-
+
delete[] opts0;
if (res != JNI_OK)
@@ -780,16 +806,16 @@ namespace ignite
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_CREATE, reinterpret_cast<void*>(JniMessagingFilterCreate));
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_APPLY, reinterpret_cast<void*>(JniMessagingFilterApply));
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_MESSAGING_FILTER_DESTROY, reinterpret_cast<void*>(JniMessagingFilterDestroy));
-
+
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_CREATE, reinterpret_cast<void*>(JniEventFilterCreate));
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_APPLY, reinterpret_cast<void*>(JniEventFilterApply));
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_EVENT_FILTER_DESTROY, reinterpret_cast<void*>(JniEventFilterDestroy));
-
+
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_INIT, reinterpret_cast<void*>(JniServiceInit));
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_EXECUTE, reinterpret_cast<void*>(JniServiceExecute));
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_CANCEL, reinterpret_cast<void*>(JniServiceCancel));
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_SERVICE_INVOKE_METHOD, reinterpret_cast<void*>(JniServiceInvokeMethod));
-
+
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_CLUSTER_NODE_FILTER_APPLY, reinterpret_cast<void*>(JniClusterNodeFilterApply));
AddNativeMethod(methods + idx++, M_PLATFORM_CALLBACK_UTILS_NODE_INFO, reinterpret_cast<void*>(JniNodeInfo));
@@ -806,7 +832,7 @@ namespace ignite
if (res != JNI_OK)
throw JvmException();
- }
+ }
}
JniContext::JniContext(JniJvm* jvm, JniHandlers hnds) : jvm(jvm), hnds(hnds) {
@@ -950,7 +976,7 @@ namespace ignite
jobject JniContext::IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr) {
return IgnitionStart(cfgPath, name, factoryId, dataPtr, NULL);
}
-
+
jobject JniContext::IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr, JniErrorInfo* errInfo)
{
JNIEnv* env = Attach();
@@ -1146,7 +1172,7 @@ namespace ignite
return LocalToGlobal(env, tx);
}
-
+
jobject JniContext::ProcessorCompute(jobject obj, jobject prj) {
JNIEnv* env = Attach();
@@ -1186,7 +1212,7 @@ namespace ignite
return LocalToGlobal(env, res);
}
-
+
jobject JniContext::ProcessorExtensions(jobject obj)
{
JNIEnv* env = Attach();
@@ -1835,7 +1861,7 @@ namespace ignite
return res != 0;
}
-
+
jobject JniContext::ServicesWithAsync(jobject obj) {
JNIEnv* env = Attach();
@@ -2023,7 +2049,7 @@ namespace ignite
return obj0;
}
-
+
return NULL;
}
@@ -2031,14 +2057,14 @@ namespace ignite
if (obj)
{
JavaVM* jvm = JVM.GetJvm();
-
+
if (jvm)
{
JNIEnv* env;
jint attachRes = jvm->AttachCurrentThread(reinterpret_cast<void**>(&env), NULL);
- if (attachRes == JNI_OK)
+ if (attachRes == JNI_OK)
{
AttachHelper::OnThreadAttach();
@@ -2124,7 +2150,7 @@ namespace ignite
if (hnds.error)
hnds.error(hnds.target, IGNITE_JNI_ERR_GENERIC, clsName0.c_str(), clsNameLen, msg0.c_str(), msgLen,
errBytesNative, errBytesLen);
-
+
env->ReleaseByteArrayElements(errData, errBytesNative, JNI_ABORT);
}
else
@@ -2133,7 +2159,7 @@ namespace ignite
hnds.error(hnds.target, IGNITE_JNI_ERR_GENERIC, clsName0.c_str(), clsNameLen, msg0.c_str(), msgLen,
NULL, 0);
}
-
+
env->DeleteLocalRef(err);
}
}
@@ -2161,7 +2187,22 @@ namespace ignite
}
JNIEXPORT jint JNICALL JniCacheStoreInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr, jlong memPtr, jobject cb) {
- IGNITE_SAFE_FUNC(env, envPtr, CacheStoreInvokeHandler, cacheStoreInvoke, objPtr, memPtr, cb);
+ if (cb)
+ {
+ jobject cb0 = env->NewGlobalRef(cb);
+
+ if (cb0)
+ {
+ JniGlobalRefGuard guard(env, cb0);
+
+ IGNITE_SAFE_FUNC(env, envPtr, CacheStoreInvokeHandler, cacheStoreInvoke, objPtr, memPtr, cb0);
+ }
+ else
+ return 0;
+ }
+ else {
+ IGNITE_SAFE_FUNC(env, envPtr, CacheStoreInvokeHandler, cacheStoreInvoke, objPtr, memPtr, NULL);
+ }
}
JNIEXPORT void JNICALL JniCacheStoreDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr) {
@@ -2223,7 +2264,7 @@ namespace ignite
JNIEXPORT void JNICALL JniComputeJobDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr) {
IGNITE_SAFE_PROC(env, envPtr, ComputeJobDestroyHandler, computeJobDestroy, jobPtr);
}
-
+
JNIEXPORT void JNICALL JniContinuousQueryListenerApply(JNIEnv *env, jclass cls, jlong envPtr, jlong cbPtr, jlong memPtr) {
IGNITE_SAFE_PROC(env, envPtr, ContinuousQueryListenerApplyHandler, contQryLsnrApply, cbPtr, memPtr);
}
@@ -2245,7 +2286,14 @@ namespace ignite
}
JNIEXPORT void JNICALL JniDataStreamerStreamReceiverInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jobject cache, jlong memPtr, jboolean keepPortable) {
- IGNITE_SAFE_PROC(env, envPtr, DataStreamerStreamReceiverInvokeHandler, streamReceiverInvoke, ptr, cache, memPtr, keepPortable);
+ jobject cache0 = env->NewGlobalRef(cache);
+
+ if (cache0)
+ {
+ JniGlobalRefGuard guard(env, cache0);
+
+ IGNITE_SAFE_PROC(env, envPtr, DataStreamerStreamReceiverInvokeHandler, streamReceiverInvoke, ptr, cache0, memPtr, keepPortable);
+ }
}
JNIEXPORT void JNICALL JniFutureByteResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res) {
@@ -2311,7 +2359,7 @@ namespace ignite
JNIEXPORT void JNICALL JniMessagingFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr) {
IGNITE_SAFE_PROC(env, envPtr, MessagingFilterDestroyHandler, messagingFilterDestroy, ptr);
}
-
+
JNIEXPORT jlong JNICALL JniEventFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr) {
IGNITE_SAFE_FUNC(env, envPtr, EventFilterCreateHandler, eventFilterCreate, memPtr);
}
@@ -2355,7 +2403,7 @@ namespace ignite
JNIEXPORT void JNICALL JniOnStop(JNIEnv *env, jclass cls, jlong envPtr) {
IGNITE_SAFE_PROC_NO_ARG(env, envPtr, OnStopHandler, onStop);
}
-
+
JNIEXPORT jlong JNICALL JniExtensionCallbackInLongOutLong(JNIEnv *env, jclass cls, jlong envPtr, jint typ, jlong arg1) {
IGNITE_SAFE_FUNC(env, envPtr, ExtensionCallbackInLongOutLongHandler, extensionCallbackInLongOutLong, typ, arg1);
}
[5/6] ignite git commit: Merge branch 'ignite-1847' into ignite-1816
Posted by vo...@apache.org.
Merge branch 'ignite-1847' into ignite-1816
Conflicts:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/158b0fdc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/158b0fdc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/158b0fdc
Branch: refs/heads/ignite-1816
Commit: 158b0fdcd7792ad2b60d2c9dac7996729a6b30b3
Parents: bb46df1 07f9055
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Nov 16 10:33:42 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Nov 16 10:33:42 2015 +0300
----------------------------------------------------------------------
.../CacheObjectBinaryProcessorImpl.java | 40 +++----
.../cache/portable/PortableMetaDataKey.java | 82 --------------
.../cache/portable/PortableMetadataKey.java | 82 ++++++++++++++
modules/platforms/cpp/common/src/java.cpp | 110 +++++++++++++------
4 files changed, 181 insertions(+), 133 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/158b0fdc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
index 6538b14,05cfb5f..c581dd3
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
@@@ -292,25 -294,27 +292,25 @@@ public class CacheObjectBinaryProcessor
* @param key Metadata key.
* @param newMeta Metadata.
*/
- private void addClientCacheMetaData(PortableMetaDataKey key, final BinaryMetadata newMeta) {
+ private void addClientCacheMetaData(PortableMetadataKey key, final BinaryMetadata newMeta) {
int key0 = key.typeId();
- clientMetaDataCache.compute(key0,
- new ConcurrentHashMap8.BiFun<Integer, BinaryTypeImpl, BinaryTypeImpl>() {
- @Override public BinaryTypeImpl apply(Integer key, BinaryTypeImpl oldMeta) {
- BinaryMetadata res;
+ clientMetaDataCache.compute(key0, new ConcurrentHashMap8.BiFun<Integer, BinaryTypeImpl, BinaryTypeImpl>() {
+ @Override public BinaryTypeImpl apply(Integer key, BinaryTypeImpl oldMeta) {
+ BinaryMetadata res;
- BinaryMetadata oldMeta0 = oldMeta != null ? oldMeta.metadata() : null;
+ BinaryMetadata oldMeta0 = oldMeta != null ? oldMeta.metadata() : null;
- try {
- res = checkMeta(key, oldMeta0, newMeta, null) ? newMeta : oldMeta0;
- }
- catch (BinaryObjectException e) {
- res = oldMeta0;
- }
-
- return res != null ? res.wrap(portableCtx) : null;
+ try {
+ res = PortableUtils.mergeMetadata(oldMeta0, newMeta);
+ }
+ catch (BinaryObjectException e) {
+ res = oldMeta0;
}
+
+ return res != null ? res.wrap(portableCtx) : null;
}
- );
+ });
}
/** {@inheritDoc} */
[6/6] ignite git commit: IGNITE-1816: Fixes after merge.
Posted by vo...@apache.org.
IGNITE-1816: Fixes after merge.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3f2320e2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3f2320e2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3f2320e2
Branch: refs/heads/ignite-1816
Commit: 3f2320e2b822626dd79a5ea426acb59e2d7e1cef
Parents: 158b0fd
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Nov 16 10:49:55 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Nov 16 10:49:55 2015 +0300
----------------------------------------------------------------------
.../cache/portable/CacheObjectBinaryProcessorImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3f2320e2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
index c581dd3..f2d1d24 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
@@ -725,7 +725,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
* Processor responsible for metadata update.
*/
private static class MetadataProcessor
- implements EntryProcessor<PortableMetaDataKey, BinaryMetadata, BinaryObjectException>, Externalizable {
+ implements EntryProcessor<PortableMetadataKey, BinaryMetadata, BinaryObjectException>, Externalizable {
/** */
private static final long serialVersionUID = 0L;
@@ -749,7 +749,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
}
/** {@inheritDoc} */
- @Override public BinaryObjectException process(MutableEntry<PortableMetaDataKey, BinaryMetadata> entry,
+ @Override public BinaryObjectException process(MutableEntry<PortableMetadataKey, BinaryMetadata> entry,
Object... args) {
try {
BinaryMetadata oldMeta = entry.getValue();
[4/6] ignite git commit: Merge branch 'ignite-1282' into ignite-1847
Posted by vo...@apache.org.
Merge branch 'ignite-1282' into ignite-1847
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/07f90555
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/07f90555
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/07f90555
Branch: refs/heads/ignite-1816
Commit: 07f90555c5ab1f377677727bf35ef307cd056fac
Parents: 3301446 25292c7
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Nov 16 10:30:13 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Nov 16 10:30:13 2015 +0300
----------------------------------------------------------------------
modules/platforms/cpp/common/src/java.cpp | 110 ++++++++++++++++++-------
1 file changed, 79 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
[2/6] ignite git commit: IGNITE-1847: WIP.
Posted by vo...@apache.org.
IGNITE-1847: WIP.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/33014462
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/33014462
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/33014462
Branch: refs/heads/ignite-1816
Commit: 330144620aade982b592f1d323898a2892125347
Parents: 65edfbc
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Nov 11 13:29:35 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Nov 11 13:29:35 2015 +0300
----------------------------------------------------------------------
.../CacheObjectBinaryProcessorImpl.java | 44 +++++------
.../cache/portable/PortableMetadataKey.java | 82 ++++++++++++++++++++
.../cache/portable/PortableMetadataKey2.java | 82 --------------------
3 files changed, 104 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/33014462/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
index d765197..05cfb5f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
@@ -110,7 +110,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
private final boolean clientNode;
/** */
- private volatile IgniteCacheProxy<PortableMetadataKey2, BinaryMetadata> metaDataCache;
+ private volatile IgniteCacheProxy<PortableMetadataKey, BinaryMetadata> metaDataCache;
/** */
private final ConcurrentHashMap8<Integer, BinaryTypeImpl> clientMetaDataCache;
@@ -120,7 +120,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
private static final long serialVersionUID = 0L;
@Override public boolean apply(GridCacheEntryEx e) {
- return e.key().value(e.context().cacheObjectContext(), false) instanceof PortableMetadataKey2;
+ return e.key().value(e.context().cacheObjectContext(), false) instanceof PortableMetadataKey;
}
};
@@ -238,7 +238,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
GridCacheQueryManager qryMgr = metaDataCache.context().queries();
- CacheQuery<Map.Entry<PortableMetadataKey2, BinaryMetadata>> qry =
+ CacheQuery<Map.Entry<PortableMetadataKey, BinaryMetadata>> qry =
qryMgr.createScanQuery(new MetaDataPredicate(), null, false);
qry.keepAll(false);
@@ -246,9 +246,9 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
qry.projection(ctx.cluster().get().forNode(oldestSrvNode));
try {
- CacheQueryFuture<Map.Entry<PortableMetadataKey2, BinaryMetadata>> fut = qry.execute();
+ CacheQueryFuture<Map.Entry<PortableMetadataKey, BinaryMetadata>> fut = qry.execute();
- Map.Entry<PortableMetadataKey2, BinaryMetadata> next;
+ Map.Entry<PortableMetadataKey, BinaryMetadata> next;
while ((next = fut.next()) != null) {
assert next.getKey() != null : next;
@@ -294,7 +294,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
* @param key Metadata key.
* @param newMeta Metadata.
*/
- private void addClientCacheMetaData(PortableMetadataKey2 key, final BinaryMetadata newMeta) {
+ private void addClientCacheMetaData(PortableMetadataKey key, final BinaryMetadata newMeta) {
int key0 = key.typeId();
clientMetaDataCache.compute(key0,
@@ -460,7 +460,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
BinaryMetadata newMeta0 = ((BinaryTypeImpl)newMeta).metadata();
- final PortableMetadataKey2 key = new PortableMetadataKey2(typeId);
+ final PortableMetadataKey key = new PortableMetadataKey(typeId);
try {
BinaryMetadata oldMeta = metaDataCache.localPeek(key);
@@ -483,7 +483,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
if (clientNode)
return clientMetaDataCache.get(typeId);
else {
- BinaryMetadata meta = metaDataCache.localPeek(new PortableMetadataKey2(typeId));
+ BinaryMetadata meta = metaDataCache.localPeek(new PortableMetadataKey(typeId));
return meta != null ? meta.wrap(portableCtx) : null;
}
@@ -497,16 +497,16 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
@Override public Map<Integer, BinaryType> metadata(Collection<Integer> typeIds)
throws BinaryObjectException {
try {
- Collection<PortableMetadataKey2> keys = new ArrayList<>(typeIds.size());
+ Collection<PortableMetadataKey> keys = new ArrayList<>(typeIds.size());
for (Integer typeId : typeIds)
- keys.add(new PortableMetadataKey2(typeId));
+ keys.add(new PortableMetadataKey(typeId));
- Map<PortableMetadataKey2, BinaryMetadata> meta = metaDataCache.getAll(keys);
+ Map<PortableMetadataKey, BinaryMetadata> meta = metaDataCache.getAll(keys);
Map<Integer, BinaryType> res = U.newHashMap(meta.size());
- for (Map.Entry<PortableMetadataKey2, BinaryMetadata> e : meta.entrySet())
+ for (Map.Entry<PortableMetadataKey, BinaryMetadata> e : meta.entrySet())
res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx));
return res;
@@ -527,10 +527,10 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
});
else {
return F.viewReadOnly(metaDataCache.entrySetx(metaPred),
- new C1<Cache.Entry<PortableMetadataKey2, BinaryMetadata>, BinaryType>() {
+ new C1<Cache.Entry<PortableMetadataKey, BinaryMetadata>, BinaryType>() {
private static final long serialVersionUID = 0L;
- @Override public BinaryType apply(Cache.Entry<PortableMetadataKey2, BinaryMetadata> e) {
+ @Override public BinaryType apply(Cache.Entry<PortableMetadataKey, BinaryMetadata> e) {
return e.getValue().wrap(portableCtx);
}
});
@@ -799,7 +799,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/**
*/
private static class MetaDataProcessor implements
- EntryProcessor<PortableMetadataKey2, BinaryMetadata, BinaryObjectException>, Externalizable {
+ EntryProcessor<PortableMetadataKey, BinaryMetadata, BinaryObjectException>, Externalizable {
/** */
private static final long serialVersionUID = 0L;
@@ -829,7 +829,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public BinaryObjectException process(
- MutableEntry<PortableMetadataKey2, BinaryMetadata> entry,
+ MutableEntry<PortableMetadataKey, BinaryMetadata> entry,
Object... args) {
try {
BinaryMetadata oldMeta = entry.getValue();
@@ -873,15 +873,15 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/**
*
*/
- class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetadataKey2, BinaryMetadata> {
+ class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetadataKey, BinaryMetadata> {
/** {@inheritDoc} */
@Override public void onUpdated(
- Iterable<CacheEntryEvent<? extends PortableMetadataKey2, ? extends BinaryMetadata>> evts)
+ Iterable<CacheEntryEvent<? extends PortableMetadataKey, ? extends BinaryMetadata>> evts)
throws CacheEntryListenerException {
- for (CacheEntryEvent<? extends PortableMetadataKey2, ? extends BinaryMetadata> evt : evts) {
+ for (CacheEntryEvent<? extends PortableMetadataKey, ? extends BinaryMetadata> evt : evts) {
assert evt.getEventType() == EventType.CREATED || evt.getEventType() == EventType.UPDATED : evt;
- PortableMetadataKey2 key = evt.getKey();
+ PortableMetadataKey key = evt.getKey();
final BinaryMetadata newMeta = evt.getValue();
@@ -906,7 +906,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public boolean evaluate(CacheEntryEvent<?, ?> evt) throws CacheEntryListenerException {
- return evt.getKey() instanceof PortableMetadataKey2;
+ return evt.getKey() instanceof PortableMetadataKey;
}
/** {@inheritDoc} */
@@ -924,7 +924,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public boolean apply(Object key, Object val) {
- return key instanceof PortableMetadataKey2;
+ return key instanceof PortableMetadataKey;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/33014462/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey.java
new file mode 100644
index 0000000..f838c82
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey.java
@@ -0,0 +1,82 @@
+/*
+ * 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.portable;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Key for portable meta data.
+ */
+class PortableMetadataKey extends GridCacheUtilityKey<PortableMetadataKey> implements Externalizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private int typeId;
+
+ /**
+ * For {@link Externalizable}.
+ */
+ public PortableMetadataKey() {
+ // No-op.
+ }
+
+ /**
+ * @param typeId Type ID.
+ */
+ PortableMetadataKey(int typeId) {
+ this.typeId = typeId;
+ }
+
+ /**
+ * @return Type id.
+ */
+ public int typeId() {
+ return typeId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeInt(typeId);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ typeId = in.readInt();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean equalsx(PortableMetadataKey key) {
+ return typeId == key.typeId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return typeId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(PortableMetadataKey.class, this);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/33014462/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java
deleted file mode 100644
index 4c99b70..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.portable;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Key for portable meta data.
- */
-class PortableMetadataKey2 extends GridCacheUtilityKey<PortableMetadataKey2> implements Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private int typeId;
-
- /**
- * For {@link Externalizable}.
- */
- public PortableMetadataKey2() {
- // No-op.
- }
-
- /**
- * @param typeId Type ID.
- */
- PortableMetadataKey2(int typeId) {
- this.typeId = typeId;
- }
-
- /**
- * @return Type id.
- */
- public int typeId() {
- return typeId;
- }
-
- /** {@inheritDoc} */
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- out.writeInt(typeId);
- }
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- typeId = in.readInt();
- }
-
- /** {@inheritDoc} */
- @Override protected boolean equalsx(PortableMetadataKey2 key) {
- return typeId == key.typeId;
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- return typeId;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(PortableMetadataKey2.class, this);
- }
-}
\ No newline at end of file