示例#1
0
  private void updateDeletes() {
    Integer reps = Main.getDatabase().getDeletedFiles().get(header.get(1));

    if (reps != null) {
      Main.getDatabase().changeRepDegree(header.get(1), reps - 1);
    }

    Main.getService().submit(new ReclaimProcess());
  }
示例#2
0
  void receive() throws UnsupportedEncodingException {

    while (running) {

      byte[] mssg = ctrlComm.receive();
      if (mssg != null) {
        Main.getService().submit(new ControlProcess(mssg));
      }
    }
  }
示例#3
0
 private void removedProcess() {
   for (int i = 0; i < Main.getDatabase().getChunksSize(); i++) {
     Chunk chunk = Main.getDatabase().getChunk(i);
     if (chunk.getFileId().equals(header.get(2))
         && (chunk.getChunkNo() == Integer.parseInt(header.get(3)))) {
       chunk.setKnownReps(-1);
       if (chunk.getKnownReps() < chunk.getRepDegree()) {
         BackupSend send =
             new BackupSend(
                 chunk.getFileId(),
                 chunk.getRepDegree(),
                 false,
                 chunk.getChunkNo(),
                 chunk.getKnownReps());
         Main.getBackup().addSending(send);
         Main.getService().submit(send);
       }
       break;
     }
   }
 }
示例#4
0
 private void processIn() {
   Main.getService().submit(new ReclaimProcess());
 }