@InterfaceAudience.Private public class CacheableDeserializerIdManager extends Object
CacheableDeserializer.
All deserializers are registered with this Manager via the
registerDeserializer(CacheableDeserializer)}. On registration, we return an
int *identifier* for this deserializer. The int identifier is passed to
getDeserializer(int)} to obtain the registered deserializer instance.| Modifier and Type | Field and Description |
|---|---|
private static AtomicInteger |
identifier |
private static Map<Integer,CacheableDeserializer<Cacheable>> |
registeredDeserializers |
| Constructor and Description |
|---|
CacheableDeserializerIdManager() |
| Modifier and Type | Method and Description |
|---|---|
static CacheableDeserializer<Cacheable> |
getDeserializer(int id)
Get the cacheable deserializer registered at the given identifier Id.
|
static int |
registerDeserializer(CacheableDeserializer<Cacheable> cd)
Register the given
Cacheable -- usually an hfileblock instance, these implement
the Cacheable Interface -- deserializer and generate a unique identifier id for it and return
this as our result. |
static Map<Integer,String> |
save()
Snapshot a map of the current identifiers to class names for reconstruction on reading out
of a file.
|
private static final Map<Integer,CacheableDeserializer<Cacheable>> registeredDeserializers
private static final AtomicInteger identifier
public CacheableDeserializerIdManager()
public static int registerDeserializer(CacheableDeserializer<Cacheable> cd)
Cacheable -- usually an hfileblock instance, these implement
the Cacheable Interface -- deserializer and generate a unique identifier id for it and return
this as our result.getDeserializer(int)public static CacheableDeserializer<Cacheable> getDeserializer(int id)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.