You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by iv...@apache.org on 2015/07/01 12:02:34 UTC
[01/23] incubator-ignite git commit: #IGNITE-1046 Added dockerfile
and scripts for running container with ignite.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-964-1 b963d0339 -> 3807762a9
#IGNITE-1046 Added dockerfile and scripts for running container with ignite.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9de7d248
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9de7d248
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9de7d248
Branch: refs/heads/ignite-964-1
Commit: 9de7d248d9ed720179887547772a899beea48488
Parents: 1c66078
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jun 24 16:26:07 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jun 24 16:26:07 2015 +0300
----------------------------------------------------------------------
modules/docker/Dockerfile | 38 +++++++++++++++++++++++++++++
modules/docker/README.txt | 11 +++++++++
modules/docker/build_users_libs.sh | 23 ++++++++++++++++++
modules/docker/download_ignite.sh | 33 ++++++++++++++++++++++++++
modules/docker/execute.sh | 42 +++++++++++++++++++++++++++++++++
modules/docker/run.sh | 11 +++++++++
6 files changed, 158 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9de7d248/modules/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/docker/Dockerfile b/modules/docker/Dockerfile
new file mode 100644
index 0000000..2723333
--- /dev/null
+++ b/modules/docker/Dockerfile
@@ -0,0 +1,38 @@
+# Start from a Debian image.
+FROM debian:8
+
+# Install tools.
+RUN apt-get update && apt-get install -y --fix-missing \
+ wget \
+ dstat \
+ maven \
+ git
+
+# Intasll Oracle JDK.
+RUN mkdir /opt/jdk
+
+RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie" \
+ http://download.oracle.com/otn-pub/java/jdk/7u76-b13/jdk-7u76-linux-x64.tar.gz
+
+RUN tar -zxf jdk-7u76-linux-x64.tar.gz -C /opt/jdk
+
+RUN rm jdk-7u76-linux-x64.tar.gz
+
+RUN update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.7.0_76/bin/java 100
+
+RUN update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.7.0_76/bin/javac 100
+
+# Sets java variables.
+ENV JAVA_HOME /opt/jdk/jdk1.7.0_76/
+
+# Create working directory
+RUN mkdir /home/ignite_home
+
+WORKDIR /home/ignite_home
+
+# Copy sh files and set permission
+ADD *.sh ./
+
+RUN chmod +x *.sh
+
+CMD ./run.sh
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9de7d248/modules/docker/README.txt
----------------------------------------------------------------------
diff --git a/modules/docker/README.txt b/modules/docker/README.txt
new file mode 100644
index 0000000..0299d4c
--- /dev/null
+++ b/modules/docker/README.txt
@@ -0,0 +1,11 @@
+Apache Ignite Docker module
+------------------------
+
+Apache Ignite Docker module provides Dockerfile and bash scripts for building docker image.
+
+Build image
+-------------------------------------
+
+cd to ./modules/docker
+
+sudo docker build .
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9de7d248/modules/docker/build_users_libs.sh
----------------------------------------------------------------------
diff --git a/modules/docker/build_users_libs.sh b/modules/docker/build_users_libs.sh
new file mode 100644
index 0000000..24f4420
--- /dev/null
+++ b/modules/docker/build_users_libs.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [ -z $GIT_REPO ]; then
+ echo Users git repo is not provided.
+
+ exit 0
+fi
+
+git clone $GIT_REPO user-repo
+
+cd user-repo
+
+if [ ! -z $GIT_BRANCH ]; then
+ git checkout $GIT_BRANCH
+fi
+
+if [ ! -z "$BUILD_CMD" ]; then
+ echo "Starting to execute build command: $BUILD_CMD"
+
+ eval "$BUILD_CMD"
+else
+ mvn clean package
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9de7d248/modules/docker/download_ignite.sh
----------------------------------------------------------------------
diff --git a/modules/docker/download_ignite.sh b/modules/docker/download_ignite.sh
new file mode 100644
index 0000000..6a8617f
--- /dev/null
+++ b/modules/docker/download_ignite.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+function download {
+ wget -O ignite.zip $1
+
+ unzip ignite.zip -d ignite
+
+ rm ignite.zip
+
+ exit 0
+}
+
+if [ ! -z $IGNITE_URL ]; then
+ download $IGNITE_URL
+fi
+
+if [ ! -z $IGNITE_VERSION ]; then
+ if [[ $IGNITE_VERSION =~ [0-9]*\.[0-9]*\.0 ]]; then
+ download http://apache-mirror.rbc.ru/pub/apache/incubator/ignite/${IGNITE_VERSION}/apache-ignite-fabric-${IGNITE_VERSION}-incubating-bin.zip
+ else
+ download http://www.gridgain.com/media/gridgain-community-fabric-${IGNITE_VERSION}.zip
+ fi
+fi
+
+if [ -z $IGNITE_SOURCE ] || [ $IGNITE_SOURCE = "COMMUNITY" ]; then
+ download http://tiny.cc/updater/download_community.php
+fi
+
+if [ $IGNITE_SOURCE = "APACHE" ]; then
+ download http://tiny.cc/updater/download_ignite.php
+fi
+
+echo "Unsupported IGNITE_SOURCE type: ${IGNITE_SOURCE}"
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9de7d248/modules/docker/execute.sh
----------------------------------------------------------------------
diff --git a/modules/docker/execute.sh b/modules/docker/execute.sh
new file mode 100644
index 0000000..2aaaa2d
--- /dev/null
+++ b/modules/docker/execute.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+if [ ! -z "$GIT_REPO" ]; then
+ if [ -z "$LIB_PATTERN" ]; then
+ find user-repo/ -regextype posix-extended -regex "user-repo/target/.*(jar|zip)$" -exec cp {} ignite/*/libs \;
+ else
+ find user-repo/ -regextype posix-extended -regex "$LIB_PATTERN" -exec cp {} ignite/*/libs \;
+ fi
+fi
+
+if [ ! -z "$OPTION_LIBS" ]; then
+ IFS=, LIBS_LIST=("$OPTION_LIBS")
+
+ for lib in ${LIBS_LIST[@]}; do
+ cp -r ./ignite/*/libs/optional/"$lib"/* ./ignite/*/libs
+ done
+fi
+
+# Try to download
+if [ ! -z "$IGNITE_CONFIG" ]; then
+ wget -O ignite-config.xml "$IGNITE_CONFIG" 2>/dev/null
+
+ RETVAL=$?
+
+ [ $RETVAL -eq 0 ] && IGNITE_CONFIG=ignite-config.xml
+
+ [ $RETVAL -ne 0 ] && rm ignite-config.xml && echo "Failed download config: $IGNITE_CONFIG. Try to load config from classpath."
+fi
+
+if [ ! -z "$EXEC_CMD" ]; then
+ echo "Starting to execute command: $EXEC_CMD"
+
+ eval "$EXEC_CMD"
+
+ exit 0
+fi
+
+if [ -z "$IGNITE_CONFIG" ]; then
+ ignite/*/bin/ignite.sh
+else
+ ignite/*/bin/ignite.sh ignite-config.xml
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9de7d248/modules/docker/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/run.sh b/modules/docker/run.sh
new file mode 100644
index 0000000..42fb29d
--- /dev/null
+++ b/modules/docker/run.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [ -z $SKIP_DOWNLOAD ]; then
+ ./download_ignite.sh
+fi
+
+if [ -z $SKIP_BUILD_LIBS ]; then
+ ./build_users_libs.sh
+fi
+
+./execute.sh
\ No newline at end of file
[11/23] incubator-ignite git commit: # ignite-sprint-7 minor
Posted by iv...@apache.org.
# ignite-sprint-7 minor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e0c53b81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e0c53b81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e0c53b81
Branch: refs/heads/ignite-964-1
Commit: e0c53b8171add7bfed0249c67a8e743443b7593f
Parents: e91bc48
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jul 1 10:06:20 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jul 1 10:06:20 2015 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e0c53b81/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index fa3e564..720ce3a 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -2332,7 +2332,7 @@ class ServerImpl extends TcpDiscoveryImpl {
LT.warn(log, null, "Local node has detected failed nodes and started cluster-wide procedure. " +
"To speed up failure detection please see 'Failure Detection' section under javadoc" +
- "for 'TcpDiscoverySpi'");
+ " for 'TcpDiscoverySpi'");
}
}
[16/23] incubator-ignite git commit: #ignite-964: QueryCommandHandler
code style.
Posted by iv...@apache.org.
#ignite-964: QueryCommandHandler code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7e0a63b6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7e0a63b6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7e0a63b6
Branch: refs/heads/ignite-964-1
Commit: 7e0a63b6408d079b146e7d5b9dc21efd766e803f
Parents: f9a738f
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 12:25:35 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 12:25:35 2015 +0300
----------------------------------------------------------------------
.../handlers/query/QueryCommandHandler.java | 99 +++++++++-----------
1 file changed, 43 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e0a63b6/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
index a254115..9432bb7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
@@ -25,7 +25,6 @@ import org.apache.ignite.internal.processors.rest.request.*;
import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.typedef.internal.*;
-import javax.cache.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
@@ -45,8 +44,7 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
private static final AtomicLong qryIdGen = new AtomicLong();
/** Current queries. */
- private final ConcurrentHashMap<Long, Iterator<Cache.Entry<Object, Object>>> curs =
- new ConcurrentHashMap<>();
+ private final ConcurrentHashMap<Long, Iterator> curs = new ConcurrentHashMap<>();
/**
* @param ctx Context.
@@ -79,7 +77,7 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
assert req instanceof RestSqlQueryRequest : "Invalid type of query request.";
return ctx.closure().callLocalSafe(
- new FetchQueryCallable(ctx, (RestSqlQueryRequest)req, curs), false);
+ new FetchQueryCallable((RestSqlQueryRequest)req, curs), false);
}
}
@@ -90,9 +88,6 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
* Execute query callable.
*/
private static class ExecuteQueryCallable implements Callable<GridRestResponse> {
- /** */
- private static final long serialVersionUID = 0L;
-
/** Kernal context. */
private GridKernalContext ctx;
@@ -100,14 +95,15 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
private RestSqlQueryRequest req;
/** Queries cursors. */
- private ConcurrentHashMap<Long, Iterator<Cache.Entry<Object, Object>>> curs;
+ private ConcurrentHashMap<Long, Iterator> curs;
/**
* @param ctx Kernal context.
* @param req Execute query request.
+ * @param curs Queries cursors.
*/
public ExecuteQueryCallable(GridKernalContext ctx, RestSqlQueryRequest req,
- ConcurrentHashMap<Long, Iterator<Cache.Entry<Object, Object>>> curs) {
+ ConcurrentHashMap<Long, Iterator> curs) {
this.ctx = ctx;
this.req = req;
this.curs = curs;
@@ -129,31 +125,15 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
((SqlFieldsQuery)qry).setArgs(req.arguments());
}
- Iterator<Cache.Entry<Object, Object>> cur =
- ctx.grid().cache(req.cacheName()).query(qry).iterator();
+ Iterator cur = ctx.grid().cache(req.cacheName()).query(qry).iterator();
long qryId = qryIdGen.getAndIncrement();
curs.put(qryId, cur);
- List res = new ArrayList<>();
-
- CacheQueryResult response = new CacheQueryResult();
-
- for (int i = 0; i < req.pageSize() && cur.hasNext(); ++i) {
- res.add(cur.next());
- }
-
- response.setItems(res);
-
- response.setLast(!cur.hasNext());
-
- response.setQueryId(qryId);
-
- if (!cur.hasNext())
- curs.remove(qryId);
+ CacheQueryResult res = createQueryResult(curs, cur, req, qryId);
- return new GridRestResponse(response);
+ return new GridRestResponse(res);
}
catch (Exception e) {
return new GridRestResponse(GridRestResponse.STATUS_FAILED, e.getMessage());
@@ -165,25 +145,18 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
* Fetch query callable.
*/
private static class FetchQueryCallable implements Callable<GridRestResponse> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Kernal context. */
- private GridKernalContext ctx;
-
/** Execute query request. */
private RestSqlQueryRequest req;
/** Queries cursors. */
- private ConcurrentHashMap<Long, Iterator<Cache.Entry<Object, Object>>> curs;
+ private ConcurrentHashMap<Long, Iterator> curs;
/**
- * @param ctx Kernal context.
* @param req Execute query request.
+ * @param curs Queries cursors.
*/
- public FetchQueryCallable(GridKernalContext ctx, RestSqlQueryRequest req,
- ConcurrentHashMap<Long, Iterator<Cache.Entry<Object, Object>>> curs) {
- this.ctx = ctx;
+ public FetchQueryCallable(RestSqlQueryRequest req,
+ ConcurrentHashMap<Long, Iterator> curs) {
this.req = req;
this.curs = curs;
}
@@ -191,29 +164,15 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
/** {@inheritDoc} */
@Override public GridRestResponse call() throws Exception {
try {
- Iterator<Cache.Entry<Object, Object>> cur = curs.get(req.queryId());
+ Iterator cur = curs.get(req.queryId());
if (cur == null)
return new GridRestResponse(GridRestResponse.STATUS_FAILED,
"Cannot find query [qryId=" + req.queryId() + "]");
- List res = new ArrayList<>();
+ CacheQueryResult res = createQueryResult(curs, cur, req, req.queryId());
- CacheQueryResult response = new CacheQueryResult();
-
- for (int i = 0; i < req.pageSize() && cur.hasNext(); ++i) {
- res.add(cur.next());
- }
- response.setItems(res);
-
- response.setLast(!cur.hasNext());
-
- response.setQueryId(req.queryId());
-
- if (!cur.hasNext())
- curs.remove(req.queryId());
-
- return new GridRestResponse(response);
+ return new GridRestResponse(res);
}
catch (Exception e) {
curs.remove(req.queryId());
@@ -222,4 +181,32 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
}
}
}
+
+ /**
+ * @param curs Queries cursors.
+ * @param cur Current cursor.
+ * @param req Sql request.
+ * @param qryId Query id.
+ * @return Query result with items.
+ */
+ private static CacheQueryResult createQueryResult(ConcurrentHashMap<Long, Iterator> curs, Iterator cur,
+ RestSqlQueryRequest req, Long qryId) {
+ CacheQueryResult res = new CacheQueryResult();
+
+ List<Object> items = new ArrayList<>();
+
+ for (int i = 0; i < req.pageSize() && cur.hasNext(); ++i)
+ items.add(cur.next());
+
+ res.setItems(items);
+
+ res.setLast(!cur.hasNext());
+
+ res.setQueryId(qryId);
+
+ if (!cur.hasNext())
+ curs.remove(req.queryId());
+
+ return res;
+ }
}
[09/23] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
into ignite-1063
Posted by iv...@apache.org.
Merge branch 'ignite-sprint-7' into ignite-1063
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/28525acb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/28525acb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/28525acb
Branch: refs/heads/ignite-964-1
Commit: 28525acbe2e19f5605137dbb7e9b3824eab25987
Parents: ef7a35c 6ebcb6d
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 30 16:56:15 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 30 16:56:15 2015 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 26 +-
.../IgniteTopologyPrintFormatSelfTest.java | 289 +++++++++++++++++++
.../testsuites/IgniteKernalSelfTestSuite.java | 1 +
3 files changed, 310 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[12/23] incubator-ignite git commit: Merge branch 'ignite-sprint-7'
into ignite-1046
Posted by iv...@apache.org.
Merge branch 'ignite-sprint-7' into ignite-1046
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/aea804b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/aea804b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/aea804b4
Branch: refs/heads/ignite-964-1
Commit: aea804b41fd0a73a1eb4f8f68e28bf77d00de966
Parents: 4eef6d0 e91bc48
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jul 1 11:03:32 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jul 1 11:03:32 2015 +0300
----------------------------------------------------------------------
.../ClientAbstractConnectivitySelfTest.java | 4 +-
.../org/apache/ignite/cluster/ClusterGroup.java | 18 +-
.../org/apache/ignite/cluster/ClusterNode.java | 2 +
.../ignite/compute/ComputeTaskSplitAdapter.java | 2 +-
.../configuration/CacheConfiguration.java | 105 +--
.../configuration/IgniteReflectionFactory.java | 81 +-
.../configuration/NearCacheConfiguration.java | 10 +-
.../ignite/internal/GridKernalContextImpl.java | 5 +-
.../internal/cluster/ClusterGroupAdapter.java | 50 +-
.../cluster/IgniteClusterAsyncImpl.java | 12 +-
.../discovery/GridDiscoveryManager.java | 32 +-
.../processors/cache/GridCacheContext.java | 2 +-
.../cache/GridCacheDeploymentManager.java | 10 +-
.../GridCachePartitionExchangeManager.java | 6 +-
.../processors/cache/GridCacheProcessor.java | 62 +-
.../distributed/dht/GridDhtLocalPartition.java | 3 +-
.../distributed/dht/GridDhtLockFuture.java | 2 +-
.../dht/atomic/GridDhtAtomicCache.java | 9 +-
.../GridDhtPartitionsExchangeFuture.java | 46 +-
.../processors/clock/GridClockServer.java | 21 +-
.../datastructures/DataStructuresProcessor.java | 64 +-
.../processors/hadoop/HadoopJobInfo.java | 4 +-
.../hadoop/counter/HadoopCounterWriter.java | 5 +-
.../processors/plugin/CachePluginManager.java | 10 +-
.../processors/rest/GridRestProcessor.java | 4 +-
.../handlers/task/GridTaskCommandHandler.java | 12 +-
.../processors/task/GridTaskWorker.java | 4 +-
.../internal/util/GridConfigurationFinder.java | 55 +-
.../ignite/internal/util/IgniteUtils.java | 6 +-
.../shmem/IpcSharedMemoryServerEndpoint.java | 10 +-
.../apache/ignite/internal/visor/VisorJob.java | 2 +
.../internal/visor/log/VisorLogSearchTask.java | 2 +-
.../visor/node/VisorNodeDataCollectorJob.java | 4 +
.../visor/query/VisorQueryCleanupTask.java | 14 +
.../util/VisorClusterGroupEmptyException.java | 37 +
.../ignite/spi/discovery/tcp/ClientImpl.java | 151 ++--
.../ignite/spi/discovery/tcp/ServerImpl.java | 103 ++-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 3 +-
.../TcpDiscoveryMulticastIpFinder.java | 74 +-
.../core/src/test/config/spark/spark-config.xml | 46 ++
.../internal/ClusterGroupAbstractTest.java | 777 ++++++++++++++++++
.../internal/ClusterGroupHostsSelfTest.java | 141 ++++
.../ignite/internal/ClusterGroupSelfTest.java | 251 ++++++
.../internal/GridDiscoveryEventSelfTest.java | 12 +-
.../internal/GridProjectionAbstractTest.java | 784 -------------------
.../ignite/internal/GridProjectionSelfTest.java | 251 ------
.../apache/ignite/internal/GridSelfTest.java | 2 +-
.../IgniteTopologyPrintFormatSelfTest.java | 289 +++++++
.../CacheReadThroughAtomicRestartSelfTest.java | 32 +
...heReadThroughLocalAtomicRestartSelfTest.java | 32 +
.../CacheReadThroughLocalRestartSelfTest.java | 32 +
...dThroughReplicatedAtomicRestartSelfTest.java | 32 +
...cheReadThroughReplicatedRestartSelfTest.java | 32 +
.../cache/CacheReadThroughRestartSelfTest.java | 133 ++++
.../cache/GridCacheAbstractSelfTest.java | 2 +-
.../cache/GridCacheDaemonNodeStopSelfTest.java | 119 ---
.../IgniteDaemonNodeMarshallerCacheTest.java | 192 +++++
...eDynamicCacheStartNoExchangeTimeoutTest.java | 466 +++++++++++
.../cache/IgniteDynamicCacheStartSelfTest.java | 37 +
...GridCacheQueueMultiNodeAbstractSelfTest.java | 4 +-
.../GridCacheSetAbstractSelfTest.java | 22 +-
.../IgniteDataStructureWithJobTest.java | 111 +++
.../distributed/IgniteCache150ClientsTest.java | 189 +++++
...teCacheClientNodePartitionsExchangeTest.java | 1 +
.../distributed/IgniteCacheManyClientsTest.java | 1 +
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 5 -
...achePartitionedMultiNodeFullApiSelfTest.java | 53 +-
.../GridCacheReplicatedFailoverSelfTest.java | 5 +
.../IgniteCacheTxStoreSessionTest.java | 4 +
.../internal/util/IgniteUtilsSelfTest.java | 22 +
.../tcp/TcpClientDiscoverySpiSelfTest.java | 265 ++++++-
.../testframework/junits/GridAbstractTest.java | 2 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 7 +-
.../IgniteCacheDataStructuresSelfTestSuite.java | 1 +
.../testsuites/IgniteCacheTestSuite3.java | 1 -
.../testsuites/IgniteCacheTestSuite4.java | 8 +
.../testsuites/IgniteClientTestSuite.java | 38 +
.../testsuites/IgniteKernalSelfTestSuite.java | 1 +
.../p2p/GridP2PContinuousDeploymentTask1.java | 2 +-
modules/hadoop/pom.xml | 78 --
.../fs/IgniteHadoopFileSystemCounterWriter.java | 9 +-
.../processors/hadoop/HadoopClassLoader.java | 29 +
.../processors/hadoop/HadoopDefaultJobInfo.java | 27 +-
.../internal/processors/hadoop/HadoopUtils.java | 237 ------
.../hadoop/SecondaryFileSystemProvider.java | 3 +-
.../hadoop/fs/HadoopFileSystemCacheUtils.java | 241 ++++++
.../hadoop/fs/HadoopFileSystemsUtils.java | 11 +
.../hadoop/fs/HadoopLazyConcurrentMap.java | 5 +
.../hadoop/jobtracker/HadoopJobTracker.java | 25 +-
.../child/HadoopChildProcessRunner.java | 3 +-
.../processors/hadoop/v2/HadoopV2Job.java | 84 +-
.../hadoop/v2/HadoopV2JobResourceManager.java | 22 +-
.../hadoop/v2/HadoopV2TaskContext.java | 37 +-
.../apache/ignite/igfs/IgfsEventsTestSuite.java | 5 +-
.../processors/hadoop/HadoopMapReduceTest.java | 2 +-
.../processors/hadoop/HadoopTasksV1Test.java | 7 +-
.../processors/hadoop/HadoopTasksV2Test.java | 7 +-
.../processors/hadoop/HadoopV2JobSelfTest.java | 6 +-
.../collections/HadoopAbstractMapTest.java | 3 +-
.../testsuites/IgniteHadoopTestSuite.java | 2 +-
.../IgniteIgfsLinuxAndMacOSTestSuite.java | 3 +-
.../ignite/schema/model/PojoDescriptor.java | 2 +
.../apache/ignite/schema/model/PojoField.java | 1 +
.../parser/dialect/OracleMetadataDialect.java | 2 +-
.../org/apache/ignite/spark/IgniteContext.scala | 50 +-
.../org/apache/ignite/spark/IgniteRddSpec.scala | 18 +
.../commands/cache/VisorCacheCommand.scala | 7 +-
pom.xml | 12 +-
scripts/git-patch-prop.sh | 2 +-
109 files changed, 4514 insertions(+), 1876 deletions(-)
----------------------------------------------------------------------
[06/23] incubator-ignite git commit: # ignite-gg-1064 allow start if
can not initialize multicast
Posted by iv...@apache.org.
# ignite-gg-1064 allow start if can not initialize multicast
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b5bc06ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b5bc06ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b5bc06ee
Branch: refs/heads/ignite-964-1
Commit: b5bc06ee813471643c460aaa74ef4395ad79bd53
Parents: bade9f1
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 30 12:40:53 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 30 12:40:53 2015 +0300
----------------------------------------------------------------------
.../TcpDiscoveryMulticastIpFinder.java | 74 ++++++++++++++++----
1 file changed, 60 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b5bc06ee/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
index 8e5a1fd..014d937 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
@@ -26,7 +26,6 @@ import org.apache.ignite.marshaller.*;
import org.apache.ignite.marshaller.jdk.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.*;
-import org.apache.ignite.spi.discovery.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.jetbrains.annotations.*;
@@ -278,7 +277,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
addrSnds = new ArrayList<>(locAddrs.size());
- Collection<InetAddress> reqItfs = new ArrayList<>(locAddrs.size()); // Interfaces used to send requests.
+ Set<InetAddress> reqItfs = new HashSet<>(locAddrs.size()); // Interfaces used to send requests.
for (String locAddr : locAddrs) {
InetAddress addr;
@@ -309,6 +308,8 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
}
}
+ boolean mcastErr = false;
+
if (!clientMode) {
if (addrSnds.isEmpty()) {
try {
@@ -317,13 +318,31 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
addrSnds.add(new AddressSender(mcastAddr, null, addrs));
}
catch (IOException e) {
- throw new IgniteSpiException("Failed to create multicast socket [mcastAddr=" + mcastAddr +
- ", mcastGrp=" + mcastGrp + ", mcastPort=" + mcastPort + ']', e);
+ if (log.isDebugEnabled())
+ log.debug("Failed to create multicast socket [mcastAddr=" + mcastAddr +
+ ", mcastGrp=" + mcastGrp + ", mcastPort=" + mcastPort + ", err=" + e + ']');
+ }
+
+ if (addrSnds.isEmpty()) {
+ try {
+ addrSnds.add(new AddressSender(mcastAddr, mcastAddr, addrs));
+
+ reqItfs.add(mcastAddr);
+ }
+ catch (IOException e) {
+ log.debug("Failed to create multicast socket [mcastAddr=" + mcastAddr +
+ ", mcastGrp=" + mcastGrp + ", mcastPort=" + mcastPort + ", locAddr=" + mcastAddr +
+ ", err=" + e + ']');
+ }
}
}
- for (AddressSender addrSnd : addrSnds)
- addrSnd.start();
+ if (!addrSnds.isEmpty()) {
+ for (AddressSender addrSnd : addrSnds)
+ addrSnd.start();
+ }
+ else
+ mcastErr = true;
}
else
assert addrSnds.isEmpty() : addrSnds;
@@ -358,10 +377,30 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
}
}
}
- else
- ret = requestAddresses(mcastAddr, F.first(reqItfs));
+ else {
+ T2<Collection<InetSocketAddress>, Boolean> res = requestAddresses(mcastAddr, F.first(reqItfs));
+
+ ret = res.get1();
+
+ mcastErr |= res.get2();
+ }
+
+ if (ret.isEmpty()) {
+ if (mcastErr) {
+ if (getRegisteredAddresses().isEmpty()) {
+ InetSocketAddress addr = new InetSocketAddress("localhost", TcpDiscoverySpi.DFLT_PORT);
+
+ U.quietAndWarn(log, "TcpDiscoveryMulticastIpFinder failed to initialize multicast, " +
+ "will use default address: " + addr);
- if (!ret.isEmpty())
+ registerAddresses(Collections.singleton(addr));
+ }
+ else
+ U.quietAndWarn(log, "TcpDiscoveryMulticastIpFinder failed to initialize multicast, " +
+ "will use pre-configured addresses.");
+ }
+ }
+ else
registerAddresses(ret);
}
@@ -379,11 +418,16 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
*
* @param mcastAddr Multicast address where to send request.
* @param sockItf Optional interface multicast socket should be bound to.
- * @return Collection of received addresses.
+ * @return Tuple where first value is collection of received addresses, second is boolean which is
+ * {@code true} if got error on send.
*/
- private Collection<InetSocketAddress> requestAddresses(InetAddress mcastAddr, @Nullable InetAddress sockItf) {
+ private T2<Collection<InetSocketAddress>, Boolean> requestAddresses(InetAddress mcastAddr,
+ @Nullable InetAddress sockItf)
+ {
Collection<InetSocketAddress> rmtAddrs = new HashSet<>();
+ boolean sndErr = false;
+
try {
DatagramPacket reqPckt = new DatagramPacket(MSG_ADDR_REQ_DATA, MSG_ADDR_REQ_DATA.length,
mcastAddr, mcastPort);
@@ -414,6 +458,8 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
sock.send(reqPckt);
}
catch (IOException e) {
+ sndErr = true;
+
if (!handleNetworkError(e))
break;
@@ -486,14 +532,14 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
if (rmtAddrs.isEmpty() && sndError)
U.quietAndWarn(log, "Failed to send multicast message (is multicast enabled on this node?).");
- return rmtAddrs;
+ return new T2<>(rmtAddrs, sndErr);
}
catch (IgniteInterruptedCheckedException ignored) {
U.warn(log, "Got interrupted while sending address request.");
Thread.currentThread().interrupt();
- return rmtAddrs;
+ return new T2<>(rmtAddrs, sndErr);
}
}
@@ -610,7 +656,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
/** {@inheritDoc} */
@Override protected void body() throws InterruptedException {
- addrs = requestAddresses(mcastAddr, sockAddr);
+ addrs = requestAddresses(mcastAddr, sockAddr).get1();
}
/**
[05/23] incubator-ignite git commit: IGNITE-1063 Added generic for
chaining setters.
Posted by iv...@apache.org.
IGNITE-1063 Added generic for chaining setters.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ef7a35ce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ef7a35ce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ef7a35ce
Branch: refs/heads/ignite-964-1
Commit: ef7a35ce9afb830c2e02b624eb3f3298f66e6129
Parents: bade9f1
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 30 12:31:13 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 30 12:31:13 2015 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 105 ++++++++++---------
.../configuration/NearCacheConfiguration.java | 10 +-
2 files changed, 61 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ef7a35ce/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 7af4974..e2308f2 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -419,7 +419,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param name Cache name. May be <tt>null</tt>, but may not be empty string.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setName(String name) {
+ public CacheConfiguration<K, V> setName(String name) {
A.ensure(name == null || !name.isEmpty(), "Name cannot be null or empty.");
this.name = name;
@@ -444,7 +444,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param evictPlc Cache expiration policy.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setEvictionPolicy(@Nullable EvictionPolicy evictPlc) {
+ public CacheConfiguration<K, V> setEvictionPolicy(@Nullable EvictionPolicy evictPlc) {
this.evictPlc = evictPlc;
return this;
@@ -461,7 +461,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param nearCfg Near cache configuration.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setNearConfiguration(NearCacheConfiguration<K, V> nearCfg) {
+ public CacheConfiguration<K, V> setNearConfiguration(NearCacheConfiguration<K, V> nearCfg) {
this.nearCfg = nearCfg;
return this;
@@ -483,7 +483,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param writeSync Write synchronization mode.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setWriteSynchronizationMode(CacheWriteSynchronizationMode writeSync) {
+ public CacheConfiguration<K, V> setWriteSynchronizationMode(CacheWriteSynchronizationMode writeSync) {
this.writeSync = writeSync;
return this;
@@ -504,7 +504,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param nodeFilter Predicate specifying on which nodes the cache should be started.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter) {
+ public CacheConfiguration<K, V> setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter) {
this.nodeFilter = nodeFilter;
return this;
@@ -536,7 +536,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param evictSync {@code true} if synchronized, {@code false} if not.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setEvictSynchronized(boolean evictSync) {
+ public CacheConfiguration<K, V> setEvictSynchronized(boolean evictSync) {
this.evictSync = evictSync;
return this;
@@ -559,7 +559,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param evictKeyBufSize Eviction key buffer size.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setEvictSynchronizedKeyBufferSize(int evictKeyBufSize) {
+ public CacheConfiguration<K, V> setEvictSynchronizedKeyBufferSize(int evictKeyBufSize) {
this.evictKeyBufSize = evictKeyBufSize;
return this;
@@ -593,7 +593,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param evictSyncConcurrencyLvl Concurrency level for synchronized evictions.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setEvictSynchronizedConcurrencyLevel(int evictSyncConcurrencyLvl) {
+ public CacheConfiguration<K, V> setEvictSynchronizedConcurrencyLevel(int evictSyncConcurrencyLvl) {
this.evictSyncConcurrencyLvl = evictSyncConcurrencyLvl;
return this;
@@ -619,7 +619,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param evictSyncTimeout Timeout for synchronized evictions.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setEvictSynchronizedTimeout(long evictSyncTimeout) {
+ public CacheConfiguration<K, V> setEvictSynchronizedTimeout(long evictSyncTimeout) {
this.evictSyncTimeout = evictSyncTimeout;
return this;
@@ -651,7 +651,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param evictMaxOverflowRatio Maximum eviction overflow ratio.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setEvictMaxOverflowRatio(float evictMaxOverflowRatio) {
+ public CacheConfiguration<K, V> setEvictMaxOverflowRatio(float evictMaxOverflowRatio) {
this.evictMaxOverflowRatio = evictMaxOverflowRatio;
return this;
@@ -680,7 +680,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param evictFilter Eviction filter.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setEvictionFilter(EvictionFilter<K, V> evictFilter) {
+ public CacheConfiguration<K, V> setEvictionFilter(EvictionFilter<K, V> evictFilter) {
this.evictFilter = evictFilter;
return this;
@@ -709,7 +709,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #isEagerTtl()
* @return {@code this} for chaining.
*/
- public CacheConfiguration setEagerTtl(boolean eagerTtl) {
+ public CacheConfiguration<K, V> setEagerTtl(boolean eagerTtl) {
this.eagerTtl = eagerTtl;
return this;
@@ -731,7 +731,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param startSize Cache start size.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setStartSize(int startSize) {
+ public CacheConfiguration<K, V> setStartSize(int startSize) {
this.startSize = startSize;
return this;
@@ -775,7 +775,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param loadPrevVal Load previous value flag.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setLoadPreviousValue(boolean loadPrevVal) {
+ public CacheConfiguration<K, V> setLoadPreviousValue(boolean loadPrevVal) {
this.loadPrevVal = loadPrevVal;
return this;
@@ -798,7 +798,8 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @return {@code this} for chaining.
*/
@SuppressWarnings("unchecked")
- public CacheConfiguration setCacheStoreFactory(Factory<? extends CacheStore<? super K, ? super V>> storeFactory) {
+ public CacheConfiguration<K, V> setCacheStoreFactory(
+ Factory<? extends CacheStore<? super K, ? super V>> storeFactory) {
this.storeFactory = storeFactory;
return this;
@@ -819,7 +820,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param aff Cache key affinity.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setAffinity(AffinityFunction aff) {
+ public CacheConfiguration<K, V> setAffinity(AffinityFunction aff) {
this.aff = aff;
return this;
@@ -842,7 +843,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param cacheMode Caching mode.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setCacheMode(CacheMode cacheMode) {
+ public CacheConfiguration<K, V> setCacheMode(CacheMode cacheMode) {
this.cacheMode = cacheMode;
return this;
@@ -865,7 +866,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param atomicityMode Cache atomicity mode.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setAtomicityMode(CacheAtomicityMode atomicityMode) {
+ public CacheConfiguration<K, V> setAtomicityMode(CacheAtomicityMode atomicityMode) {
this.atomicityMode = atomicityMode;
return this;
@@ -888,7 +889,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param atomicWriteOrderMode Cache write ordering mode.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setAtomicWriteOrderMode(CacheAtomicWriteOrderMode atomicWriteOrderMode) {
+ public CacheConfiguration<K, V> setAtomicWriteOrderMode(CacheAtomicWriteOrderMode atomicWriteOrderMode) {
this.atomicWriteOrderMode = atomicWriteOrderMode;
return this;
@@ -913,7 +914,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param backups Number of backup nodes for one partition.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setBackups(int backups) {
+ public CacheConfiguration<K, V> setBackups(int backups) {
this.backups = backups;
return this;
@@ -935,7 +936,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param dfltLockTimeout Default lock timeout.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setDefaultLockTimeout(long dfltLockTimeout) {
+ public CacheConfiguration<K, V> setDefaultLockTimeout(long dfltLockTimeout) {
this.dfltLockTimeout = dfltLockTimeout;
return this;
@@ -956,7 +957,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param invalidate Flag to set this cache into invalidation-based mode. Default value is {@code false}.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setInvalidate(boolean invalidate) {
+ public CacheConfiguration<K, V> setInvalidate(boolean invalidate) {
this.invalidate = invalidate;
return this;
@@ -978,7 +979,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* receive JTA transaction manager.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setTransactionManagerLookupClassName(String tmLookupClsName) {
+ public CacheConfiguration<K, V> setTransactionManagerLookupClassName(String tmLookupClsName) {
this.tmLookupClsName = tmLookupClsName;
return this;
@@ -990,7 +991,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param rebalanceMode Rebalance mode.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setRebalanceMode(CacheRebalanceMode rebalanceMode) {
+ public CacheConfiguration<K, V> setRebalanceMode(CacheRebalanceMode rebalanceMode) {
this.rebalanceMode = rebalanceMode;
return this;
@@ -1033,7 +1034,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #getRebalanceOrder()
* @return {@code this} for chaining.
*/
- public CacheConfiguration setRebalanceOrder(int rebalanceOrder) {
+ public CacheConfiguration<K, V> setRebalanceOrder(int rebalanceOrder) {
this.rebalanceOrder = rebalanceOrder;
return this;
@@ -1057,7 +1058,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param rebalanceBatchSize Rebalance batch size.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setRebalanceBatchSize(int rebalanceBatchSize) {
+ public CacheConfiguration<K, V> setRebalanceBatchSize(int rebalanceBatchSize) {
this.rebalanceBatchSize = rebalanceBatchSize;
return this;
@@ -1079,7 +1080,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param swapEnabled {@code True} if swap storage is enabled.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setSwapEnabled(boolean swapEnabled) {
+ public CacheConfiguration<K, V> setSwapEnabled(boolean swapEnabled) {
this.swapEnabled = swapEnabled;
return this;
@@ -1108,7 +1109,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #getMaxConcurrentAsyncOperations()
* @return {@code this} for chaining.
*/
- public CacheConfiguration setMaxConcurrentAsyncOperations(int maxConcurrentAsyncOps) {
+ public CacheConfiguration<K, V> setMaxConcurrentAsyncOperations(int maxConcurrentAsyncOps) {
this.maxConcurrentAsyncOps = maxConcurrentAsyncOps;
return this;
@@ -1131,7 +1132,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param writeBehindEnabled {@code true} if write-behind is enabled.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setWriteBehindEnabled(boolean writeBehindEnabled) {
+ public CacheConfiguration<K, V> setWriteBehindEnabled(boolean writeBehindEnabled) {
this.writeBehindEnabled = writeBehindEnabled;
return this;
@@ -1159,7 +1160,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #getWriteBehindFlushSize()
* @return {@code this} for chaining.
*/
- public CacheConfiguration setWriteBehindFlushSize(int writeBehindFlushSize) {
+ public CacheConfiguration<K, V> setWriteBehindFlushSize(int writeBehindFlushSize) {
this.writeBehindFlushSize = writeBehindFlushSize;
return this;
@@ -1188,7 +1189,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #getWriteBehindFlushFrequency()
* @return {@code this} for chaining.
*/
- public CacheConfiguration setWriteBehindFlushFrequency(long writeBehindFlushFreq) {
+ public CacheConfiguration<K, V> setWriteBehindFlushFrequency(long writeBehindFlushFreq) {
this.writeBehindFlushFreq = writeBehindFlushFreq;
return this;
@@ -1215,7 +1216,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #getWriteBehindFlushThreadCount()
* @return {@code this} for chaining.
*/
- public CacheConfiguration setWriteBehindFlushThreadCount(int writeBehindFlushThreadCnt) {
+ public CacheConfiguration<K, V> setWriteBehindFlushThreadCount(int writeBehindFlushThreadCnt) {
this.writeBehindFlushThreadCnt = writeBehindFlushThreadCnt;
return this;
@@ -1242,7 +1243,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #getWriteBehindBatchSize()
* @return {@code this} for chaining.
*/
- public CacheConfiguration setWriteBehindBatchSize(int writeBehindBatchSize) {
+ public CacheConfiguration<K, V> setWriteBehindBatchSize(int writeBehindBatchSize) {
this.writeBehindBatchSize = writeBehindBatchSize;
return this;
@@ -1267,7 +1268,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param rebalancePoolSize Size of rebalancing thread pool.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setRebalanceThreadPoolSize(int rebalancePoolSize) {
+ public CacheConfiguration<K, V> setRebalanceThreadPoolSize(int rebalancePoolSize) {
this.rebalancePoolSize = rebalancePoolSize;
return this;
@@ -1290,7 +1291,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param rebalanceTimeout Rebalance timeout (ms).
* @return {@code this} for chaining.
*/
- public CacheConfiguration setRebalanceTimeout(long rebalanceTimeout) {
+ public CacheConfiguration<K, V> setRebalanceTimeout(long rebalanceTimeout) {
this.rebalanceTimeout = rebalanceTimeout;
return this;
@@ -1328,7 +1329,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param rebalanceDelay Rebalance delay to set.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setRebalanceDelay(long rebalanceDelay) {
+ public CacheConfiguration<K, V> setRebalanceDelay(long rebalanceDelay) {
this.rebalanceDelay = rebalanceDelay;
return this;
@@ -1364,7 +1365,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* {@code 0} to disable throttling.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setRebalanceThrottle(long rebalanceThrottle) {
+ public CacheConfiguration<K, V> setRebalanceThrottle(long rebalanceThrottle) {
this.rebalanceThrottle = rebalanceThrottle;
return this;
@@ -1391,7 +1392,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param affMapper Affinity mapper.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setAffinityMapper(AffinityKeyMapper affMapper) {
+ public CacheConfiguration<K, V> setAffinityMapper(AffinityKeyMapper affMapper) {
this.affMapper = affMapper;
return this;
@@ -1438,7 +1439,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param offHeapMaxMem Maximum memory in bytes available to off-heap memory space.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setOffHeapMaxMemory(long offHeapMaxMem) {
+ public CacheConfiguration<K, V> setOffHeapMaxMemory(long offHeapMaxMem) {
this.offHeapMaxMem = offHeapMaxMem;
return this;
@@ -1462,7 +1463,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param memMode Memory mode.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setMemoryMode(CacheMemoryMode memMode) {
+ public CacheConfiguration<K, V> setMemoryMode(CacheMemoryMode memMode) {
this.memMode = memMode;
return this;
@@ -1484,7 +1485,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param interceptor Cache interceptor.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setInterceptor(CacheInterceptor<K, V> interceptor) {
+ public CacheConfiguration<K, V> setInterceptor(CacheInterceptor<K, V> interceptor) {
this.interceptor = interceptor;
return this;
@@ -1505,7 +1506,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param typeMeta Collection of type metadata.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setTypeMetadata(Collection<CacheTypeMetadata> typeMeta) {
+ public CacheConfiguration<K, V> setTypeMetadata(Collection<CacheTypeMetadata> typeMeta) {
this.typeMeta = typeMeta;
return this;
@@ -1530,7 +1531,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param readFromBackup {@code true} to allow reads from backups.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setReadFromBackup(boolean readFromBackup) {
+ public CacheConfiguration<K, V> setReadFromBackup(boolean readFromBackup) {
this.readFromBackup = readFromBackup;
return this;
@@ -1554,7 +1555,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #isCopyOnRead
* @return {@code this} for chaining.
*/
- public CacheConfiguration setCopyOnRead(boolean cpOnRead) {
+ public CacheConfiguration<K, V> setCopyOnRead(boolean cpOnRead) {
this.cpOnRead = cpOnRead;
return this;
@@ -1567,7 +1568,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param cls One or more classes with SQL functions.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setSqlFunctionClasses(Class<?>... cls) {
+ public CacheConfiguration<K, V> setSqlFunctionClasses(Class<?>... cls) {
this.sqlFuncCls = cls;
return this;
@@ -1598,7 +1599,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param longQryWarnTimeout Timeout in milliseconds.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setLongQueryWarningTimeout(long longQryWarnTimeout) {
+ public CacheConfiguration<K, V> setLongQueryWarningTimeout(long longQryWarnTimeout) {
this.longQryWarnTimeout = longQryWarnTimeout;
return this;
@@ -1623,7 +1624,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param sqlEscapeAll Flag value.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setSqlEscapeAll(boolean sqlEscapeAll) {
+ public CacheConfiguration<K, V> setSqlEscapeAll(boolean sqlEscapeAll) {
this.sqlEscapeAll = sqlEscapeAll;
return this;
@@ -1660,7 +1661,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param indexedTypes Key and value type pairs.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setIndexedTypes(Class<?>... indexedTypes) {
+ public CacheConfiguration<K, V> setIndexedTypes(Class<?>... indexedTypes) {
A.ensure(indexedTypes == null || (indexedTypes.length & 1) == 0,
"Number of indexed types is expected to be even. Refer to method javadoc for details.");
@@ -1699,7 +1700,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @see #setOffHeapMaxMemory(long)
* @return {@code this} for chaining.
*/
- public CacheConfiguration setSqlOnheapRowCacheSize(int size) {
+ public CacheConfiguration<K, V> setSqlOnheapRowCacheSize(int size) {
this.sqlOnheapRowCacheSize = size;
return this;
@@ -1720,7 +1721,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param pluginCfgs Cache plugin configurations.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setPluginConfigurations(CachePluginConfiguration... pluginCfgs) {
+ public CacheConfiguration<K, V> setPluginConfigurations(CachePluginConfiguration... pluginCfgs) {
this.pluginCfgs = pluginCfgs;
return this;
@@ -1739,7 +1740,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param topValidator validator.
* @return {@code this} for chaining.
*/
- public CacheConfiguration setTopologyValidator(TopologyValidator topValidator) {
+ public CacheConfiguration<K, V> setTopologyValidator(TopologyValidator topValidator) {
this.topValidator = topValidator;
return this;
@@ -1766,7 +1767,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @return {@code this} for chaining.
* @see CacheStoreSessionListener
*/
- public CacheConfiguration setCacheStoreSessionListenerFactories(
+ public CacheConfiguration<K, V> setCacheStoreSessionListenerFactories(
Factory<? extends CacheStoreSessionListener>... storeSesLsnrs) {
this.storeSesLsnrs = storeSesLsnrs;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ef7a35ce/modules/core/src/main/java/org/apache/ignite/configuration/NearCacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/NearCacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/NearCacheConfiguration.java
index 0593601..580010a 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/NearCacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/NearCacheConfiguration.java
@@ -64,9 +64,12 @@ public class NearCacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/**
* @param nearEvictPlc Near eviction policy.
+ * @return {@code this} for chaining.
*/
- public void setNearEvictionPolicy(EvictionPolicy<K, V> nearEvictPlc) {
+ public NearCacheConfiguration<K, V> setNearEvictionPolicy(EvictionPolicy<K, V> nearEvictPlc) {
this.nearEvictPlc = nearEvictPlc;
+
+ return this;
}
/**
@@ -83,9 +86,12 @@ public class NearCacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Start size for near cache. This property is only used for {@link CacheMode#PARTITIONED} caching mode.
*
* @param nearStartSize Start size for near cache.
+ * @return {@code this} for chaining.
*/
- public void setNearStartSize(int nearStartSize) {
+ public NearCacheConfiguration<K, V> setNearStartSize(int nearStartSize) {
this.nearStartSize = nearStartSize;
+
+ return this;
}
/** {@inheritDoc} */
[15/23] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-7' into ignite-964-1
Posted by iv...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-7' into ignite-964-1
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f9a738f3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f9a738f3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f9a738f3
Branch: refs/heads/ignite-964-1
Commit: f9a738f3e3aa4370a7302512bdd149a2984e6ae5
Parents: b963d03 c7e7487
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 12:08:12 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 12:08:12 2015 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 105 ++++++++++---------
.../configuration/NearCacheConfiguration.java | 10 +-
.../managers/communication/GridIoManager.java | 49 +++++----
.../discovery/GridDiscoveryManager.java | 26 +----
.../processors/clock/GridClockServer.java | 21 +++-
.../util/nio/GridNioMessageTracker.java | 23 +++-
.../ignite/spi/discovery/tcp/ServerImpl.java | 2 +-
.../TcpDiscoveryMulticastIpFinder.java | 74 ++++++++++---
.../IgniteTopologyPrintFormatSelfTest.java | 60 ++++++++++-
modules/docker/Dockerfile | 55 ++++++++++
modules/docker/README.txt | 11 ++
modules/docker/build_users_libs.sh | 39 +++++++
modules/docker/download_ignite.sh | 49 +++++++++
modules/docker/execute.sh | 62 +++++++++++
modules/docker/run.sh | 34 ++++++
15 files changed, 497 insertions(+), 123 deletions(-)
----------------------------------------------------------------------
[21/23] incubator-ignite git commit: #ignite-964:
GridJettyRestHandler code style.
Posted by iv...@apache.org.
#ignite-964: GridJettyRestHandler code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/990e5ece
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/990e5ece
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/990e5ece
Branch: refs/heads/ignite-964-1
Commit: 990e5ecee7e78ce0c6f0e3f6a0c5b839f8eb5ff2
Parents: bb412c4
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 12:46:35 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 12:46:35 2015 +0300
----------------------------------------------------------------------
.../http/jetty/GridJettyRestHandler.java | 95 +++++++++++++-------
1 file changed, 61 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/990e5ece/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
index 55fe156..11059f3 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
@@ -315,11 +315,14 @@ public class GridJettyRestHandler extends AbstractHandler {
}
}
+ /**
+ * @param cmd Rest command.
+ * @param cmdRes Rest response.
+ */
private void createResponse(GridRestCommand cmd, GridRestResponse cmdRes) {
if (cmd == CACHE_GET_ALL) {
- if (cmdRes.getResponse() == null) {
+ if (cmdRes.getResponse() == null)
return;
- }
Map o = (Map)cmdRes.getResponse();
@@ -332,37 +335,6 @@ public class GridJettyRestHandler extends AbstractHandler {
}
}
- public static class RestEntry {
- private Object key;
- private Object value;
- public RestEntry(Object key, Object value) {
- if (key instanceof JSONCacheObject)
- this.key = ((JSONCacheObject)key).getFields();
- else
- this.key = key;
-
- if (value instanceof JSONCacheObject)
- this.value = ((JSONCacheObject)value).getFields();
- else
- this.value = value;
- }
- public Object getKey() {
- return key;
- }
-
- public void setKey(Object key) {
- this.key = key;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
- }
-
/**
* Creates REST request.
*
@@ -804,7 +776,7 @@ public class GridJettyRestHandler extends AbstractHandler {
private JSONObject parseRequest(HttpServletRequest req) throws IgniteCheckedException{
StringBuilder builder = new StringBuilder();
- Scanner reader = null;
+ Scanner reader;
try {
reader = new Scanner(req.getReader());
@@ -818,4 +790,59 @@ public class GridJettyRestHandler extends AbstractHandler {
return JSONObject.fromObject(builder.toString());
}
+
+ /**
+ * Rest entry.
+ */
+ public static class RestEntry {
+ /** Key. */
+ private Object key;
+
+ /** Value. */
+ private Object value;
+
+ /**
+ * @param key Key.
+ * @param val Value.
+ */
+ public RestEntry(Object key, Object val) {
+ if (key instanceof JSONCacheObject)
+ this.key = ((JSONCacheObject)key).getFields();
+ else
+ this.key = key;
+
+ if (val instanceof JSONCacheObject)
+ this.value = ((JSONCacheObject)val).getFields();
+ else
+ this.value = val;
+ }
+
+ /**
+ * @return Key.
+ */
+ public Object getKey() {
+ return key;
+ }
+
+ /**
+ * @param key Key.
+ */
+ public void setKey(Object key) {
+ this.key = key;
+ }
+
+ /**
+ * @return Value.
+ */
+ public Object getValue() {
+ return value;
+ }
+
+ /**
+ * @param val Value.
+ */
+ public void setValue(Object val) {
+ this.value = val;
+ }
+ }
}
[02/23] incubator-ignite git commit: IGNITE-1046 Added default option
libs.
Posted by iv...@apache.org.
IGNITE-1046 Added default option libs.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f57aa921
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f57aa921
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f57aa921
Branch: refs/heads/ignite-964-1
Commit: f57aa921e7ac7b583b0f31931890f1f9454f3b1a
Parents: 9de7d24
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 26 13:06:45 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 26 13:06:45 2015 +0300
----------------------------------------------------------------------
modules/docker/execute.sh | 4 ++++
modules/docker/run.sh | 11 ++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f57aa921/modules/docker/execute.sh
----------------------------------------------------------------------
diff --git a/modules/docker/execute.sh b/modules/docker/execute.sh
index 2aaaa2d..e0ed90c 100644
--- a/modules/docker/execute.sh
+++ b/modules/docker/execute.sh
@@ -8,6 +8,10 @@ if [ ! -z "$GIT_REPO" ]; then
fi
fi
+if [ -z "$OPTION_LIBS" ]; then
+ OPTION_LIBS="ignite-log4j"
+fi
+
if [ ! -z "$OPTION_LIBS" ]; then
IFS=, LIBS_LIST=("$OPTION_LIBS")
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f57aa921/modules/docker/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/run.sh b/modules/docker/run.sh
index 42fb29d..2e3110d 100644
--- a/modules/docker/run.sh
+++ b/modules/docker/run.sh
@@ -1,11 +1,16 @@
#!/bin/bash
-if [ -z $SKIP_DOWNLOAD ]; then
- ./download_ignite.sh
-fi
+IGNITE_VERSION=""
if [ -z $SKIP_BUILD_LIBS ]; then
./build_users_libs.sh
+
+ IGNITE_VERSION=$(mvn -f user-repo/pom.xml dependency:list | grep ':ignite-core:jar:.*:' | \
+ sed -rn 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')
+fi
+
+if [ -z $SKIP_DOWNLOAD ]; then
+ IGNITE_VERSION=$IGNITE_VERSION ./download_ignite.sh
fi
./execute.sh
\ No newline at end of file
[23/23] incubator-ignite git commit: #ignite-964: nodejs code style.
Posted by iv...@apache.org.
#ignite-964: nodejs code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3807762a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3807762a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3807762a
Branch: refs/heads/ignite-964-1
Commit: 3807762a9c7cb449e82357955b705927474c42ac
Parents: 49f4f91
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 13:01:11 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 13:01:11 2015 +0300
----------------------------------------------------------------------
modules/nodejs/src/main/js/cache.js | 4 +-
modules/nodejs/src/main/js/server.js | 57 +++++++++++++-------
.../ignite/internal/NodeJsSqlQuerySelfTest.java | 2 +-
modules/nodejs/src/test/js/test-compute.js | 3 --
4 files changed, 42 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3807762a/modules/nodejs/src/main/js/cache.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/js/cache.js b/modules/nodejs/src/main/js/cache.js
index 3eaadb4..eef4039 100644
--- a/modules/nodejs/src/main/js/cache.js
+++ b/modules/nodejs/src/main/js/cache.js
@@ -180,8 +180,8 @@ Cache.prototype._sqlFieldsQuery = function(qry, onQueryExecute) {
Cache.prototype._sqlQuery = function(qry, onQueryExecute) {
if (qry.returnType() == null) {
- qry.error("No type for sql query.");
- qry.end();
+ qry.end("No type for sql query.");
+
return;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3807762a/modules/nodejs/src/main/js/server.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/js/server.js b/modules/nodejs/src/main/js/server.js
index 021fffe..ee1a134 100644
--- a/modules/nodejs/src/main/js/server.js
+++ b/modules/nodejs/src/main/js/server.js
@@ -57,12 +57,10 @@ Server.prototype.host = function() {
* Run http request
*
* @this {Server}
- * @param {string} cmdName command name.
- * @param params Parameters for command.
+ * @param {Command} cmd Command
* @param {onGet} Called on finish
*/
Server.prototype.runCommand = function(cmd, callback) {
-
var requestQry = "cmd=" + cmd.name() + cmd.paramsString();
var http = require('http');
@@ -89,6 +87,7 @@ Server.prototype.runCommand = function(cmd, callback) {
response.on('end', function () {
console.log("fullResponseString:" + fullResponseString);
+
if (response.statusCode !== 200) {
if (response.statusCode === 401) {
callback.call(null, "Authentication failed. Status code 401.");
@@ -181,52 +180,74 @@ Server._escape = function(f) {
return qs.escape(f.toString());
}
+/**
+ * @constructor
+ * @this{Command}
+ * @param{string} name Command name.
+ */
function Command(name) {
this._name = name;
this._params = [];
}
+/**
+ * @this {Command}
+ * @param {string} key Key
+ * @param {string} val Value
+ * @returns this
+ */
Command.prototype.addParam = function(key, value) {
this._params.push({key: key, value: value});
return this;
}
-Command.prototype.addParams = function(prefix, params) {
- for (var i = 1; i <= params.length; ++i) {
- this.addParam(prefix + i, params[i - 1]);
- }
- return this;
-}
-
+/**
+ * @this {Command}
+ * @param{JSONObject} postData Post data.
+ * @returns this
+ */
Command.prototype.setPostData = function(postData) {
this._postData = postData;
return this;
}
+/**
+ * @this {Command}
+ * @returns Post data.
+ */
Command.prototype.postData = function() {
return this._postData;
}
-Command.prototype._method = function() {
- return this._isPost()? "POST" : "GET";
-}
-
-Command.prototype._isPost = function() {
- return !!this._postData;
-}
-
+/**
+ * @this {Command}
+ * @returns Command name.
+ */
Command.prototype.name = function() {
return this._name;
}
+/**
+ * @this {Command}
+ * @returns Http request string.
+ */
Command.prototype.paramsString = function() {
var paramsString = "";
for (var p of this._params) {
paramsString += "&" + Server._escape(p.key) + "=" + Server._escape(p.value);
}
+
return paramsString;
}
+Command.prototype._method = function() {
+ return this._isPost()? "POST" : "GET";
+}
+
+Command.prototype._isPost = function() {
+ return !!this._postData;
+}
+
exports.Server = Server;
exports.Command = Command;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3807762a/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSqlQuerySelfTest.java b/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSqlQuerySelfTest.java
index a6891fb..9024b93 100644
--- a/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSqlQuerySelfTest.java
+++ b/modules/nodejs/src/test/java/org/apache/ignite/internal/NodeJsSqlQuerySelfTest.java
@@ -91,7 +91,7 @@ public class NodeJsSqlQuerySelfTest extends NodeJsAbstractTest {
personCache.put(p3.getId(), p3);
personCache.put(p4.getId(), p4);
- SqlQuery qry = new SqlQuery(Person.class, "salary > ? and salary <= ?");
+ SqlQuery<Integer, Person> qry = new SqlQuery<>(Person.class, "salary > ? and salary <= ?");
qry.setArgs(1000, 2000);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3807762a/modules/nodejs/src/test/js/test-compute.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test-compute.js b/modules/nodejs/src/test/js/test-compute.js
index 6ab738c..943ab02 100644
--- a/modules/nodejs/src/test/js/test-compute.js
+++ b/modules/nodejs/src/test/js/test-compute.js
@@ -164,9 +164,6 @@ function testComputeWithErrors(map) {
var callback = function(err, res) {
assert(err != null, "Do not get error on compute task.");
- console.log("ERROR on Compute: " + err);
- console.log("End of ERROR.");
-
assert(err.indexOf("Function evaluation failed") > -1, "Incorrect error "+
"[expected=function evaluation failed, value=" + err + "]");
[07/23] incubator-ignite git commit: # ignite-gg-1064 use loopback
address in clock server if failed to get local host
Posted by iv...@apache.org.
# ignite-gg-1064 use loopback address in clock server if failed to get local host
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0ef74a14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0ef74a14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0ef74a14
Branch: refs/heads/ignite-964-1
Commit: 0ef74a1449d503ae65a200e48da735b545e923da
Parents: b5bc06e
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 30 15:07:18 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 30 15:07:18 2015 +0300
----------------------------------------------------------------------
.../processors/clock/GridClockServer.java | 21 +++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef74a14/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
index e47d1fa..a835da8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockServer.java
@@ -62,9 +62,20 @@ public class GridClockServer {
int startPort = ctx.config().getTimeServerPortBase();
int endPort = startPort + ctx.config().getTimeServerPortRange() - 1;
- InetAddress locHost = !F.isEmpty(ctx.config().getLocalHost()) ?
- InetAddress.getByName(ctx.config().getLocalHost()) :
- U.getLocalHost();
+ InetAddress locHost;
+
+ if (F.isEmpty(ctx.config().getLocalHost())) {
+ try {
+ locHost = U.getLocalHost();
+ }
+ catch (IOException e) {
+ locHost = InetAddress.getLoopbackAddress();
+
+ U.warn(log, "Failed to get local host address, will use loopback address: " + locHost);
+ }
+ }
+ else
+ locHost = InetAddress.getByName(ctx.config().getLocalHost());
for (int p = startPort; p <= endPort; p++) {
try {
@@ -83,8 +94,8 @@ public class GridClockServer {
}
if (sock == null)
- throw new IgniteCheckedException("Failed to bind time server socket within specified port range [locHost=" +
- locHost + ", startPort=" + startPort + ", endPort=" + endPort + ']');
+ throw new IgniteCheckedException("Failed to bind time server socket within specified port range " +
+ "[locHost=" + locHost + ", startPort=" + startPort + ", endPort=" + endPort + ']');
}
catch (IOException e) {
throw new IgniteCheckedException("Failed to start time server (failed to get local host address)", e);
[17/23] incubator-ignite git commit: #ignite-964: IgniteJsEmitResult
code style.
Posted by iv...@apache.org.
#ignite-964: IgniteJsEmitResult code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cec45347
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cec45347
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cec45347
Branch: refs/heads/ignite-964-1
Commit: cec45347bc6475c6b59f9128732b5c696ec20c47
Parents: 7e0a63b
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 12:26:52 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 12:26:52 2015 +0300
----------------------------------------------------------------------
.../processors/rest/handlers/scripting/IgniteJsEmitResult.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cec45347/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteJsEmitResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteJsEmitResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteJsEmitResult.java
index ecd6cba..b5ae106 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteJsEmitResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteJsEmitResult.java
@@ -37,9 +37,9 @@ public class IgniteJsEmitResult {
List<T3<Object, Object, Object>> res = emitResPerCall.get();
if (res == null)
- res = new ArrayList();
+ res = new ArrayList<>();
- res.add(new T3(f, args, node));
+ res.add(new T3<>(f, args, node));
emitResPerCall.set(res);
}
[22/23] incubator-ignite git commit: #ignite-964:
GridJettyRestHandler code style.
Posted by iv...@apache.org.
#ignite-964: GridJettyRestHandler code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/49f4f910
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/49f4f910
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/49f4f910
Branch: refs/heads/ignite-964-1
Commit: 49f4f91036c39118df71863371b6b3ef83fa42eb
Parents: 990e5ec
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 12:49:27 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 12:49:27 2015 +0300
----------------------------------------------------------------------
.../http/jetty/GridJettyRestHandler.java | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/49f4f910/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
index 11059f3..b5877b6 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
@@ -542,27 +542,12 @@ public class GridJettyRestHandler extends AbstractHandler {
restReq0.sqlQuery((String)params.get("qry"));
- StringBuilder builder = new StringBuilder();
+ JSONObject o = parseRequest(req);
- Scanner reader = null;
+ List args = (List)o.get("arg");
- try {
- reader = new Scanner(req.getReader());
- }
- catch (IOException e) {
- throw new IgniteCheckedException(e);
- }
-
- while (reader.hasNext())
- builder.append(reader.next() + "\n");
-
- JSONObject o = JSONObject.fromObject(builder.toString());
-
- List<Object> args = (List<Object>)o.get("arg");
restReq0.arguments(args.toArray());
-
restReq0.typeName((String)params.get("type"));
-
restReq0.pageSize(Integer.parseInt((String) params.get("psz")));
restReq0.cacheName((String)params.get("cacheName"));
[18/23] incubator-ignite git commit: #ignite-964:
IgniteScriptingCommandHandler code style.
Posted by iv...@apache.org.
#ignite-964: IgniteScriptingCommandHandler code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3bc20e8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3bc20e8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3bc20e8d
Branch: refs/heads/ignite-964-1
Commit: 3bc20e8def3926f05950077cc40f61b1b2b641ac
Parents: cec4534
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 12:28:16 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 12:28:16 2015 +0300
----------------------------------------------------------------------
.../rest/handlers/scripting/IgniteScriptingCommandHandler.java | 6 ------
1 file changed, 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3bc20e8d/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
index d7525a0..2d65016 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
@@ -260,9 +260,6 @@ public class IgniteScriptingCommandHandler extends GridRestCommandHandlerAdapter
* Run script callable.
*/
private static class RunScriptCallable implements Callable<GridRestResponse> {
- /** */
- private static final long serialVersionUID = 0L;
-
/** Kernal context. */
private GridKernalContext ctx;
@@ -294,9 +291,6 @@ public class IgniteScriptingCommandHandler extends GridRestCommandHandlerAdapter
* Map reduce callable.
*/
private static class MapReduceCallable implements Callable<GridRestResponse> {
- /** */
- private static final long serialVersionUID = 0L;
-
/** Kernal context. */
private GridKernalContext ctx;
[19/23] incubator-ignite git commit: #ignite-964:
GridVersionCommandHandler code style.
Posted by iv...@apache.org.
#ignite-964: GridVersionCommandHandler code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d85dab7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d85dab7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d85dab7e
Branch: refs/heads/ignite-964-1
Commit: d85dab7e830f9a7157755d6823080ab6a6dccc70
Parents: 3bc20e8
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 12:29:20 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 12:29:20 2015 +0300
----------------------------------------------------------------------
.../processors/rest/GridRestProcessor.java | 2 +-
.../version/GridVersionCommandHandler.java | 67 --------------------
.../version/GridVersionNameCommandHandler.java | 67 ++++++++++++++++++++
3 files changed, 68 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d85dab7e/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index 86bfafe..5a073a0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -290,7 +290,7 @@ public class GridRestProcessor extends GridProcessorAdapter {
addHandler(new GridCacheCommandHandler(ctx));
addHandler(new GridTaskCommandHandler(ctx));
addHandler(new GridTopologyCommandHandler(ctx));
- addHandler(new GridVersionCommandHandler(ctx));
+ addHandler(new GridVersionNameCommandHandler(ctx));
addHandler(new DataStructuresCommandHandler(ctx));
addHandler(new IgniteScriptingCommandHandler(ctx));
addHandler(new QueryCommandHandler(ctx));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d85dab7e/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/version/GridVersionCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/version/GridVersionCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/version/GridVersionCommandHandler.java
deleted file mode 100644
index 9597ab3..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/version/GridVersionCommandHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.rest.handlers.version;
-
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.rest.*;
-import org.apache.ignite.internal.processors.rest.handlers.*;
-import org.apache.ignite.internal.processors.rest.request.*;
-import org.apache.ignite.internal.util.future.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-
-import java.util.*;
-
-import static org.apache.ignite.internal.IgniteVersionUtils.*;
-import static org.apache.ignite.internal.processors.rest.GridRestCommand.*;
-
-/**
- * Handler for {@link GridRestCommand#VERSION} command.
- */
-public class GridVersionCommandHandler extends GridRestCommandHandlerAdapter {
- /** Supported commands. */
- private static final Collection<GridRestCommand> SUPPORTED_COMMANDS = U.sealList(VERSION, NAME);
-
- /**
- * @param ctx Context.
- */
- public GridVersionCommandHandler(GridKernalContext ctx) {
- super(ctx);
- }
-
- /** {@inheritDoc} */
- @Override public Collection<GridRestCommand> supportedCommands() {
- return SUPPORTED_COMMANDS;
- }
-
- /** {@inheritDoc} */
- @Override public IgniteInternalFuture<GridRestResponse> handleAsync(GridRestRequest req) {
- assert req != null;
-
- assert SUPPORTED_COMMANDS.contains(req.command());
-
- switch (req.command()){
- case VERSION:
- return new GridFinishedFuture<>(new GridRestResponse(VER_STR));
-
- case NAME:
- return new GridFinishedFuture<>(new GridRestResponse(ctx.gridName()));
- }
-
- return new GridFinishedFuture<>();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d85dab7e/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/version/GridVersionNameCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/version/GridVersionNameCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/version/GridVersionNameCommandHandler.java
new file mode 100644
index 0000000..c22b838
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/version/GridVersionNameCommandHandler.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.rest.handlers.version;
+
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.rest.*;
+import org.apache.ignite.internal.processors.rest.handlers.*;
+import org.apache.ignite.internal.processors.rest.request.*;
+import org.apache.ignite.internal.util.future.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.util.*;
+
+import static org.apache.ignite.internal.IgniteVersionUtils.*;
+import static org.apache.ignite.internal.processors.rest.GridRestCommand.*;
+
+/**
+ * Handler for {@link GridRestCommand#VERSION} and {@link GridRestCommand#NAME} command.
+ */
+public class GridVersionNameCommandHandler extends GridRestCommandHandlerAdapter {
+ /** Supported commands. */
+ private static final Collection<GridRestCommand> SUPPORTED_COMMANDS = U.sealList(VERSION, NAME);
+
+ /**
+ * @param ctx Context.
+ */
+ public GridVersionNameCommandHandler(GridKernalContext ctx) {
+ super(ctx);
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<GridRestCommand> supportedCommands() {
+ return SUPPORTED_COMMANDS;
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteInternalFuture<GridRestResponse> handleAsync(GridRestRequest req) {
+ assert req != null;
+
+ assert SUPPORTED_COMMANDS.contains(req.command());
+
+ switch (req.command()){
+ case VERSION:
+ return new GridFinishedFuture<>(new GridRestResponse(VER_STR));
+
+ case NAME:
+ return new GridFinishedFuture<>(new GridRestResponse(ctx.gridName()));
+ }
+
+ return new GridFinishedFuture<>();
+ }
+}
[03/23] incubator-ignite git commit: IGNITE-1046 Added license.
Posted by iv...@apache.org.
IGNITE-1046 Added license.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/86c5d207
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/86c5d207
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/86c5d207
Branch: refs/heads/ignite-964-1
Commit: 86c5d207094947aa9e53ea6da6314c125188ec8d
Parents: f57aa92
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 26 13:09:59 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 26 13:09:59 2015 +0300
----------------------------------------------------------------------
modules/docker/Dockerfile | 17 +++++++++++++++++
modules/docker/build_users_libs.sh | 16 ++++++++++++++++
modules/docker/download_ignite.sh | 16 ++++++++++++++++
modules/docker/execute.sh | 16 ++++++++++++++++
modules/docker/run.sh | 16 ++++++++++++++++
5 files changed, 81 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/86c5d207/modules/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/docker/Dockerfile b/modules/docker/Dockerfile
index 2723333..11e2e3d 100644
--- a/modules/docker/Dockerfile
+++ b/modules/docker/Dockerfile
@@ -1,3 +1,20 @@
+#
+# 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.
+#
+
# Start from a Debian image.
FROM debian:8
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/86c5d207/modules/docker/build_users_libs.sh
----------------------------------------------------------------------
diff --git a/modules/docker/build_users_libs.sh b/modules/docker/build_users_libs.sh
index 24f4420..4d37187 100644
--- a/modules/docker/build_users_libs.sh
+++ b/modules/docker/build_users_libs.sh
@@ -1,4 +1,20 @@
#!/bin/bash
+#
+# 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.
+#
if [ -z $GIT_REPO ]; then
echo Users git repo is not provided.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/86c5d207/modules/docker/download_ignite.sh
----------------------------------------------------------------------
diff --git a/modules/docker/download_ignite.sh b/modules/docker/download_ignite.sh
index 6a8617f..9e2cb51 100644
--- a/modules/docker/download_ignite.sh
+++ b/modules/docker/download_ignite.sh
@@ -1,4 +1,20 @@
#!/bin/bash
+#
+# 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.
+#
function download {
wget -O ignite.zip $1
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/86c5d207/modules/docker/execute.sh
----------------------------------------------------------------------
diff --git a/modules/docker/execute.sh b/modules/docker/execute.sh
index e0ed90c..8afba59 100644
--- a/modules/docker/execute.sh
+++ b/modules/docker/execute.sh
@@ -1,4 +1,20 @@
#!/bin/bash
+#
+# 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.
+#
if [ ! -z "$GIT_REPO" ]; then
if [ -z "$LIB_PATTERN" ]; then
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/86c5d207/modules/docker/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/run.sh b/modules/docker/run.sh
index 2e3110d..e7feb8c 100644
--- a/modules/docker/run.sh
+++ b/modules/docker/run.sh
@@ -1,4 +1,20 @@
#!/bin/bash
+#
+# 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.
+#
IGNITE_VERSION=""
[20/23] incubator-ignite git commit: #ignite-964: JSONCacheObject
code style.
Posted by iv...@apache.org.
#ignite-964: JSONCacheObject code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bb412c42
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bb412c42
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bb412c42
Branch: refs/heads/ignite-964-1
Commit: bb412c4233c29a14fb96a58fb3cda2e0ea528388
Parents: d85dab7
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jul 1 12:36:54 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jul 1 12:36:54 2015 +0300
----------------------------------------------------------------------
.../protocols/http/jetty/JSONCacheObject.java | 78 +++++++++++---------
1 file changed, 45 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bb412c42/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/JSONCacheObject.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/JSONCacheObject.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/JSONCacheObject.java
index 67f2430..7ea30b3 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/JSONCacheObject.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/JSONCacheObject.java
@@ -26,28 +26,62 @@ import java.util.*;
*/
public class JSONCacheObject {
/** Fields map. */
- private Map<Object, Object> fields = new HashMap<>();
+ private final Map<Object, Object> fields = new HashMap<>();
- public JSONCacheObject() {
+ /**
+ * Empty constructor.
+ */
+ private JSONCacheObject() {
+ }
+ /**
+ * @param o JSON object.
+ */
+ public JSONCacheObject(JSONObject o) {
+ for (Object key : o.keySet())
+ addField(toSimpleObject(key), toSimpleObject(o.get(key)));
}
- public void setFields(Map<Object, Object> fields) {
- this.fields = fields;
+ /**
+ * @param key Field name.
+ * @param val Field value.
+ */
+ public void addField(Object key, Object val) {
+ fields.put(key, val);
}
- public Map<Object, Object> getFields() {
- return fields;
+ /**
+ * @param key Field name.
+ * @return Field value.
+ */
+ public Object getField(Object key) {
+ return fields.get(key);
}
- public JSONCacheObject(JSONObject o) {
- for (Object key : o.keySet())
- addField(toSimpleObject(key), toSimpleObject(o.get(key)));
+ /**
+ * @return Fields key set.
+ */
+ public Set<Object> keys() {
+ return fields.keySet();
+ }
+
+ /**
+ * @return Fields map.
+ */
+ public Map<Object, Object> getFields() {
+ return fields;
}
+ /**
+ * Convert JSON object to JSONCacheObject
+ *
+ * @param o Object to convert.
+ * @return Converted object.
+ */
private Object toSimpleObject(Object o) {
if (o instanceof JSONObject) {
JSONObject o1 = (JSONObject)o;
+
JSONCacheObject res = new JSONCacheObject();
for (Object key : o1.keySet())
@@ -57,7 +91,9 @@ public class JSONCacheObject {
}
else if (o instanceof JSONArray) {
JSONArray o1 = (JSONArray) o;
+
List<Object> val = new ArrayList<>();
+
for (Object v : o1)
val.add(toSimpleObject(v));
@@ -67,32 +103,8 @@ public class JSONCacheObject {
return o;
}
- /**
- * @param key Field name.
- * @param val Field value.
- */
- public void addField(Object key, Object val) {
- fields.put(key, val);
- }
-
- /**
- * @param key Field name.
- * @return Field value.
- */
- public Object getField(Object key) {
- return fields.get(key);
- }
-
- /**
- * @return Fields key set.
- */
- public Set<Object> keys() {
- return fields.keySet();
- }
-
/** {@inheritDoc} */
@Override public int hashCode() {
- //TODO:
return fields.hashCode();
}
[14/23] incubator-ignite git commit: IGNITE-1068: Fixing ordered
messages back pressure control.
Posted by iv...@apache.org.
IGNITE-1068: Fixing ordered messages back pressure control.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c7e74874
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c7e74874
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c7e74874
Branch: refs/heads/ignite-964-1
Commit: c7e7487458b72ba8b666fba7b9e24004d425719f
Parents: bccba30
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Jul 1 11:50:08 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Jul 1 11:50:08 2015 +0300
----------------------------------------------------------------------
.../managers/communication/GridIoManager.java | 49 +++++++++++---------
.../util/nio/GridNioMessageTracker.java | 23 +++++++--
2 files changed, 48 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c7e74874/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 4382731..d8dcc2c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.managers.deployment.*;
import org.apache.ignite.internal.managers.eventstorage.*;
import org.apache.ignite.internal.processors.timeout.*;
import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -718,7 +719,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
map = msgSetMap.get(msg.topic());
if (map == null) {
- set = new GridCommunicationMessageSet(plc, msg.topic(), nodeId, timeout, skipOnTimeout, msg);
+ set = new GridCommunicationMessageSet(plc, msg.topic(), nodeId, timeout, skipOnTimeout, msg, msgC);
map = new ConcurrentHashMap0<>();
@@ -748,7 +749,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (set == null) {
GridCommunicationMessageSet old = map.putIfAbsent(nodeId,
set = new GridCommunicationMessageSet(plc, msg.topic(),
- nodeId, timeout, skipOnTimeout, msg));
+ nodeId, timeout, skipOnTimeout, msg, msgC));
assert old == null;
@@ -766,7 +767,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
assert set != null;
assert !isNew;
- set.add(msg);
+ set.add(msg, msgC);
break;
}
@@ -795,14 +796,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (isNew && set.endTime() != Long.MAX_VALUE)
ctx.timeout().addTimeoutObject(set);
- if (set.reserved()) {
- // Set is reserved which means that it is currently processed by worker thread.
- if (msgC != null)
- msgC.run();
-
- return;
- }
-
final GridMessageListener lsnr = lsnrMap.get(msg.topic());
if (lsnr == null) {
@@ -821,7 +814,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
"listener is registered): " + msg);
}
- // Mark the message as processed.
+ // Mark the message as processed, otherwise reading from the connection
+ // may stop.
if (msgC != null)
msgC.run();
@@ -848,8 +842,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
}
finally {
threadProcessingMessage(false);
-
- msgC.run();
}
}
};
@@ -1852,7 +1844,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
/** */
@GridToStringInclude
- private final Queue<IgniteBiTuple<GridIoMessage, Long>> msgs = new ConcurrentLinkedDeque<>();
+ private final Queue<GridTuple3<GridIoMessage, Long, IgniteRunnable>> msgs = new ConcurrentLinkedDeque<>();
/** */
private final AtomicBoolean reserved = new AtomicBoolean();
@@ -1873,6 +1865,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
* @param timeout Timeout.
* @param skipOnTimeout Whether message can be skipped on timeout.
* @param msg Message to add immediately.
+ * @param msgC Message closure (may be {@code null}).
*/
GridCommunicationMessageSet(
GridIoPolicy plc,
@@ -1880,7 +1873,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
UUID nodeId,
long timeout,
boolean skipOnTimeout,
- GridIoMessage msg
+ GridIoMessage msg,
+ @Nullable IgniteRunnable msgC
) {
assert nodeId != null;
assert topic != null;
@@ -1899,7 +1893,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
lastTs = U.currentTimeMillis();
- msgs.add(F.t(msg, lastTs));
+ msgs.add(F.t(msg, lastTs, msgC));
}
/** {@inheritDoc} */
@@ -2017,15 +2011,28 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
void unwind(GridMessageListener lsnr) {
assert reserved.get();
- for (IgniteBiTuple<GridIoMessage, Long> t = msgs.poll(); t != null; t = msgs.poll())
- lsnr.onMessage(nodeId, t.get1().message());
+ for (GridTuple3<GridIoMessage, Long, IgniteRunnable> t = msgs.poll(); t != null; t = msgs.poll()) {
+ try {
+ lsnr.onMessage(
+ nodeId,
+ t.get1().message());
+ }
+ finally {
+ if (t.get3() != null)
+ t.get3().run();
+ }
+ }
}
/**
* @param msg Message to add.
+ * @param msgC Message closure (may be {@code null}).
*/
- void add(GridIoMessage msg) {
- msgs.add(F.t(msg, U.currentTimeMillis()));
+ void add(
+ GridIoMessage msg,
+ @Nullable IgniteRunnable msgC
+ ) {
+ msgs.add(F.t(msg, U.currentTimeMillis(), msgC));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c7e74874/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java
index 52b7fed..c9ed1a0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioMessageTracker.java
@@ -56,9 +56,26 @@ public class GridNioMessageTracker implements IgniteRunnable {
/** {@inheritDoc} */
@Override public void run() {
- int cnt = msgCnt.decrementAndGet();
+ // In case of ordered messages this may be called twice for 1 message.
+ // Example: message arrives, but listener has not been installed yet.
+ // Message set is created, but message does not get actually processed.
+ // If this is not called, connection may be paused which causes hang.
+ // It seems acceptable to have the following logic accounting the aforementioned.
+ int cnt = 0;
- assert cnt >= 0 : "Invalid count: " + cnt;
+ for (;;) {
+ int cur = msgCnt.get();
+
+ if (cur == 0)
+ break;
+
+ cnt = cur - 1;
+
+ if (msgCnt.compareAndSet(cur, cnt))
+ break;
+ }
+
+ assert cnt >= 0 : "Invalid count [cnt=" + cnt + ", this=" + this + ']';
if (cnt < msgQueueLimit && paused && lock.tryLock()) {
try {
@@ -116,6 +133,6 @@ public class GridNioMessageTracker implements IgniteRunnable {
/** {@inheritDoc} */
@Override public String toString() {
- return S.toString(GridNioMessageTracker.class, this, super.toString());
+ return S.toString(GridNioMessageTracker.class, this, "hash", System.identityHashCode(this));
}
}
[10/23] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-1064' into ignite-sprint-7
Posted by iv...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1064' into ignite-sprint-7
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e91bc484
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e91bc484
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e91bc484
Branch: refs/heads/ignite-964-1
Commit: e91bc484e224ce8a039ef5bba71aa7f093dce262
Parents: 28525ac 0ef74a1
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 30 17:31:22 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 30 17:31:22 2015 +0300
----------------------------------------------------------------------
.../processors/clock/GridClockServer.java | 21 ++++--
.../TcpDiscoveryMulticastIpFinder.java | 74 ++++++++++++++++----
2 files changed, 76 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
[13/23] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-sprint-7' into ignite-sprint-7
Posted by iv...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-7' into ignite-sprint-7
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bccba308
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bccba308
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bccba308
Branch: refs/heads/ignite-964-1
Commit: bccba308a884ef527cf7f84f7f6dd57d55b1e51a
Parents: aea804b e0c53b8
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jul 1 11:13:36 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jul 1 11:13:36 2015 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[08/23] incubator-ignite git commit: IGNITE-1062 Added tests.
Posted by iv...@apache.org.
IGNITE-1062 Added tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6ebcb6de
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6ebcb6de
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6ebcb6de
Branch: refs/heads/ignite-964-1
Commit: 6ebcb6de192e1916e58226990eb9d9ec759da6ef
Parents: 8006a84
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 30 16:51:15 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 30 16:51:15 2015 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 26 +--------
.../IgniteTopologyPrintFormatSelfTest.java | 60 +++++++++++++++++++-
2 files changed, 61 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6ebcb6de/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 1d555e4..a8ce8ff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -101,7 +101,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
/** Predicate filtering client nodes. */
private static final IgnitePredicate<ClusterNode> clientFilter = new P1<ClusterNode>() {
@Override public boolean apply(ClusterNode n) {
- return n.isClient();
+ return CU.clientNode(n);
}
};
@@ -940,9 +940,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
Collection<ClusterNode> rmtNodes = discoCache.remoteNodes();
- Collection<ClusterNode> serverNodes = discoCache.serverNodes();
+ Collection<ClusterNode> serverNodes = F.view(discoCache.allNodes(), F.not(clientFilter));
- Collection<ClusterNode> clientNodes = discoCache.clientNodes();
+ Collection<ClusterNode> clientNodes = F.view(discoCache.allNodes(), clientFilter);
ClusterNode locNode = discoCache.localNode();
@@ -2122,12 +2122,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
/** Remote nodes. */
private final List<ClusterNode> rmtNodes;
- /** Client nodes. */
- private final List<ClusterNode> clientNodes;
-
- /** Server nodes. */
- private final List<ClusterNode> serverNodes;
-
/** All nodes. */
private final List<ClusterNode> allNodes;
@@ -2216,10 +2210,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
all.addAll(rmtNodes);
- clientNodes = Collections.unmodifiableList(new ArrayList<>(F.view(all, clientFilter)));
-
- serverNodes = Collections.unmodifiableList(new ArrayList<>(F.view(all, F.not(clientFilter))));
-
Collections.sort(all, GridNodeOrderComparator.INSTANCE);
allNodes = Collections.unmodifiableList(all);
@@ -2370,16 +2360,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
return rmtNodes;
}
- /** @return Server nodes. */
- Collection<ClusterNode> serverNodes() {
- return serverNodes;
- }
-
- /** @return Client nodes. */
- Collection<ClusterNode> clientNodes() {
- return clientNodes;
- }
-
/** @return All nodes. */
Collection<ClusterNode> allNodes() {
return allNodes;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6ebcb6de/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/IgniteTopologyPrintFormatSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/IgniteTopologyPrintFormatSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/IgniteTopologyPrintFormatSelfTest.java
index efbc431..2a71f28 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/IgniteTopologyPrintFormatSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/IgniteTopologyPrintFormatSelfTest.java
@@ -56,11 +56,16 @@ public class IgniteTopologyPrintFormatSelfTest extends GridCommonAbstractTest {
TcpDiscoverySpi disc = new TcpDiscoverySpi();
disc.setIpFinder(IP_FINDER);
- cfg.setDiscoverySpi(disc);
-
if (gridName.endsWith("client"))
cfg.setClientMode(true);
+ if (gridName.endsWith("client_force_server")) {
+ cfg.setClientMode(true);
+ disc.setForceServerMode(true);
+ }
+
+ cfg.setDiscoverySpi(disc);
+
return cfg;
}
@@ -176,6 +181,57 @@ public class IgniteTopologyPrintFormatSelfTest extends GridCommonAbstractTest {
}
/**
+ * @throws Exception If failed.
+ */
+ public void testForceServerAndClientLogs() throws Exception {
+ MockLogger log = new MockLogger();
+
+ log.setLevel(Level.INFO);
+
+ doForceServerAndClientTest(log);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testForceServerAndClientDebugLogs() throws Exception {
+ MockLogger log = new MockLogger();
+
+ log.setLevel(Level.DEBUG);
+
+ doForceServerAndClientTest(log);
+ }
+
+ /**
+ * @param log Log.
+ * @throws Exception If failed.
+ */
+ private void doForceServerAndClientTest(MockLogger log) throws Exception {
+ try {
+ Ignite server = startGrid("server");
+
+ setLogger(log, server);
+
+ Ignite server1 = startGrid("server1");
+ Ignite client1 = startGrid("first client");
+ Ignite client2 = startGrid("second client");
+ Ignite forceServClnt3 = startGrid("third client_force_server");
+
+ waitForDiscovery(server, server1, client1, client2, forceServClnt3);
+ }
+ finally {
+ stopAllGrids();
+ }
+
+ assertTrue(F.forAny(log.logs(), new IgnitePredicate<String>() {
+ @Override public boolean apply(String s) {
+ return s.contains("Topology snapshot [ver=5, server nodes=2, client nodes=3,")
+ || (s.contains(">>> Number of server nodes: 2") && s.contains(">>> Number of client nodes: 3"));
+ }
+ }));
+ }
+
+ /**
* Set log.
*
* @param log Log.
[04/23] incubator-ignite git commit: IGNITE-1046 Added license.
Posted by iv...@apache.org.
IGNITE-1046 Added license.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4eef6d04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4eef6d04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4eef6d04
Branch: refs/heads/ignite-964-1
Commit: 4eef6d04c09a730188dbde33b9063965947a1683
Parents: 86c5d20
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 26 18:00:37 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 26 18:00:37 2015 +0300
----------------------------------------------------------------------
modules/docker/run.sh | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4eef6d04/modules/docker/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/run.sh b/modules/docker/run.sh
index e7feb8c..0f01c1c 100644
--- a/modules/docker/run.sh
+++ b/modules/docker/run.sh
@@ -16,13 +16,15 @@
# limitations under the License.
#
-IGNITE_VERSION=""
-
if [ -z $SKIP_BUILD_LIBS ]; then
./build_users_libs.sh
- IGNITE_VERSION=$(mvn -f user-repo/pom.xml dependency:list | grep ':ignite-core:jar:.*:' | \
+ PROJ_VER=$(mvn -f user-repo/pom.xml dependency:list | grep ':ignite-core:jar:.*:' | \
sed -rn 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')
+
+ if [ ! -z $PROJ_VER ]; then
+ IGNITE_VERSION=$PROJ_VER
+ fi
fi
if [ -z $SKIP_DOWNLOAD ]; then