HADOOP-6150. Users should be able to instantiate comparator using TFile

API. (Hong Tang via rangadi)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@797274 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Raghu Angadi 2009-07-24 00:11:20 +00:00
parent 53c127013c
commit e4450e5487
2 changed files with 15 additions and 1 deletions

View File

@ -891,6 +891,9 @@ Trunk (unreleased changes)
HADOOP-6132. RPC client create an extra connection because of incorrect
key for connection cache. (Kan Zhang via rangadi)
HADOOP-6150. Users should be able to instantiate comparator using TFile
API. (Hong Tang via rangadi)
Release 0.20.1 - Unreleased
INCOMPATIBLE CHANGES

View File

@ -161,6 +161,17 @@ public class TFile {
/** comparator prefix: java class */
public static final String COMPARATOR_JCLASS = "jclass:";
/**
* Make a raw comparator from a string name.
*
* @param name
* Comparator name
* @return A RawComparable comparator.
*/
static public Comparator<RawComparable> makeComparator(String name) {
return TFileMeta.makeComparator(name);
}
// Prevent the instantiation of TFiles
private TFile() {
// nothing
@ -1947,7 +1958,7 @@ public class TFile {
}
@SuppressWarnings("unchecked")
private static BytesComparator makeComparator(String comparator) {
static BytesComparator makeComparator(String comparator) {
if (comparator.length() == 0) {
// unsorted keys
return null;