You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/09 08:33:12 UTC
[23/24] incubator-ignite git commit: ignite-545: merge from
ignite-sprint-6
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/dev-tools/slurp.sh
----------------------------------------------------------------------
diff --git a/dev-tools/slurp.sh b/dev-tools/slurp.sh
new file mode 100755
index 0000000..7edc776
--- /dev/null
+++ b/dev-tools/slurp.sh
@@ -0,0 +1,76 @@
+#!/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.
+#
+
+#
+# Copy this script file at root of ignite repo.
+# Fill all variables.
+#
+
+#
+# Default branch name. Need to use last version of "jiraslurp" scripts.
+#
+DEFAULT_BRANCH='ignite-sprint-5'
+
+#
+# TC URL. It is 10.30.0.229 for public TC from agents.
+#
+TC_URL='10.30.0.229'
+
+#
+# Jira user name to add comments aboyt triggered builds.
+#
+JIRA_USER='tc_commenter'
+
+#
+# Jira password.
+#
+JIRA_PWD=''
+
+#
+# TC user which have permissions to trigger new builds.
+#
+TASK_RUNNER_USER='task_runner'
+
+#
+# TC user password.
+#
+TASK_RUNNER_PWD=''
+
+echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+echo "<"$(date + "%D - %H:%M:%S")"> Starting task triggering"
+echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+
+# Useful settings
+#cd /home/teamcity/jobs/incubator-ignite/
+#
+#export JAVA_HOME=<java_home>
+#export PATH=$PATH:<gradle_path>
+
+git fetch
+
+git checkout ${DEFAULT_BRANCH}
+
+git pull
+
+export TC_URL=${TC_URL}
+export JIRA_USER=${JIRA_USER}
+export JIRA_PWD=${JIRA_PWD}
+export TASK_RUNNER_PWD=${TASK_RUNNER_PWD}
+export TASK_RUNNER_USER=${TASK_RUNNER_USER}
+
+gradle slurp -b dev-tools/build.gradle
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
new file mode 100644
index 0000000..8498cf0
--- /dev/null
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -0,0 +1,544 @@
+/*
+ * 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 of util methods.
+ */
+
+def envVariable = { name, defaultVar ->
+ def res = System.getenv(name as String)
+
+ if (res == 'null' || res == null)
+ return defaultVar
+
+ res
+}
+
+def envVariableAsList = { name, defaultList ->
+ def list = System.getenv(name as String)?.split(' ') as List
+
+ if (list == 'null' || list == null)
+ return defaultList
+
+ list
+}
+
+/**
+ * Monitors given process and show errors if exist.
+ */
+def checkprocess = { process ->
+ process.waitFor()
+
+ if (process.exitValue() != 0) {
+ println "Return code: " + process.exitValue()
+// println "Errout:\n" + process.err.text
+
+ assert process.exitValue() == 0 || process.exitValue() == 128
+ }
+}
+
+def exec = {command, envp, dir ->
+ println "Executing command '$command'..."
+
+ def ps = command.execute(envp, dir)
+
+ try {
+ println "Command output:"
+
+ println ps.text
+ }
+ catch (Throwable e) {
+ // Do nothing.
+ println "Error: could not get caommand output."
+ }
+
+ checkprocess ps
+}
+
+def execGit = {command ->
+ exec(command, null, new File("../"))
+}
+
+/**
+ * Util method to send http request.
+ */
+def sendHttpRequest = { requestMethod, urlString, user, pwd, postData, contentType ->
+ URL url = new URL(urlString as String);
+
+ HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+
+ String encoded = new sun.misc.BASE64Encoder().encode("$user:$pwd".getBytes());
+
+ conn.setRequestProperty("Authorization", "Basic " + encoded);
+
+ conn.setDoOutput(true);
+ conn.setRequestMethod(requestMethod);
+
+ if (postData) {
+ conn.setRequestProperty("Content-Type", contentType);
+ conn.setRequestProperty("Content-Length", String.valueOf(postData.length()));
+
+ OutputStream os = conn.getOutputStream();
+ os.write(postData.getBytes());
+ os.flush();
+ os.close();
+ }
+
+ conn.connect();
+
+ // Read response.
+ BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ String response = "";
+ String line;
+
+ while ((line = br.readLine()) != null)
+ response += line
+
+ br.close();
+
+ response
+}
+
+/**
+ * Util method to send http POST request.
+ */
+def sendPostRequest = { urlString, user, pwd, postData, contentType ->
+ sendHttpRequest("POST", urlString, user, pwd, postData, contentType);
+}
+
+/**
+ * Util method to send http GET request.
+ */
+def sendGetRequest = { urlString, user, pwd->
+ sendHttpRequest("GET", urlString, user, pwd, null, null);
+}
+
+/*
+ * End of util methods.
+ */
+
+/**
+ * Parsing a special filter from Apache Ignite JIRA and picking up latest by ID
+ * attachments to process.
+ */
+final GIT_REPO = "https://git1-us-west.apache.org/repos/asf/incubator-ignite.git"
+final JIRA_URL = "https://issues.apache.org"
+final ATTACHMENT_URL = "$JIRA_URL/jira/secure/attachment"
+final HISTORY_FILE = "${System.getProperty("user.home")}/validated-jira.txt"
+final LAST_SUCCESSFUL_ARTIFACT = "guestAuth/repository/download/Ignite_PatchValidation_PatchChecker/.lastSuccessful/$HISTORY_FILE"
+final NL = System.getProperty("line.separator")
+
+final def JIRA_CMD = System.getProperty('JIRA_COMMAND', 'jira.sh')
+
+// Envariement variables.
+final def TC_PROJECT_NAME = envVariable("PROJECT_NAME", "Ignite")
+final def TC_BUILD_EXCLUDE_LIST = envVariableAsList("BUILD_ID_EXCLUDES", ["Ignite_RunAllTestBuilds"])
+
+final def JIRA_USER = System.getenv('JIRA_USER')
+final def JIRA_PWD = System.getenv('JIRA_PWD')
+
+final def CONTRIBUTORS = []
+
+def contributors = {
+ if (!CONTRIBUTORS) {
+ def response = sendGetRequest(
+ "$JIRA_URL/jira/rest/api/2/project/12315922/role/10010" as String,
+ JIRA_USER,
+ JIRA_PWD)
+
+ println "Response on contributors request = $response"
+
+ def json = new groovy.json.JsonSlurper().parseText(response)
+
+ json.actors.each {
+ CONTRIBUTORS.add(it.name)
+ }
+
+ println "Contributors list: $CONTRIBUTORS"
+ }
+
+ CONTRIBUTORS
+}
+
+/**
+ * Gets jiras for which test tasks were already triggered.
+ *
+ * @return List of pairs [jira,attachemntId].
+ */
+def readHistory = {
+ final int MAX_HISTORY = 5000
+
+ List validated_list = []
+
+ def validated = new File(HISTORY_FILE)
+
+ if (validated.exists()) {
+ validated_list = validated.text.split('\n')
+ }
+
+ // Let's make sure the preserved history isn't too long
+ if (validated_list.size > MAX_HISTORY) {
+ validated_list = validated_list[validated_list.size - MAX_HISTORY..validated_list.size - 1]
+
+ validated.delete()
+ validated << validated_list.join(NL)
+ }
+
+ println "History=$validated_list"
+
+ validated_list
+}
+
+/**
+ * Accepting the <jira> XML element from JIRA stream
+ * @return <code>null</code> or <code>JIRA-###,latest_attach_id</code>
+ */
+def getLatestAttachment = { jira ->
+ def attachment = jira.attachments[0].attachment.list()
+ .sort { it.@id.toInteger() }
+ .reverse()
+ .find {
+ def fName = it.@name.toString()
+
+ contributors().contains(it.@author as String) &&
+ (fName.endsWith(".patch") || fName.endsWith(".txt") || fName.endsWith(".diff"))
+ }
+
+ String row = null
+
+ if (attachment == null) {
+ println "${jira.key} is in invalid state: there was not found '.{patch/txt/diff}'-file from approved user."
+ }
+ else {
+ row = "${jira.key},${attachment.@id}"
+ }
+}
+
+/**
+ * Checks all "Patch availiable" jiras on attached ".patch"-files from approved users.
+ */
+def findAttachments = {
+ // See https://issues.apache.org/jira/issues/?filter=12330308 (the same).
+ def JIRA_FILTER =
+ "https://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/12330308/SearchRequest-12330308.xml?tempMax=100&field=key&field=attachments"
+ def rss = new XmlSlurper().parse(JIRA_FILTER)
+
+ final List history = readHistory {}
+
+ LinkedHashMap<String, String> attachments = [:]
+
+ rss.channel.item.each { jira ->
+ String row = getLatestAttachment(jira)
+
+ if (row != null && !history.contains(row)) {
+ def pair = row.split(',')
+
+ attachments.put(pair[0] as String, pair[1] as String)
+ }
+ }
+
+ attachments
+}
+
+/**
+ * Store jira with attachment id to hostory.
+ */
+def addToHistory = {jira, attachmentId ->
+ def validated = new File(HISTORY_FILE)
+
+ assert validated.exists(), "History file does not exist."
+
+ validated << NL + "$jira,$attachmentId"
+}
+
+def tryGitAmAbort = {
+ try {
+ checkprocess "git am --abort".execute(null, new File("../"))
+
+ println "Succsessfull: git am --abort."
+ }
+ catch (Throwable e) {
+ println "Error: git am --abort fails: "
+ }
+}
+
+/**
+ * Applys patch from jira to given git state.
+ */
+def applyPatch = { jira, attachementURL ->
+ // Delete all old IGNITE-*-*.patch files.
+ def directory = new File("./")
+
+ println "Remove IGNITE-*-*.patch files in ${directory.absolutePath} and its subdirectories..."
+
+ def classPattern = ~/.*IGNITE-.*-.*\.patch/
+
+ directory.eachFileRecurse(groovy.io.FileType.FILES)
+ { file ->
+ if (file ==~ classPattern){
+ println "Deleting ${file}..."
+
+ file.delete()
+ }
+ }
+
+ // Main logic.
+ println "Patch apllying with jira='$jira' and attachment='$ATTACHMENT_URL/$attachementURL/'."
+
+ def userEmail = System.getenv("env.GIT_USER_EMAIL");
+ def userName = System.getenv("env.GIT_USER_NAME");
+
+ def patchFile = new File("${jira}-${attachementURL}.patch")
+
+ println "Getting patch content."
+
+ def attachmentUrl = new URL("$ATTACHMENT_URL/$attachementURL/")
+
+ HttpURLConnection conn = (HttpURLConnection)attachmentUrl.openConnection();
+ conn.setRequestProperty("Content-Type", "text/x-patch;charset=utf-8");
+ conn.setRequestProperty("X-Content-Type-Options", "nosniff");
+ conn.connect();
+
+ patchFile << conn.getInputStream()
+
+ println "Got patch content."
+
+ try {
+ tryGitAmAbort()
+
+ execGit "git branch"
+
+ execGit "git config user.email \"$userEmail\""
+ execGit "git config user.name \"$userName\""
+
+ // Create a new uniqueue branch to applying patch
+ def newTestBranch = "test-branch-${jira}-${attachementURL}-${System.currentTimeMillis()}"
+ execGit "git checkout -b ${newTestBranch}"
+
+ execGit "git branch"
+
+ println "Trying to apply patch."
+
+ execGit "git am dev-tools/${patchFile.name}"
+
+ println "Patch was applied successfully."
+ }
+ catch (Throwable e) {
+ println "Patch was not applied successfully. Aborting patch applying."
+
+ tryGitAmAbort()
+
+ throw e;
+ }
+}
+
+def JIRA_xml = { jiranum ->
+ "https://issues.apache.org/jira/si/jira.issueviews:issue-xml/$jiranum/${jiranum}.xml"
+}
+
+/**
+ * Gets all builds from TC project.
+ */
+def getTestBuilds = { ->
+ def tcURL = System.getenv('TC_URL')
+
+ def project = new XmlSlurper().parse("http://$tcURL:80/guestAuth/app/rest/projects/id:$TC_PROJECT_NAME")
+
+ def buildIds = []
+
+ def count = Integer.valueOf(project.buildTypes.@count as String)
+
+ for (int i = 0; i < count; i++) {
+ def id = project.buildTypes.buildType[i].@id
+
+ if (TC_BUILD_EXCLUDE_LIST == null || !TC_BUILD_EXCLUDE_LIST.contains(id))
+ buildIds.add(id)
+ }
+
+ buildIds
+}
+
+/**
+ * Adds comment to jira ticket.
+ */
+def addJiraComment = { jiraNum, comment ->
+ try {
+ println "Comment: $comment"
+
+ def jsonComment = "{\n \"body\": \"${comment}\"\n}";
+
+ def response = sendPostRequest(
+ "$JIRA_URL/jira/rest/api/2/issue/$jiraNum/comment" as String,
+ JIRA_USER,
+ JIRA_PWD,
+ jsonComment,
+ "application/json")
+
+ println "Response: $response"
+ }
+ catch (Exception e) {
+ e.printStackTrace()
+ }
+}
+
+/**
+ * Runs all given test builds to validate last patch from given jira.
+ */
+def runAllTestBuilds = {builds, jiraNum ->
+ def tcURL = System.getenv('TC_URL')
+ def user = System.getenv('TASK_RUNNER_USER')
+ def pwd = System.getenv('TASK_RUNNER_PWD')
+
+ def triggeredBuilds = [:]
+
+ builds.each {
+ try {
+ println "Triggering $it build for $jiraNum jira..."
+
+ String postData
+
+ if (jiraNum == 'null' || jiraNum == null) {
+ postData = "<build>" +
+ " <buildType id='$it'/>" +
+ "</build>";
+ }
+ else {
+ postData = "<build>" +
+ " <buildType id='$it'/>" +
+ " <comment>" +
+ " <text>Auto triggered build to validate last attached patch file at $jiraNum.</text>" +
+ " </comment>" +
+ " <properties>" +
+ " <property name='env.JIRA_NUM' value='$jiraNum'/>" +
+ " </properties>" +
+ "</build>";
+ }
+
+ println "Request: $postData"
+
+ def response = sendPostRequest(
+ "http://$tcURL:80/httpAuth/app/rest/buildQueue" as String,
+ user,
+ pwd,
+ postData,
+ "application/xml")
+
+ println "Response: $response"
+
+ def build = new XmlSlurper().parseText(response)
+
+ triggeredBuilds.put(build.buildType.@name, build.@webUrl)
+ }
+ catch (Exception e) {
+ e.printStackTrace()
+ }
+ }
+
+ // Format comment for jira.
+ def triggeredBuildsComment = "There was triggered next test builds for last attached patch-file:\\n"
+
+ def n = 1;
+
+ triggeredBuilds.each { name, url ->
+ def prefix = n < 10 ? "0" : ""
+
+ triggeredBuildsComment += "${prefix}${n}. ${url as String} - ${name as String}\\n"
+
+ n++
+ }
+
+ addJiraComment(jiraNum, triggeredBuildsComment)
+}
+
+/**
+ * Main.
+ *
+ * Modes:
+ * 1. "slurp" mode - triggers all TC test builds for all jiras with valid attachment
+ * (Jira in "patch availiable" state, there is attached file from approved user with "patch" extension)
+ * 2. "patchApply" mode - gets last valid patch file from given jira number and applies it.
+ * 3. "runAllBuilds" - triggers given jira number for all TC test builds.
+ *
+ * Main workflow:
+ * 1. run in "slurp" mode
+ * 2. each triggered build uses "patchApply" mode to apply latest valid patch.
+ */
+args.each {
+ println "Arg=$it"
+
+ def parameters = it.split(",")
+
+ println parameters
+
+ if (parameters.length >= 1 && parameters[0] == "slurp") {
+ println "Running in 'slurp' mode."
+
+ def builds = getTestBuilds()
+
+ println "Test builds to be triggered=$builds"
+
+ def attachments = findAttachments()
+
+ // For each ticket with new attachment, let's trigger remove build
+ attachments.each { k, v ->
+ // Trailing slash is important for download; only need to pass JIRA number
+ println "Triggering the test builds for: $k = $ATTACHMENT_URL/$v/"
+
+ runAllTestBuilds(builds, k)
+
+ addToHistory(k, v)
+ }
+ }
+ else if (parameters.length >= 1 && parameters[0] == "patchApply") {
+ if (parameters.length < 2 || parameters[1] == 'null') {
+ println "There is no jira number to apply. Exit."
+
+ return
+ }
+
+ def jiraNum = parameters[1]
+
+ println "Running in 'patch apply' mode with jira number '$jiraNum'"
+
+ // Extract JIRA rss from the and pass the ticket element into attachment extraction
+ def rss = new XmlSlurper().parse(JIRA_xml(parameters[1]))
+
+ String row = getLatestAttachment(rss.channel.item)
+
+ println "Got row: $row."
+
+ if (row != null) {
+ def pair = row.split(',')
+ def jira = pair[0]
+ def attachementURL = pair[1]
+
+ applyPatch(jira, attachementURL)
+ }
+ }
+ else if (parameters.length > 1 && parameters[0] == "runAllBuilds" ) {
+ def jiraNum = parameters[1]
+
+ println "Running in 'all builds' mode with jira number='$jiraNum'."
+
+ def builds = getTestBuilds()
+
+ println "Test builds to be triggered=$builds"
+
+ runAllTestBuilds(builds, jiraNum)
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 9dda753..78c5852 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
index 5e95892..966fce2 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamTransformerExample.java
@@ -30,11 +30,9 @@ import java.util.*;
* Stream random numbers into the streaming cache.
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start streaming using {@link StreamTransformerExample}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class StreamTransformerExample {
/** Random number generator. */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
index 0fbce68..baae5af 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
@@ -31,11 +31,9 @@ import java.util.*;
* Stream random numbers into the streaming cache.
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start streaming using {@link StreamVisitorExample}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class StreamVisitorExample {
/** Random number generator. */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java
index 43dea13..43fbab3 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/package-info.java
@@ -16,7 +16,6 @@
*/
/**
- * <!-- Package description. -->
* Demonstrates usage of data streamer.
*/
package org.apache.ignite.examples.streaming;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
index bb2a18e..d17b97d 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/CacheConfig.java
@@ -18,7 +18,6 @@
package org.apache.ignite.examples.streaming.wordcount;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.eviction.fifo.*;
import org.apache.ignite.configuration.*;
import javax.cache.configuration.*;
@@ -27,7 +26,7 @@ import javax.cache.expiry.*;
import static java.util.concurrent.TimeUnit.*;
/**
- * Configuration for the streaming cache to store the stream of random numbers.
+ * Configuration for the streaming cache to store the stream of words.
* This cache is configured with sliding window of 1 second, which means that
* data older than 1 second will be automatically removed from the cache.
*/
@@ -44,10 +43,6 @@ public class CacheConfig {
// Sliding window of 1 seconds.
cfg.setExpiryPolicyFactory(FactoryBuilder.factoryOf(new CreatedExpiryPolicy(new Duration(SECONDS, 1))));
- // Do not allow more than 1 million entries.
- // Allows to run this example with smaller available memory.
- cfg.setEvictionPolicy(new FifoEvictionPolicy<>(1_000_000));
-
return cfg;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
index 3bd9d3d..58c6ef2 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/QueryWords.java
@@ -28,14 +28,18 @@ import java.util.*;
* Periodically query popular numbers from the streaming cache.
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start streaming using {@link StreamWords}.</li>
- * <li>Start querying popular numbers using {@link QueryWords}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class QueryWords {
+ /**
+ * Schedules words query execution.
+ *
+ * @param args Command line arguments (none required).
+ * @throws Exception If failed.
+ */
public static void main(String[] args) throws Exception {
// Mark this cluster member as client.
Ignition.setClientMode(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
index c59fa51..6024c4b 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/StreamWords.java
@@ -27,14 +27,18 @@ import java.io.*;
* Stream words into Ignite cache.
* To start the example, you should:
* <ul>
- * <li>Start a few nodes using {@link ExampleNodeStartup} or by starting remote nodes as specified below.</li>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
* <li>Start streaming using {@link StreamWords}.</li>
- * <li>Start querying popular numbers using {@link QueryWords}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
* </ul>
- * <p>
- * You should start remote nodes by running {@link ExampleNodeStartup} in another JVM.
*/
public class StreamWords {
+ /**
+ * Starts words streaming.
+ *
+ * @param args Command line arguments (none required).
+ * @throws Exception If failed.
+ */
public static void main(String[] args) throws Exception {
// Mark this cluster member as client.
Ignition.setClientMode(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java
index 010f86a..5d48ae3 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/package-info.java
@@ -16,7 +16,6 @@
*/
/**
- * <!-- Package description. -->
* Streaming word count example.
*/
package org.apache.ignite.examples.streaming.wordcount;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
new file mode 100644
index 0000000..c4d7b8c
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerClient.java
@@ -0,0 +1,82 @@
+/*
+ * 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.examples.streaming.wordcount.socket;
+
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
+import org.apache.ignite.stream.socket.*;
+
+import java.io.*;
+import java.net.*;
+
+/**
+ * Example demonstrates streaming of data from external components into Ignite cache.
+ * <p>
+ * {@code WordsSocketStreamerClient} is simple socket streaming client implementation that sends words to socket server
+ * based on {@link SocketStreamer} using message delimiter based protocol. Example illustrates usage of TCP socket
+ * streamer in case of non-Java clients. In this example words are zero-terminated strings.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
+ * <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
+ * <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
+ * </ul>
+ */
+public class WordsSocketStreamerClient {
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0};
+
+ /**
+ * @param args Args.
+ */
+ public static void main(String[] args) throws IOException {
+ InetAddress addr = InetAddress.getLocalHost();
+
+ try (
+ Socket sock = new Socket(addr, PORT);
+ OutputStream oos = new BufferedOutputStream(sock.getOutputStream())
+ ) {
+ System.out.println("Words streaming started.");
+
+ while (true) {
+ try (InputStream in = WordsSocketStreamerClient.class.getResourceAsStream("../alice-in-wonderland.txt");
+ LineNumberReader rdr = new LineNumberReader(new InputStreamReader(in))) {
+ for (String line = rdr.readLine(); line != null; line = rdr.readLine()) {
+ for (String word : line.split(" ")) {
+ if (!word.isEmpty()) {
+ // Stream words into Ignite through socket.
+ byte[] arr = word.getBytes("ASCII");
+
+ // Write message
+ oos.write(arr);
+
+ // Write message delimiter
+ oos.write(DELIM);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
new file mode 100644
index 0000000..9e68096
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/WordsSocketStreamerServer.java
@@ -0,0 +1,124 @@
+/*
+ * 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.examples.streaming.wordcount.socket;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.examples.*;
+import org.apache.ignite.examples.streaming.wordcount.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.stream.*;
+import org.apache.ignite.stream.socket.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+/**
+ * Example demonstrates streaming of data from external components into Ignite cache.
+ * <p>
+ * {@code WordsSocketStreamerServer} is simple socket streaming server implementation that
+ * receives words from socket using {@link SocketStreamer} and message delimiter based protocol
+ * and streams them into Ignite cache. Example illustrates usage of TCP socket streamer in case of non-Java clients.
+ * In this example words are zero-terminated strings.
+ * <p>
+ * To start the example, you should:
+ * <ul>
+ * <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
+ * <li>Start socket server using {@link WordsSocketStreamerServer}.</li>
+ * <li>Start a few socket clients using {@link WordsSocketStreamerClient}.</li>
+ * <li>Start querying popular words using {@link QueryWords}.</li>
+ * </ul>
+ */
+public class WordsSocketStreamerServer {
+ /** Port. */
+ private static final int PORT = 5555;
+
+ /** Delimiter. */
+ private static final byte[] DELIM = new byte[] {0};
+
+ /**
+ * Starts socket streaming server.
+ *
+ * @param args Command line arguments (none required).
+ * @throws Exception If failed.
+ */
+ public static void main(String[] args) throws Exception {
+ // Mark this cluster member as client.
+ Ignition.setClientMode(true);
+
+ Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
+
+ if (!ExamplesUtils.hasServerNodes(ignite)) {
+ ignite.close();
+
+ return;
+ }
+
+ // The cache is configured with sliding window holding 1 second of the streaming data.
+ IgniteCache<AffinityUuid, String> stmCache = ignite.getOrCreateCache(CacheConfig.wordCache());
+
+ IgniteDataStreamer<AffinityUuid, String> stmr = ignite.dataStreamer(stmCache.getName());
+
+ InetAddress addr = InetAddress.getLocalHost();
+
+ // Configure socket streamer
+ SocketStreamer<String, AffinityUuid, String> sockStmr = new SocketStreamer<>();
+
+ sockStmr.setAddr(addr);
+
+ sockStmr.setPort(PORT);
+
+ sockStmr.setDelimiter(DELIM);
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ // Converter from zero-terminated string to Java strings.
+ sockStmr.setConverter(new SocketMessageConverter<String>() {
+ @Override public String convert(byte[] msg) {
+ try {
+ return new String(msg, "ASCII");
+ }
+ catch (UnsupportedEncodingException e) {
+ throw new IgniteException(e);
+ }
+ }
+ });
+
+ sockStmr.setTupleExtractor(new StreamTupleExtractor<String, AffinityUuid, String>() {
+ @Override public Map.Entry<AffinityUuid, String> extract(String word) {
+ // By using AffinityUuid we ensure that identical
+ // words are processed on the same cluster node.
+ return new IgniteBiTuple<>(new AffinityUuid(word), word);
+ }
+ });
+
+ try {
+ sockStmr.start();
+ }
+ catch (IgniteException e) {
+ System.err.println("Streaming server didn't start due to an error: ");
+
+ e.printStackTrace();
+
+ ignite.close();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/package-info.java b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/package-info.java
new file mode 100644
index 0000000..048299f
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/socket/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * Contains {@link org.apache.ignite.stream.socket.SocketStreamer} usage examples.
+ */
+package org.apache.ignite.examples.streaming.wordcount.socket;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index ef44603..85e9608 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 43f24bc..e5cdae7 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/clients/config/grid-client-config.properties
----------------------------------------------------------------------
diff --git a/modules/clients/config/grid-client-config.properties b/modules/clients/config/grid-client-config.properties
index b6bce8d..d25352b 100644
--- a/modules/clients/config/grid-client-config.properties
+++ b/modules/clients/config/grid-client-config.properties
@@ -16,89 +16,89 @@
#
# Required. Comma-separated list of servers to connect to in format "host:port".
-gg.client.servers=localhost:11211
+ignite.client.servers=localhost:11211
# Optional. Default client load balancer. Default value is "".
# Balancer may be "random", "roundrobin" or full class name for "your.balancer.ImplementationClass"
-#gg.client.balancer=
+#ignite.client.balancer=
# Optional. Socket connect timeout (ms). Default value is "0".
-#gg.client.connectTimeout=10000
+#ignite.client.connectTimeout=10000
# Optional. Credentials if grid requires authentication. Default value is "".
-#gg.client.credentials=
+#ignite.client.credentials=
# Optional. Flag indicating whether topology cache is enabled. Default value is "false".
-#gg.client.cacheTop=false
+#ignite.client.cacheTop=false
# Optional. Max time of connection idleness (ms). Default value is "30000".
-#gg.client.idleTimeout=30000
+#ignite.client.idleTimeout=30000
# Optional. Client protocol, one of TCP or HTTP. Default value is "TCP".
-#gg.client.protocol=TCP
+#ignite.client.protocol=TCP
# Optional. TCP_NODELAY communication flag. Default value is "true".
-#gg.client.tcp.noDelay=true
+#ignite.client.tcp.noDelay=true
# Optional. Topology refresh frequency (ms). Default value is "2000".
-#gg.client.topology.refresh=2000
+#ignite.client.topology.refresh=2000
#
# Data configurations.
#
# Optional. List of comma-separated names of data configurations. Default value is "".
-#gg.client.data.configurations=cfg1, cfg2
+#ignite.client.data.configurations=cfg1, cfg2
# Optional. Cache name (space) to work with (for configuration 'cfg1').
-#gg.client.data.cfg1.name=
+#ignite.client.data.cfg1.name=
# Optional. Specific load balancer for configuration 'cfg1'. Default value is "".
# Balancer may be "random", "roundrobin" or full class name for "your.balancer.ImplementationClass"
-#gg.client.data.cfg1.balancer=random
+#ignite.client.data.cfg1.balancer=random
# Optional. Specific affinity for configuration 'cfg1'. Default value is "".
# Affinity may be "" (no affinity), "partitioned" or full class name for "your.affinity.ImplementationClass"
-#gg.client.data.cfg1.affinity=
+#ignite.client.data.cfg1.affinity=
# Optional. Cache name (space) to work with (for configuration 'cfg2').
-#gg.client.data.cfg2.name=partitioned
+#ignite.client.data.cfg2.name=partitioned
# Optional. Specific load balancer for configuration 'cfg2'. Default value is "".
# Balancer may be "random", "roundrobin" or full class name for "your.balancer.ImplementationClass"
-#gg.client.data.cfg2.balancer=roundrobin
+#ignite.client.data.cfg2.balancer=roundrobin
# Optional. Specific affinity for configuration 'cfg2'. Default value is "".
# Affinity may be "" (no affinity), "partitioned" or full class name for "your.affinity.ImplementationClass"
-#gg.client.data.cfg2.affinity=partitioned
+#ignite.client.data.cfg2.affinity=partitioned
#
# SSL configuration.
#
# Optional. SSL enabled. Default value is "false".
-#gg.client.ssl.enabled=false
+#ignite.client.ssl.enabled=false
# Optional. SSL protocol. Default value is "TLS".
-#gg.client.ssl.protocol=TLS
+#ignite.client.ssl.protocol=TLS
# Optional. Key manager algorithm. Default value is "SunX509".
-#gg.client.ssl.key.algorithm=SunX509
+#ignite.client.ssl.key.algorithm=SunX509
# Optional. Keystore to be used by client to connect with Ignite topology over SSL. Default value is "".
-#gg.client.ssl.keystore.location=
+#ignite.client.ssl.keystore.location=
# Optional. Default value is "".
-#gg.client.ssl.keystore.password=
+#ignite.client.ssl.keystore.password=
# Optional. Default value is "jks".
-#gg.client.ssl.keystore.type=jks
+#ignite.client.ssl.keystore.type=jks
# Optional. Truststore to be used by client to connect with Ignite topology over SSL. Default value is "".
-#gg.client.ssl.truststore.location=
+#ignite.client.ssl.truststore.location=
# Optional. Default value is "".
-#gg.client.ssl.truststore.password=
+#ignite.client.ssl.truststore.password=
# Optional. Default value is "jks".
-#gg.client.ssl.truststore.type=jks
+#ignite.client.ssl.truststore.type=jks
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index ca93673..2132f24 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java
index 6e2a1eb..8e981d1 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPropertiesConfigurationSelfTest.java
@@ -85,8 +85,8 @@ public class ClientPropertiesConfigurationSelfTest extends GridCommonAbstractTes
for (Map.Entry<Object, Object> e : props.entrySet())
props2.put("new." + e.getKey(), e.getValue());
- validateConfig(0, new GridClientConfiguration("new.gg.client", props2));
- validateConfig(0, new GridClientConfiguration("new.gg.client.", props2));
+ validateConfig(0, new GridClientConfiguration("new.ignite.client", props2));
+ validateConfig(0, new GridClientConfiguration("new.ignite.client.", props2));
// Validate loaded test configuration.
File tmp = uncommentProperties(GRID_CLIENT_CONFIG);
@@ -100,14 +100,14 @@ public class ClientPropertiesConfigurationSelfTest extends GridCommonAbstractTes
for (Map.Entry<Object, Object> e : props.entrySet())
props2.put("new." + e.getKey(), e.getValue());
- validateConfig(2, new GridClientConfiguration("new.gg.client", props2));
- validateConfig(2, new GridClientConfiguration("new.gg.client.", props2));
+ validateConfig(2, new GridClientConfiguration("new.ignite.client", props2));
+ validateConfig(2, new GridClientConfiguration("new.ignite.client.", props2));
// Validate loaded test configuration with empty key prefixes.
props2 = new Properties();
for (Map.Entry<Object, Object> e : props.entrySet())
- props2.put(e.getKey().toString().replace("gg.client.", ""), e.getValue());
+ props2.put(e.getKey().toString().replace("ignite.client.", ""), e.getValue());
validateConfig(2, new GridClientConfiguration("", props2));
validateConfig(2, new GridClientConfiguration(".", props2));
@@ -156,7 +156,7 @@ public class ClientPropertiesConfigurationSelfTest extends GridCommonAbstractTes
Collection<String> lines = new ArrayList<>();
while (it.hasNext())
- lines.add(it.nextLine().replace("#gg.client.", "gg.client."));
+ lines.add(it.nextLine().replace("#ignite.client.", "ignite.client."));
IgniteUtils.closeQuiet(in);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java
index 7272b2c..5aec7e5 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractConnectivitySelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.client.integration;
import org.apache.ignite.*;
import org.apache.ignite.internal.client.*;
+import org.apache.ignite.internal.util.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -123,6 +124,19 @@ public abstract class ClientAbstractConnectivitySelfTest extends GridCommonAbstr
}
/**
+ * Simple test of address list filtering.
+ * @throws Exception
+ */
+ public void testResolveReachableOneAddress() throws Exception {
+ InetAddress addr = InetAddress.getByAddress(new byte[] {127, 0, 0, 1} );
+
+ List <InetAddress> filtered = IgniteUtils.filterReachable(Collections.singletonList(addr));
+
+ assertEquals(1, filtered.size());
+ assertEquals(addr, filtered.get(0));
+ }
+
+ /**
* Tests correct behavior in case of 1 REST-enabled node
* with explicitly specified loopback address setting.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 38c126f..e27dc2a 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -17,9 +17,7 @@
limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -31,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
@@ -105,4 +103,4 @@
</dependencies>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java b/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
index 2637742..7555b16 100644
--- a/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
+++ b/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
@@ -30,6 +30,7 @@ import org.jclouds.*;
import org.jclouds.compute.*;
import org.jclouds.compute.domain.*;
import org.jclouds.domain.*;
+import org.jclouds.googlecloud.*;
import org.jclouds.location.reference.*;
import java.io.*;
@@ -97,7 +98,7 @@ import java.util.concurrent.atomic.*;
* <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinder"/>
* <property name="provider" value="google-compute-engine"/>
* <property name="identity" value="your_service_account_email"/>
- * <property name="credentialPath" value="path_to_pem_file"/>
+ * <property name="credentialPath" value="path_to_json_key"/>
* <property name="zones">
* <list>
* <value>us-central1-a</value>
@@ -253,8 +254,7 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
/**
* Sets the path to a credential that is used during authentication on the cloud.
*
- * This method should be used when an access key or private key is stored in a plain or PEM file without
- * a passphrase.
+ * This method should be used when an access key or private key is stored in a file.
* Content of the file, referred by @{code credentialPath}, is fully read and used as a access key or private key
* during authentication.
*
@@ -322,7 +322,7 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
throw new IgniteSpiException("Both credential and credentialPath are set. Use only one method.");
if (credentialPath != null)
- credential = getPrivateKeyFromFile();
+ credential = getCredentialFromFile();
try {
ContextBuilder ctxBuilder = ContextBuilder.newBuilder(provider);
@@ -398,13 +398,22 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
}
/**
- * Retrieves a private key from the secrets file.
+ * Reads credential info from {@link #credentialPath} and returns in a string format.
*
- * @return Private key
+ * @return Credential in {@code String} representation.
+ * @throws IgniteSpiException In case of error.
*/
- private String getPrivateKeyFromFile() throws IgniteSpiException {
+ private String getCredentialFromFile() throws IgniteSpiException {
try {
- return Files.toString(new File(credentialPath), Charsets.UTF_8);
+ String fileContents = Files.toString(new File(credentialPath), Charsets.UTF_8);
+
+ if (provider.equals("google-compute-engine")) {
+ Supplier<Credentials> credentialSupplier = new GoogleCredentialsFromJson(fileContents);
+
+ return credentialSupplier.get().credential;
+ }
+
+ return fileContents;
}
catch (IOException e) {
throw new IgniteSpiException("Failed to retrieve the private key from the file: " + credentialPath, e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java b/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
index 7ac1994..d1d945f 100644
--- a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
+++ b/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
@@ -101,14 +101,11 @@ public class TcpDiscoveryCloudIpFinderSelfTest extends
if (provider.equals("google-compute-engine"))
ipFinder.setCredentialPath(IgniteCloudTestSuite.getSecretKey(provider));
- else {
+ else
ipFinder.setCredential(IgniteCloudTestSuite.getSecretKey(provider));
- }
Collection<InetSocketAddress> addresses = ipFinder.getRegisteredAddresses();
- assert addresses.size() > 0;
-
for (InetSocketAddress addr : addresses)
info("Registered instance: " + addr.getAddress().getHostAddress() + ":" + addr.getPort());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9e03dab..32bd7c2 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
index f75bcf4..0540148 100644
--- a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
+++ b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
@@ -18,7 +18,6 @@
package org.apache.ignite.codegen;
import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.datastreamer.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.plugin.extensions.communication.*;
@@ -46,6 +45,9 @@ public class MessageCodeGenerator {
private static final String DFLT_SRC_DIR = U.getIgniteHome() + "/modules/core/src/main/java";
/** */
+ private static final String INDEXING_SRC_DIR = U.getIgniteHome() + "/modules/indexing/src/main/java";
+
+ /** */
private static final Class<?> BASE_CLS = Message.class;
/** */
@@ -140,7 +142,7 @@ public class MessageCodeGenerator {
MessageCodeGenerator gen = new MessageCodeGenerator(srcDir);
- gen.generateAndWrite(DataStreamerEntry.class);
+// gen.generateAndWrite(DataStreamerEntry.class);
// gen.generateAndWrite(GridDistributedLockRequest.class);
// gen.generateAndWrite(GridDistributedLockResponse.class);
@@ -163,8 +165,8 @@ public class MessageCodeGenerator {
// gen.generateAndWrite(GridDhtTxFinishRequest.class);
// gen.generateAndWrite(GridDhtTxFinishResponse.class);
//
-// gen.generateAndWrite(GridCacheOptimisticCheckPreparedTxRequest.class);
-// gen.generateAndWrite(GridCacheOptimisticCheckPreparedTxResponse.class);
+// gen.generateAndWrite(GridCacheTxRecoveryRequest.class);
+// gen.generateAndWrite(GridCacheTxRecoveryResponse.class);
// gen.generateAndWrite(GridQueryCancelRequest.class);
// gen.generateAndWrite(GridQueryFailResponse.class);
@@ -172,6 +174,26 @@ public class MessageCodeGenerator {
// gen.generateAndWrite(GridQueryNextPageResponse.class);
// gen.generateAndWrite(GridQueryRequest.class);
// gen.generateAndWrite(GridCacheSqlQuery.class);
+
+// gen.generateAndWrite(GridH2Null.class);
+// gen.generateAndWrite(GridH2Boolean.class);
+// gen.generateAndWrite(GridH2Byte.class);
+// gen.generateAndWrite(GridH2Short.class);
+// gen.generateAndWrite(GridH2Integer.class);
+// gen.generateAndWrite(GridH2Long.class);
+// gen.generateAndWrite(GridH2Decimal.class);
+// gen.generateAndWrite(GridH2Double.class);
+// gen.generateAndWrite(GridH2Float.class);
+// gen.generateAndWrite(GridH2Time.class);
+// gen.generateAndWrite(GridH2Date.class);
+// gen.generateAndWrite(GridH2Timestamp.class);
+// gen.generateAndWrite(GridH2Bytes.class);
+// gen.generateAndWrite(GridH2String.class);
+// gen.generateAndWrite(GridH2Array.class);
+// gen.generateAndWrite(GridH2JavaObject.class);
+// gen.generateAndWrite(GridH2Uuid.class);
+// gen.generateAndWrite(GridH2Geometry.class);
+// gen.generateAndWrite(GridH2CacheObject.class);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 62612f8..0460b46 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/META-INF/LICENSE
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/META-INF/LICENSE b/modules/core/src/main/java/META-INF/LICENSE
new file mode 100644
index 0000000..7649b39
--- /dev/null
+++ b/modules/core/src/main/java/META-INF/LICENSE
@@ -0,0 +1,238 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
+
+
+==============================================================================
+Apache Ignite (incubating) Subcomponents:
+
+The Apache Ignite project contains subcomponents with separate copyright
+notices and license terms. Your use of the source code for the these
+subcomponents is subject to the terms and conditions of the following
+licenses.
+
+
+==============================================================================
+For SnapTree:
+==============================================================================
+This product bundles SnapTree, which is available under a
+"3-clause BSD" license. For details, see
+https://github.com/nbronson/snaptree/blob/master/LICENSE.
+
+==============================================================================
+For JSR 166 classes in "org.jsr166" package
+==============================================================================
+This product bundles JSR-166 classes which are donated to public domain.
+For details, see CC0 1.0 Universal (1.0), Public Domain Dedication,
+http://creativecommons.org/publicdomain/zero/1.0/
+
+==============================================================================
+For books used for tests in "org.apache.ignite.internal.processors.hadoop.books"
+==============================================================================
+This code bundles book text files used for testing purposes which contain
+the following header:
+
+This eBook is for the use of anyone anywhere at no cost and with
+almost no restrictions whatsoever. You may copy it, give it away or
+re-use it under the terms of the Project Gutenberg License included
+with this eBook or online at www.gutenberg.org
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/META-INF/NOTICE b/modules/core/src/main/java/META-INF/NOTICE
new file mode 100644
index 0000000..298d05b
--- /dev/null
+++ b/modules/core/src/main/java/META-INF/NOTICE
@@ -0,0 +1,12 @@
+Apache Ignite (incubating)
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
+This software includes code from IntelliJ IDEA Community Edition
+Copyright (C) JetBrains s.r.o.
+https://www.jetbrains.com/idea/
+Licensed under Apache License, Version 2.0.
+http://search.maven.org/#artifactdetails%7Corg.jetbrains%7Cannotations%7C13.0%7Cjar
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/Ignite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/Ignite.java b/modules/core/src/main/java/org/apache/ignite/Ignite.java
index 40c9bbb..209946b 100644
--- a/modules/core/src/main/java/org/apache/ignite/Ignite.java
+++ b/modules/core/src/main/java/org/apache/ignite/Ignite.java
@@ -103,9 +103,9 @@ public interface Ignite extends AutoCloseable {
public IgniteCluster cluster();
/**
- * Gets {@code compute} facade over all cluster nodes.
+ * Gets {@code compute} facade over all cluster nodes started in server mode.
*
- * @return Compute instance over all cluster nodes.
+ * @return Compute instance over all cluster nodes started in server mode.
*/
public IgniteCompute compute();
@@ -154,9 +154,9 @@ public interface Ignite extends AutoCloseable {
public IgniteEvents events(ClusterGroup grp);
/**
- * Gets {@code services} facade over all cluster nodes.
+ * Gets {@code services} facade over all cluster nodes started in server mode.
*
- * @return Services facade over all cluster nodes.
+ * @return Services facade over all cluster nodes started in server mode.
*/
public IgniteServices services();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index d99902a..f9007a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -499,6 +499,11 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
CacheEntryProcessor<K, V, T> entryProcessor, Object... args);
/**
+ * Completely deletes the cache with all its data from the system on all cluster nodes.
+ */
+ @Override void close();
+
+ /**
* This cache node to re-balance its partitions. This method is usually used when
* {@link CacheConfiguration#getRebalanceDelay()} configuration parameter has non-zero value.
* When many nodes are started or stopped almost concurrently, it is more efficient to delay
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
index a7c2eae..17ec221 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java
@@ -90,101 +90,101 @@ import java.util.logging.*;
* <th>Optional</th>
* </tr>
* <tr>
- * <td><b>gg.client.protocol</b></td>
+ * <td><b>ignite.client.protocol</b></td>
* <td>Communication protocol ({@code TCP} or {@code HTTP}).</td>
* <td>{@code TCP}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.connectTimeout</b></td>
+ * <td><b>ignite.client.connectTimeout</b></td>
* <td>Socket connection timeout.</td>
* <td>{@code 0} (infinite timeout)</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.tcp.noDelay</b></td>
+ * <td><b>ignite.client.tcp.noDelay</b></td>
* <td>Flag indicating whether TCP_NODELAY flag should be enabled for outgoing connections.</td>
* <td>{@code true}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.enabled</b></td>
+ * <td><b>ignite.client.ssl.enabled</b></td>
* <td>Flag indicating that {@code SSL} is needed for connection.</td>
* <td>{@code false}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.protocol</b></td>
+ * <td><b>ignite.client.ssl.protocol</b></td>
* <td>SSL protocol ({@code SSL} or {@code TLS}).</td>
* <td>{@code TLS}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.key.algorithm</b></td>
+ * <td><b>ignite.client.ssl.key.algorithm</b></td>
* <td>Key manager algorithm.</td>
* <td>{@code SunX509}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.keystore.location</b></td>
+ * <td><b>ignite.client.ssl.keystore.location</b></td>
* <td>Key store to be used by client to connect with Ignite topology.</td>
* <td> </td>
* <td>No (if {@code SSL} is enabled)</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.keystore.password</b></td>
+ * <td><b>ignite.client.ssl.keystore.password</b></td>
* <td>Key store password.</td>
* <td> </td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.keystore.type</b></td>
+ * <td><b>ignite.client.ssl.keystore.type</b></td>
* <td>Key store type.</td>
* <td>{@code jks}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.truststore.location</b></td>
+ * <td><b>ignite.client.ssl.truststore.location</b></td>
* <td>Trust store to be used by client to connect with Ignite topology.</td>
* <td> </td>
* <td>No (if {@code SSL} is enabled)</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.truststore.password</b></td>
+ * <td><b>ignite.client.ssl.truststore.password</b></td>
* <td>Trust store password.</td>
* <td> </td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.ssl.truststore.type</b></td>
+ * <td><b>ignite.client.ssl.truststore.type</b></td>
* <td>Trust store type.</td>
* <td>{@code jks}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.credentials</b></td>
+ * <td><b>ignite.client.credentials</b></td>
* <td>Client credentials used in authentication process.</td>
* <td> </td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.cache.top</b></td>
+ * <td><b>ignite.client.cache.top</b></td>
* <td>
* Flag indicating that topology is cached internally. Cache will be refreshed in
- * the background with interval defined by {@code gg.client.topology.refresh}
+ * the background with interval defined by {@code ignite.client.topology.refresh}
* property (see below).
* </td>
* <td>{@code false}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.topology.refresh</b></td>
+ * <td><b>ignite.client.topology.refresh</b></td>
* <td>Topology cache refresh frequency (ms).</td>
* <td>{@code 2000}</td>
* <td>Yes</td>
* </tr>
* <tr>
- * <td><b>gg.client.idleTimeout</b></td>
+ * <td><b>ignite.client.idleTimeout</b></td>
* <td>Maximum amount of time that connection can be idle before it is closed (ms).</td>
* <td>{@code 30000}</td>
* <td>Yes</td>
@@ -225,7 +225,7 @@ import java.util.logging.*;
@SuppressWarnings("JavadocReference")
public class IgniteJdbcDriver implements Driver {
/** Prefix for property names. */
- private static final String PROP_PREFIX = "gg.jdbc.";
+ private static final String PROP_PREFIX = "ignite.jdbc.";
/** Hostname property name. */
public static final String PROP_HOST = PROP_PREFIX + "host";
@@ -236,11 +236,8 @@ public class IgniteJdbcDriver implements Driver {
/** Cache name property name. */
public static final String PROP_CACHE = PROP_PREFIX + "cache";
- /** Node ID URL parameter name. */
- public static final String PARAM_NODE_ID = "nodeId";
-
/** Node ID property name. */
- public static final String PROP_NODE_ID = PROP_PREFIX + PARAM_NODE_ID;
+ public static final String PROP_NODE_ID = PROP_PREFIX + "nodeId";
/** URL prefix. */
public static final String URL_PREFIX = "jdbc:ignite://";
@@ -290,40 +287,40 @@ public class IgniteJdbcDriver implements Driver {
props[1] = new PropertyInfo("Port number", info.getProperty(PROP_PORT), "");
props[2] = new PropertyInfo("Cache name", info.getProperty(PROP_CACHE), "");
props[3] = new PropertyInfo("Node ID", info.getProperty(PROP_NODE_ID, ""));
- props[4] = new PropertyInfo("gg.client.protocol", info.getProperty("gg.client.protocol", "TCP"),
+ props[4] = new PropertyInfo("ignite.client.protocol", info.getProperty("ignite.client.protocol", "TCP"),
"Communication protocol (TCP or HTTP).");
- props[5] = new PropertyInfo("gg.client.connectTimeout", info.getProperty("gg.client.connectTimeout", "0"),
+ props[5] = new PropertyInfo("ignite.client.connectTimeout", info.getProperty("ignite.client.connectTimeout", "0"),
"Socket connection timeout.");
- props[6] = new PropertyInfo("gg.client.tcp.noDelay", info.getProperty("gg.client.tcp.noDelay", "true"),
+ props[6] = new PropertyInfo("ignite.client.tcp.noDelay", info.getProperty("ignite.client.tcp.noDelay", "true"),
"Flag indicating whether TCP_NODELAY flag should be enabled for outgoing connections.");
- props[7] = new PropertyInfo("gg.client.ssl.enabled", info.getProperty("gg.client.ssl.enabled", "false"),
+ props[7] = new PropertyInfo("ignite.client.ssl.enabled", info.getProperty("ignite.client.ssl.enabled", "false"),
"Flag indicating that SSL is needed for connection.");
- props[8] = new PropertyInfo("gg.client.ssl.protocol", info.getProperty("gg.client.ssl.protocol", "TLS"),
+ props[8] = new PropertyInfo("ignite.client.ssl.protocol", info.getProperty("ignite.client.ssl.protocol", "TLS"),
"SSL protocol.");
- props[9] = new PropertyInfo("gg.client.ssl.key.algorithm", info.getProperty("gg.client.ssl.key.algorithm",
+ props[9] = new PropertyInfo("ignite.client.ssl.key.algorithm", info.getProperty("ignite.client.ssl.key.algorithm",
"SunX509"), "Key manager algorithm.");
- props[10] = new PropertyInfo("gg.client.ssl.keystore.location",
- info.getProperty("gg.client.ssl.keystore.location", ""),
+ props[10] = new PropertyInfo("ignite.client.ssl.keystore.location",
+ info.getProperty("ignite.client.ssl.keystore.location", ""),
"Key store to be used by client to connect with Ignite topology.");
- props[11] = new PropertyInfo("gg.client.ssl.keystore.password",
- info.getProperty("gg.client.ssl.keystore.password", ""), "Key store password.");
- props[12] = new PropertyInfo("gg.client.ssl.keystore.type", info.getProperty("gg.client.ssl.keystore.type",
+ props[11] = new PropertyInfo("ignite.client.ssl.keystore.password",
+ info.getProperty("ignite.client.ssl.keystore.password", ""), "Key store password.");
+ props[12] = new PropertyInfo("ignite.client.ssl.keystore.type", info.getProperty("ignite.client.ssl.keystore.type",
"jks"), "Key store type.");
- props[13] = new PropertyInfo("gg.client.ssl.truststore.location",
- info.getProperty("gg.client.ssl.truststore.location", ""),
+ props[13] = new PropertyInfo("ignite.client.ssl.truststore.location",
+ info.getProperty("ignite.client.ssl.truststore.location", ""),
"Trust store to be used by client to connect with Ignite topology.");
- props[14] = new PropertyInfo("gg.client.ssl.keystore.password",
- info.getProperty("gg.client.ssl.truststore.password", ""), "Trust store password.");
- props[15] = new PropertyInfo("gg.client.ssl.truststore.type", info.getProperty("gg.client.ssl.truststore.type",
+ props[14] = new PropertyInfo("ignite.client.ssl.keystore.password",
+ info.getProperty("ignite.client.ssl.truststore.password", ""), "Trust store password.");
+ props[15] = new PropertyInfo("ignite.client.ssl.truststore.type", info.getProperty("ignite.client.ssl.truststore.type",
"jks"), "Trust store type.");
- props[16] = new PropertyInfo("gg.client.credentials", info.getProperty("gg.client.credentials", ""),
+ props[16] = new PropertyInfo("ignite.client.credentials", info.getProperty("ignite.client.credentials", ""),
"Client credentials used in authentication process.");
- props[17] = new PropertyInfo("gg.client.cache.top", info.getProperty("gg.client.cache.top", "false"),
+ props[17] = new PropertyInfo("ignite.client.cache.top", info.getProperty("ignite.client.cache.top", "false"),
"Flag indicating that topology is cached internally. Cache will be refreshed in the background with " +
"interval defined by topologyRefreshFrequency property (see below).");
- props[18] = new PropertyInfo("gg.client.topology.refresh", info.getProperty("gg.client.topology.refresh",
+ props[18] = new PropertyInfo("ignite.client.topology.refresh", info.getProperty("ignite.client.topology.refresh",
"2000"), "Topology cache refresh frequency (ms).");
- props[19] = new PropertyInfo("gg.client.idleTimeout", info.getProperty("gg.client.idleTimeout", "30000"),
+ props[19] = new PropertyInfo("ignite.client.idleTimeout", info.getProperty("ignite.client.idleTimeout", "30000"),
"Maximum amount of time that connection can be idle before it is closed (ms).");
return props;