Skip to content

Commit

Permalink
code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingfei committed Jul 30, 2015
1 parent 0501459 commit 0cce392
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -66,6 +66,12 @@ public BlockLockManager(BlockMetadataManager metaManager) {
} }
} }


/**
* Get index of the lock that will be used to lock the block
*
* @param blockId the id of the block
* @return hash index of the lock
*/
public static int blockHashIndex(long blockId) { public static int blockHashIndex(long blockId) {
return Math.abs(HASH_FUNC.hashLong(blockId).asInt()) % NUM_LOCKS; return Math.abs(HASH_FUNC.hashLong(blockId).asInt()) % NUM_LOCKS;
} }
Expand Down
Expand Up @@ -83,7 +83,7 @@ public Map<Long, String> getDirPaths() {


public int getNumberOfBlocks() { public int getNumberOfBlocks() {
int numberOfBlocks = 0; int numberOfBlocks = 0;
for (List blockIds : mBlockIdsOnDirs.values()) { for (List<Long> blockIds : mBlockIdsOnDirs.values()) {
numberOfBlocks += blockIds.size(); numberOfBlocks += blockIds.size();
} }
return numberOfBlocks; return numberOfBlocks;
Expand Down

0 comments on commit 0cce392

Please sign in to comment.