ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/3] incubator-ignite git commit: # ignite-648: java docs.
Date Tue, 21 Apr 2015 13:44:29 GMT
# ignite-648: java docs.


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

Branch: refs/heads/ignite-648
Commit: cdaac3e88598692f0ab4a8fb079f17cc104c1afb
Parents: cf6c040
Author: Artem Shutak <ashutak@gridgain.com>
Authored: Tue Apr 21 16:29:48 2015 +0300
Committer: Artem Shutak <ashutak@gridgain.com>
Committed: Tue Apr 21 16:29:48 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/multijvm/CacheProxy.java   | 60 ++++++++++++
 ...CachePartitionedMultiJvmFullApiSelfTest.java | 29 +++++-
 .../cache/multijvm/IgniteExProxy.java           | 63 ++++++++++++-
 .../cache/multijvm/IgniteNodeRunner.java        | 98 +++++++++++---------
 4 files changed, 202 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cdaac3e8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
index b070445..ed02526 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
@@ -45,98 +45,121 @@ public class CacheProxy<K, V> implements IgniteCache<K, V>
{
         gridId = proxy.getId();
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteCache<K, V> withAsync() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean isAsync() {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <R> IgniteFuture<R> future() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <C extends Configuration<K, V>> C getConfiguration(Class<C>
clazz) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public Entry<K, V> randomEntry() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteCache<K, V> withExpiryPolicy(ExpiryPolicy plc) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteCache<K, V> withSkipStore() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public void loadCache(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object...
args) throws CacheException {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public void localLoadCache(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object...
args) throws CacheException {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public V getAndPutIfAbsent(K key, V val) throws CacheException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public Lock lock(K key) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public Lock lockAll(Collection<? extends K> keys) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean isLocalLocked(K key, boolean byCurrThread) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <R> QueryCursor<R> query(Query<R> qry) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public Iterable<Entry<K, V>> localEntries(CachePeekMode... peekModes)
throws CacheException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public QueryMetrics queryMetrics() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void localEvict(Collection<? extends K> keys) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public V localPeek(K key, CachePeekMode... peekModes) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void localPromote(Set<? extends K> keys) throws CacheException
{
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public int size(CachePeekMode... peekModes) throws CacheException {
         return 0; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public int localSize(CachePeekMode... peekModes) {
         return 0; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public <T> Map<K, EntryProcessorResult<T>> invokeAll(Map<? extends
K, ? extends EntryProcessor<K, V, T>> map,
         Object... args) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public V get(K key) {
         ClusterGroup grp = proxy.localJvmGrid().cluster().forNodeId(proxy.getId());
 
@@ -159,63 +182,78 @@ public class CacheProxy<K, V> implements IgniteCache<K, V>
{
         }
     } 
 
+    /** {@inheritDoc} */
     @Override public Map<K, V> getAll(Set<? extends K> keys) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean containsKey(K key) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, CompletionListener
completionListener) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean containsKeys(Set<? extends K> keys) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void put(K key, V val) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public V getAndPut(K key, V val) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void putAll(Map<? extends K, ? extends V> map) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean putIfAbsent(K key, V val) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean remove(K key) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean remove(K key, V oldVal) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public V getAndRemove(K key) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean replace(K key, V oldVal, V newVal) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean replace(K key, V val) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public V getAndReplace(K key, V val) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void removeAll(final Set<? extends K> keys) {
         ClusterGroup grp = proxy.localJvmGrid().cluster().forNodeId(proxy.getId());
 
@@ -252,95 +290,117 @@ public class CacheProxy<K, V> implements IgniteCache<K, V>
{
         }
     }
 
+    /** {@inheritDoc} */
     @Override public void removeAll() {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void clear() {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void clear(K key) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void clearAll(Set<? extends K> keys) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void localClear(K key) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void localClearAll(Set<? extends K> keys) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <T> T invoke(K key, EntryProcessor<K, V, T> entryProcessor,
Object... arguments) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <T> T invoke(K key, CacheEntryProcessor<K, V, T> entryProcessor,
Object... arguments) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public <T> Map<K, EntryProcessorResult<T>> invokeAll(Set<? extends
K> keys, EntryProcessor<K, V, T> entryProcessor,
         Object... args) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public String getName() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public CacheManager getCacheManager() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void close() {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean isClosed() {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <T> T unwrap(Class<T> clazz) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public void registerCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration)
{
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V>
cacheEntryListenerConfiguration) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public Iterator<Entry<K, V>> iterator() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(Set<?
extends K> keys,
         CacheEntryProcessor<K, V, T> entryProcessor, Object... args) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteFuture<?> rebalance() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public CacheMetrics metrics() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public CacheMetrics metrics(ClusterGroup grp) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public CacheMetricsMXBean mxBean() {
         return null; // TODO: CODE: implement.
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cdaac3e8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java
index 9395b54..c5e7c11 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java
@@ -19,12 +19,15 @@ package org.apache.ignite.internal.processors.cache.multijvm;
 
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
 import org.apache.ignite.internal.processors.resource.*;
+import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 
 import java.util.*;
+import java.util.concurrent.*;
 
 /**
  * TODO: Add class description.
@@ -32,13 +35,29 @@ import java.util.*;
 public class GridCachePartitionedMultiJvmFullApiSelfTest extends GridCachePartitionedMultiNodeFullApiSelfTest
{
     /** Local ignite. */
     private Ignite locIgnite;
+
+    /** */
+    private CountDownLatch allNodesJoinLatch;
+    
+    /** */
+    private final IgnitePredicate<Event> nodeJoinLsnr = new IgnitePredicate<Event>()
{
+        @Override public boolean apply(Event evt) {
+            allNodesJoinLatch.countDown();
+
+            return true;
+        }
+    };
     
     /** Proces name to process map. */
     private final Map<String, IgniteExProxy> ignites = new HashMap<>();
 
     /** {@inheritDoc} */
     @Override protected void beforeTestsStarted() throws Exception {
+        allNodesJoinLatch = new CountDownLatch(gridCount() - 1);
+        
         super.beforeTestsStarted();
+
+        assert allNodesJoinLatch.await(5, TimeUnit.SECONDS);
     }
 
     /** {@inheritDoc} */
@@ -70,6 +89,12 @@ public class GridCachePartitionedMultiJvmFullApiSelfTest extends GridCachePartit
 
         ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IgniteNodeRunner.ipFinder);
 
+        Map<IgnitePredicate<? extends Event>, int[]> lsnrs = new HashMap<>();
+        
+        lsnrs.put(nodeJoinLsnr, new int[] {EventType.EVT_NODE_JOINED});
+        
+        cfg.setLocalEventListeners(lsnrs);
+
         return cfg;
     }
 
@@ -101,7 +126,7 @@ public class GridCachePartitionedMultiJvmFullApiSelfTest extends GridCachePartit
         try {
             IgniteConfiguration cfg = optimize(getConfiguration(gridName));
 
-            IgniteExProxy proxy = new IgniteExProxy(cfg, log, locIgnite);
+            IgniteExProxy proxy = new IgniteExProxy(cfg, log, grid(0));
 
             ignites.put(gridName, proxy);
 
@@ -152,6 +177,8 @@ public class GridCachePartitionedMultiJvmFullApiSelfTest extends GridCachePartit
         atomicClockModeDelay(c0);
 
         c1.removeAll(putMap.keySet());
+        
+        Thread.sleep(5_000);
 
         for (int i = 0; i < size; i++) {
             assertNull(c0.get(i));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cdaac3e8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteExProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteExProxy.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteExProxy.java
index 074529f..cf7079d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteExProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteExProxy.java
@@ -54,7 +54,6 @@ public class IgniteExProxy implements IgniteEx {
         this.locJvmGrid = locJvmGrid;
         this.log = log;
 
-        String cfgAsString = IgniteNodeRunner.asParams(id, cfg);
         IgniteNodeRunner.storeToFile(cfg.getCacheConfiguration()[0]);
 
         List<String> jvmArgs = U.jvmArgs();
@@ -68,7 +67,7 @@ public class IgniteExProxy implements IgniteEx {
         
         proc = GridJavaProcess.exec(
             IgniteNodeRunner.class,
-            cfgAsString, // Params.
+            IgniteNodeRunner.asParams(id, cfg), // Params.
             log,
             // Optional closure to be called each time wrapped process prints line to system.out
or system.err.
             new IgniteInClosure<String>() {
@@ -86,233 +85,292 @@ public class IgniteExProxy implements IgniteEx {
         gridProxies.put(cfg.getGridName(), this);
     }
 
+    /**
+     * @return Local JVM grid instance.
+     */
     public Ignite localJvmGrid() {
         return locJvmGrid;
     }
 
+    /** 
+     * @return Grid id.
+     */
     public UUID getId() {
         return id;
     }
 
+    /** {@inheritDoc} */
     @Override public String name() {
         return cfg.getGridName();
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteLogger log() {
         return log;
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteConfiguration configuration() {
         return cfg;
     }
 
+    /** {@inheritDoc} */
     @Override public <K extends GridCacheUtilityKey, V> IgniteInternalCache<K, V>
utilityCache() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Nullable @Override public <K, V> IgniteInternalCache<K, V> cachex(@Nullable
String name) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Nullable @Override public <K, V> IgniteInternalCache<K, V> cachex() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public Collection<IgniteInternalCache<?, ?>> cachesx(
         @Nullable IgnitePredicate<? super IgniteInternalCache<?, ?>>... p) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean eventUserRecordable(int type) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean allEventsUserRecordable(int[] types) {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean isJmxRemoteEnabled() {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public boolean isRestartEnabled() {
         return false; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Nullable @Override public IgniteFileSystem igfsx(@Nullable String name) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public Hadoop hadoop() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteClusterEx cluster() {
         return (IgniteClusterEx)locJvmGrid.cluster();
     }
 
+    /** {@inheritDoc} */
     @Nullable @Override public String latestVersion() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public ClusterNode localNode() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public GridKernalContext context() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteCompute compute() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteCompute compute(ClusterGroup grp) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteMessaging message() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteMessaging message(ClusterGroup grp) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteEvents events() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteEvents events(ClusterGroup grp) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteServices services() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteServices services(ClusterGroup grp) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public ExecutorService executorService() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public ExecutorService executorService(ClusterGroup grp) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteProductVersion version() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteScheduler scheduler() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> createCache(CacheConfiguration<K,
V> cacheCfg) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> createCache(String cacheName) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K,
V> cacheCfg) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> getOrCreateCache(String cacheName)
{
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> void addCacheConfiguration(CacheConfiguration<K, V>
cacheCfg) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> createCache(CacheConfiguration<K,
V> cacheCfg,
         NearCacheConfiguration<K, V> nearCfg) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K,
V> cacheCfg,
         NearCacheConfiguration<K, V> nearCfg) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public <K, V> IgniteCache<K, V> createNearCache(@Nullable String cacheName,
NearCacheConfiguration<K, V> nearCfg) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> getOrCreateNearCache(@Nullable
String cacheName,
         NearCacheConfiguration<K, V> nearCfg) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void destroyCache(String cacheName) {
         // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> cache(@Nullable final String name)
{
         return new CacheProxy(name, this);
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteTransactions transactions() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <K, V> IgniteDataStreamer<K, V> dataStreamer(@Nullable String
cacheName) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteFileSystem fileSystem(String name) {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public Collection<IgniteFileSystem> fileSystems() {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create)
throws IgniteException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteAtomicLong atomicLong(String name, long initVal, boolean create)
throws IgniteException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <T> IgniteAtomicReference<T> atomicReference(String name,
@Nullable T initVal,
         boolean create) throws IgniteException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override
     public <T, S> IgniteAtomicStamped<T, S> atomicStamped(String name, @Nullable
T initVal, @Nullable S initStamp,
         boolean create) throws IgniteException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public IgniteCountDownLatch countDownLatch(String name, int cnt, boolean autoDel,
         boolean create) throws IgniteException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <T> IgniteQueue<T> queue(String name, int cap,
         @Nullable CollectionConfiguration cfg) throws IgniteException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <T> IgniteSet<T> set(String name, @Nullable CollectionConfiguration
cfg) throws IgniteException {
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public <T extends IgnitePlugin> T plugin(String name) throws PluginNotFoundException
{
         return null; // TODO: CODE: implement.
     }
 
+    /** {@inheritDoc} */
     @Override public void close() throws IgniteException {
         try {
             getProcess().kill();
@@ -322,6 +380,7 @@ public class IgniteExProxy implements IgniteEx {
         }
     }
 
+    /** {@inheritDoc} */
     @Override public <K> Affinity<K> affinity(String cacheName) {
         return null; // TODO: CODE: implement.
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cdaac3e8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java
index 8ee0abf..cd55d84 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/IgniteNodeRunner.java
@@ -22,7 +22,6 @@ import org.apache.ignite.configuration.*;
 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.*;
 import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -38,11 +37,16 @@ import java.util.*;
 public class IgniteNodeRunner {
     /** VM ip finder for TCP discovery. */
     public static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
-
-    public static final char DELIM = ' ';
     
-//    public static final String CACHE_CONFIGURATION_TMP_FILE = "/tmp/cacheConfiguration.tmp";
-
+    /** */
+    private static final String CACHE_CONFIGURATION_TMP_FILE = "/tmp/cacheConfiguration.tmp";
+
+    /**
+     * Starts {@link Ignite} instance accorging to given arguments.
+     *  
+     * @param args Arguments.
+     * @throws Exception If failed.
+     */
     public static void main(String[] args) throws Exception {
         try {
             X.println(GridJavaProcess.PID_MSG_PREFIX + U.jvmPid());
@@ -51,15 +55,7 @@ public class IgniteNodeRunner {
 
             IgniteConfiguration cfg = configuration(args);
 
-            Ignite ignite = Ignition.start(cfg);
-            
-            Thread.sleep(2_000);
-
-            ignite.compute().broadcast(new IgniteRunnable() {
-                @Override public void run() {
-                    System.out.println(">>>>> [rmt] trololo");
-                }
-            });
+            Ignition.start(cfg);
         }
         catch (Throwable e) {
             e.printStackTrace();
@@ -68,20 +64,31 @@ public class IgniteNodeRunner {
         }
     }
 
+    /** 
+     * @param id Grid id.
+     * @param cfg Configuration.
+     * @return Given paramethers as command line string arguments.
+     */
     public static String asParams(UUID id, IgniteConfiguration cfg) {
-        return id.toString() + DELIM + cfg.getGridName();
+        return id.toString() + ' ' + cfg.getGridName();
     }
 
+    /** 
+     * @param args Command line args.
+     * @return Ignite configuration.
+     * @throws Exception If failed.
+     */
     private static IgniteConfiguration configuration(String[] args) throws Exception {
-        // Pars args.
+        // Parse args.
         assert args != null && args.length >= 1;
 
         final UUID nodeId = UUID.fromString(args[0]);
-        final String gridName = "Node " + nodeId;
+        final String gridName = args[1];
         
+        // Configuration.
         IgniteConfiguration cfg = GridAbstractTest.getConfiguration0(gridName, new IgniteTestResources(),
-            GridCachePartitionedMultiJvmFullApiSelfTest.class, isDebug());
-//      ---------------
+            GridCachePartitionedMultiJvmFullApiSelfTest.class, false);
+        
         TcpDiscoverySpi disco = new TcpDiscoverySpi();
 
 //        disco.setMaxMissedHeartbeats(Integer.MAX_VALUE);
@@ -92,10 +99,9 @@ public class IgniteNodeRunner {
 //            disco.setAckTimeout(Integer.MAX_VALUE);
 
         cfg.setDiscoverySpi(disco);
-//
-//        // TODO
-////        cfg.setCacheConfiguration(cacheConfiguration());
-//
+
+//        cfg.setCacheConfiguration(cacheConfiguration());
+
         cfg.setMarshaller(new OptimizedMarshaller(false));
 ////        ----------------
 ////        if (offHeapValues())
@@ -114,31 +120,33 @@ public class IgniteNodeRunner {
         return cfg;
     }
 
-    private static boolean isDebug() {
-        return false;
-    }
-
+    /**
+     * Stors given cache configuration to the file.
+     *
+     * @param cc Cache configuration.
+     * @throws IOException If exception.
+     */
     public static void storeToFile(CacheConfiguration cc) throws IOException {
-        // TODO use actual config.
-        cc = new CacheConfiguration();
-        
-//        File ccfgTmpFile = new File(CACHE_CONFIGURATION_TMP_FILE);
-//
-//        ccfgTmpFile.createNewFile();
-//        if (!ccfgTmpFile.createNewFile())
-//            throw new IgniteSpiException("File was not created.");
-        
-//        try(ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(ccfgTmpFile)))
{
-//            out.writeObject(cc);
-//        }
+        File ccfgTmpFile = new File(CACHE_CONFIGURATION_TMP_FILE);
+
+        boolean created = ccfgTmpFile.createNewFile();
+
+        try(ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(ccfgTmpFile)))
{
+            out.writeObject(cc);
+        }
     }
 
+    /**
+     * Reads cache configuration from the file.
+     *  
+     * @return Cache configuration.
+     * @throws Exception If exception.
+     */
     private static CacheConfiguration cacheConfiguration() throws Exception {
-//        File ccfgTmpFile = new File(CACHE_CONFIGURATION_TMP_FILE);
-//        
-//        try(ObjectInputStream in = new ObjectInputStream(new FileInputStream(ccfgTmpFile)))
{
-//            return (CacheConfiguration)in.readObject();
-//        }
-        return new CacheConfiguration();
+        File ccfgTmpFile = new File(CACHE_CONFIGURATION_TMP_FILE);
+
+        try(ObjectInputStream in = new ObjectInputStream(new FileInputStream(ccfgTmpFile)))
{
+            return (CacheConfiguration)in.readObject();
+        }
     }
 }


Mime
View raw message