Skip to content

Commit

Permalink
Modifying comments as per Jessica's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthick Duraisamy Soundararaj committed Jul 20, 2016
1 parent 36edf02 commit 29831fd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
18 changes: 15 additions & 3 deletions storm/src/main/storm/mesos/resources/AggregatedOffers.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ public boolean isAvailable(ResourceType resourceType, ResourceEntry<?> resource)
return availableResources.get(resourceType).isAvailable(resource);
}

// Unused Method - Exists for the reason described in https://github.com/mesos/storm/pull/146#issuecomment-225496075
/**
* Unused Method - Exists for the purpose of facilitating support of reservations.
* TODO: Support reservations (https://github.com/mesos/storm/issues/148)
* For more information about why this unused code exists, see discussion: https://github.com/mesos/storm/pull/146#issuecomment-225496075
*/
public boolean isAvailable(ResourceType resourceType, ReservationType reservationType, ResourceEntry<?> resource) {
return availableResources.get(resourceType).isAvailable(resource, reservationType);
}
Expand All @@ -107,7 +111,11 @@ public <T extends ResourceEntry> List<T> getAllAvailableResources(ResourceType r
return availableResources.get(resourceType).getAllAvailableResources();
}

// Unused Method - Exists for the reason described in https://github.com/mesos/storm/pull/146#issuecomment-225496075
/**
* Unused Method - Exists for the purpose of facilitating support of reservations.
* TODO: Support reservations (https://github.com/mesos/storm/issues/148)
* For more information about why this unused code exists, see discussion: https://github.com/mesos/storm/pull/146#issuecomment-225496075
*/
public <T extends ResourceEntry> List<T> getAllAvailableResources(ResourceType resourceType, ReservationType reservationType) {
return availableResources.get(resourceType).getAllAvailableResources(reservationType);
}
Expand All @@ -125,7 +133,11 @@ public List<ResourceEntry> reserveAndGet(ResourceType resourceType, ResourceEntr
return new ArrayList<>();
}

// Unused Method - Exists for the reason described in https://github.com/mesos/storm/pull/146#issuecomment-225496075
/**
* Unused Method - Exists for the purpose of facilitating support of reservations.
* TODO: Support reservations (https://github.com/mesos/storm/issues/148)
* For more information about why this unused code exists, see discussion: https://github.com/mesos/storm/pull/146#issuecomment-225496075
*/
public List<ResourceEntry> reserveAndGet(ResourceType resourceType, ReservationType reservationType, ResourceEntry<?> resource) throws
ResourceNotAvailableException {
if (availableResources.get(resourceType).isAvailable(resource, reservationType)) {
Expand Down
8 changes: 6 additions & 2 deletions storm/src/main/storm/mesos/resources/RangeResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ public List<ResourceEntry> removeAndGet(RangeResourceEntry rangeResourceEntry) t


/**
* Unused Method - Exists for the reason described in https://github.com/mesos/storm/pull/146#issuecomment-225496075
* Unused Method - Exists for the purpose of facilitating support of reservations.
* TODO: Support reservations (https://github.com/mesos/storm/issues/148)
* For more information about why this unused code exists, see discussion: https://github.com/mesos/storm/pull/146#issuecomment-225496075
*
* Remove/Reserve range from available ranges.
* {@param rangeResourceEntry} range resource to removeAndGet
Expand All @@ -131,7 +133,9 @@ public List<ResourceEntry> removeAndGet(RangeResourceEntry rangeResourceEntry, R
}

/**
* Unused Method - Exists for the reason described in https://github.com/mesos/storm/pull/146#issuecomment-225496075
* Unused Method - Exists for the purpose of facilitating support of reservations.
* TODO: Support reservations (https://github.com/mesos/storm/issues/148)
* For more information about why this unused code exists, see discussion: https://github.com/mesos/storm/pull/146#issuecomment-225496075
*
* Remove/Reserve range from available ranges
* {@param rangeResourceEntry} range resource to removeAndGet
Expand Down
12 changes: 10 additions & 2 deletions storm/src/main/storm/mesos/resources/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,18 @@ public interface Resource<T extends ResourceEntry<? extends Number>> {

public List<ResourceEntry> removeAndGet(T resourceEntry) throws ResourceNotAvailableException;

// Unused Method - Exists for the reason described in https://github.com/mesos/storm/pull/146#issuecomment-225496075
/**
* Unused Method - Exists for the purpose of facilitating support of reservations.
* TODO: Support reservations (https://github.com/mesos/storm/issues/148)
* For more information about why this unused code exists, see discussion: https://github.com/mesos/storm/pull/146#issuecomment-225496075
*/
public List<ResourceEntry> removeAndGet(T value, ReservationType reservationType) throws ResourceNotAvailableException;

// Unused Method - Exists for the reason described in https://github.com/mesos/storm/pull/146#issuecomment-225496075
/**
* Unused Method - Exists for the purpose of facilitating support of reservations.
* TODO: Support reservations (https://github.com/mesos/storm/issues/148)
* For more information about why this unused code exists, see discussion: https://github.com/mesos/storm/pull/146#issuecomment-225496075
*/
public List<ResourceEntry> removeAndGet(T value, Comparator<ReservationType> reservationTypeComparator) throws ResourceNotAvailableException;

}
6 changes: 5 additions & 1 deletion storm/src/main/storm/mesos/resources/ScalarResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public boolean isAvailable(ScalarResourceEntry scalarResourceEntry, ReservationT
return (availableResourcesByReservationType.get(reservationType).getValue() >= scalarResourceEntry.getValue());
}

// Unused Method - Exists for the reason described in https://github.com/mesos/storm/pull/146#issuecomment-225496075
/**
* Unused Method - Exists for the purpose of facilitating support of reservations.
* TODO: Support reservations (https://github.com/mesos/storm/issues/148)
* For more information about why this unused code exists, see discussion: https://github.com/mesos/storm/pull/146#issuecomment-225496075
*/
public Double getTotalAvailableResource(ReservationType reservationType) {
return availableResourcesByReservationType.get(reservationType).getValue();
}
Expand Down

0 comments on commit 29831fd

Please sign in to comment.