Skip to content

Commit

Permalink
contrib: hadoop: return the last used OSD as the current datanode
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-schmidtke committed Oct 28, 2016
1 parent ec6b102 commit 93cf13d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ public synchronized void close() throws IOException {
fileHandle.close();
closed = true;
}

// For use by external systems, such as the StatisticsFileSystem
// https://github.com/robert-schmidtke/hdfs-statistics-adapter
public String getCurrentDatanodeHostName() {
return fileHandle.getLastOSDAddress();
}

private int readFromBuffer(byte[] bytes, int offset, int length) throws IOException {
if (EOF || length == 0) {
Expand Down

0 comments on commit 93cf13d

Please sign in to comment.