Yuta HIGUCHI
Committed by Gerrit Code Review

Scrubbing store related TODO/FIXMEs

Change-Id: I4e6bf026845bbd5be127ecacd9956d12f3386c9e
...@@ -51,7 +51,7 @@ public interface LinkResourceStore { ...@@ -51,7 +51,7 @@ public interface LinkResourceStore {
51 * Returns resources allocated for an Intent. 51 * Returns resources allocated for an Intent.
52 * 52 *
53 * @param intentId the target Intent's ID 53 * @param intentId the target Intent's ID
54 - * @return allocated resources 54 + * @return allocated resources or null if no resource is allocated
55 */ 55 */
56 LinkResourceAllocations getAllocations(IntentId intentId); 56 LinkResourceAllocations getAllocations(IntentId intentId);
57 57
......
...@@ -57,7 +57,7 @@ public class LeadershipManager implements LeadershipService { ...@@ -57,7 +57,7 @@ public class LeadershipManager implements LeadershipService {
57 // a unexpected error. 57 // a unexpected error.
58 private static final int WAIT_BEFORE_RETRY_MS = 2000; 58 private static final int WAIT_BEFORE_RETRY_MS = 2000;
59 59
60 - // TODO: Appropriate Thread pool sizing. 60 + // TODO: Make Thread pool size configurable.
61 private final ScheduledExecutorService threadPool = 61 private final ScheduledExecutorService threadPool =
62 Executors.newScheduledThreadPool(25, namedThreads("leadership-manager-%d")); 62 Executors.newScheduledThreadPool(25, namedThreads("leadership-manager-%d"));
63 63
......
...@@ -98,7 +98,6 @@ import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; ...@@ -98,7 +98,6 @@ import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
98 import static org.onosproject.store.device.impl.GossipDeviceStoreMessageSubjects.DEVICE_ADVERTISE; 98 import static org.onosproject.store.device.impl.GossipDeviceStoreMessageSubjects.DEVICE_ADVERTISE;
99 import static org.onosproject.store.device.impl.GossipDeviceStoreMessageSubjects.DEVICE_REMOVE_REQ; 99 import static org.onosproject.store.device.impl.GossipDeviceStoreMessageSubjects.DEVICE_REMOVE_REQ;
100 100
101 -// TODO: give me a better name
102 /** 101 /**
103 * Manages inventory of infrastructure devices using gossip protocol to distribute 102 * Manages inventory of infrastructure devices using gossip protocol to distribute
104 * information. 103 * information.
...@@ -167,6 +166,10 @@ public class GossipDeviceStore ...@@ -167,6 +166,10 @@ public class GossipDeviceStore
167 166
168 private ScheduledExecutorService backgroundExecutor; 167 private ScheduledExecutorService backgroundExecutor;
169 168
169 + // TODO make these anti-entropy parameters configurable
170 + private long initialDelaySec = 5;
171 + private long periodSec = 5;
172 +
170 173
171 @Activate 174 @Activate
172 public void activate() { 175 public void activate() {
...@@ -189,9 +192,6 @@ public class GossipDeviceStore ...@@ -189,9 +192,6 @@ public class GossipDeviceStore
189 backgroundExecutor = 192 backgroundExecutor =
190 newSingleThreadScheduledExecutor(minPriority(namedThreads("device-bg-%d"))); 193 newSingleThreadScheduledExecutor(minPriority(namedThreads("device-bg-%d")));
191 194
192 - // TODO: Make these configurable
193 - long initialDelaySec = 5;
194 - long periodSec = 5;
195 // start anti-entropy thread 195 // start anti-entropy thread
196 backgroundExecutor.scheduleAtFixedRate(new SendAdvertisementTask(), 196 backgroundExecutor.scheduleAtFixedRate(new SendAdvertisementTask(),
197 initialDelaySec, periodSec, TimeUnit.SECONDS); 197 initialDelaySec, periodSec, TimeUnit.SECONDS);
...@@ -412,7 +412,6 @@ public class GossipDeviceStore ...@@ -412,7 +412,6 @@ public class GossipDeviceStore
412 } 412 }
413 boolean removed = availableDevices.remove(deviceId); 413 boolean removed = availableDevices.remove(deviceId);
414 if (removed) { 414 if (removed) {
415 - // TODO: broadcast ... DOWN only?
416 return new DeviceEvent(DEVICE_AVAILABILITY_CHANGED, device, null); 415 return new DeviceEvent(DEVICE_AVAILABILITY_CHANGED, device, null);
417 } 416 }
418 return null; 417 return null;
...@@ -885,7 +884,7 @@ public class GossipDeviceStore ...@@ -885,7 +884,7 @@ public class GossipDeviceStore
885 if (e.getKey().equals(primary)) { 884 if (e.getKey().equals(primary)) {
886 continue; 885 continue;
887 } 886 }
888 - // TODO: should keep track of Description timestamp 887 + // Note: should keep track of Description timestamp in the future
889 // and only merge conflicting keys when timestamp is newer. 888 // and only merge conflicting keys when timestamp is newer.
890 // Currently assuming there will never be a key conflict between 889 // Currently assuming there will never be a key conflict between
891 // providers 890 // providers
...@@ -913,7 +912,6 @@ public class GossipDeviceStore ...@@ -913,7 +912,6 @@ public class GossipDeviceStore
913 ProviderId primary = pickPrimaryPID(descsMap); 912 ProviderId primary = pickPrimaryPID(descsMap);
914 DeviceDescriptions primDescs = descsMap.get(primary); 913 DeviceDescriptions primDescs = descsMap.get(primary);
915 // if no primary, assume not enabled 914 // if no primary, assume not enabled
916 - // TODO: revisit this default port enabled/disabled behavior
917 boolean isEnabled = false; 915 boolean isEnabled = false;
918 DefaultAnnotations annotations = DefaultAnnotations.builder().build(); 916 DefaultAnnotations annotations = DefaultAnnotations.builder().build();
919 917
...@@ -927,7 +925,7 @@ public class GossipDeviceStore ...@@ -927,7 +925,7 @@ public class GossipDeviceStore
927 if (e.getKey().equals(primary)) { 925 if (e.getKey().equals(primary)) {
928 continue; 926 continue;
929 } 927 }
930 - // TODO: should keep track of Description timestamp 928 + // Note: should keep track of Description timestamp in the future
931 // and only merge conflicting keys when timestamp is newer. 929 // and only merge conflicting keys when timestamp is newer.
932 // Currently assuming there will never be a key conflict between 930 // Currently assuming there will never be a key conflict between
933 // providers 931 // providers
...@@ -968,7 +966,6 @@ public class GossipDeviceStore ...@@ -968,7 +966,6 @@ public class GossipDeviceStore
968 return providerDescs.get(pid); 966 return providerDescs.get(pid);
969 } 967 }
970 968
971 - // TODO: should we be throwing exception?
972 private void unicastMessage(NodeId recipient, MessageSubject subject, Object event) throws IOException { 969 private void unicastMessage(NodeId recipient, MessageSubject subject, Object event) throws IOException {
973 ClusterMessage message = new ClusterMessage( 970 ClusterMessage message = new ClusterMessage(
974 clusterService.getLocalNode().id(), 971 clusterService.getLocalNode().id(),
...@@ -977,7 +974,6 @@ public class GossipDeviceStore ...@@ -977,7 +974,6 @@ public class GossipDeviceStore
977 clusterCommunicator.unicast(message, recipient); 974 clusterCommunicator.unicast(message, recipient);
978 } 975 }
979 976
980 - // TODO: should we be throwing exception?
981 private void broadcastMessage(MessageSubject subject, Object event) throws IOException { 977 private void broadcastMessage(MessageSubject subject, Object event) throws IOException {
982 ClusterMessage message = new ClusterMessage( 978 ClusterMessage message = new ClusterMessage(
983 clusterService.getLocalNode().id(), 979 clusterService.getLocalNode().id(),
......
...@@ -17,7 +17,6 @@ package org.onosproject.store.device.impl; ...@@ -17,7 +17,6 @@ package org.onosproject.store.device.impl;
17 17
18 import org.onosproject.store.cluster.messaging.MessageSubject; 18 import org.onosproject.store.cluster.messaging.MessageSubject;
19 19
20 -// TODO: add prefix to assure uniqueness.
21 /** 20 /**
22 * MessageSubjects used by GossipDeviceStore peer-peer communication. 21 * MessageSubjects used by GossipDeviceStore peer-peer communication.
23 */ 22 */
......
...@@ -503,7 +503,7 @@ public class DistributedFlowRuleStore ...@@ -503,7 +503,7 @@ public class DistributedFlowRuleStore
503 } 503 }
504 504
505 // TODO: Confirm if this behavior is correct. See SimpleFlowRuleStore 505 // TODO: Confirm if this behavior is correct. See SimpleFlowRuleStore
506 - // TODO: also update backup. 506 + // TODO: also update backup if the behavior is correct.
507 flowEntries.put(did, new DefaultFlowEntry(rule)); 507 flowEntries.put(did, new DefaultFlowEntry(rule));
508 } finally { 508 } finally {
509 flowEntriesLock.writeLock().unlock(); 509 flowEntriesLock.writeLock().unlock();
...@@ -541,7 +541,7 @@ public class DistributedFlowRuleStore ...@@ -541,7 +541,7 @@ public class DistributedFlowRuleStore
541 Future<byte[]> responseFuture = clusterCommunicator.sendAndReceive(message, replicaInfo.master().get()); 541 Future<byte[]> responseFuture = clusterCommunicator.sendAndReceive(message, replicaInfo.master().get());
542 return SERIALIZER.decode(responseFuture.get(FLOW_RULE_STORE_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)); 542 return SERIALIZER.decode(responseFuture.get(FLOW_RULE_STORE_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS));
543 } catch (IOException | TimeoutException | ExecutionException | InterruptedException e) { 543 } catch (IOException | TimeoutException | ExecutionException | InterruptedException e) {
544 - // FIXME: throw a FlowStoreException 544 + // TODO: Retry against latest master or throw a FlowStoreException
545 throw new RuntimeException(e); 545 throw new RuntimeException(e);
546 } 546 }
547 } 547 }
...@@ -586,8 +586,6 @@ public class DistributedFlowRuleStore ...@@ -586,8 +586,6 @@ public class DistributedFlowRuleStore
586 for (Entry<FlowId, ImmutableList<StoredFlowEntry>> e 586 for (Entry<FlowId, ImmutableList<StoredFlowEntry>> e
587 : backupFlowTable.entrySet()) { 587 : backupFlowTable.entrySet()) {
588 588
589 - // TODO: should we be directly updating internal structure or
590 - // should we be triggering event?
591 log.trace("loading {}", e.getValue()); 589 log.trace("loading {}", e.getValue());
592 for (StoredFlowEntry entry : e.getValue()) { 590 for (StoredFlowEntry entry : e.getValue()) {
593 flowEntries.remove(did, entry); 591 flowEntries.remove(did, entry);
...@@ -714,7 +712,7 @@ public class DistributedFlowRuleStore ...@@ -714,7 +712,7 @@ public class DistributedFlowRuleStore
714 // This node is no longer the master holder, 712 // This node is no longer the master holder,
715 // clean local structure 713 // clean local structure
716 removeFromPrimary(did); 714 removeFromPrimary(did);
717 - // FIXME: probably should stop pending backup activities in 715 + // TODO: probably should stop pending backup activities in
718 // executors to avoid overwriting with old value 716 // executors to avoid overwriting with old value
719 } 717 }
720 break; 718 break;
...@@ -767,7 +765,6 @@ public class DistributedFlowRuleStore ...@@ -767,7 +765,6 @@ public class DistributedFlowRuleStore
767 } else { 765 } else {
768 success = backupFlowTable.replace(id, original, newValue); 766 success = backupFlowTable.replace(id, original, newValue);
769 } 767 }
770 - // TODO retry?
771 if (!success) { 768 if (!success) {
772 log.error("Updating backup failed."); 769 log.error("Updating backup failed.");
773 } 770 }
...@@ -790,7 +787,6 @@ public class DistributedFlowRuleStore ...@@ -790,7 +787,6 @@ public class DistributedFlowRuleStore
790 } else { 787 } else {
791 success = backupFlowTable.replace(id, original, newValue); 788 success = backupFlowTable.replace(id, original, newValue);
792 } 789 }
793 - // TODO retry?
794 if (!success) { 790 if (!success) {
795 log.error("Updating backup failed."); 791 log.error("Updating backup failed.");
796 } 792 }
......
...@@ -88,7 +88,6 @@ import com.google.common.collect.Multimap; ...@@ -88,7 +88,6 @@ import com.google.common.collect.Multimap;
88 import com.google.common.collect.Multimaps; 88 import com.google.common.collect.Multimaps;
89 import com.google.common.collect.SetMultimap; 89 import com.google.common.collect.SetMultimap;
90 90
91 -//TODO: multi-provider, annotation not supported.
92 /** 91 /**
93 * Manages inventory of end-station hosts in distributed data store 92 * Manages inventory of end-station hosts in distributed data store
94 * that uses optimistic replication and gossip based techniques. 93 * that uses optimistic replication and gossip based techniques.
......
...@@ -86,6 +86,4 @@ public class AbsentInvalidatingLoadingCache<K, V> extends ...@@ -86,6 +86,4 @@ public class AbsentInvalidatingLoadingCache<K, V> extends
86 } 86 }
87 return v; 87 return v;
88 } 88 }
89 -
90 - // TODO should we be also checking getAll, etc.
91 } 89 }
......
...@@ -30,8 +30,6 @@ import java.util.concurrent.TimeUnit; ...@@ -30,8 +30,6 @@ import java.util.concurrent.TimeUnit;
30 30
31 import static com.google.common.base.Preconditions.checkNotNull; 31 import static com.google.common.base.Preconditions.checkNotNull;
32 32
33 -// TODO: implementation is incomplete
34 -
35 /** 33 /**
36 * Wrapper around IQueue&lt;byte[]&gt; which serializes/deserializes 34 * Wrapper around IQueue&lt;byte[]&gt; which serializes/deserializes
37 * key and value using StoreSerializer. 35 * key and value using StoreSerializer.
......
...@@ -28,7 +28,6 @@ import org.onosproject.store.serializers.StoreSerializer; ...@@ -28,7 +28,6 @@ import org.onosproject.store.serializers.StoreSerializer;
28 import com.hazelcast.core.TransactionalMap; 28 import com.hazelcast.core.TransactionalMap;
29 import com.hazelcast.query.Predicate; 29 import com.hazelcast.query.Predicate;
30 30
31 -// TODO: implement Predicate, etc. if we need them.
32 /** 31 /**
33 * Wrapper around TransactionalMap&lt;byte[], byte[]&gt; which serializes/deserializes 32 * Wrapper around TransactionalMap&lt;byte[], byte[]&gt; which serializes/deserializes
34 * key and value using StoreSerializer. 33 * key and value using StoreSerializer.
...@@ -100,7 +99,6 @@ public class STxMap<K, V> implements TransactionalMap<K, V> { ...@@ -100,7 +99,6 @@ public class STxMap<K, V> implements TransactionalMap<K, V> {
100 99
101 @Override 100 @Override
102 public V getForUpdate(Object key) { 101 public V getForUpdate(Object key) {
103 - // TODO Auto-generated method stub
104 return deserializeVal(m.getForUpdate(serializeKey(key))); 102 return deserializeVal(m.getForUpdate(serializeKey(key)));
105 } 103 }
106 104
......
...@@ -90,7 +90,7 @@ public class DistributedIntentStore ...@@ -90,7 +90,7 @@ public class DistributedIntentStore
90 private static final String STATES_TABLE = "intent-states"; 90 private static final String STATES_TABLE = "intent-states";
91 private CMap<IntentId, IntentState> states; 91 private CMap<IntentId, IntentState> states;
92 92
93 - // TODO left behind transient state issue: ONOS-103 93 + // TODO transient state issue remains for this impl.: ONOS-103
94 // Map to store instance local intermediate state transition 94 // Map to store instance local intermediate state transition
95 private transient Map<IntentId, IntentState> transientStates = new ConcurrentHashMap<>(); 95 private transient Map<IntentId, IntentState> transientStates = new ConcurrentHashMap<>();
96 96
...@@ -142,7 +142,7 @@ public class DistributedIntentStore ...@@ -142,7 +142,7 @@ public class DistributedIntentStore
142 getIntentTimer = createResponseTimer("getIntent"); 142 getIntentTimer = createResponseTimer("getIntent");
143 getIntentStateTimer = createResponseTimer("getIntentState"); 143 getIntentStateTimer = createResponseTimer("getIntentState");
144 144
145 - // FIXME: We need a way to add serializer for intents which has been plugged-in. 145 + // We need a way to add serializer for intents which has been plugged-in.
146 // As a short term workaround, relax Kryo config to 146 // As a short term workaround, relax Kryo config to
147 // registrationRequired=false 147 // registrationRequired=false
148 serializer = new KryoSerializer() { 148 serializer = new KryoSerializer() {
...@@ -264,7 +264,6 @@ public class DistributedIntentStore ...@@ -264,7 +264,6 @@ public class DistributedIntentStore
264 } 264 }
265 } 265 }
266 266
267 - // FIXME temporary workaround until we fix our state machine
268 private void verify(boolean expression, String errorMessageTemplate, Object... errorMessageArgs) { 267 private void verify(boolean expression, String errorMessageTemplate, Object... errorMessageArgs) {
269 if (onlyLogTransitionError) { 268 if (onlyLogTransitionError) {
270 if (!expression) { 269 if (!expression) {
...@@ -488,7 +487,6 @@ public class DistributedIntentStore ...@@ -488,7 +487,6 @@ public class DistributedIntentStore
488 return failed; 487 return failed;
489 } else { 488 } else {
490 // everything failed 489 // everything failed
491 - // FIXME what to do with events?
492 return batch.operations(); 490 return batch.operations();
493 } 491 }
494 } 492 }
......
...@@ -529,7 +529,7 @@ public class GossipLinkStore ...@@ -529,7 +529,7 @@ public class GossipLinkStore
529 continue; 529 continue;
530 } 530 }
531 531
532 - // TODO: should keep track of Description timestamp 532 + // Note: In the long run we should keep track of Description timestamp
533 // and only merge conflicting keys when timestamp is newer 533 // and only merge conflicting keys when timestamp is newer
534 // Currently assuming there will never be a key conflict between 534 // Currently assuming there will never be a key conflict between
535 // providers 535 // providers
......
...@@ -299,7 +299,7 @@ public class DistributedMastershipStore ...@@ -299,7 +299,7 @@ public class DistributedMastershipStore
299 } else { 299 } else {
300 // no master candidate 300 // no master candidate
301 roleMap.put(deviceId, rv); 301 roleMap.put(deviceId, rv);
302 - // TODO: Should there be new event type for no MASTER? 302 + // TBD: Should there be new event type for no MASTER?
303 return new MastershipEvent(MASTER_CHANGED, deviceId, rv.roleInfo()); 303 return new MastershipEvent(MASTER_CHANGED, deviceId, rv.roleInfo());
304 } 304 }
305 case STANDBY: 305 case STANDBY:
......
...@@ -78,7 +78,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -78,7 +78,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
78 78
79 private final Logger log = getLogger(getClass()); 79 private final Logger log = getLogger(getClass());
80 80
81 - // FIXME: what is the Bandwidth unit?
82 private static final Bandwidth DEFAULT_BANDWIDTH = Bandwidth.valueOf(1_000); 81 private static final Bandwidth DEFAULT_BANDWIDTH = Bandwidth.valueOf(1_000);
83 82
84 // table to store current allocations 83 // table to store current allocations
...@@ -143,7 +142,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -143,7 +142,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
143 } 142 }
144 143
145 private Set<? extends ResourceAllocation> getResourceCapacity(ResourceType type, Link link) { 144 private Set<? extends ResourceAllocation> getResourceCapacity(ResourceType type, Link link) {
146 - // TODO: plugin/provider mechanism to add resource type in the future?
147 if (type == ResourceType.BANDWIDTH) { 145 if (type == ResourceType.BANDWIDTH) {
148 return ImmutableSet.of(getBandwidthResourceCapacity(link)); 146 return ImmutableSet.of(getBandwidthResourceCapacity(link));
149 } 147 }
...@@ -154,7 +152,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -154,7 +152,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
154 } 152 }
155 153
156 private Set<LambdaResourceAllocation> getLambdaResourceCapacity(Link link) { 154 private Set<LambdaResourceAllocation> getLambdaResourceCapacity(Link link) {
157 - // FIXME enumerate all the possible link/port lambdas
158 Set<LambdaResourceAllocation> allocations = new HashSet<>(); 155 Set<LambdaResourceAllocation> allocations = new HashSet<>();
159 try { 156 try {
160 final int waves = Integer.parseInt(link.annotations().value(wavesAnnotation)); 157 final int waves = Integer.parseInt(link.annotations().value(wavesAnnotation));
...@@ -323,7 +320,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -323,7 +320,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
323 if (log.isDebugEnabled()) { 320 if (log.isDebugEnabled()) {
324 logFailureDetail(batch, result); 321 logFailureDetail(batch, result);
325 } 322 }
326 - // FIXME throw appropriate exception, with what failed.
327 checkState(result.isSuccessful(), "Allocation failed"); 323 checkState(result.isSuccessful(), "Allocation failed");
328 } 324 }
329 } 325 }
...@@ -389,7 +385,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -389,7 +385,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
389 double bwLeft = bw.bandwidth().toDouble(); 385 double bwLeft = bw.bandwidth().toDouble();
390 bwLeft -= ((BandwidthResourceAllocation) req).bandwidth().toDouble(); 386 bwLeft -= ((BandwidthResourceAllocation) req).bandwidth().toDouble();
391 if (bwLeft < 0) { 387 if (bwLeft < 0) {
392 - // FIXME throw appropriate Exception
393 checkState(bwLeft >= 0, 388 checkState(bwLeft >= 0,
394 "There's no Bandwidth left on %s. %s", 389 "There's no Bandwidth left on %s. %s",
395 link, bwLeft); 390 link, bwLeft);
...@@ -399,7 +394,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -399,7 +394,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
399 // check if allocation should be accepted 394 // check if allocation should be accepted
400 if (!avail.contains(req)) { 395 if (!avail.contains(req)) {
401 // requested lambda was not available 396 // requested lambda was not available
402 - // FIXME throw appropriate exception
403 checkState(avail.contains(req), 397 checkState(avail.contains(req),
404 "Allocating %s on %s failed", 398 "Allocating %s on %s failed",
405 req, link); 399 req, link);
...@@ -433,7 +427,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -433,7 +427,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
433 final String dbIntentId = toIntentDbKey(intendId); 427 final String dbIntentId = toIntentDbKey(intendId);
434 final Collection<Link> links = allocations.links(); 428 final Collection<Link> links = allocations.links();
435 429
436 - // TODO: does release must happen in a batch?
437 boolean success; 430 boolean success;
438 do { 431 do {
439 Builder tx = BatchWriteRequest.newBuilder(); 432 Builder tx = BatchWriteRequest.newBuilder();
...@@ -476,7 +469,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -476,7 +469,6 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
476 checkNotNull(intentId); 469 checkNotNull(intentId);
477 VersionedValue vv = databaseService.get(INTENT_ALLOCATIONS, toIntentDbKey(intentId)); 470 VersionedValue vv = databaseService.get(INTENT_ALLOCATIONS, toIntentDbKey(intentId));
478 if (vv == null) { 471 if (vv == null) {
479 - // FIXME: should we return null or LinkResourceAllocations with nothing allocated?
480 return null; 472 return null;
481 } 473 }
482 LinkResourceAllocations allocations = decodeIntentAllocations(vv.value()); 474 LinkResourceAllocations allocations = decodeIntentAllocations(vv.value());
...@@ -486,7 +478,7 @@ public class DistributedLinkResourceStore implements LinkResourceStore { ...@@ -486,7 +478,7 @@ public class DistributedLinkResourceStore implements LinkResourceStore {
486 private String toLinkDbKey(LinkKey linkid) { 478 private String toLinkDbKey(LinkKey linkid) {
487 // introduce cache if necessary 479 // introduce cache if necessary
488 return linkid.toString(); 480 return linkid.toString();
489 - // TODO: Above is irreversible, if we need reverse conversion 481 + // Note: Above is irreversible, if we need reverse conversion
490 // we may need something like below, due to String only limitation 482 // we may need something like below, due to String only limitation
491 // byte[] bytes = serializer.encode(linkid); 483 // byte[] bytes = serializer.encode(linkid);
492 // StringBuilder builder = new StringBuilder(bytes.length * 4); 484 // StringBuilder builder = new StringBuilder(bytes.length * 4);
......
...@@ -76,7 +76,6 @@ public class HazelcastLinkResourceStore ...@@ -76,7 +76,6 @@ public class HazelcastLinkResourceStore
76 76
77 private final Logger log = getLogger(getClass()); 77 private final Logger log = getLogger(getClass());
78 78
79 - // FIXME: what is the Bandwidth unit?
80 private static final Bandwidth DEFAULT_BANDWIDTH = Bandwidth.valueOf(1_000); 79 private static final Bandwidth DEFAULT_BANDWIDTH = Bandwidth.valueOf(1_000);
81 80
82 private static final Bandwidth EMPTY_BW = Bandwidth.valueOf(0); 81 private static final Bandwidth EMPTY_BW = Bandwidth.valueOf(0);
...@@ -134,7 +133,6 @@ public class HazelcastLinkResourceStore ...@@ -134,7 +133,6 @@ public class HazelcastLinkResourceStore
134 } 133 }
135 134
136 private Set<? extends ResourceAllocation> getResourceCapacity(ResourceType type, Link link) { 135 private Set<? extends ResourceAllocation> getResourceCapacity(ResourceType type, Link link) {
137 - // TODO: plugin/provider mechanism to add resource type in the future?
138 if (type == ResourceType.BANDWIDTH) { 136 if (type == ResourceType.BANDWIDTH) {
139 return ImmutableSet.of(getBandwidthResourceCapacity(link)); 137 return ImmutableSet.of(getBandwidthResourceCapacity(link));
140 } 138 }
...@@ -145,7 +143,6 @@ public class HazelcastLinkResourceStore ...@@ -145,7 +143,6 @@ public class HazelcastLinkResourceStore
145 } 143 }
146 144
147 private Set<LambdaResourceAllocation> getLambdaResourceCapacity(Link link) { 145 private Set<LambdaResourceAllocation> getLambdaResourceCapacity(Link link) {
148 - // FIXME enumerate all the possible link/port lambdas
149 Set<LambdaResourceAllocation> allocations = new HashSet<>(); 146 Set<LambdaResourceAllocation> allocations = new HashSet<>();
150 try { 147 try {
151 final int waves = Integer.parseInt(link.annotations().value(wavesAnnotation)); 148 final int waves = Integer.parseInt(link.annotations().value(wavesAnnotation));
...@@ -335,7 +332,6 @@ public class HazelcastLinkResourceStore ...@@ -335,7 +332,6 @@ public class HazelcastLinkResourceStore
335 double bwLeft = bw.bandwidth().toDouble(); 332 double bwLeft = bw.bandwidth().toDouble();
336 bwLeft -= ((BandwidthResourceAllocation) req).bandwidth().toDouble(); 333 bwLeft -= ((BandwidthResourceAllocation) req).bandwidth().toDouble();
337 if (bwLeft < 0) { 334 if (bwLeft < 0) {
338 - // FIXME throw appropriate Exception
339 checkState(bwLeft >= 0, 335 checkState(bwLeft >= 0,
340 "There's no Bandwidth left on %s. %s", 336 "There's no Bandwidth left on %s. %s",
341 link, bwLeft); 337 link, bwLeft);
...@@ -345,7 +341,6 @@ public class HazelcastLinkResourceStore ...@@ -345,7 +341,6 @@ public class HazelcastLinkResourceStore
345 // check if allocation should be accepted 341 // check if allocation should be accepted
346 if (!avail.contains(req)) { 342 if (!avail.contains(req)) {
347 // requested lambda was not available 343 // requested lambda was not available
348 - // FIXME throw appropriate exception
349 checkState(avail.contains(req), 344 checkState(avail.contains(req),
350 "Allocating %s on %s failed", 345 "Allocating %s on %s failed",
351 req, link); 346 req, link);
...@@ -381,7 +376,8 @@ public class HazelcastLinkResourceStore ...@@ -381,7 +376,8 @@ public class HazelcastLinkResourceStore
381 376
382 boolean success = false; 377 boolean success = false;
383 do { 378 do {
384 - // TODO: smaller tx unit to lower the chance of collisions? 379 + // Note: might want to break it down into smaller tx unit
380 + // to lower the chance of collisions.
385 TransactionContext tx = theInstance.newTransactionContext(); 381 TransactionContext tx = theInstance.newTransactionContext();
386 tx.beginTransaction(); 382 tx.beginTransaction();
387 try { 383 try {
......
...@@ -100,7 +100,7 @@ public class ClusterMessagingProtocol ...@@ -100,7 +100,7 @@ public class ClusterMessagingProtocol
100 // for snapshot 100 // for snapshot
101 .register(State.class) 101 .register(State.class)
102 .register(TableMetadata.class) 102 .register(TableMetadata.class)
103 - // TODO: Move this out ? 103 + // TODO: Move this out to API?
104 .register(TableModificationEvent.class) 104 .register(TableModificationEvent.class)
105 .register(TableModificationEvent.Type.class) 105 .register(TableModificationEvent.Type.class)
106 .build(); 106 .build();
......
...@@ -96,13 +96,11 @@ public class DistributedLockManager implements LockService { ...@@ -96,13 +96,11 @@ public class DistributedLockManager implements LockService {
96 96
97 @Override 97 @Override
98 public void addListener(LockEventListener listener) { 98 public void addListener(LockEventListener listener) {
99 - // FIXME:
100 throw new UnsupportedOperationException(); 99 throw new UnsupportedOperationException();
101 } 100 }
102 101
103 @Override 102 @Override
104 public void removeListener(LockEventListener listener) { 103 public void removeListener(LockEventListener listener) {
105 - // FIXME:
106 throw new UnsupportedOperationException(); 104 throw new UnsupportedOperationException();
107 } 105 }
108 106
......