HBASE-9443 ReplicationProtobufUtil.HLogEntries needs to be removed (Roman Shaposhnik)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1520449 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2013-09-05 22:44:53 +00:00
parent 99b0f61b9d
commit efffa5714e
1 changed files with 0 additions and 30 deletions

View File

@ -50,36 +50,6 @@ import com.google.protobuf.ServiceException;
@InterfaceAudience.Private
public class ReplicationProtbufUtil {
/**
* Get the HLog entries from a list of protocol buffer WALEntry
*
* @param protoList the list of protocol buffer WALEntry
* @return an array of HLog entries
*/
public static HLog.Entry[]
toHLogEntries(final List<AdminProtos.WALEntry> protoList) throws IOException {
List<HLog.Entry> entries = new ArrayList<HLog.Entry>();
for (AdminProtos.WALEntry entry: protoList) {
WALProtos.WALKey walKey = entry.getKey();
HLogKey key = new HLogKey(walKey);
WALEdit edit = new WALEdit();
for (ByteString keyValue: entry.getKeyValueBytesList()) {
edit.add(new KeyValue(keyValue.toByteArray()));
}
if (walKey.getScopesCount() > 0) {
TreeMap<byte[], Integer> scopes =
new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR);
for (WALProtos.FamilyScope scope: walKey.getScopesList()) {
scopes.put(scope.getFamily().toByteArray(),
Integer.valueOf(scope.getScopeType().ordinal()));
}
key.setScopes(scopes);
}
entries.add(new HLog.Entry(key, edit));
}
return entries.toArray(new HLog.Entry[entries.size()]);
}
/**
* A helper to replicate a list of HLog entries using admin protocol.
*