/** * Copy constructor. * @param from the source replica */ LocalReplica(LocalReplica from) { this(from, from.getVolume(), from.getDir()); }
/** * Get the full path of this replica's data file. * @return the full path of this replica's data file */ @VisibleForTesting public File getBlockFile() { return new File(getDir(), getBlockName()); }
/** * Get the full path of this replica's meta file. * @return the full path of this replica's meta file */ @VisibleForTesting public File getMetaFile() { return new File(getDir(), DatanodeUtil.getMetaName(getBlockName(), getGenerationStamp())); }
public ReplicaUnderRecovery(ReplicaInfo replica, long recoveryId) { super(replica, replica.getVolume(), ((LocalReplica)replica).getDir()); if ( replica.getState() != ReplicaState.FINALIZED && replica.getState() != ReplicaState.RBW && replica.getState() != ReplicaState.RWR ) { throw new IllegalArgumentException("Cannot recover replica: " + replica); } this.original = (LocalReplica) replica; this.recoveryId = recoveryId; }