@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class Platform extends Object
HadoopPlatform
that supports all key types of Hadoop and users could implement their custom
platform.Modifier and Type | Field and Description |
---|---|
protected Set<String> |
keyClassNames |
Constructor and Description |
---|
Platform() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
define(Class<?> keyComparator)
whether it's the platform that has defined a custom Java comparator
NativeTask doesn't support custom Java comparators
(set with mapreduce.job.output.key.comparator.class)
but a platform (e.g Pig) could also set that conf and implement native
comparators so we shouldn't bail out.
|
abstract void |
init()
initialize a platform, where we should call registerKey
|
abstract String |
name() |
protected void |
registerKey(String keyClassName,
Class<?> key)
associate a key class with its serializer and platform
|
protected abstract boolean |
support(String keyClassName,
INativeSerializer<?> serializer,
JobConf job)
whether a platform supports a specific key should at least satisfy two conditions
1.
|
public abstract void init() throws IOException
IOException
public abstract String name()
protected void registerKey(String keyClassName, Class<?> key) throws IOException
keyClassName
- map out key class namekey
- key serializer classIOException
protected abstract boolean support(String keyClassName, INativeSerializer<?> serializer, JobConf job)
INativeComparable
interfacekeyClassName
- map out put key class nameserializer
- serializer associated with key via registerKeyjob
- job configurationprotected abstract boolean define(Class<?> keyComparator)
keyComparator
- comparator set with mapreduce.job.output.key.comparator.classCopyright © 2024 Apache Software Foundation. All rights reserved.