executorService.executeOnKeyOwner
casting method, which, unlike executorService.submitToKeyOwner
does not imply waiting for the execution result. Must quit task and forget. public void executeOnKeyOwner(Runnable command, Object key) { Callable<?> callable = createRunnableAdapter(command); submitToKeyOwner(callable, key); }
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM
. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM
. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM
. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Future submitToKeyOwner. .
( , ):
public static final int SYNC_FREQUENCY = 100; private final AtomicInteger consecutiveSubmits = new AtomicInteger(); private volatile long lastSubmitTime; ... ... boolean sync = !preventSync && checkSync(); CallableTaskOperation op = new CallableTaskOperation(name, uuid, task); ICompletableFuture future = invoke(partitionId, op); if (sync) { Object response; try { response = future.get(); ... ... /** * This is a hack to prevent overloading the system with unprocessed tasks. Once backpressure is added, this can * be removed. */ private boolean checkSync() { boolean sync = false; long last = lastSubmitTime; long now = Clock.currentTimeMillis(); if (last + 10 < now) { consecutiveSubmits.set(0); } else if (consecutiveSubmits.incrementAndGet() % SYNC_FREQUENCY == 0) { sync = true; } lastSubmitTime = now; return sync; }
, ExecutorService
100 10 , hazelcast (100 ) .
, . , .. , . , . , .
Test 5 -
, 4. , hazelcast . . 100 .
hazelcast . .
:
INFO: 100000 25223 sec: 13.350
INFO: Done tasks: hz1: 49257 hz2: 50743 sec: 52.837
25k . , , - . hazelcast ( ) , .
, 50 OOM

. , . - .
Test 6 - OOM
Hazelcast . . 10.
:
WARNING: [10.0.0.3]:5701 [dev] [3.2.3] While executing RunnableAdapter{task=Test6$RunnableTask@219307f2} on Executor[exe] java.util.concurrent.RejectedExecutionException: Executor[exe] is overloaded! at com.hazelcast.util.executor.CachedExecutorServiceDelegate.execute(CachedExecutorServiceDelegate.java:98)
:
public void execute(Runnable command) { if (!taskQ.offer(command)) { throw new RejectedExecutionException("Executor[" + name + "] is overloaded!"); } ...
, - . ( executeOnKeyOwner
), .
:
INFO: 100000 32604 sec: 16.931
INFO: Done tasks: hz1: 26304 hz2: 26281 sec: 27.269
.
Test 7 -
- , , ? executeOnKeyOwner
Future submitToKeyOwner
Callable
.
:
INFO: 100000 31790 sec: 16.713
INFO: Done tasks: hz1: 25898 hz2: 25873 sec: 27.046
INFO: Canceled tasks: 0 execution exceptions: 48229 rejected tasks: 48229
. .
hazelcast , 10 99; , ; , . OOM; . ;
- . , . .
Source: https://habr.com/ru/post/229149/
All Articles