root / src / protocols / Reclaim.java
History | View | Annotate | Download (727 Bytes)
1 |
package protocols; |
---|---|
2 |
|
3 |
import chord.ChordManager; |
4 |
import chord.ConnectionInfo; |
5 |
import files.FileHandler; |
6 |
import messages.*; |
7 |
import peer.Peer; |
8 |
|
9 |
import java.io.IOException; |
10 |
import java.math.BigInteger; |
11 |
import java.net.InetAddress; |
12 |
import java.net.UnknownHostException; |
13 |
import java.security.NoSuchAlgorithmException; |
14 |
import java.util.concurrent.ExecutionException; |
15 |
|
16 |
public class Reclaim implements Runnable{ |
17 |
private long reservedSpace; |
18 |
|
19 |
public Reclaim(long reservedSpace) { |
20 |
this.reservedSpace = reservedSpace;
|
21 |
} |
22 |
|
23 |
@Override
|
24 |
public void run() { |
25 |
try {
|
26 |
Peer.storage.setSpaceReserved(this.reservedSpace);
|
27 |
} catch (IOException e) { |
28 |
e.printStackTrace(); |
29 |
} |
30 |
} |
31 |
} |