You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/08/31 16:10:57 UTC
[04/18] ignite git commit: IGNITE-1331: Reworked "op" method names.
IGNITE-1331: Reworked "op" method names.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0995037c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0995037c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0995037c
Branch: refs/heads/ignite-843
Commit: 0995037cd5c6561f059089801b5fcfe1918c1b15
Parents: e6de574
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Aug 31 11:46:36 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Aug 31 11:46:36 2015 +0300
----------------------------------------------------------------------
.../platform/PlatformNoopProcessor.java | 5 +
.../processors/platform/PlatformProcessor.java | 7 +
.../processors/platform/PlatformTarget.java | 28 ++--
.../platform/PlatformAbstractTarget.java | 80 ++++++++----
.../platform/cache/PlatformCache.java | 127 ++++++++++---------
.../platform/cache/PlatformCacheIterator.java | 4 +-
.../cache/affinity/PlatformAffinity.java | 10 +-
.../query/PlatformAbstractQueryCursor.java | 4 +-
.../platform/cluster/PlatformClusterGroup.java | 21 +--
.../platform/compute/PlatformCompute.java | 11 +-
.../datastreamer/PlatformDataStreamer.java | 4 +-
.../platform/events/PlatformEvents.java | 20 +--
.../platform/messaging/PlatformMessaging.java | 11 +-
.../platform/services/PlatformServices.java | 33 +++--
.../transactions/PlatformTransactions.java | 4 +-
15 files changed, 215 insertions(+), 154 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java
index e60fbeb..7cb65d3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java
@@ -48,4 +48,9 @@ public class PlatformNoopProcessor extends GridProcessorAdapter implements Platf
@Override public void awaitStart() throws IgniteCheckedException {
// No-op.
}
+
+ /** {@inheritDoc} */
+ @Override public PlatformTarget extensions() {
+ return null;
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java
index 8c48649..0cf2df4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java
@@ -51,4 +51,11 @@ public interface PlatformProcessor extends GridProcessor {
* @throws IgniteCheckedException If failed.
*/
public void awaitStart() throws IgniteCheckedException;
+
+ /**
+ * Get platform extensions. Override this method to provide any additional targets and operations you need.
+ *
+ * @return Platform extensions.
+ */
+ PlatformTarget extensions();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java
index b444247..6a22453 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java
@@ -26,54 +26,54 @@ import org.jetbrains.annotations.*;
@SuppressWarnings("UnusedDeclaration")
public interface PlatformTarget {
/**
- * Synchronous IN operation.
+ * Operation accepting memory stream and returning long value.
*
* @param type Operation type.
* @param memPtr Memory pointer.
- * @return Value specific for the given operation otherwise.
- * @throws Exception If failed.
+ * @return Result.
+ * @throws Exception If case of failure.
*/
- public int inOp(int type, long memPtr) throws Exception;
+ public long inStreamOutLong(int type, long memPtr) throws Exception;
/**
- * Synchronous IN operation which returns managed object as result.
+ * Operation accepting memory stream and returning object.
*
* @param type Operation type.
* @param memPtr Memory pointer.
- * @return Managed result.
+ * @return Result.
* @throws Exception If case of failure.
*/
- public Object inOpObject(int type, long memPtr) throws Exception;
+ public Object inStreamOutObject(int type, long memPtr) throws Exception;
/**
- * Synchronous OUT operation.
+ * Operation returning result to memory stream.
*
* @param type Operation type.
* @param memPtr Memory pointer.
* @throws Exception In case of failure.
*/
- public void outOp(int type, long memPtr) throws Exception;
+ public void outStream(int type, long memPtr) throws Exception;
/**
- * Synchronous IN-OUT operation.
+ * Operation accepting one memory stream and returning result to another memory stream.
*
* @param type Operation type.
* @param inMemPtr Input memory pointer.
* @param outMemPtr Output memory pointer.
* @throws Exception In case of failure.
*/
- public void inOutOp(int type, long inMemPtr, long outMemPtr) throws Exception;
+ public void inStreamOutStream(int type, long inMemPtr, long outMemPtr) throws Exception;
/**
- * Synchronous IN-OUT operation with optional argument.
+ * Operation accepting an object and a memory stream and returning result to another memory stream.
*
* @param type Operation type.
+ * @param arg Argument (optional).
* @param inMemPtr Input memory pointer.
* @param outMemPtr Output memory pointer.
- * @param arg Argument (optional).
* @throws Exception In case of failure.
*/
- public void inOutOp(int type, long inMemPtr, long outMemPtr, @Nullable Object arg) throws Exception;
+ public void inObjectStreamOutStream(int type, @Nullable Object arg, long inMemPtr, long outMemPtr) throws Exception;
/**
* Start listening for the future.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
index 903df0a..5864a7e 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
@@ -55,7 +55,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
}
/** {@inheritDoc} */
- @Override public int inOp(int type, long memPtr) throws Exception {
+ @Override public long inStreamOutLong(int type, long memPtr) throws Exception {
try (PlatformMemory mem = platformCtx.memory().get(memPtr)) {
PortableRawReaderEx reader = platformCtx.reader(mem);
@@ -65,7 +65,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
return TRUE;
}
else
- return processInOp(type, reader);
+ return processInStreamOutLong(type, reader);
}
catch (Exception e) {
throw convertException(e);
@@ -73,11 +73,11 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
}
/** {@inheritDoc} */
- @Override public Object inOpObject(int type, long memPtr) throws Exception {
+ @Override public Object inStreamOutObject(int type, long memPtr) throws Exception {
try (PlatformMemory mem = platformCtx.memory().get(memPtr)) {
PortableRawReaderEx reader = platformCtx.reader(mem);
- return processInOpObject(type, reader);
+ return processInStreamOutObject(type, reader);
}
catch (Exception e) {
throw convertException(e);
@@ -85,13 +85,13 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
}
/** {@inheritDoc} */
- @Override public void outOp(int type, long memPtr) throws Exception {
+ @Override public void outStream(int type, long memPtr) throws Exception {
try (PlatformMemory mem = platformCtx.memory().get(memPtr)) {
PlatformOutputStream out = mem.output();
PortableRawWriterEx writer = platformCtx.writer(out);
- processOutOp(type, writer);
+ processOutStream(type, writer);
out.synchronize();
}
@@ -101,12 +101,27 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
}
/** {@inheritDoc} */
- @Override public void inOutOp(int type, long inMemPtr, long outMemPtr) throws Exception {
- inOutOp(type, inMemPtr, outMemPtr, null);
+ @Override public void inStreamOutStream(int type, long inMemPtr, long outMemPtr) throws Exception {
+ try (PlatformMemory inMem = platformCtx.memory().get(inMemPtr)) {
+ PortableRawReaderEx reader = platformCtx.reader(inMem);
+
+ try (PlatformMemory outMem = platformCtx.memory().get(outMemPtr)) {
+ PlatformOutputStream out = outMem.output();
+
+ PortableRawWriterEx writer = platformCtx.writer(out);
+
+ processInStreamOutStream(type, reader, writer);
+
+ out.synchronize();
+ }
+ }
+ catch (Exception e) {
+ throw convertException(e);
+ }
}
/** {@inheritDoc} */
- @Override public void inOutOp(int type, long inMemPtr, long outMemPtr, Object arg) throws Exception {
+ @Override public void inObjectStreamOutStream(int type, Object arg, long inMemPtr, long outMemPtr) throws Exception {
try (PlatformMemory inMem = platformCtx.memory().get(inMemPtr)) {
PortableRawReaderEx reader = platformCtx.reader(inMem);
@@ -115,7 +130,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
PortableRawWriterEx writer = platformCtx.writer(out);
- processInOutOp(type, reader, writer, arg);
+ processInObjectStreamOutStream(type, arg, reader, writer);
out.synchronize();
}
@@ -156,7 +171,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
* Get current future with proper exception conversions.
*
* @return Future.
- * @throws org.apache.ignite.IgniteCheckedException If failed.
+ * @throws IgniteCheckedException If failed.
*/
@SuppressWarnings({"ThrowableResultOfMethodCallIgnored", "unchecked"})
protected IgniteFuture currentFutureWrapped() throws IgniteCheckedException {
@@ -185,7 +200,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
* When overridden in a derived class, gets future for the current operation.
*
* @return current future.
- * @throws org.apache.ignite.IgniteCheckedException
+ * @throws IgniteCheckedException
*/
protected IgniteFuture currentFuture() throws IgniteCheckedException {
throw new IgniteCheckedException("Future listening is not supported in " + this.getClass());
@@ -207,46 +222,59 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
* @param type Type.
* @param reader Portable reader.
* @return Result.
- * @throws org.apache.ignite.IgniteCheckedException In case of exception.
+ * @throws IgniteCheckedException In case of exception.
*/
- protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ protected long processInStreamOutLong(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
return throwUnsupported(type);
}
/**
+ * Process IN-OUT operation.
+ *
+ * @param type Type.
+ * @param reader Portable reader.
+ * @param writer Portable writer.
+ * @throws IgniteCheckedException In case of exception.
+ */
+ protected void processInStreamOutStream(int type, PortableRawReaderEx reader, PortableRawWriterEx writer)
+ throws IgniteCheckedException {
+ throwUnsupported(type);
+ }
+
+ /**
* Process IN operation with managed object as result.
*
* @param type Type.
* @param reader Portable reader.
* @return Result.
- * @throws org.apache.ignite.IgniteCheckedException In case of exception.
+ * @throws IgniteCheckedException In case of exception.
*/
- protected Object processInOpObject(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ protected Object processInStreamOutObject(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
return throwUnsupported(type);
}
/**
- * Process OUT operation.
+ * Process IN-OUT operation.
*
* @param type Type.
+ * @param arg Argument.
+ * @param reader Portable reader.
* @param writer Portable writer.
- * @throws org.apache.ignite.IgniteCheckedException In case of exception.
+ * @throws IgniteCheckedException In case of exception.
*/
- protected void processOutOp(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
+ protected void processInObjectStreamOutStream(int type, @Nullable Object arg, PortableRawReaderEx reader,
+ PortableRawWriterEx writer) throws IgniteCheckedException {
throwUnsupported(type);
}
/**
- * Process IN-OUT operation.
+ * Process OUT operation.
*
* @param type Type.
- * @param reader Portable reader.
* @param writer Portable writer.
- * @param arg Argument.
- * @throws org.apache.ignite.IgniteCheckedException In case of exception.
+ * @throws IgniteCheckedException In case of exception.
*/
- protected void processInOutOp(int type, PortableRawReaderEx reader, PortableRawWriterEx writer,
- @Nullable Object arg) throws IgniteCheckedException {
+ protected void processOutStream(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
throwUnsupported(type);
}
@@ -255,7 +283,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
*
* @param type Operation type.
* @return Dummy value which is never returned.
- * @throws org.apache.ignite.IgniteCheckedException Exception to be thrown.
+ * @throws IgniteCheckedException Exception to be thrown.
*/
protected <T> T throwUnsupported(int type) throws IgniteCheckedException {
throw new IgniteCheckedException("Unsupported operation type: " + type);
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
index dff9d67..0347d4d 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
@@ -256,7 +256,7 @@ public class PlatformCache extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected long processInStreamOutLong(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
switch (type) {
case OP_PUT:
cache.put(reader.readObjectDetached(), reader.readObjectDetached());
@@ -343,7 +343,7 @@ public class PlatformCache extends PlatformAbstractTarget {
return cache.isLocalLocked(reader.readObjectDetached(), reader.readBoolean()) ? TRUE : FALSE;
default:
- throw new IgniteCheckedException("Unsupported operation type: " + type);
+ return super.processInStreamOutLong(type, reader);
}
return TRUE;
@@ -369,7 +369,7 @@ public class PlatformCache extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected Object processInOpObject(int type, PortableRawReaderEx reader)
+ @Override protected Object processInStreamOutObject(int type, PortableRawReaderEx reader)
throws IgniteCheckedException {
switch (type) {
case OP_QRY_SQL:
@@ -402,7 +402,7 @@ public class PlatformCache extends PlatformAbstractTarget {
}
default:
- return throwUnsupported(type);
+ return super.processInStreamOutObject(type, reader);
}
}
@@ -428,81 +428,81 @@ public class PlatformCache extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected void processOutOp(int type, PortableRawWriterEx w) throws IgniteCheckedException {
+ @Override protected void processOutStream(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
switch (type) {
case OP_GET_NAME:
- w.writeObject(cache.getName());
+ writer.writeObject(cache.getName());
break;
case OP_METRICS:
CacheMetrics metrics = cache.metrics();
- w.writeLong(metrics.getCacheGets());
- w.writeLong(metrics.getCachePuts());
- w.writeLong(metrics.getCacheHits());
- w.writeLong(metrics.getCacheMisses());
- w.writeLong(metrics.getCacheTxCommits());
- w.writeLong(metrics.getCacheTxRollbacks());
- w.writeLong(metrics.getCacheEvictions());
- w.writeLong(metrics.getCacheRemovals());
- w.writeFloat(metrics.getAveragePutTime());
- w.writeFloat(metrics.getAverageGetTime());
- w.writeFloat(metrics.getAverageRemoveTime());
- w.writeFloat(metrics.getAverageTxCommitTime());
- w.writeFloat(metrics.getAverageTxRollbackTime());
- w.writeString(metrics.name());
- w.writeLong(metrics.getOverflowSize());
- w.writeLong(metrics.getOffHeapEntriesCount());
- w.writeLong(metrics.getOffHeapAllocatedSize());
- w.writeInt(metrics.getSize());
- w.writeInt(metrics.getKeySize());
- w.writeBoolean(metrics.isEmpty());
- w.writeInt(metrics.getDhtEvictQueueCurrentSize());
- w.writeInt(metrics.getTxThreadMapSize());
- w.writeInt(metrics.getTxXidMapSize());
- w.writeInt(metrics.getTxCommitQueueSize());
- w.writeInt(metrics.getTxPrepareQueueSize());
- w.writeInt(metrics.getTxStartVersionCountsSize());
- w.writeInt(metrics.getTxCommittedVersionsSize());
- w.writeInt(metrics.getTxRolledbackVersionsSize());
- w.writeInt(metrics.getTxDhtThreadMapSize());
- w.writeInt(metrics.getTxDhtXidMapSize());
- w.writeInt(metrics.getTxDhtCommitQueueSize());
- w.writeInt(metrics.getTxDhtPrepareQueueSize());
- w.writeInt(metrics.getTxDhtStartVersionCountsSize());
- w.writeInt(metrics.getTxDhtCommittedVersionsSize());
- w.writeInt(metrics.getTxDhtRolledbackVersionsSize());
- w.writeBoolean(metrics.isWriteBehindEnabled());
- w.writeInt(metrics.getWriteBehindFlushSize());
- w.writeInt(metrics.getWriteBehindFlushThreadCount());
- w.writeLong(metrics.getWriteBehindFlushFrequency());
- w.writeInt(metrics.getWriteBehindStoreBatchSize());
- w.writeInt(metrics.getWriteBehindTotalCriticalOverflowCount());
- w.writeInt(metrics.getWriteBehindCriticalOverflowCount());
- w.writeInt(metrics.getWriteBehindErrorRetryCount());
- w.writeInt(metrics.getWriteBehindBufferSize());
- w.writeString(metrics.getKeyType());
- w.writeString(metrics.getValueType());
- w.writeBoolean(metrics.isStoreByValue());
- w.writeBoolean(metrics.isStatisticsEnabled());
- w.writeBoolean(metrics.isManagementEnabled());
- w.writeBoolean(metrics.isReadThrough());
- w.writeBoolean(metrics.isWriteThrough());
- w.writeFloat(metrics.getCacheHitPercentage());
- w.writeFloat(metrics.getCacheMissPercentage());
+ writer.writeLong(metrics.getCacheGets());
+ writer.writeLong(metrics.getCachePuts());
+ writer.writeLong(metrics.getCacheHits());
+ writer.writeLong(metrics.getCacheMisses());
+ writer.writeLong(metrics.getCacheTxCommits());
+ writer.writeLong(metrics.getCacheTxRollbacks());
+ writer.writeLong(metrics.getCacheEvictions());
+ writer.writeLong(metrics.getCacheRemovals());
+ writer.writeFloat(metrics.getAveragePutTime());
+ writer.writeFloat(metrics.getAverageGetTime());
+ writer.writeFloat(metrics.getAverageRemoveTime());
+ writer.writeFloat(metrics.getAverageTxCommitTime());
+ writer.writeFloat(metrics.getAverageTxRollbackTime());
+ writer.writeString(metrics.name());
+ writer.writeLong(metrics.getOverflowSize());
+ writer.writeLong(metrics.getOffHeapEntriesCount());
+ writer.writeLong(metrics.getOffHeapAllocatedSize());
+ writer.writeInt(metrics.getSize());
+ writer.writeInt(metrics.getKeySize());
+ writer.writeBoolean(metrics.isEmpty());
+ writer.writeInt(metrics.getDhtEvictQueueCurrentSize());
+ writer.writeInt(metrics.getTxThreadMapSize());
+ writer.writeInt(metrics.getTxXidMapSize());
+ writer.writeInt(metrics.getTxCommitQueueSize());
+ writer.writeInt(metrics.getTxPrepareQueueSize());
+ writer.writeInt(metrics.getTxStartVersionCountsSize());
+ writer.writeInt(metrics.getTxCommittedVersionsSize());
+ writer.writeInt(metrics.getTxRolledbackVersionsSize());
+ writer.writeInt(metrics.getTxDhtThreadMapSize());
+ writer.writeInt(metrics.getTxDhtXidMapSize());
+ writer.writeInt(metrics.getTxDhtCommitQueueSize());
+ writer.writeInt(metrics.getTxDhtPrepareQueueSize());
+ writer.writeInt(metrics.getTxDhtStartVersionCountsSize());
+ writer.writeInt(metrics.getTxDhtCommittedVersionsSize());
+ writer.writeInt(metrics.getTxDhtRolledbackVersionsSize());
+ writer.writeBoolean(metrics.isWriteBehindEnabled());
+ writer.writeInt(metrics.getWriteBehindFlushSize());
+ writer.writeInt(metrics.getWriteBehindFlushThreadCount());
+ writer.writeLong(metrics.getWriteBehindFlushFrequency());
+ writer.writeInt(metrics.getWriteBehindStoreBatchSize());
+ writer.writeInt(metrics.getWriteBehindTotalCriticalOverflowCount());
+ writer.writeInt(metrics.getWriteBehindCriticalOverflowCount());
+ writer.writeInt(metrics.getWriteBehindErrorRetryCount());
+ writer.writeInt(metrics.getWriteBehindBufferSize());
+ writer.writeString(metrics.getKeyType());
+ writer.writeString(metrics.getValueType());
+ writer.writeBoolean(metrics.isStoreByValue());
+ writer.writeBoolean(metrics.isStatisticsEnabled());
+ writer.writeBoolean(metrics.isManagementEnabled());
+ writer.writeBoolean(metrics.isReadThrough());
+ writer.writeBoolean(metrics.isWriteThrough());
+ writer.writeFloat(metrics.getCacheHitPercentage());
+ writer.writeFloat(metrics.getCacheMissPercentage());
break;
default:
- throwUnsupported(type);
+ super.processOutStream(type, writer);
}
}
/** {@inheritDoc} */
@SuppressWarnings({"IfMayBeConditional", "ConstantConditions"})
- @Override protected void processInOutOp(int type, PortableRawReaderEx reader, PortableRawWriterEx writer,
- Object arg) throws IgniteCheckedException {
+ @Override protected void processInStreamOutStream(int type, PortableRawReaderEx reader, PortableRawWriterEx writer)
+ throws IgniteCheckedException {
switch (type) {
case OP_GET: {
writer.writeObjectDetached(cache.get(reader.readObjectDetached()));
@@ -593,6 +593,9 @@ public class PlatformCache extends PlatformAbstractTarget {
writer.writeLong(registerLock(cache.lockAll(PlatformUtils.readCollection(reader))));
break;
+
+ default:
+ super.processInStreamOutStream(type, reader, writer);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator.java
index 45e777d..7494fc8 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheIterator.java
@@ -47,7 +47,7 @@ public class PlatformCacheIterator extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected void processOutOp(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
+ @Override protected void processOutStream(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
switch (type) {
case OP_NEXT:
if (iter.hasNext()) {
@@ -66,7 +66,7 @@ public class PlatformCacheIterator extends PlatformAbstractTarget {
break;
default:
- throwUnsupported(type);
+ super.processOutStream(type, writer);
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/affinity/PlatformAffinity.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/affinity/PlatformAffinity.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/affinity/PlatformAffinity.java
index d6dfcdb..4c134be 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/affinity/PlatformAffinity.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/affinity/PlatformAffinity.java
@@ -110,7 +110,7 @@ public class PlatformAffinity extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected long processInStreamOutLong(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
switch (type) {
case OP_PARTITION:
return aff.partition(reader.readObjectDetached());
@@ -155,14 +155,14 @@ public class PlatformAffinity extends PlatformAbstractTarget {
}
default:
- return throwUnsupported(type);
+ return super.processInStreamOutLong(type, reader);
}
}
/** {@inheritDoc} */
@SuppressWarnings({"IfMayBeConditional", "ConstantConditions"})
- @Override protected void processInOutOp(int type, PortableRawReaderEx reader, PortableRawWriterEx writer,
- Object arg) throws IgniteCheckedException {
+ @Override protected void processInStreamOutStream(int type, PortableRawReaderEx reader, PortableRawWriterEx writer)
+ throws IgniteCheckedException {
switch (type) {
case OP_PRIMARY_PARTITIONS: {
UUID nodeId = reader.readObject();
@@ -280,7 +280,7 @@ public class PlatformAffinity extends PlatformAbstractTarget {
}
default:
- throwUnsupported(type);
+ super.processInStreamOutStream(type, reader, writer);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformAbstractQueryCursor.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformAbstractQueryCursor.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformAbstractQueryCursor.java
index c01da0e..c357535 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformAbstractQueryCursor.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformAbstractQueryCursor.java
@@ -62,7 +62,7 @@ public abstract class PlatformAbstractQueryCursor<T> extends PlatformAbstractTar
}
/** {@inheritDoc} */
- @Override protected void processOutOp(int type, final PortableRawWriterEx writer) throws IgniteCheckedException {
+ @Override protected void processOutStream(int type, final PortableRawWriterEx writer) throws IgniteCheckedException {
switch (type) {
case OP_GET_BATCH: {
assert iter != null : "iterator() has not been called";
@@ -123,7 +123,7 @@ public abstract class PlatformAbstractQueryCursor<T> extends PlatformAbstractTar
}
default:
- throwUnsupported(type);
+ super.processOutStream(type, writer);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java
index 1f2a002..6aebce0 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java
@@ -90,7 +90,7 @@ public class PlatformClusterGroup extends PlatformAbstractTarget {
/** {@inheritDoc} */
@SuppressWarnings("deprecation")
- @Override protected void processOutOp(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
+ @Override protected void processOutStream(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
switch (type) {
case OP_METRICS:
platformCtx.writeClusterMetrics(writer, prj.metrics());
@@ -103,14 +103,14 @@ public class PlatformClusterGroup extends PlatformAbstractTarget {
break;
default:
- throwUnsupported(type);
+ super.processOutStream(type, writer);
}
}
/** {@inheritDoc} */
@SuppressWarnings({"ConstantConditions", "deprecation"})
- @Override protected void processInOutOp(int type, PortableRawReaderEx reader, PortableRawWriterEx writer,
- Object obj) throws IgniteCheckedException {
+ @Override protected void processInStreamOutStream(int type, PortableRawReaderEx reader, PortableRawWriterEx writer)
+ throws IgniteCheckedException {
switch (type) {
case OP_METRICS_FILTERED: {
Collection<UUID> ids = PlatformUtils.readCollection(reader);
@@ -185,22 +185,23 @@ public class PlatformClusterGroup extends PlatformAbstractTarget {
}
default:
- throwUnsupported(type);
+ super.processInStreamOutStream(type, reader, writer);
}
}
/** {@inheritDoc} */
- @Override protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected long processInStreamOutLong(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
switch (type) {
case OP_PING_NODE:
return pingNode(reader.readUuid()) ? TRUE : FALSE;
- }
- return throwUnsupported(type);
+ default:
+ return super.processInStreamOutLong(type, reader);
+ }
}
/** {@inheritDoc} */
- @Override protected Object processInOpObject(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected Object processInStreamOutObject(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
switch (type) {
case OP_FOR_NODE_IDS: {
Collection<UUID> ids = PlatformUtils.readCollection(reader);
@@ -239,7 +240,7 @@ public class PlatformClusterGroup extends PlatformAbstractTarget {
}
default:
- return throwUnsupported(type);
+ return super.processInStreamOutObject(type, reader);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
index 2b1f6be..3a0d031 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
@@ -67,7 +67,7 @@ public class PlatformCompute extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected long processInStreamOutLong(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
switch (type) {
case OP_UNICAST:
processClosures(reader.readLong(), reader, false, false);
@@ -85,7 +85,7 @@ public class PlatformCompute extends PlatformAbstractTarget {
return TRUE;
default:
- return throwUnsupported(type);
+ return super.processInStreamOutLong(type, reader);
}
}
@@ -162,8 +162,8 @@ public class PlatformCompute extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected void processInOutOp(int type, PortableRawReaderEx reader, PortableRawWriterEx writer,
- Object arg) throws IgniteCheckedException {
+ @Override protected void processInStreamOutStream(int type, PortableRawReaderEx reader, PortableRawWriterEx writer)
+ throws IgniteCheckedException {
switch (type) {
case OP_EXEC:
writer.writeObjectDetached(executeJavaTask(reader, false));
@@ -174,8 +174,9 @@ public class PlatformCompute extends PlatformAbstractTarget {
writer.writeObjectDetached(executeJavaTask(reader, true));
break;
+
default:
- throwUnsupported(type);
+ super.processInStreamOutStream(type, reader, writer);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
index fc9f535..f953d36 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
@@ -83,7 +83,7 @@ public class PlatformDataStreamer extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected long processInStreamOutLong(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
switch (type) {
case OP_UPDATE:
int plc = reader.readInt();
@@ -132,7 +132,7 @@ public class PlatformDataStreamer extends PlatformAbstractTarget {
return TRUE;
default:
- return throwUnsupported(type);
+ return super.processInStreamOutLong(type, reader);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java
index befc3bd..257c291 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEvents.java
@@ -130,11 +130,12 @@ public class PlatformEvents extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected long processInStreamOutLong(int type, PortableRawReaderEx reader)
+ throws IgniteCheckedException {
switch (type) {
case OP_RECORD_LOCAL:
// TODO: GG-10244
- break;
+ return TRUE;
case OP_ENABLE_LOCAL:
@@ -152,15 +153,16 @@ public class PlatformEvents extends PlatformAbstractTarget {
events.stopRemoteListen(reader.readUuid());
return TRUE;
- }
- throw new IgniteCheckedException("Unsupported operation type: " + type);
+ default:
+ return super.processInStreamOutLong(type, reader);
+ }
}
/** {@inheritDoc} */
@SuppressWarnings({"IfMayBeConditional", "ConstantConditions", "unchecked"})
- @Override protected void processInOutOp(int type, PortableRawReaderEx reader, PortableRawWriterEx writer,
- Object arg) throws IgniteCheckedException {
+ @Override protected void processInStreamOutStream(int type, PortableRawReaderEx reader, PortableRawWriterEx writer)
+ throws IgniteCheckedException {
switch (type) {
case OP_LOCAL_QUERY: {
Collection<EventAdapter> result =
@@ -242,12 +244,12 @@ public class PlatformEvents extends PlatformAbstractTarget {
}
default:
- throw new IgniteCheckedException("Unsupported operation type: " + type);
+ super.processInStreamOutStream(type, reader, writer);
}
}
/** {@inheritDoc} */
- @Override protected void processOutOp(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
+ @Override protected void processOutStream(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
switch (type) {
case OP_GET_ENABLED_EVENTS:
writeEventTypes(events.enabledEvents(), writer);
@@ -255,7 +257,7 @@ public class PlatformEvents extends PlatformAbstractTarget {
break;
default:
- throwUnsupported(type);
+ super.processOutStream(type, writer);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessaging.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessaging.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessaging.java
index ffc2ab3..c09e149 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessaging.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessaging.java
@@ -81,7 +81,8 @@ public class PlatformMessaging extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected long processInStreamOutLong(int type, PortableRawReaderEx reader)
+ throws IgniteCheckedException {
switch (type) {
case OP_SEND:
messaging.send(reader.readObjectDetached(), reader.readObjectDetached());
@@ -125,14 +126,14 @@ public class PlatformMessaging extends PlatformAbstractTarget {
}
default:
- throw new IgniteCheckedException("Unsupported operation type: " + type);
+ return super.processInStreamOutLong(type, reader);
}
}
/** {@inheritDoc} */
@SuppressWarnings({"IfMayBeConditional", "ConstantConditions", "unchecked"})
- @Override protected void processInOutOp(int type, PortableRawReaderEx reader, PortableRawWriterEx writer,
- Object arg) throws IgniteCheckedException {
+ @Override protected void processInStreamOutStream(int type, PortableRawReaderEx reader, PortableRawWriterEx writer)
+ throws IgniteCheckedException {
switch (type) {
case OP_REMOTE_LISTEN:{
Object nativeFilter = reader.readObjectDetached();
@@ -151,7 +152,7 @@ public class PlatformMessaging extends PlatformAbstractTarget {
}
default:
- throw new IgniteCheckedException("Unsupported operation type: " + type);
+ super.processInStreamOutStream(type, reader, writer);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
index d0956f9..36a7147 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
@@ -118,7 +118,8 @@ public class PlatformServices extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected int processInOp(int type, PortableRawReaderEx reader) throws IgniteCheckedException {
+ @Override protected long processInStreamOutLong(int type, PortableRawReaderEx reader)
+ throws IgniteCheckedException {
switch (type) {
case OP_DOTNET_DEPLOY: {
ServiceConfiguration cfg = new ServiceConfiguration();
@@ -151,14 +152,15 @@ public class PlatformServices extends PlatformAbstractTarget {
return TRUE;
}
- }
- return super.processInOp(type, reader);
+ default:
+ return super.processInStreamOutLong(type, reader);
+ }
}
/** {@inheritDoc} */
- @Override protected void processInOutOp(int type, PortableRawReaderEx reader, PortableRawWriterEx writer,
- Object arg) throws IgniteCheckedException {
+ @Override protected void processInStreamOutStream(int type, PortableRawReaderEx reader, PortableRawWriterEx writer)
+ throws IgniteCheckedException {
switch (type) {
case OP_DOTNET_SERVICES: {
Collection<Service> svcs = services.services(reader.readString());
@@ -179,6 +181,15 @@ public class PlatformServices extends PlatformAbstractTarget {
return;
}
+ default:
+ super.processInStreamOutStream(type, reader, writer);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void processInObjectStreamOutStream(int type, Object arg, PortableRawReaderEx reader,
+ PortableRawWriterEx writer) throws IgniteCheckedException {
+ switch (type) {
case OP_DOTNET_INVOKE: {
assert arg != null;
assert arg instanceof PlatformDotNetService;
@@ -207,13 +218,14 @@ public class PlatformServices extends PlatformAbstractTarget {
return;
}
- }
- super.processInOutOp(type, reader, writer, arg);
+ default:
+ super.processInObjectStreamOutStream(type, arg, reader, writer);
+ }
}
/** {@inheritDoc} */
- @Override protected void processOutOp(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
+ @Override protected void processOutStream(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
switch (type) {
case OP_DESCRIPTORS: {
Collection<ServiceDescriptor> descs = services.serviceDescriptors();
@@ -240,9 +252,10 @@ public class PlatformServices extends PlatformAbstractTarget {
return;
}
- }
- super.processOutOp(type, writer);
+ default:
+ super.processOutStream(type, writer);
+ }
}
/** <inheritDoc /> */
http://git-wip-us.apache.org/repos/asf/ignite/blob/0995037c/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/transactions/PlatformTransactions.java
----------------------------------------------------------------------
diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/transactions/PlatformTransactions.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/transactions/PlatformTransactions.java
index aedc380..d717255 100644
--- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/transactions/PlatformTransactions.java
+++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/transactions/PlatformTransactions.java
@@ -227,7 +227,7 @@ public class PlatformTransactions extends PlatformAbstractTarget {
}
/** {@inheritDoc} */
- @Override protected void processOutOp(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
+ @Override protected void processOutStream(int type, PortableRawWriterEx writer) throws IgniteCheckedException {
switch (type) {
case OP_CACHE_CONFIG_PARAMETERS:
TransactionConfiguration txCfg = platformCtx.kernalContext().config().getTransactionConfiguration();
@@ -249,7 +249,7 @@ public class PlatformTransactions extends PlatformAbstractTarget {
break;
default:
- throwUnsupported(type);
+ super.processOutStream(type, writer);
}
}
}
\ No newline at end of file