Toggle navigation
Home
boolean to org.junit.Test
No. of Instances - 1
No. of Commits - 1
No. of Projects - {'ignite'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Jdk -> External
Mapping:
Update Anonymous class
{ @Override public Object call() throws Exception { int iter=0; ThreadLocalRandom rnd=ThreadLocalRandom.current(); long time; long lastInfo=0; while ((time=System.currentTimeMillis()) < endTime) { if (time - lastInfo > 5000) { log.info("Do putAll [iter=" + iter + ']'); lastInfo=time; } if (async) { Collection<IgniteFuture<?>> futs=new ArrayList<>(); for (int i=0; i < 10; i++) { TreeMap<TestKey,TestValue> map=new TreeMap<>(); for (int k=0; k < 100; k++) map.put(new TestKey(rnd.nextInt(200)),new TestValue(iter)); cache.putAll(map); IgniteFuture<?> fut=cache.future(); assertNotNull(fut); futs.add(fut); } for ( IgniteFuture<?> fut : futs) fut.get(); } else { TreeMap<TestKey,TestValue> map=new TreeMap<>(); for (int k=0; k < 100; k++) map.put(new TestKey(rnd.nextInt(200)),new TestValue(iter)); cache.putAll(map); } iter++; } return null; } }
to
{ @Override public Object call() throws Exception { int iter=0; ThreadLocalRandom rnd=ThreadLocalRandom.current(); long time; long lastInfo=0; while ((time=System.currentTimeMillis()) < endTime) { if (time - lastInfo > 5000) { log.info("Do putAll [iter=" + iter + ']'); lastInfo=time; } switch (test) { case PUT_ALL: { TreeMap<TestKey,TestValue> map=new TreeMap<>(); for (int k=0; k < 100; k++) map.put(new TestKey(rnd.nextInt(200)),new TestValue(iter)); cache.putAll(map); break; } case PUT_ALL_ASYNC: { Collection<IgniteFuture<?>> futs=new ArrayList<>(); for (int i=0; i < 10; i++) { TreeMap<TestKey,TestValue> map=new TreeMap<>(); for (int k=0; k < 100; k++) map.put(new TestKey(rnd.nextInt(200)),new TestValue(iter)); cache.putAll(map); IgniteFuture<?> fut=cache.future(); assertNotNull(fut); futs.add(fut); } for ( IgniteFuture<?> fut : futs) fut.get(); break; } case PUT_ALL_PESSIMISTIC_TX: { final TreeMap<TestKey,TestValue> map=new TreeMap<>(); for (int k=0; k < 100; k++) map.put(new TestKey(rnd.nextInt(200)),new TestValue(iter)); doInTransaction(ignite(0),new Callable<Object>(){ @Override public Object call() throws Exception { for ( TestKey key : map.keySet()) cache.get(key); cache.putAll(map); return null; } } ); break; } default : assert false; } iter++; } return null; } }
Rename Variable
async
to
test