HBASE-19922 remove ProtobufUtil::PRIMITIVES
This commit is contained in:
parent
6307689a6e
commit
8de820786c
|
@ -34,7 +34,6 @@ import java.io.IOException;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -122,11 +121,6 @@ public final class ProtobufUtil {
|
||||||
private ProtobufUtil() {
|
private ProtobufUtil() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Primitive type to class mapping.
|
|
||||||
*/
|
|
||||||
private final static Map<String, Class<?>> PRIMITIVES = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Many results are simple: no cell, exists true or false. To save on object creations,
|
* Many results are simple: no cell, exists true or false. To save on object creations,
|
||||||
* we reuse them across calls.
|
* we reuse them across calls.
|
||||||
|
@ -183,16 +177,6 @@ public final class ProtobufUtil {
|
||||||
ClassLoader parent = ProtobufUtil.class.getClassLoader();
|
ClassLoader parent = ProtobufUtil.class.getClassLoader();
|
||||||
Configuration conf = HBaseConfiguration.create();
|
Configuration conf = HBaseConfiguration.create();
|
||||||
CLASS_LOADER = new DynamicClassLoader(conf, parent);
|
CLASS_LOADER = new DynamicClassLoader(conf, parent);
|
||||||
|
|
||||||
PRIMITIVES.put(Boolean.TYPE.getName(), Boolean.TYPE);
|
|
||||||
PRIMITIVES.put(Byte.TYPE.getName(), Byte.TYPE);
|
|
||||||
PRIMITIVES.put(Character.TYPE.getName(), Character.TYPE);
|
|
||||||
PRIMITIVES.put(Short.TYPE.getName(), Short.TYPE);
|
|
||||||
PRIMITIVES.put(Integer.TYPE.getName(), Integer.TYPE);
|
|
||||||
PRIMITIVES.put(Long.TYPE.getName(), Long.TYPE);
|
|
||||||
PRIMITIVES.put(Float.TYPE.getName(), Float.TYPE);
|
|
||||||
PRIMITIVES.put(Double.TYPE.getName(), Double.TYPE);
|
|
||||||
PRIMITIVES.put(Void.TYPE.getName(), Void.TYPE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -27,7 +27,6 @@ import java.lang.reflect.Method;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -200,11 +199,6 @@ public final class ProtobufUtil {
|
||||||
private ProtobufUtil() {
|
private ProtobufUtil() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Primitive type to class mapping.
|
|
||||||
*/
|
|
||||||
private final static Map<String, Class<?>> PRIMITIVES = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Many results are simple: no cell, exists true or false. To save on object creations,
|
* Many results are simple: no cell, exists true or false. To save on object creations,
|
||||||
* we reuse them across calls.
|
* we reuse them across calls.
|
||||||
|
@ -260,16 +254,6 @@ public final class ProtobufUtil {
|
||||||
ClassLoader parent = ProtobufUtil.class.getClassLoader();
|
ClassLoader parent = ProtobufUtil.class.getClassLoader();
|
||||||
Configuration conf = HBaseConfiguration.create();
|
Configuration conf = HBaseConfiguration.create();
|
||||||
CLASS_LOADER = new DynamicClassLoader(conf, parent);
|
CLASS_LOADER = new DynamicClassLoader(conf, parent);
|
||||||
|
|
||||||
PRIMITIVES.put(Boolean.TYPE.getName(), Boolean.TYPE);
|
|
||||||
PRIMITIVES.put(Byte.TYPE.getName(), Byte.TYPE);
|
|
||||||
PRIMITIVES.put(Character.TYPE.getName(), Character.TYPE);
|
|
||||||
PRIMITIVES.put(Short.TYPE.getName(), Short.TYPE);
|
|
||||||
PRIMITIVES.put(Integer.TYPE.getName(), Integer.TYPE);
|
|
||||||
PRIMITIVES.put(Long.TYPE.getName(), Long.TYPE);
|
|
||||||
PRIMITIVES.put(Float.TYPE.getName(), Float.TYPE);
|
|
||||||
PRIMITIVES.put(Double.TYPE.getName(), Double.TYPE);
|
|
||||||
PRIMITIVES.put(Void.TYPE.getName(), Void.TYPE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue