svn merge -c 1334156 from trunk for HDFS-3303. Remove Writable implementation from RemoteEditLogManifest.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1334157 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e63d0b2667
commit
6096db181d
|
@ -277,6 +277,9 @@ Release 2.0.0 - UNRELEASED
|
||||||
|
|
||||||
HDFS-3339. Change INode to package private. (John George via szetszwo)
|
HDFS-3339. Change INode to package private. (John George via szetszwo)
|
||||||
|
|
||||||
|
HDFS-3303. Remove Writable implementation from RemoteEditLogManifest.
|
||||||
|
(Brandon Li via szetszwo)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HDFS-2477. Optimize computing the diff between a block report and the
|
HDFS-2477. Optimize computing the diff between a block report and the
|
||||||
|
|
|
@ -17,22 +17,16 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.hadoop.hdfs.server.protocol;
|
package org.apache.hadoop.hdfs.server.protocol;
|
||||||
|
|
||||||
import java.io.DataInput;
|
|
||||||
import java.io.DataOutput;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.hadoop.io.Writable;
|
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumeration of logs available on a remote NameNode.
|
* An enumeration of logs available on a remote NameNode.
|
||||||
*/
|
*/
|
||||||
public class RemoteEditLogManifest implements Writable {
|
public class RemoteEditLogManifest {
|
||||||
|
|
||||||
private List<RemoteEditLog> logs;
|
private List<RemoteEditLog> logs;
|
||||||
|
|
||||||
|
@ -75,25 +69,4 @@ public class RemoteEditLogManifest implements Writable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[" + Joiner.on(", ").join(logs) + "]";
|
return "[" + Joiner.on(", ").join(logs) + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(DataOutput out) throws IOException {
|
|
||||||
out.writeInt(logs.size());
|
|
||||||
for (RemoteEditLog log : logs) {
|
|
||||||
log.write(out);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFields(DataInput in) throws IOException {
|
|
||||||
int numLogs = in.readInt();
|
|
||||||
logs = Lists.newArrayList();
|
|
||||||
for (int i = 0; i < numLogs; i++) {
|
|
||||||
RemoteEditLog log = new RemoteEditLog();
|
|
||||||
log.readFields(in);
|
|
||||||
logs.add(log);
|
|
||||||
}
|
|
||||||
checkState();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue