You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/04/27 07:17:34 UTC
[32/37] ignite git commit: IGNITE-4988 Rework Visor task arguments.
Code cleanup for ignite-2.0.
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBinaryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBinaryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBinaryConfiguration.java
new file mode 100644
index 0000000..f69caf1
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBinaryConfiguration.java
@@ -0,0 +1,131 @@
+/*
+ * 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.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.List;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
+
+/**
+ * Data transfer object for configuration of binary data structures.
+ */
+public class VisorBinaryConfiguration extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** ID mapper. */
+ private String idMapper;
+
+ /** Name mapper. */
+ private String nameMapper;
+
+ /** Serializer. */
+ private String serializer;
+
+ /** Types. */
+ private List<VisorBinaryTypeConfiguration> typeCfgs;
+
+ /** Compact footer flag. */
+ private boolean compactFooter;
+
+ /**
+ * Default constructor.
+ */
+ public VisorBinaryConfiguration() {
+ // No-op.
+ }
+
+ /**
+ * Create data transfer object for binary configuration.
+ *
+ * @param src Binary configuration.
+ */
+ public VisorBinaryConfiguration(BinaryConfiguration src) {
+ idMapper = compactClass(src.getIdMapper());
+ nameMapper = compactClass(src.getNameMapper());
+ serializer = compactClass(src.getSerializer());
+ compactFooter = src.isCompactFooter();
+
+ typeCfgs = VisorBinaryTypeConfiguration.list(src.getTypeConfigurations());
+ }
+
+ /**
+ * @return ID mapper.
+ */
+ public String getIdMapper() {
+ return idMapper;
+ }
+
+ /**
+ * @return Name mapper.
+ */
+ public String getNameMapper() {
+ return nameMapper;
+ }
+
+ /**
+ * @return Serializer.
+ */
+ public String getSerializer() {
+ return serializer;
+ }
+
+ /**
+ * @return Types.
+ */
+ public List<VisorBinaryTypeConfiguration> getTypeConfigurations() {
+ return typeCfgs;
+ }
+
+ /**
+ * @return Compact footer flag.
+ */
+ public boolean isCompactFooter() {
+ return compactFooter;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeString(out, idMapper);
+ U.writeString(out, nameMapper);
+ U.writeString(out, serializer);
+ U.writeCollection(out, typeCfgs);
+ out.writeBoolean(compactFooter);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ idMapper = U.readString(in);
+ nameMapper = U.readString(in);
+ serializer = U.readString(in);
+ typeCfgs = U.readList(in);
+ compactFooter = in.readBoolean();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorBinaryConfiguration.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBinaryTypeConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBinaryTypeConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBinaryTypeConfiguration.java
new file mode 100644
index 0000000..3b575ee
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorBinaryTypeConfiguration.java
@@ -0,0 +1,150 @@
+/*
+ * 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.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.apache.ignite.binary.BinaryTypeConfiguration;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
+
+/**
+ * Data transfer object for configuration of binary type structures.
+ */
+public class VisorBinaryTypeConfiguration extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Class name. */
+ private String typeName;
+
+ /** ID mapper. */
+ private String idMapper;
+
+ /** Name mapper. */
+ private String nameMapper;
+
+ /** Serializer. */
+ private String serializer;
+
+ /** Enum flag. */
+ private boolean isEnum;
+
+ /**
+ * Construct data transfer object for Executor configurations properties.
+ *
+ * @param cfgs Executor configurations.
+ * @return Executor configurations properties.
+ */
+ public static List<VisorBinaryTypeConfiguration> list(Collection<BinaryTypeConfiguration> cfgs) {
+ List<VisorBinaryTypeConfiguration> res = new ArrayList<>();
+
+ if (!F.isEmpty(cfgs)) {
+ for (BinaryTypeConfiguration cfg : cfgs)
+ res.add(new VisorBinaryTypeConfiguration(cfg));
+ }
+
+ return res;
+ }
+
+ /**
+ * Default constructor.
+ */
+ public VisorBinaryTypeConfiguration() {
+ // No-op.
+ }
+
+ /**
+ * Create data transfer object for binary type configuration.
+ *
+ * @param src Binary type configuration.
+ */
+ public VisorBinaryTypeConfiguration(BinaryTypeConfiguration src) {
+ typeName = src.getTypeName();
+ idMapper = compactClass(src.getIdMapper());
+ nameMapper = compactClass(src.getNameMapper());
+ serializer = compactClass(src.getSerializer());
+ isEnum = src.isEnum();
+ }
+
+ /**
+ * @return Class name.
+ */
+ public String getTypeName() {
+ return typeName;
+ }
+
+ /**
+ * @return ID mapper.
+ */
+ public String getIdMapper() {
+ return idMapper;
+ }
+
+ /**
+ * @return Name mapper.
+ */
+ public String getNameMapper() {
+ return nameMapper;
+ }
+
+ /**
+ * @return Serializer.
+ */
+ public String getSerializer() {
+ return serializer;
+ }
+
+ /**
+ * @return Enum flag.
+ */
+ public boolean isEnum() {
+ return isEnum;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeString(out, typeName);
+ U.writeString(out, idMapper);
+ U.writeString(out, nameMapper);
+ U.writeString(out, serializer);
+ out.writeBoolean(isEnum);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ typeName = U.readString(in);
+ idMapper = U.readString(in);
+ nameMapper = U.readString(in);
+ serializer = U.readString(in);
+ isEnum = in.readBoolean();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorBinaryTypeConfiguration.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorCacheKeyConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorCacheKeyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorCacheKeyConfiguration.java
new file mode 100644
index 0000000..cbd7b55
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorCacheKeyConfiguration.java
@@ -0,0 +1,108 @@
+/*
+ * 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.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.cache.CacheKeyConfiguration;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Data transfer object for configuration of cache key data structures.
+ */
+public class VisorCacheKeyConfiguration extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Type name. */
+ private String typeName;
+
+ /** Affinity key field name. */
+ private String affKeyFieldName;
+
+ /**
+ * Construct data transfer object for cache key configurations properties.
+ *
+ * @param cfgs Cache key configurations.
+ * @return Cache key configurations properties.
+ */
+ public static List<VisorCacheKeyConfiguration> list(CacheKeyConfiguration[] cfgs) {
+ List<VisorCacheKeyConfiguration> res = new ArrayList<>();
+
+ if (!F.isEmpty(cfgs)) {
+ for (CacheKeyConfiguration cfg : cfgs)
+ res.add(new VisorCacheKeyConfiguration(cfg));
+ }
+
+ return res;
+ }
+
+ /**
+ * Default constructor.
+ */
+ public VisorCacheKeyConfiguration() {
+ // No-op.
+ }
+
+ /**
+ * Create data transfer object for cache key configuration.
+ *
+ * @param src Cache key configuration.
+ */
+ public VisorCacheKeyConfiguration(CacheKeyConfiguration src) {
+ typeName = src.getTypeName();
+ affKeyFieldName = src.getAffinityKeyFieldName();
+ }
+
+ /**
+ * @return Type name.
+ */
+ public String getTypeName() {
+ return typeName;
+ }
+
+ /**
+ * @return Affinity key field name.
+ */
+ public String getAffinityKeyFieldName() {
+ return affKeyFieldName;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeString(out, typeName);
+ U.writeString(out, affKeyFieldName);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ typeName = U.readString(in);
+ affKeyFieldName = U.readString(in);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorCacheKeyConfiguration.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorConfiguration.java
new file mode 100644
index 0000000..82eaf0b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorConfiguration.java
@@ -0,0 +1,108 @@
+/*
+ * 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.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.configuration.ExecutorConfiguration;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Data transfer object for configuration of executor data structures.
+ */
+public class VisorExecutorConfiguration extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Thread pool name. */
+ private String name;
+
+ /** Thread pool size. */
+ private int size;
+
+ /**
+ * Construct data transfer object for Executor configurations properties.
+ *
+ * @param cfgs Executor configurations.
+ * @return Executor configurations properties.
+ */
+ public static List<VisorExecutorConfiguration> list(ExecutorConfiguration[] cfgs) {
+ List<VisorExecutorConfiguration> res = new ArrayList<>();
+
+ if (!F.isEmpty(cfgs)) {
+ for (ExecutorConfiguration cfg : cfgs)
+ res.add(new VisorExecutorConfiguration(cfg));
+ }
+
+ return res;
+ }
+
+ /**
+ * Default constructor.
+ */
+ public VisorExecutorConfiguration() {
+ // No-op.
+ }
+
+ /**
+ * Create data transfer object for executor configuration.
+ *
+ * @param src Executor configuration.
+ */
+ public VisorExecutorConfiguration(ExecutorConfiguration src) {
+ name = src.getName();
+ size = src.getSize();
+ }
+
+ /**
+ * @return Executor name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return Thread pool size.
+ */
+ public int getSize() {
+ return size;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeString(out, name);
+ out.writeInt(size);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ name = U.readString(in);
+ size = in.readInt();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorExecutorConfiguration.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorServiceConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorServiceConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorServiceConfiguration.java
index 0ad9288..6929190 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorServiceConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorExecutorServiceConfiguration.java
@@ -20,9 +20,12 @@ package org.apache.ignite.internal.visor.node;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import java.util.List;
import org.apache.ignite.configuration.ConnectorConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.OdbcConfiguration;
import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.visor.VisorDataTransferObject;
/**
@@ -53,6 +56,30 @@ public class VisorExecutorServiceConfiguration extends VisorDataTransferObject {
/** REST requests pool size. */
private int restPoolSz;
+ /** Async Callback pool size. */
+ private int cbPoolSize;
+
+ /** Data stream pool size. */
+ private int dataStreamerPoolSize;
+
+ /** Query pool size. */
+ private int qryPoolSize;
+
+ /** Use striped pool for internal requests processing when possible */
+ private int stripedPoolSize;
+
+ /** Service pool size. */
+ private int svcPoolSize;
+
+ /** Utility cache pool size. */
+ private int utilityCachePoolSize;
+
+ /** ODBC pool size. */
+ private int odbcPoolSize;
+
+ /** List of executor configurations. */
+ private List<VisorExecutorConfiguration> executors;
+
/**
* Default constructor.
*/
@@ -77,6 +104,20 @@ public class VisorExecutorServiceConfiguration extends VisorDataTransferObject {
if (cc != null)
restPoolSz = cc.getThreadPoolSize();
+
+ cbPoolSize = c.getAsyncCallbackPoolSize();
+ dataStreamerPoolSize = c.getDataStreamerThreadPoolSize();
+ qryPoolSize = c.getQueryThreadPoolSize();
+ stripedPoolSize = c.getStripedPoolSize();
+ svcPoolSize = c.getServiceThreadPoolSize();
+ utilityCachePoolSize = c.getUtilityCacheThreadPoolSize();
+
+ OdbcConfiguration oc = c.getOdbcConfiguration();
+
+ if (oc != null)
+ odbcPoolSize = oc.getThreadPoolSize();
+
+ executors = VisorExecutorConfiguration.list(c.getExecutorConfiguration());
}
/**
@@ -128,6 +169,64 @@ public class VisorExecutorServiceConfiguration extends VisorDataTransferObject {
return restPoolSz;
}
+ /**
+ * @return Thread pool size to be used for processing of asynchronous callbacks.
+ */
+ public int getCallbackPoolSize() {
+ return cbPoolSize;
+ }
+
+ /**
+ * @return Thread pool size to be used for data stream messages.
+ */
+ public int getDataStreamerPoolSize() {
+ return dataStreamerPoolSize;
+ }
+
+ /**
+ * @return Thread pool size to be used in grid for query messages.
+ */
+ public int getQueryThreadPoolSize() {
+ return qryPoolSize;
+ }
+
+ /**
+ * @return Positive value if striped pool should be initialized
+ * with configured number of threads (stripes) and used for requests processing
+ * or non-positive value to process requests in system pool.
+ */
+ public int getStripedPoolSize() {
+ return stripedPoolSize;
+ }
+
+ /**
+ * @return Thread pool size to be used in grid to process service proxy invocations.
+ */
+ public int getServiceThreadPoolSize() {
+ return svcPoolSize;
+ }
+
+ /**
+ * @return Thread pool size to be used in grid for utility cache messages.
+ */
+ public int getUtilityCacheThreadPoolSize() {
+ return utilityCachePoolSize;
+ }
+
+ /**
+ * @return Thread pool that is in charge of processing ODBC tasks.
+ */
+ public int getOdbcThreadPoolSize() {
+ return odbcPoolSize;
+ }
+
+ /**
+ * @return List of executor configurations.
+ */
+ public List<VisorExecutorConfiguration> getExecutors() {
+ return executors;
+ }
+
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
out.writeInt(pubPoolSize);
@@ -137,6 +236,14 @@ public class VisorExecutorServiceConfiguration extends VisorDataTransferObject {
out.writeInt(p2pPoolSz);
out.writeInt(rebalanceThreadPoolSize);
out.writeInt(restPoolSz);
+ out.writeInt(cbPoolSize);
+ out.writeInt(dataStreamerPoolSize);
+ out.writeInt(qryPoolSize);
+ out.writeInt(stripedPoolSize);
+ out.writeInt(svcPoolSize);
+ out.writeInt(utilityCachePoolSize);
+ out.writeInt(odbcPoolSize);
+ U.writeCollection(out, executors);
}
/** {@inheritDoc} */
@@ -148,6 +255,14 @@ public class VisorExecutorServiceConfiguration extends VisorDataTransferObject {
p2pPoolSz = in.readInt();
rebalanceThreadPoolSize = in.readInt();
restPoolSz = in.readInt();
+ cbPoolSize = in.readInt();
+ dataStreamerPoolSize = in.readInt();
+ qryPoolSize = in.readInt();
+ stripedPoolSize = in.readInt();
+ svcPoolSize = in.readInt();
+ utilityCachePoolSize = in.readInt();
+ odbcPoolSize = in.readInt();
+ executors = U.readList(in);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java
index 23a74e7..ea5ce9e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java
@@ -25,13 +25,17 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.HadoopConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.OdbcConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.visor.VisorDataTransferObject;
import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactArray;
+import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
/**
* Data transfer object for node configuration data.
@@ -91,6 +95,27 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
/** Database configuration. */
private VisorMemoryConfiguration memCfg;
+ /** Cache store session listeners. */
+ private String storeSesLsnrs;
+
+ /** Warmup closure. Will be invoked before actual grid start. */
+ private String warmupClos;
+
+ /** Binary configuration. */
+ private VisorBinaryConfiguration binaryCfg;
+
+ /** List of cache key configurations. */
+ private List<VisorCacheKeyConfiguration> cacheKeyCfgs;
+
+ /** Hadoop configuration. */
+ private VisorHadoopConfiguration hadoopCfg;
+
+ /** ODBC configuration. */
+ private VisorOdbcConfiguration odbcCfg;
+
+ /** List of service configurations. */
+ private List<VisorServiceConfiguration> srvcCfgs;
+
/**
* Default constructor.
*/
@@ -127,6 +152,28 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
if (c.getMemoryConfiguration() != null)
memCfg = new VisorMemoryConfiguration(c.getMemoryConfiguration());
+
+ storeSesLsnrs = compactArray(c.getCacheStoreSessionListenerFactories());
+ warmupClos = compactClass(c.getWarmupClosure());
+
+ BinaryConfiguration bc = c.getBinaryConfiguration();
+
+ if (bc != null)
+ binaryCfg = new VisorBinaryConfiguration();
+
+ cacheKeyCfgs = VisorCacheKeyConfiguration.list(c.getCacheKeyConfiguration());
+
+ HadoopConfiguration hc = c.getHadoopConfiguration();
+
+ if (hc != null)
+ hadoopCfg = new VisorHadoopConfiguration(hc);
+
+ OdbcConfiguration oc = c.getOdbcConfiguration();
+
+ if (oc != null)
+ odbcCfg = new VisorOdbcConfiguration(c.getOdbcConfiguration());
+
+ srvcCfgs = VisorServiceConfiguration.list(c.getServiceConfiguration());
}
/**
@@ -248,6 +295,55 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
return memCfg;
}
+ /**
+ * @return Cache store session listener factories.
+ */
+ public String getCacheStoreSessionListenerFactories() {
+ return storeSesLsnrs;
+ }
+
+ /**
+ * @return Warmup closure to execute.
+ */
+ public String getWarmupClosure() {
+ return warmupClos;
+ }
+
+ /**
+ * @return Binary configuration.
+ */
+ public VisorBinaryConfiguration getBinaryConfiguration() {
+ return binaryCfg;
+ }
+
+ /**
+ * @return List of cache key configurations.
+ */
+ public List<VisorCacheKeyConfiguration> getCacheKeyConfigurations() {
+ return cacheKeyCfgs;
+ }
+
+ /**
+ * @return Hadoop configuration.
+ */
+ public VisorHadoopConfiguration getHadoopConfiguration() {
+ return hadoopCfg;
+ }
+
+ /**
+ * @return ODBC configuration.
+ */
+ public VisorOdbcConfiguration getOdbcConfiguration() {
+ return odbcCfg;
+ }
+
+ /**
+ * @return List of service configurations
+ */
+ public List<VisorServiceConfiguration> getServiceConfigurations() {
+ return srvcCfgs;
+ }
+
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
out.writeObject(basic);
@@ -267,6 +363,13 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
out.writeObject(atomic);
out.writeObject(txCfg);
out.writeObject(memCfg);
+ U.writeString(out, storeSesLsnrs);
+ U.writeString(out, warmupClos);
+ out.writeObject(binaryCfg);
+ U.writeCollection(out, cacheKeyCfgs);
+ out.writeObject(hadoopCfg);
+ out.writeObject(odbcCfg);
+ U.writeCollection(out, srvcCfgs);
}
/** {@inheritDoc} */
@@ -288,6 +391,13 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
atomic = (VisorAtomicConfiguration)in.readObject();
txCfg = (VisorTransactionConfiguration)in.readObject();
memCfg = (VisorMemoryConfiguration)in.readObject();
+ storeSesLsnrs = U.readString(in);
+ warmupClos = U.readString(in);
+ binaryCfg = (VisorBinaryConfiguration)in.readObject();
+ cacheKeyCfgs = U.readList(in);
+ hadoopCfg = (VisorHadoopConfiguration)in.readObject();
+ odbcCfg = (VisorOdbcConfiguration)in.readObject();
+ srvcCfgs = U.readList(in);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorHadoopConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorHadoopConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorHadoopConfiguration.java
new file mode 100644
index 0000000..de41def
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorHadoopConfiguration.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.visor.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.List;
+import org.apache.ignite.configuration.HadoopConfiguration;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+import org.jetbrains.annotations.Nullable;
+
+import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
+
+/**
+ * Data transfer object for configuration of hadoop data structures.
+ */
+public class VisorHadoopConfiguration extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Map reduce planner. */
+ private String planner;
+
+ /** */
+ private boolean extExecution;
+
+ /** Finished job info TTL. */
+ private long finishedJobInfoTtl;
+
+ /** */
+ private int maxParallelTasks;
+
+ /** */
+ private int maxTaskQueueSize;
+
+ /** Library names. */
+ private List<String> libNames;
+
+ /**
+ * Default constructor.
+ */
+ public VisorHadoopConfiguration() {
+ // No-op.
+ }
+
+ /**
+ * Create data transfer object for hadoop configuration.
+ *
+ * @param src Hadoop configuration.
+ */
+ public VisorHadoopConfiguration(HadoopConfiguration src) {
+ planner = compactClass(src.getMapReducePlanner());
+ // TODO: IGNITE-404: Uncomment when fixed.
+ //extExecution = cfg.isExternalExecution();
+ finishedJobInfoTtl = src.getFinishedJobInfoTtl();
+ maxParallelTasks = src.getMaxParallelTasks();
+ maxTaskQueueSize = src.getMaxTaskQueueSize();
+ libNames = U.sealList(src.getNativeLibraryNames());
+ }
+
+ /**
+ * @return Max number of local tasks that may be executed in parallel.
+ */
+ public int getMaxParallelTasks() {
+ return maxParallelTasks;
+ }
+
+ /**
+ * @return Max task queue size.
+ */
+ public int getMaxTaskQueueSize() {
+ return maxTaskQueueSize;
+ }
+
+ /**
+ * @return Finished job info time-to-live.
+ */
+ public long getFinishedJobInfoTtl() {
+ return finishedJobInfoTtl;
+ }
+
+ /**
+ * @return {@code True} if external execution.
+ */
+ public boolean isExternalExecution() {
+ return extExecution;
+ }
+
+ /**
+ * @return Map-reduce planner.
+ */
+ public String getMapReducePlanner() {
+ return planner;
+ }
+
+ /**
+ * @return Native library names.
+ */
+ @Nullable public List<String> getNativeLibraryNames() {
+ return libNames;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeString(out, planner);
+ out.writeBoolean(extExecution);
+ out.writeLong(finishedJobInfoTtl);
+ out.writeInt(maxParallelTasks);
+ out.writeInt(maxTaskQueueSize);
+ U.writeCollection(out, libNames);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ planner = U.readString(in);
+ extExecution = in.readBoolean();
+ finishedJobInfoTtl = in.readLong();
+ maxParallelTasks = in.readInt();
+ maxTaskQueueSize = in.readInt();
+ libNames = U.readList(in);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorHadoopConfiguration.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
index db91982..3075b26 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
@@ -32,8 +32,6 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.visor.VisorDataTransferObject;
import org.jetbrains.annotations.Nullable;
-import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
-
/**
* Data transfer object for IGFS configuration properties.
*/
@@ -98,6 +96,15 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
/** Amount of sequential block reads before prefetch is triggered. */
private int seqReadsBeforePrefetch;
+ /** Metadata co-location flag. */
+ private boolean colocateMeta;
+
+ /** Relaxed consistency flag. */
+ private boolean relaxedConsistency;
+
+ /** Update file length on flush flag. */
+ private boolean updateFileLenOnFlush;
+
/**
* Default constructor.
*/
@@ -134,6 +141,10 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
ipcEndpointEnabled = igfs.isIpcEndpointEnabled();
mgmtPort = igfs.getManagementPort();
seqReadsBeforePrefetch = igfs.getSequentialReadsBeforePrefetch();
+
+ colocateMeta = igfs.isColocateMetadata();
+ relaxedConsistency = igfs.isRelaxedConsistency();
+ updateFileLenOnFlush = igfs.isUpdateFileLengthOnFlush();
}
/**
@@ -286,6 +297,27 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
return seqReadsBeforePrefetch;
}
+ /**
+ * @return {@code True} if metadata co-location is enabled.
+ */
+ public boolean isColocateMetadata() {
+ return colocateMeta;
+ }
+
+ /**
+ * @return {@code True} if relaxed consistency is enabled.
+ */
+ public boolean isRelaxedConsistency() {
+ return relaxedConsistency;
+ }
+
+ /**
+ * @return Whether to update file length on flush.
+ */
+ public boolean isUpdateFileLengthOnFlush() {
+ return updateFileLenOnFlush;
+ }
+
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
U.writeString(out, name);
@@ -307,6 +339,9 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
out.writeBoolean(ipcEndpointEnabled);
out.writeInt(mgmtPort);
out.writeInt(seqReadsBeforePrefetch);
+ out.writeBoolean(colocateMeta);
+ out.writeBoolean(relaxedConsistency);
+ out.writeBoolean(updateFileLenOnFlush);
}
/** {@inheritDoc} */
@@ -330,6 +365,9 @@ public class VisorIgfsConfiguration extends VisorDataTransferObject {
ipcEndpointEnabled = in.readBoolean();
mgmtPort = in.readInt();
seqReadsBeforePrefetch = in.readInt();
+ colocateMeta = in.readBoolean();
+ relaxedConsistency = in.readBoolean();
+ updateFileLenOnFlush = in.readBoolean();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/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 509aa48..d117e5f 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
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.visor.node;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import org.apache.ignite.configuration.DataPageEvictionMode;
import org.apache.ignite.configuration.MemoryPolicyConfiguration;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -41,6 +42,17 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
/** Path for memory mapped file. */
private String swapFilePath;
+ /** An algorithm for memory pages eviction. */
+ private DataPageEvictionMode pageEvictionMode;
+
+ /**
+ * A threshold for memory pages eviction initiation. For instance, if the threshold is 0.9 it means that the page
+ * memory will start the eviction only after 90% memory region (defined by this policy) is occupied.
+ */
+ private double evictionThreshold;
+
+ /** Minimum number of empty pages in reuse lists. */
+ private int emptyPagesPoolSize;
/**
* Default constructor.
@@ -60,6 +72,9 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
name = plc.getName();
size = plc.getSize();
swapFilePath = plc.getSwapFilePath();
+ pageEvictionMode = plc.getPageEvictionMode();
+ evictionThreshold = plc.getEvictionThreshold();
+ emptyPagesPoolSize = plc.getEmptyPagesPoolSize();
}
/**
@@ -83,12 +98,35 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
return swapFilePath;
}
+ /**
+ * @return Memory pages eviction algorithm. {@link DataPageEvictionMode#DISABLED} used by default.
+ */
+ public DataPageEvictionMode getPageEvictionMode() {
+ return pageEvictionMode;
+ }
+
+ /**
+ * @return Memory pages eviction threshold.
+ */
+ public double getEvictionThreshold() {
+ return evictionThreshold;
+ }
+
+ /**
+ * @return Minimum number of empty pages in reuse list.
+ */
+ public int getEmptyPagesPoolSize() {
+ return emptyPagesPoolSize;
+ }
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
U.writeString(out, name);
out.writeLong(size);
U.writeString(out, swapFilePath);
+ U.writeEnum(out, pageEvictionMode);
+ out.writeDouble(evictionThreshold);
+ out.writeInt(emptyPagesPoolSize);
}
/** {@inheritDoc} */
@@ -96,6 +134,9 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
name = U.readString(in);
size = in.readLong();
swapFilePath = U.readString(in);
+ pageEvictionMode = DataPageEvictionMode.fromOrdinal(in.readByte());
+ evictionThreshold = in.readDouble();
+ emptyPagesPoolSize = in.readInt();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTask.java
index 6169dcb..ee2e968 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTask.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.visor.node;
import java.util.List;
-import java.util.UUID;
import org.apache.ignite.cluster.ClusterTopologyException;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.internal.processors.task.GridInternal;
@@ -31,12 +30,12 @@ import org.jetbrains.annotations.Nullable;
* Ping other node.
*/
@GridInternal
-public class VisorNodePingTask extends VisorOneNodeTask<UUID, VisorNodePingTaskResult> {
+public class VisorNodePingTask extends VisorOneNodeTask<VisorNodePingTaskArg, VisorNodePingTaskResult> {
/** */
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
- @Override protected VisorNodePingJob job(UUID arg) {
+ @Override protected VisorNodePingJob job(VisorNodePingTaskArg arg) {
return new VisorNodePingJob(arg, debug);
}
@@ -53,7 +52,7 @@ public class VisorNodePingTask extends VisorOneNodeTask<UUID, VisorNodePingTaskR
/**
* Job that ping node.
*/
- private static class VisorNodePingJob extends VisorJob<UUID, VisorNodePingTaskResult> {
+ private static class VisorNodePingJob extends VisorJob<VisorNodePingTaskArg, VisorNodePingTaskResult> {
/** */
private static final long serialVersionUID = 0L;
@@ -61,15 +60,15 @@ public class VisorNodePingTask extends VisorOneNodeTask<UUID, VisorNodePingTaskR
* @param arg Node ID to ping.
* @param debug Debug flag.
*/
- protected VisorNodePingJob(UUID arg, boolean debug) {
+ protected VisorNodePingJob(VisorNodePingTaskArg arg, boolean debug) {
super(arg, debug);
}
/** {@inheritDoc} */
- @Override protected VisorNodePingTaskResult run(UUID nodeToPing) {
+ @Override protected VisorNodePingTaskResult run(VisorNodePingTaskArg arg) {
long start = System.currentTimeMillis();
- return new VisorNodePingTaskResult(ignite.cluster().pingNode(nodeToPing), start, System.currentTimeMillis());
+ return new VisorNodePingTaskResult(ignite.cluster().pingNode(arg.getNodeId()), start, System.currentTimeMillis());
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTaskArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTaskArg.java
new file mode 100644
index 0000000..bd5a826
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodePingTaskArg.java
@@ -0,0 +1,73 @@
+/*
+ * 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.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.UUID;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Argument for {@link VisorNodePingTask}.
+ */
+public class VisorNodePingTaskArg extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Node ID to ping. */
+ private UUID nodeId;
+
+ /**
+ * Default constructor.
+ */
+ public VisorNodePingTaskArg() {
+ // No-op.
+ }
+
+ /**
+ * @param nodeId Node ID to ping.
+ */
+ public VisorNodePingTaskArg(UUID nodeId) {
+ this.nodeId = nodeId;
+ }
+
+ /**
+ * @return Node ID to ping.
+ */
+ public UUID getNodeId() {
+ return nodeId;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeUuid(out, nodeId);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ nodeId = U.readUuid(in);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorNodePingTaskArg.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrors.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrors.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrors.java
index 482adce..fa599ec 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrors.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrors.java
@@ -33,7 +33,7 @@ public class VisorNodeSuppressedErrors extends VisorDataTransferObject {
private static final long serialVersionUID = 0L;
/** Order number of last suppressed error. */
- private Long order;
+ private long order;
/** List of suppressed errors. */
private List<VisorSuppressedError> errors;
@@ -51,7 +51,7 @@ public class VisorNodeSuppressedErrors extends VisorDataTransferObject {
* @param order Order number of last suppressed error.
* @param errors List of suppressed errors.
*/
- public VisorNodeSuppressedErrors(Long order, List<VisorSuppressedError> errors) {
+ public VisorNodeSuppressedErrors(long order, List<VisorSuppressedError> errors) {
this.order = order;
this.errors = errors;
}
@@ -59,7 +59,7 @@ public class VisorNodeSuppressedErrors extends VisorDataTransferObject {
/**
* @return Order number of last suppressed error.
*/
- public Long getOrder() {
+ public long getOrder() {
return order;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTask.java
index c7b9cf7..263d3e7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTask.java
@@ -35,13 +35,13 @@ import org.jetbrains.annotations.Nullable;
* Task to collect last errors on nodes.
*/
@GridInternal
-public class VisorNodeSuppressedErrorsTask extends VisorMultiNodeTask<Map<UUID, Long>,
+public class VisorNodeSuppressedErrorsTask extends VisorMultiNodeTask<VisorNodeSuppressedErrorsTaskArg,
Map<UUID, VisorNodeSuppressedErrors>, VisorNodeSuppressedErrors> {
/** */
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
- @Override protected VisorNodeSuppressedErrorsJob job(Map<UUID, Long> arg) {
+ @Override protected VisorNodeSuppressedErrorsJob job(VisorNodeSuppressedErrorsTaskArg arg) {
return new VisorNodeSuppressedErrorsJob(arg, debug);
}
@@ -63,7 +63,7 @@ public class VisorNodeSuppressedErrorsTask extends VisorMultiNodeTask<Map<UUID,
/**
* Job to collect last errors on nodes.
*/
- private static class VisorNodeSuppressedErrorsJob extends VisorJob<Map<UUID, Long>, VisorNodeSuppressedErrors> {
+ private static class VisorNodeSuppressedErrorsJob extends VisorJob<VisorNodeSuppressedErrorsTaskArg, VisorNodeSuppressedErrors> {
/** */
private static final long serialVersionUID = 0L;
@@ -73,13 +73,13 @@ public class VisorNodeSuppressedErrorsTask extends VisorMultiNodeTask<Map<UUID,
* @param arg Map with last error counter.
* @param debug Debug flag.
*/
- private VisorNodeSuppressedErrorsJob(Map<UUID, Long> arg, boolean debug) {
+ private VisorNodeSuppressedErrorsJob(VisorNodeSuppressedErrorsTaskArg arg, boolean debug) {
super(arg, debug);
}
/** {@inheritDoc} */
- @Override protected VisorNodeSuppressedErrors run(Map<UUID, Long> arg) {
- Long lastOrder = arg.get(ignite.localNode().id());
+ @Override protected VisorNodeSuppressedErrors run(VisorNodeSuppressedErrorsTaskArg arg) {
+ Long lastOrder = arg.getOrders().get(ignite.localNode().id());
long order = lastOrder != null ? lastOrder : 0;
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTaskArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTaskArg.java
new file mode 100644
index 0000000..17f7a9c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeSuppressedErrorsTaskArg.java
@@ -0,0 +1,74 @@
+/*
+ * 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.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Arguments for task {@link VisorNodeSuppressedErrorsTask}
+ */
+public class VisorNodeSuppressedErrorsTaskArg extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Last laded error orders. */
+ private Map<UUID, Long> orders;
+
+ /**
+ * Default constructor.
+ */
+ public VisorNodeSuppressedErrorsTaskArg() {
+ // No-op.
+ }
+
+ /**
+ * @param orders Last laded error orders.
+ */
+ public VisorNodeSuppressedErrorsTaskArg(Map<UUID, Long> orders) {
+ this.orders = orders;
+ }
+
+ /**
+ * @return Last laded error orders.
+ */
+ public Map<UUID, Long> getOrders() {
+ return orders;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeMap(out, orders);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ orders = U.readMap(in);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorNodeSuppressedErrorsTaskArg.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorOdbcConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorOdbcConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorOdbcConfiguration.java
new file mode 100644
index 0000000..e29376b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorOdbcConfiguration.java
@@ -0,0 +1,114 @@
+/*
+ * 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.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.configuration.OdbcConfiguration;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Data transfer object for configuration of ODBC data structures.
+ */
+public class VisorOdbcConfiguration extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Endpoint address. */
+ private String endpointAddr;
+
+ /** Socket send buffer size. */
+ private int sockSndBufSize;
+
+ /** Socket receive buffer size. */
+ private int sockRcvBufSize;
+
+ /** Max number of opened cursors per connection. */
+ private int maxOpenCursors;
+
+ /**
+ * Default constructor.
+ */
+ public VisorOdbcConfiguration() {
+ // No-op.
+ }
+
+ /**
+ * Create data transfer object for ODBC configuration.
+ *
+ * @param src ODBC configuration.
+ */
+ public VisorOdbcConfiguration(OdbcConfiguration src) {
+ endpointAddr = src.getEndpointAddress();
+ sockSndBufSize = src.getSocketSendBufferSize();
+ sockRcvBufSize = src.getSocketReceiveBufferSize();
+ maxOpenCursors = src.getMaxOpenCursors();
+ }
+
+ /**
+ * @return ODBC endpoint address.
+ */
+ public String getEndpointAddress() {
+ return endpointAddr;
+ }
+
+ /**
+ * @return Maximum number of opened cursors.
+ */
+ public int getMaxOpenCursors() {
+ return maxOpenCursors;
+ }
+
+ /**
+ * @return Socket send buffer size in bytes.
+ */
+ public int getSocketSendBufferSize() {
+ return sockSndBufSize;
+ }
+
+ /**
+ * @return Socket receive buffer size in bytes.
+ */
+ public int getSocketReceiveBufferSize() {
+ return sockRcvBufSize;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeString(out, endpointAddr);
+ out.writeInt(sockSndBufSize);
+ out.writeInt(sockRcvBufSize);
+ out.writeInt(maxOpenCursors);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ endpointAddr = U.readString(in);
+ sockSndBufSize = in.readInt();
+ sockRcvBufSize = in.readInt();
+ maxOpenCursors = in.readInt();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorOdbcConfiguration.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java
index 1f1e2b7..baf0ea6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorRestConfiguration.java
@@ -59,11 +59,53 @@ public class VisorRestConfiguration extends VisorDataTransferObject {
private String tcpHost;
/** REST TCP binary port. */
- private Integer tcpPort;
+ private int tcpPort;
/** Context factory for SSL. */
private String tcpSslCtxFactory;
+ /** REST secret key. */
+ private String secretKey;
+
+ /** TCP no delay flag. */
+ private boolean noDelay;
+
+ /** REST TCP direct buffer flag. */
+ private boolean directBuf;
+
+ /** REST TCP send buffer size. */
+ private int sndBufSize;
+
+ /** REST TCP receive buffer size. */
+ private int rcvBufSize;
+
+ /** REST idle timeout for query cursor. */
+ private long idleQryCurTimeout;
+
+ /** REST idle check frequency for query cursor. */
+ private long idleQryCurCheckFreq;
+
+ /** REST TCP send queue limit. */
+ private int sndQueueLimit;
+
+ /** REST TCP selector count. */
+ private int selectorCnt;
+
+ /** Idle timeout. */
+ private long idleTimeout;
+
+ /** SSL need client auth flag. */
+ private boolean sslClientAuth;
+
+ /** SSL context factory for rest binary server. */
+ private String sslFactory;
+
+ /** Port range */
+ private int portRange;
+
+ /** Client message interceptor. */
+ private String msgInterceptor;
+
/**
* Default constructor.
*/
@@ -79,18 +121,32 @@ public class VisorRestConfiguration extends VisorDataTransferObject {
public VisorRestConfiguration(IgniteConfiguration c) {
assert c != null;
- ConnectorConfiguration clnCfg = c.getConnectorConfiguration();
+ ConnectorConfiguration conCfg = c.getConnectorConfiguration();
- restEnabled = clnCfg != null;
+ restEnabled = conCfg != null;
if (restEnabled) {
- tcpSslEnabled = clnCfg.isSslEnabled();
- jettyPath = clnCfg.getJettyPath();
+ tcpSslEnabled = conCfg.isSslEnabled();
+ jettyPath = conCfg.getJettyPath();
jettyHost = getProperty(IGNITE_JETTY_HOST);
jettyPort = intValue(IGNITE_JETTY_PORT, null);
- tcpHost = clnCfg.getHost();
- tcpPort = clnCfg.getPort();
- tcpSslCtxFactory = compactClass(clnCfg.getSslContextFactory());
+ tcpHost = conCfg.getHost();
+ tcpPort = conCfg.getPort();
+ tcpSslCtxFactory = compactClass(conCfg.getSslContextFactory());
+ secretKey = conCfg.getSecretKey();
+ noDelay = conCfg.isNoDelay();
+ directBuf = conCfg.isDirectBuffer();
+ sndBufSize = conCfg.getSendBufferSize();
+ rcvBufSize = conCfg.getReceiveBufferSize();
+ idleQryCurTimeout = conCfg.getIdleQueryCursorTimeout();
+ idleQryCurCheckFreq = conCfg.getIdleQueryCursorCheckFrequency();
+ sndQueueLimit = conCfg.getSendQueueLimit();
+ selectorCnt = conCfg.getSelectorCount();
+ idleTimeout = conCfg.getIdleTimeout();
+ sslClientAuth = conCfg.isSslClientAuth();
+ sslFactory = compactClass(conCfg.getSslFactory());
+ portRange = conCfg.getPortRange();
+ msgInterceptor = compactClass(conCfg.getMessageInterceptor());
}
}
@@ -139,7 +195,7 @@ public class VisorRestConfiguration extends VisorDataTransferObject {
/**
* @return REST TCP binary port.
*/
- @Nullable public Integer getTcpPort() {
+ public int getTcpPort() {
return tcpPort;
}
@@ -150,6 +206,107 @@ public class VisorRestConfiguration extends VisorDataTransferObject {
return tcpSslCtxFactory;
}
+ /**
+ * @return Secret key.
+ */
+ @Nullable public String getSecretKey() {
+ return secretKey;
+ }
+
+ /**
+ * @return Whether {@code TCP_NODELAY} option should be enabled.
+ */
+ public boolean isNoDelay() {
+ return noDelay;
+ }
+
+ /**
+ * @return Whether direct buffer should be used.
+ */
+ public boolean isDirectBuffer() {
+ return directBuf;
+ }
+
+ /**
+ * @return REST TCP server send buffer size (0 for default).
+ */
+ public int getSendBufferSize() {
+ return sndBufSize;
+ }
+
+ /**
+ * @return REST TCP server receive buffer size (0 for default).
+ */
+ public int getReceiveBufferSize() {
+ return rcvBufSize;
+ }
+
+ /**
+ * @return Idle query cursors timeout in milliseconds
+ */
+ public long getIdleQueryCursorTimeout() {
+ return idleQryCurTimeout;
+ }
+
+ /**
+ * @return Idle query cursor check frequency in milliseconds.
+ */
+ public long getIdleQueryCursorCheckFrequency() {
+ return idleQryCurCheckFreq;
+ }
+
+ /**
+ * @return REST TCP server send queue limit (0 for unlimited).
+ */
+ public int getSendQueueLimit() {
+ return sndQueueLimit;
+ }
+
+ /**
+ * @return Number of selector threads for REST TCP server.
+ */
+ public int getSelectorCount() {
+ return selectorCnt;
+ }
+
+ /**
+ * @return Idle timeout in milliseconds.
+ */
+ public long getIdleTimeout() {
+ return idleTimeout;
+ }
+
+ /**
+ * Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which
+ * validity will be verified with trust manager.
+ *
+ * @return Whether or not client authentication is required.
+ */
+ public boolean isSslClientAuth() {
+ return sslClientAuth;
+ }
+
+ /**
+ * @return SslContextFactory instance.
+ */
+ public String getSslFactory() {
+ return sslFactory;
+ }
+
+ /**
+ * @return Number of ports to try.
+ */
+ public int getPortRange() {
+ return portRange;
+ }
+
+ /**
+ * @return Interceptor.
+ */
+ @Nullable public String getMessageInterceptor() {
+ return msgInterceptor;
+ }
+
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
out.writeBoolean(restEnabled);
@@ -158,8 +315,22 @@ public class VisorRestConfiguration extends VisorDataTransferObject {
U.writeString(out, jettyHost);
out.writeObject(jettyPort);
U.writeString(out, tcpHost);
- out.writeObject(tcpPort);
+ out.writeInt(tcpPort);
U.writeString(out, tcpSslCtxFactory);
+ U.writeString(out, secretKey);
+ out.writeBoolean(noDelay);
+ out.writeBoolean(directBuf);
+ out.writeInt(sndBufSize);
+ out.writeInt(rcvBufSize);
+ out.writeLong(idleQryCurTimeout);
+ out.writeLong(idleQryCurCheckFreq);
+ out.writeInt(sndQueueLimit);
+ out.writeInt(selectorCnt);
+ out.writeLong(idleTimeout);
+ out.writeBoolean(sslClientAuth);
+ U.writeString(out, sslFactory);
+ out.writeInt(portRange);
+ U.writeString(out, msgInterceptor);
}
/** {@inheritDoc} */
@@ -170,8 +341,22 @@ public class VisorRestConfiguration extends VisorDataTransferObject {
jettyHost = U.readString(in);
jettyPort = (Integer)in.readObject();
tcpHost = U.readString(in);
- tcpPort = (Integer)in.readObject();
+ tcpPort = in.readInt();
tcpSslCtxFactory = U.readString(in);
+ secretKey = U.readString(in);
+ noDelay = in.readBoolean();
+ directBuf = in.readBoolean();
+ sndBufSize = in.readInt();
+ rcvBufSize = in.readInt();
+ idleQryCurTimeout = in.readLong();
+ idleQryCurCheckFreq = in.readLong();
+ sndQueueLimit = in.readInt();
+ selectorCnt = in.readInt();
+ idleTimeout = in.readLong();
+ sslClientAuth = in.readBoolean();
+ sslFactory = U.readString(in);
+ portRange = in.readInt();
+ msgInterceptor = U.readString(in);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSegmentationConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSegmentationConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSegmentationConfiguration.java
index 6516141..5e4dd40 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSegmentationConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSegmentationConfiguration.java
@@ -51,6 +51,9 @@ public class VisorSegmentationConfiguration extends VisorDataTransferObject {
/** Whether or not all resolvers should succeed for node to be in correct segment. */
private boolean allResolversPassReq;
+ /** Segmentation resolve attempts count. */
+ private int segResolveAttempts;
+
/**
* Default constructor.
*/
@@ -69,6 +72,7 @@ public class VisorSegmentationConfiguration extends VisorDataTransferObject {
checkFreq = c.getSegmentCheckFrequency();
waitOnStart = c.isWaitForSegmentOnStart();
allResolversPassReq = c.isAllSegmentationResolversPassRequired();
+ segResolveAttempts = c.getSegmentationResolveAttempts();
}
/**
@@ -106,6 +110,13 @@ public class VisorSegmentationConfiguration extends VisorDataTransferObject {
return allResolversPassReq;
}
+ /**
+ * @return Segmentation resolve attempts.
+ */
+ public int getSegmentationResolveAttempts() {
+ return segResolveAttempts;
+ }
+
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
U.writeEnum(out, plc);
@@ -113,6 +124,7 @@ public class VisorSegmentationConfiguration extends VisorDataTransferObject {
out.writeLong(checkFreq);
out.writeBoolean(waitOnStart);
out.writeBoolean(allResolversPassReq);
+ out.writeInt(segResolveAttempts);
}
/** {@inheritDoc} */
@@ -122,6 +134,7 @@ public class VisorSegmentationConfiguration extends VisorDataTransferObject {
checkFreq = in.readLong();
waitOnStart = in.readBoolean();
allResolversPassReq = in.readBoolean();
+ segResolveAttempts = in.readInt();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorServiceConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorServiceConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorServiceConfiguration.java
new file mode 100644
index 0000000..1cd883e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorServiceConfiguration.java
@@ -0,0 +1,176 @@
+/*
+ * 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.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+import org.apache.ignite.services.ServiceConfiguration;
+
+import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
+
+/**
+ * Data transfer object for configuration of service data structures.
+ */
+public class VisorServiceConfiguration extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Service name. */
+ private String name;
+
+ /** Service instance. */
+ private String svc;
+
+ /** Total count. */
+ private int totalCnt;
+
+ /** Max per-node count. */
+ private int maxPerNodeCnt;
+
+ /** Cache name. */
+ private String cacheName;
+
+ /** Affinity key. */
+ private String affKey;
+
+ /** Node filter. */
+ private String nodeFilter;
+
+ /**
+ * Construct data transfer object for service configurations properties.
+ *
+ * @param cfgs Service configurations.
+ * @return Service configurations properties.
+ */
+ public static List<VisorServiceConfiguration> list(ServiceConfiguration[] cfgs) {
+ List<VisorServiceConfiguration> res = new ArrayList<>();
+
+ if (!F.isEmpty(cfgs)) {
+ for (ServiceConfiguration cfg : cfgs)
+ res.add(new VisorServiceConfiguration(cfg));
+ }
+
+ return res;
+ }
+
+ /**
+ * Default constructor.
+ */
+ public VisorServiceConfiguration() {
+ // No-op.
+ }
+
+ /**
+ * Create data transfer object for service configuration.
+ *
+ * @param src Service configuration.
+ */
+ public VisorServiceConfiguration(ServiceConfiguration src) {
+ name = src.getName();
+ svc = compactClass(src.getService());
+ totalCnt = src.getTotalCount();
+ maxPerNodeCnt = src.getMaxPerNodeCount();
+ cacheName = src.getCacheName();
+ affKey = compactClass(src.getAffinityKey());
+ nodeFilter = compactClass(src.getNodeFilter());
+ }
+
+ /**
+ * @return Service name.
+ */
+ public String getName() {
+ return name;
+ }
+
+
+ /**
+ * @return Service instance.
+ */
+ public String getService() {
+ return svc;
+ }
+
+ /**
+ * @return Total number of deployed service instances in the cluster, {@code 0} for unlimited.
+ */
+ public int getTotalCount() {
+ return totalCnt;
+ }
+
+ /**
+ * @return Maximum number of deployed service instances on each node, {@code 0} for unlimited.
+ */
+ public int getMaxPerNodeCount() {
+ return maxPerNodeCnt;
+ }
+
+ /**
+ * @return Cache name, possibly {@code null}.
+ */
+ public String getCacheName() {
+ return cacheName;
+ }
+
+ /**
+ * @return Affinity key, possibly {@code null}.
+ */
+ public String getAffinityKey() {
+ return affKey;
+ }
+
+ /**
+ * @return Node filter used to filter nodes on which the service will be deployed, possibly {@code null}.
+ */
+ public String getNodeFilter() {
+ return nodeFilter;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ U.writeString(out, name);
+ U.writeString(out, svc);
+ out.writeInt(totalCnt);
+ out.writeInt(maxPerNodeCnt);
+ U.writeString(out, cacheName);
+ U.writeString(out, affKey);
+ U.writeString(out, nodeFilter);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ name = U.readString(in);
+ svc = U.readString(in);
+ totalCnt = in.readInt();
+ maxPerNodeCnt = in.readInt();
+ cacheName = U.readString(in);
+ affKey = U.readString(in);
+ nodeFilter = U.readString(in);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorServiceConfiguration.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java
deleted file mode 100644
index d4eb65a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java
+++ /dev/null
@@ -1,155 +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.query;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Arguments for {@link VisorQueryTask}.
- */
-public class VisorQueryArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name for query. */
- private String cacheName;
-
- /** Query text. */
- private String qryTxt;
-
- /** Distributed joins enabled flag. */
- private boolean distributedJoins;
-
- /** Enforce join order flag. */
- private boolean enforceJoinOrder;
-
- /** Query contains only replicated tables flag.*/
- private boolean replicatedOnly;
-
- /** Flag whether to execute query locally. */
- private boolean loc;
-
- /** Result batch size. */
- private int pageSize;
-
- /**
- * Default constructor.
- */
- public VisorQueryArg() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name for query.
- * @param qryTxt Query text.
- * @param distributedJoins If {@code true} then distributed joins enabled.
- * @param enforceJoinOrder If {@code true} then enforce join order.
- * @param replicatedOnly {@code true} then query contains only replicated tables.
- * @param loc Flag whether to execute query locally.
- * @param pageSize Result batch size.
- */
- public VisorQueryArg(String cacheName, String qryTxt,
- boolean distributedJoins, boolean enforceJoinOrder, boolean replicatedOnly, boolean loc, int pageSize) {
- this.cacheName = cacheName;
- this.qryTxt = qryTxt;
- this.distributedJoins = distributedJoins;
- this.enforceJoinOrder = enforceJoinOrder;
- this.replicatedOnly = replicatedOnly;
- this.loc = loc;
- this.pageSize = pageSize;
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /**
- * @return Query txt.
- */
- public String getQueryText() {
- return qryTxt;
- }
-
- /**
- * @return Distributed joins enabled flag.
- */
- public boolean isDistributedJoins() {
- return distributedJoins;
- }
-
- /**
- * @return Enforce join order flag.
- */
- public boolean isEnforceJoinOrder() {
- return enforceJoinOrder;
- }
-
- /**
- * @return {@code true} If the query contains only replicated tables.
- */
- public boolean isReplicatedOnly() {
- return replicatedOnly;
- }
-
- /**
- * @return {@code true} If query should be executed locally.
- */
- public boolean isLocal() {
- return loc;
- }
-
- /**
- * @return Page size.
- */
- public int getPageSize() {
- return pageSize;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- U.writeString(out, qryTxt);
- out.writeBoolean(distributedJoins);
- out.writeBoolean(enforceJoinOrder);
- out.writeBoolean(loc);
- out.writeInt(pageSize);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- qryTxt = U.readString(in);
- distributedJoins = in.readBoolean();
- enforceJoinOrder = in.readBoolean();
- loc = in.readBoolean();
- pageSize = in.readInt();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorQueryArg.class, this);
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTask.java
index 6b81dc4..207b690 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTask.java
@@ -30,12 +30,12 @@ import org.jetbrains.annotations.Nullable;
* Task to cancel queries.
*/
@GridInternal
-public class VisorQueryCancelTask extends VisorOneNodeTask<Long, Void> {
+public class VisorQueryCancelTask extends VisorOneNodeTask<VisorQueryCancelTaskArg, Void> {
/** */
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
- @Override protected VisorCancelQueriesJob job(Long arg) {
+ @Override protected VisorCancelQueriesJob job(VisorQueryCancelTaskArg arg) {
return new VisorCancelQueriesJob(arg, debug);
}
@@ -47,7 +47,7 @@ public class VisorQueryCancelTask extends VisorOneNodeTask<Long, Void> {
/**
* Job to cancel queries on node.
*/
- private static class VisorCancelQueriesJob extends VisorJob<Long, Void> {
+ private static class VisorCancelQueriesJob extends VisorJob<VisorQueryCancelTaskArg, Void> {
/** */
private static final long serialVersionUID = 0L;
@@ -57,13 +57,13 @@ public class VisorQueryCancelTask extends VisorOneNodeTask<Long, Void> {
* @param arg Job argument.
* @param debug Flag indicating whether debug information should be printed into node log.
*/
- protected VisorCancelQueriesJob(@Nullable Long arg, boolean debug) {
+ protected VisorCancelQueriesJob(@Nullable VisorQueryCancelTaskArg arg, boolean debug) {
super(arg, debug);
}
/** {@inheritDoc} */
- @Override protected Void run(@Nullable Long queries) throws IgniteException {
- ignite.context().query().cancelQueries(Collections.singleton(queries));
+ @Override protected Void run(@Nullable VisorQueryCancelTaskArg arg) throws IgniteException {
+ ignite.context().query().cancelQueries(Collections.singleton(arg.getQueryId()));
return null;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTaskArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTaskArg.java
new file mode 100644
index 0000000..887a11e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCancelTaskArg.java
@@ -0,0 +1,71 @@
+/*
+ * 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.query;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Arguments for task {@link VisorQueryCancelTask}
+ */
+public class VisorQueryCancelTaskArg extends VisorDataTransferObject {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Query ID to cancel. */
+ private long qryId;
+
+ /**
+ * Default constructor.
+ */
+ public VisorQueryCancelTaskArg() {
+ // No-op.
+ }
+
+ /**
+ * @param qryId Query ID to cancel.
+ */
+ public VisorQueryCancelTaskArg(long qryId) {
+ this.qryId = qryId;
+ }
+
+ /**
+ * @return Query ID to cancel.
+ */
+ public long getQueryId() {
+ return qryId;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+ out.writeLong(qryId);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+ qryId = in.readLong();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(VisorQueryCancelTaskArg.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6a435b17/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCleanupTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCleanupTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCleanupTask.java
index 572cf3b..9dfa0cf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCleanupTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryCleanupTask.java
@@ -40,19 +40,19 @@ import static org.apache.ignite.internal.visor.util.VisorTaskUtils.logMapped;
* Task for cleanup not needed SCAN or SQL queries result futures from node local.
*/
@GridInternal
-public class VisorQueryCleanupTask extends VisorMultiNodeTask<Map<UUID, Collection<String>>, Void, Void> {
+public class VisorQueryCleanupTask extends VisorMultiNodeTask<VisorQueryCleanupTaskArg, Void, Void> {
/** */
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
- @Override protected VisorJob<Map<UUID, Collection<String>>, Void> job(Map<UUID, Collection<String>> arg) {
+ @Override protected VisorJob<VisorQueryCleanupTaskArg, Void> job(VisorQueryCleanupTaskArg arg) {
return null;
}
/** {@inheritDoc} */
@Override protected Map<? extends ComputeJob, ClusterNode> map0(List<ClusterNode> subgrid,
- @Nullable VisorTaskArgument<Map<UUID, Collection<String>>> arg) {
- Set<UUID> nodeIds = taskArg.keySet();
+ @Nullable VisorTaskArgument<VisorQueryCleanupTaskArg> arg) {
+ Set<UUID> nodeIds = taskArg.getQueryIds().keySet();
if (nodeIds.isEmpty())
throw new VisorClusterGroupEmptyException("Nothing to clear. List with node IDs is empty!");
@@ -62,7 +62,7 @@ public class VisorQueryCleanupTask extends VisorMultiNodeTask<Map<UUID, Collecti
try {
for (ClusterNode node : subgrid)
if (nodeIds.contains(node.id()))
- map.put(new VisorQueryCleanupJob(taskArg.get(node.id()), debug), node);
+ map.put(new VisorQueryCleanupJob(taskArg.getQueryIds().get(node.id()), debug), node);
if (map.isEmpty()) {
StringBuilder notFoundNodes = new StringBuilder();