ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/26] ignite git commit: IGNITE-5577 Added missed fields to DTO.
Date Wed, 28 Jun 2017 06:10:40 GMT
IGNITE-5577 Added missed fields to DTO.


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

Branch: refs/heads/ignite-2.1.2-exchange
Commit: 1cb9772833261a14afc8aae3e6005df7fb28b83f
Parents: 4adfca9
Author: vsisko <vsisko@gridgain.com>
Authored: Wed Jun 28 10:44:33 2017 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Wed Jun 28 10:44:33 2017 +0700

----------------------------------------------------------------------
 .../internal/visor/VisorDataTransferObject.java |  8 ++++-
 .../node/VisorMemoryPolicyConfiguration.java    | 36 +++++++++++++++-----
 2 files changed, 35 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1cb97728/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
index c562662..8660891 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
@@ -35,6 +35,12 @@ public abstract class VisorDataTransferObject implements Externalizable
{
     /** Magic number to detect correct transfer objects. */
     private static final int MAGIC = 0x42BEEF00;
 
+    /** Version 1. */
+    protected static final byte V1 = 1;
+
+    /** Version 2. */
+    protected static final byte V2 = 2;
+
     /**
      * @param col Source collection.
      * @param <T> Collection type.
@@ -63,7 +69,7 @@ public abstract class VisorDataTransferObject implements Externalizable
{
      * @return Transfer object version.
      */
     public byte getProtocolVersion() {
-        return 1;
+        return V1;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1cb97728/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
index dedd71c..4f8d15e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
@@ -36,8 +36,11 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject
{
     /** Unique name of MemoryPolicy. */
     private String name;
 
-    /** Page memory size in bytes. */
-    private long size;
+    /** Maximum memory region size defined by this memory policy. */
+    private long maxSize;
+
+    /** Initial memory region size defined by this memory policy. */
+    private long initSize;
 
     /** Path for memory mapped file. */
     private String swapFilePath;
@@ -70,13 +73,19 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject
{
         assert plc != null;
 
         name = plc.getName();
-        size = plc.getMaxSize();
+        maxSize = plc.getMaxSize();
+        initSize = plc.getInitialSize();
         swapFilePath = plc.getSwapFilePath();
         pageEvictionMode = plc.getPageEvictionMode();
         evictionThreshold = plc.getEvictionThreshold();
         emptyPagesPoolSize = plc.getEmptyPagesPoolSize();
     }
 
+    /** {@inheritDoc} */
+    @Override public byte getProtocolVersion() {
+        return V2;
+    }
+
     /**
      * Unique name of MemoryPolicy.
      */
@@ -85,10 +94,17 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject
{
     }
 
     /**
-     * Page memory size in bytes.
+     * Maximum memory region size defined by this memory policy.
      */
-    public long getSize() {
-        return size;
+    public long getMaxSize() {
+        return maxSize;
+    }
+
+    /**
+     * Initial memory region size defined by this memory policy.
+     */
+    public long getInitSize() {
+        return initSize;
     }
 
     /**
@@ -122,21 +138,25 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject
{
     /** {@inheritDoc} */
     @Override protected void writeExternalData(ObjectOutput out) throws IOException {
         U.writeString(out, name);
-        out.writeLong(size);
+        out.writeLong(maxSize);
         U.writeString(out, swapFilePath);
         U.writeEnum(out, pageEvictionMode);
         out.writeDouble(evictionThreshold);
         out.writeInt(emptyPagesPoolSize);
+        out.writeLong(initSize);
     }
 
     /** {@inheritDoc} */
     @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException,
ClassNotFoundException {
         name = U.readString(in);
-        size = in.readLong();
+        maxSize = in.readLong();
         swapFilePath = U.readString(in);
         pageEvictionMode = DataPageEvictionMode.fromOrdinal(in.readByte());
         evictionThreshold = in.readDouble();
         emptyPagesPoolSize = in.readInt();
+
+        if (protoVer >= V2)
+            initSize = in.readLong();
     }
 
     /** {@inheritDoc} */


Mime
View raw message