ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [39/50] [abbrv] ignite git commit: GG-11750 Implemented DELETE command and minor refactorings.
Date Thu, 29 Dec 2016 09:37:43 GMT
GG-11750 Implemented DELETE command and minor refactorings.


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

Branch: refs/heads/ignite-3477
Commit: 7677f5f223d1904d914e6d702aaf925195fbc1b8
Parents: cf67df2
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Sun Dec 25 21:46:33 2016 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Sun Dec 25 21:46:33 2016 +0700

----------------------------------------------------------------------
 .../visor/event/VisorGridDiscoveryEvent.java    | 18 ++++-
 .../visor/event/VisorGridDiscoveryEventV2.java  | 80 --------------------
 .../visor/node/VisorNodeDataCollectorJob.java   |  3 +-
 .../internal/visor/util/VisorEventMapper.java   |  4 +-
 .../internal/visor/util/VisorTaskUtils.java     | 23 +-----
 .../resources/META-INF/classnames.properties    |  1 -
 .../commands/disco/VisorDiscoveryCommand.scala  |  2 +-
 7 files changed, 24 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7677f5f2/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEvent.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEvent.java
index 7d970de..bad6966 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEvent.java
@@ -38,6 +38,9 @@ public class VisorGridDiscoveryEvent extends VisorGridEvent {
     /** If node that caused this event is daemon. */
     private final boolean isDaemon;
 
+    /** Topology version. */
+    private final long topVer;
+
     /**
      * Create event with given parameters.
      *
@@ -51,6 +54,7 @@ public class VisorGridDiscoveryEvent extends VisorGridEvent {
      * @param evtNodeId Event node id.
      * @param addr Event node address.
      * @param isDaemon If event node is daemon on not.
+     * @param topVer Topology version.
      */
     public VisorGridDiscoveryEvent(
         int typeId,
@@ -62,13 +66,15 @@ public class VisorGridDiscoveryEvent extends VisorGridEvent {
         String shortDisplay,
         UUID evtNodeId,
         String addr,
-        boolean isDaemon
+        boolean isDaemon,
+        long topVer
     ) {
         super(typeId, id, name, nid, ts, msg, shortDisplay);
 
         this.evtNodeId = evtNodeId;
         this.addr = addr;
         this.isDaemon = isDaemon;
+        this.topVer = topVer;
     }
 
     /**
@@ -92,8 +98,16 @@ public class VisorGridDiscoveryEvent extends VisorGridEvent {
         return isDaemon;
     }
 
+    /**
+     * @return Topology version or {@code 0} if configured discovery SPI implementation
+     *      does not support versioning.
+     **/
+    public long topologyVersion() {
+        return topVer;
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(VisorGridDiscoveryEvent.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/7677f5f2/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEventV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEventV2.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEventV2.java
deleted file mode 100644
index b66aacf..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDiscoveryEventV2.java
+++ /dev/null
@@ -1,80 +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.visor.event;
-
-import java.util.UUID;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteUuid;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Lightweight counterpart for {@link org.apache.ignite.events.DiscoveryEvent}.
- */
-public class VisorGridDiscoveryEventV2 extends VisorGridDiscoveryEvent {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Topology version. */
-    private final long topVer;
-
-    /**
-     * Create event with given parameters.
-     *
-     * @param typeId Event type.
-     * @param id Event id.
-     * @param name Event name.
-     * @param nid Event node ID.
-     * @param ts Event timestamp.
-     * @param msg Event message.
-     * @param shortDisplay Shortened version of {@code toString()} result.
-     * @param evtNodeId Event node id.
-     * @param addr Event node address.
-     * @param isDaemon If event node is daemon on not.
-     * @param topVer Topology version.
-     */
-    public VisorGridDiscoveryEventV2(
-        int typeId,
-        IgniteUuid id,
-        String name,
-        UUID nid,
-        long ts,
-        @Nullable String msg,
-        String shortDisplay,
-        UUID evtNodeId,
-        String addr,
-        boolean isDaemon,
-        long topVer
-    ) {
-        super(typeId, id, name, nid, ts, msg, shortDisplay, evtNodeId, addr, isDaemon);
-
-        this.topVer = topVer;
-    }
-
-    /**
-     * @return Topology version or {@code 0} if configured discovery SPI implementation
-     *      does not support versioning.
-     **/
-    public long topologyVersion() {
-        return topVer;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(VisorGridDiscoveryEventV2.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/7677f5f2/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
index 18dce34..694bc94 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
@@ -39,7 +39,6 @@ import static org.apache.ignite.internal.processors.cache.GridCacheUtils.isIgfsC
 import static org.apache.ignite.internal.processors.cache.GridCacheUtils.isSystemCache;
 import static org.apache.ignite.internal.visor.compute.VisorComputeMonitoringHolder.COMPUTE_MONITORING_HOLDER_KEY;
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.EVT_MAPPER;
-import static org.apache.ignite.internal.visor.util.VisorTaskUtils.EVT_MAPPER_V2;
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.VISOR_TASK_EVTS;
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.checkExplicitTaskMonitoring;
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.collectEvents;
@@ -72,7 +71,7 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
      */
     protected void events0(VisorNodeDataCollectorJobResult res, String evtOrderKey, String
evtThrottleCntrKey,
         final boolean all) {
-        res.events().addAll(collectEvents(ignite, evtOrderKey, evtThrottleCntrKey, all, EVT_MAPPER_V2));
+        res.events().addAll(collectEvents(ignite, evtOrderKey, evtThrottleCntrKey, all, EVT_MAPPER));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/7677f5f2/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorEventMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorEventMapper.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorEventMapper.java
index 829adb3..ca319db 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorEventMapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorEventMapper.java
@@ -136,7 +136,7 @@ public class VisorEventMapper implements IgniteClosure<Event, VisorGridEvent>
{
         ClusterNode node = de.eventNode();
 
         return new VisorGridDiscoveryEvent(type, id, name, nid, ts, msg, shortDisplay, node.id(),
-            F.first(node.addresses()), node.isDaemon());
+            F.first(node.addresses()), node.isDaemon(), de.topologyVersion());
     }
 
     /** {@inheritDoc} */
@@ -144,4 +144,4 @@ public class VisorEventMapper implements IgniteClosure<Event, VisorGridEvent>
{
         return map(evt, evt.type(), evt.id(), evt.name(), evt.node().id(), evt.timestamp(),
evt.message(),
             evt.shortDisplay());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/7677f5f2/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
index 1e9346c..c859d69 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
@@ -41,7 +41,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.SortedMap;
-import java.util.UUID;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.zip.ZipEntry;
@@ -55,21 +54,18 @@ import org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicyMBean;
 import org.apache.ignite.cache.eviction.lru.LruEvictionPolicyMBean;
 import org.apache.ignite.cache.eviction.random.RandomEvictionPolicyMBean;
 import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.events.DiscoveryEvent;
 import org.apache.ignite.events.Event;
 import org.apache.ignite.internal.processors.igfs.IgfsEx;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.event.VisorGridDiscoveryEventV2;
 import org.apache.ignite.internal.visor.event.VisorGridEvent;
 import org.apache.ignite.internal.visor.event.VisorGridEventsLost;
 import org.apache.ignite.internal.visor.file.VisorFileBlock;
 import org.apache.ignite.internal.visor.log.VisorLogFile;
 import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
 
 import static java.lang.System.getProperty;
@@ -377,17 +373,6 @@ public class VisorTaskUtils {
     /** Mapper from grid event to Visor data transfer object. */
     public static final VisorEventMapper EVT_MAPPER = new VisorEventMapper();
 
-    /** Mapper from grid event to Visor data transfer object. */
-    public static final VisorEventMapper EVT_MAPPER_V2 = new VisorEventMapper() {
-        @Override protected VisorGridEvent discoveryEvent(DiscoveryEvent de, int type, IgniteUuid
id, String name,
-            UUID nid, long ts, String msg, String shortDisplay) {
-            ClusterNode node = de.eventNode();
-
-            return new VisorGridDiscoveryEventV2(type, id, name, nid, ts, msg, shortDisplay,
node.id(),
-                F.first(node.addresses()), node.isDaemon(), de.topologyVersion());
-        }
-    };
-
     /**
      * Grabs local events and detects if events was lost since last poll.
      *
@@ -860,8 +845,6 @@ public class VisorTaskUtils {
         if (cmdFilePath == null || !cmdFilePath.exists())
             throw new FileNotFoundException(String.format("File not found: %s", cmdFile));
 
-        String ignite = cmdFilePath.getCanonicalPath();
-
         File nodesCfgPath = U.resolveIgnitePath(cfgPath);
 
         if (nodesCfgPath == null || !nodesCfgPath.exists())
@@ -874,6 +857,8 @@ public class VisorTaskUtils {
         List<Process> run = new ArrayList<>();
 
         try {
+            String igniteCmd = cmdFilePath.getCanonicalPath();
+
             for (int i = 0; i < nodesToStart; i++) {
                 if (U.isMacOs()) {
                     Map<String, String> macEnv = new HashMap<>(System.getenv());
@@ -902,9 +887,9 @@ public class VisorTaskUtils {
                                     entry.getKey(), val.replace('\n', ' ').replace("'", "\'")));
                     }
 
-                    run.add(openInConsole(envs.toString(), ignite, quitePar, nodeCfg));
+                    run.add(openInConsole(envs.toString(), igniteCmd, quitePar, nodeCfg));
                 } else
-                    run.add(openInConsole(null, envVars, ignite, quitePar, nodeCfg));
+                    run.add(openInConsole(null, envVars, igniteCmd, quitePar, nodeCfg));
             }
 
             return run;

http://git-wip-us.apache.org/repos/asf/ignite/blob/7677f5f2/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index ab518e5..a1de5bb 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -1752,7 +1752,6 @@ org.apache.ignite.internal.visor.debug.VisorThreadLockInfo
 org.apache.ignite.internal.visor.debug.VisorThreadMonitorInfo
 org.apache.ignite.internal.visor.event.VisorGridDeploymentEvent
 org.apache.ignite.internal.visor.event.VisorGridDiscoveryEvent
-org.apache.ignite.internal.visor.event.VisorGridDiscoveryEventV2
 org.apache.ignite.internal.visor.event.VisorGridEvent
 org.apache.ignite.internal.visor.event.VisorGridEventsLost
 org.apache.ignite.internal.visor.event.VisorGridJobEvent

http://git-wip-us.apache.org/repos/asf/ignite/blob/7677f5f2/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/VisorDiscoveryCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/VisorDiscoveryCommand.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/VisorDiscoveryCommand.scala
index 9ff7118..0ea88ad 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/VisorDiscoveryCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/VisorDiscoveryCommand.scala
@@ -216,7 +216,7 @@ class VisorDiscoveryCommand extends VisorConsoleCommand {
 
         if (nodeStartTime > System.currentTimeMillis() - tmFrame) {
             val root = new VisorGridDiscoveryEvent(EVT_NODE_JOINED, null, U.gridEventName(EVT_NODE_JOINED),
-                node.id(), nodeStartTime, "", "", node.id, node.addresses().head, node.isDaemon)
+                node.id(), nodeStartTime, "", "", node.id, node.addresses().head, node.isDaemon,
0L)
 
             evts = Seq(root) ++ evts
         }


Mime
View raw message