Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 7180e5baf -> 564576391


# IGNITE-45 - Examples


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

Branch: refs/heads/ignite-45
Commit: b8d18b84b760a5539e2d3daa285ccf10fe1545aa
Parents: b34d7ae
Author: Valentin Kulichenko <vkuliche...@gridgain.com>
Authored: Sun Mar 22 02:07:15 2015 -0700
Committer: Valentin Kulichenko <vkuliche...@gridgain.com>
Committed: Sun Mar 22 02:07:15 2015 -0700

----------------------------------------------------------------------
 examples/config/example-cache.xml                         |  3 +--
 examples/rest/http-rest-example.php                       | 10 ++++++----
 examples/rest/memcache-rest-example.php                   | 10 ++++------
 .../rest/handlers/cache/GridCacheCommandHandler.java      |  2 --
 .../rest/protocols/http/jetty/GridJettyRestHandler.java   |  5 +++--
 5 files changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8d18b84/examples/config/example-cache.xml
----------------------------------------------------------------------
diff --git a/examples/config/example-cache.xml 
b/examples/config/example-cache.xml
index 916c452..98e1a71 100644
--- a/examples/config/example-cache.xml
+++ b/examples/config/example-cache.xml
@@ -40,8 +40,7 @@
         <property name="cacheConfiguration">
             <list>
                 <!-- Partitioned cache example configuration (Atomic mode). -->
-                <bean parent="cache-template">
-                    <property name="name" value="partitioned"/>
+                <bean 
class="org.apache.ignite.configuration.CacheConfiguration">
                     <property name="atomicityMode" value="ATOMIC"/>
                     <property name="backups" value="1"/>
                 </bean>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8d18b84/examples/rest/http-rest-example.php
----------------------------------------------------------------------
diff --git a/examples/rest/http-rest-example.php 
b/examples/rest/http-rest-example.php
index 82504ba..fe20f4e 100644
--- a/examples/rest/http-rest-example.php
+++ b/examples/rest/http-rest-example.php
@@ -19,7 +19,10 @@
  */
 
 /**
- * To execute this script simply start up an instance of Ignite with cache 
enabled.
+ * To execute this script you will have to enable optional `ignite-rest-http` 
module -
+ * copy `libs/optional/ignite-rest-http` folder into `libs` (one level up).
+ *
+ * After that start up an instance of Ignite with cache enabled.
  * You can use configuration from examples/config folder as follows:
  * ----
  * ${IGNITE_HOME}/bin/ignite.sh examples/config/example-cache.xml
@@ -40,9 +43,8 @@ if (!function_exists('json_decode'))
 
 $URL = 'http://localhost:8080/ignite?';
 
-// Cache name to use.
-// Empty string represents default cache which is used by default in this 
example.
-$CACHE_NAME = "";
+// Cache name to use (null or empty string for default cache).
+$CACHE_NAME = null;
 
 /**
  * Creates URL parameters.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8d18b84/examples/rest/memcache-rest-example.php
----------------------------------------------------------------------
diff --git a/examples/rest/memcache-rest-example.php 
b/examples/rest/memcache-rest-example.php
index c5165eb..4edcd4b 100644
--- a/examples/rest/memcache-rest-example.php
+++ b/examples/rest/memcache-rest-example.php
@@ -19,13 +19,11 @@
  */
 
 /**
- * This example shows how to use PHP Memcache client for manipulating Ignite 
cache.
+ * To execute this script you will have to enable optional `ignite-rest-http` 
module -
+ * copy `libs/optional/ignite-rest-http` folder into `libs` (one level up).
  *
- * To execute this script you need to have PHP Memcached extension installed.
- * See http://pecl.php.net/package/memcached for details.
- *
- * You can use configuration from examples/config folder to
- * start up an instance of Ignite with cache enabled as follows:
+ * After that start up an instance of Ignite with cache enabled.
+ * You can use configuration from examples/config folder as follows:
  * ----
  * ${IGNITE_HOME}/bin/ignite.sh examples/config/example-cache.xml
  * ----

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8d18b84/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
index 0f45991..efa4f6f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
@@ -532,8 +532,6 @@ public class GridCacheCommandHandler extends 
GridRestCommandHandlerAdapter {
     }
 
     /**
-     * Used for test purposes.
-     *
      * @param cacheName Name of the cache.
      * @return Instance on the named cache.
      * @throws IgniteCheckedException If cache not found.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8d18b84/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 d0917f3..7bdb76e 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
@@ -22,7 +22,6 @@ import net.sf.json.processors.*;
 import org.apache.ignite.*;
 import org.apache.ignite.internal.processors.rest.*;
 import org.apache.ignite.internal.processors.rest.request.*;
-import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -347,7 +346,9 @@ public class GridJettyRestHandler extends AbstractHandler {
             case CACHE_PREPEND: {
                 GridRestCacheRequest restReq0 = new GridRestCacheRequest();
 
-                restReq0.cacheName((String)params.get("cacheName"));
+                String cacheName = (String)params.get("cacheName");
+
+                restReq0.cacheName(F.isEmpty(cacheName) ? null : cacheName);
                 restReq0.key(params.get("key"));
                 restReq0.value(params.get("val"));
                 restReq0.value2(params.get("val2"));

Reply via email to