Skip to content

Commit

Permalink
Merge pull request #575 from arunagrawal84/3.x
Browse files Browse the repository at this point in the history
Remove the usage of guava precondition from NewTokenRetriever
  • Loading branch information
arunagrawal-84 authored Jul 20, 2017
2 parents ea3a557 + 4e1e5f2 commit 3d551a7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public NewTokenRetriever(IPriamInstanceFactory factory, IMembership membership,
@Override
public PriamInstance get() throws Exception {

logger.info("Generating my own and new token");
logger.info("Generating my own and grabbing new token");
// Sleep random interval - upto 15 sec
sleeper.sleep(new Random().nextInt(15000));
int hash = tokenManager.regionOffset(config.getDC());
Expand All @@ -70,7 +70,8 @@ public PriamInstance get() throws Exception {

if (hash == max && locMap.get(config.getRac()).size() == 0) {
int idx = config.getRacs().indexOf(config.getRac());
Preconditions.checkState(idx >= 0, "Rac %s is not in Racs %s", config.getRac(), config.getRacs());
if (idx < 0)
throw new Exception(String.format("Rac %s is not in Racs %s", config.getRac(), config.getRacs()));
my_slot = idx + maxSlot;
} else
my_slot = config.getRacs().size() + maxSlot;
Expand Down

0 comments on commit 3d551a7

Please sign in to comment.