} else if (newVal.equals("true")) {
setPersistBlocks(true);
} else if (newVal.equals("false")) {
setPersistBlocks(false);
} else {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
}
LOG.info("RECONFIGURE* changed persist blocks to " +
getPersistBlocks());
} finally {
writeUnlock();
}
} else if (property.equals("dfs.permissions.audit.log")) {
try {
writeLock();
if (newVal == null) {
// set to default
setPermissionAuditLog(false);
} else if (newVal.equals("true")) {
setPermissionAuditLog(true);
} else if (newVal.equals("false")) {
setPermissionAuditLog(false);
} else {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
}
LOG.info("RECONFIGURE* changed permission audit log to " +
getPermissionAuditLog());
} finally {
writeUnlock();
}
} else if (property.equals("dfs.heartbeat.interval")) {
writeLock();
try {
if (newVal == null) {
// set to default
setHeartbeatInterval(3L * 1000L, this.heartbeatRecheckInterval);
} else {
setHeartbeatInterval(Long.valueOf(newVal) * 1000L,
this.heartbeatRecheckInterval);
}
} catch (NumberFormatException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
} finally {
writeUnlock();
}
LOG.info("RECONFIGURE* changed heartbeatInterval to " +
this.heartbeatInterval);
} else if (property.equals("heartbeat.recheck.interval")) {
try {
writeLock();
if (newVal == null) {
// set to default
setHeartbeatInterval(this.heartbeatInterval, 5 * 60 * 1000);
} else {
setHeartbeatInterval(this.heartbeatInterval, Integer.valueOf(newVal));
}
} catch (NumberFormatException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
} finally {
writeUnlock();
}
LOG.info("RECONFIGURE* changed heartbeatRecheckInterval to " +
this.heartbeatRecheckInterval);
} else if (property.equals("dfs.access.time.precision")) {
try {
writeLock();
if (newVal == null) {
this.accessTimePrecision = 3600L;
} else {
this.accessTimePrecision = Long.parseLong(newVal);
}
} catch (NumberFormatException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
} finally {
writeUnlock();
}
LOG.info("RECONFIGURE* changed access time precision to " +
this.accessTimePrecision);
} else if (property.equals("dfs.close.replication.min")) {
try {
writeLock();
if (newVal == null) {
this.minCloseReplication = this.minReplication;
} else {
int newCloseMinReplication = Integer.parseInt(newVal);
if (newCloseMinReplication < minReplication ||
newCloseMinReplication > maxReplication) {
throw new ReconfigurationException(
property, newVal, getConf().get(property));
}
}
} catch (NumberFormatException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
} finally {
writeUnlock();
}
LOG.info("RECONFIGURE* changed new close min replication to " +
this.minCloseReplication);
} else if (property.equals("dfs.max-repl-streams")) {
try {
writeLock();
if (newVal == null) {
this.maxReplicationStreams = 2;
} else {
this.maxReplicationStreams = Integer.parseInt(newVal);
}
} catch (NumberFormatException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
} finally {
writeUnlock();
}
LOG.info("RECONFIGURE* changed max replication streams to " +
this.maxReplicationStreams);
} else if (property.equals("dfs.replication.iteration.multiplier")) {
try {
writeLock();
if (newVal == null) {
ReplicationConfigKeys.replicationWorkMultiplier =
ReplicationConfigKeys.REPLICATION_WORK_MULTIPLIER_PER_ITERATION;
} else {
ReplicationConfigKeys.replicationWorkMultiplier = Float.parseFloat(newVal);
}
} catch (NumberFormatException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
} finally {
writeUnlock();
}
LOG.info("RECONFIGURE* changed replication work multiplier to " +
ReplicationConfigKeys.replicationWorkMultiplier);
} else if (property.equals("dfs.overreplication.iteration.multiplier")) {
try {
writeLock();
if (newVal == null) {
ReplicationConfigKeys.overreplicationWorkMultiplier =
ReplicationConfigKeys.OVERREPLICATION_WORK_MULTIPLIER_PER_ITERATION;
} else {
ReplicationConfigKeys.overreplicationWorkMultiplier = Integer.parseInt(newVal);
}
} catch (NumberFormatException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
} finally {
writeUnlock();
}
LOG.info("RECONFIGURE* changed per iteration overreplication work to " +
ReplicationConfigKeys.overreplicationWorkMultiplier);
} else if (property.equals("dfs.block.invalidate.limit")) {
try {
writeLock();
if (newVal == null) {
ReplicationConfigKeys.blockInvalidateLimit =
FSConstants.BLOCK_INVALIDATE_CHUNK;
} else {
ReplicationConfigKeys.blockInvalidateLimit = Integer.parseInt(newVal);
}
} catch (NumberFormatException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
} finally {
writeUnlock();
}
LOG.info("RECONFIGURE* block invalidate limit to " +
ReplicationConfigKeys.blockInvalidateLimit);
} else {
throw new ReconfigurationException(property, newVal,
getConf().get(property));
}
}