Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add block worker report and worker report.
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
servers/src/main/java/tachyon/worker/BlockWorkerReport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,39 @@ | |||
package tachyon.worker; | |||
|
|||
import java.util.List; | |||
import java.util.Map; | |||
|
|||
/** | |||
* Represents the data the CoreWorker will send to the master in its periodic heartbeat. | |||
*/ | |||
// TODO: Make this a thrift object? | |||
public class BlockWorkerReport extends WorkerReport { | |||
private final long mWorkerId; | |||
private final List<Long> mUsedBytesOnTiers; | |||
private final List<Long> mRemovedBlocks; | |||
private final Map<Long, List<Long>> mAddedBlocks; | |||
|
|||
public BlockWorkerReport(long workerId, List<Long> usedBytesOnTiers, List<Long> removedBlocks, | |||
Map<Long, List<Long>> addedBlocks) { | |||
mWorkerId = workerId; | |||
mUsedBytesOnTiers = usedBytesOnTiers; | |||
mRemovedBlocks = removedBlocks; | |||
mAddedBlocks = addedBlocks; | |||
} | |||
|
|||
public Map<Long, List<Long>> getAddedBlocks() { | |||
return mAddedBlocks; | |||
} | |||
|
|||
public List<Long> getRemovedBlocks() { | |||
return mRemovedBlocks; | |||
} | |||
|
|||
public List<Long> getUsedBytesOnTiers() { | |||
return mUsedBytesOnTiers; | |||
} | |||
|
|||
public long getWorkerId() { | |||
return mWorkerId; | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
package tachyon.worker; | |||
|
|||
/** | |||
* Represents a report from the worker to the master. Each worker type should implement its own | |||
* version of the report. | |||
*/ | |||
public class WorkerReport { | |||
} |