mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-25 14:21:33 +02:00
HazelcastIntentStore: fix checkstyle issue
Change-Id: I1a912e44dbaa6798095ebec17d61f4a3074d6004
This commit is contained in:
parent
36dd7e4422
commit
43772d7125
@ -374,8 +374,6 @@ public class HazelcastIntentStore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO slice out methods after merging Ali's patch
|
|
||||||
// CHECKSTYLE IGNORE MethodLength FOR NEXT 1 LINES
|
|
||||||
@Override
|
@Override
|
||||||
public List<Operation> batchWrite(BatchWrite batch) {
|
public List<Operation> batchWrite(BatchWrite batch) {
|
||||||
// Hazelcast version will never fail for conditional failure now.
|
// Hazelcast version will never fail for conditional failure now.
|
||||||
@ -384,6 +382,18 @@ public class HazelcastIntentStore
|
|||||||
List<Pair<Operation, List<Future<?>>>> futures = new ArrayList<>(batch.operations().size());
|
List<Pair<Operation, List<Future<?>>>> futures = new ArrayList<>(batch.operations().size());
|
||||||
List<IntentEvent> events = Lists.newArrayList();
|
List<IntentEvent> events = Lists.newArrayList();
|
||||||
|
|
||||||
|
batchWriteAsync(batch, failed, futures);
|
||||||
|
|
||||||
|
// verify result
|
||||||
|
verifyAsyncWrites(futures, failed, events);
|
||||||
|
|
||||||
|
notifyDelegate(events);
|
||||||
|
|
||||||
|
return failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void batchWriteAsync(BatchWrite batch, List<Operation> failed,
|
||||||
|
List<Pair<Operation, List<Future<?>>>> futures) {
|
||||||
for (Operation op : batch.operations()) {
|
for (Operation op : batch.operations()) {
|
||||||
switch (op.type()) {
|
switch (op.type()) {
|
||||||
case CREATE_INTENT:
|
case CREATE_INTENT:
|
||||||
@ -437,8 +447,18 @@ public class HazelcastIntentStore
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// verify result
|
/**
|
||||||
|
* Checks the async write result Futures and prepare Events to post.
|
||||||
|
*
|
||||||
|
* @param futures async write Futures
|
||||||
|
* @param failed list to output failed batch write operations
|
||||||
|
* @param events list to output events to post as result of writes
|
||||||
|
*/
|
||||||
|
private void verifyAsyncWrites(List<Pair<Operation, List<Future<?>>>> futures,
|
||||||
|
List<Operation> failed,
|
||||||
|
List<IntentEvent> events) {
|
||||||
for (Pair<Operation, List<Future<?>>> future : futures) {
|
for (Pair<Operation, List<Future<?>>> future : futures) {
|
||||||
final Operation op = future.getLeft();
|
final Operation op = future.getLeft();
|
||||||
final List<Future<?>> subops = future.getRight();
|
final List<Future<?>> subops = future.getRight();
|
||||||
@ -582,10 +602,6 @@ public class HazelcastIntentStore
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyDelegate(events);
|
|
||||||
|
|
||||||
return failed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class RemoteIntentStateListener extends EntryAdapter<IntentId, IntentState> {
|
public final class RemoteIntentStateListener extends EntryAdapter<IntentId, IntentState> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user