org.apache.accumulo.server.tabletserver
Class NativeMap
java.lang.Object
org.apache.accumulo.server.tabletserver.NativeMap
- All Implemented Interfaces:
- Iterable<Map.Entry<Key,Value>>
public class NativeMap
- extends Object
- implements Iterable<Map.Entry<Key,Value>>
This class stores data in a C++ map. Doing this allows us to store more in memory and avoid pauses caused by Java GC.
The strategy for dealing with native memory allocated for the native map is that java code using the native map should call delete() as soon as it is
finished using the native map. When the NativeMap object is garbage collected its native resources will be released if needed. However waiting for java GC
would be a mistake for long lived NativeMaps. Long lived objects are not garbage collected quickly, therefore a process could easily use too much memory.
NativeMap
public NativeMap()
getNativeLibPath
public static String getNativeLibPath()
loadNativeLib
public static void loadNativeLib(String nativeLib)
loadedNativeLibraries
public static boolean loadedNativeLibraries()
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize
in class Object
- Throws:
Throwable
mutate
public void mutate(Mutation mutation,
int mutationCount)
mutate
public void mutate(List<Mutation> mutations,
int mutationCount)
put
public void put(Key key,
Value value)
get
public Value get(Key key)
size
public int size()
getMemoryUsed
public long getMemoryUsed()
iterator
public Iterator<Map.Entry<Key,Value>> iterator()
- Specified by:
iterator
in interface Iterable<Map.Entry<Key,Value>>
iterator
public Iterator<Map.Entry<Key,Value>> iterator(Key startKey)
delete
public void delete()
skvIterator
public SortedKeyValueIterator<Key,Value> skvIterator()
Copyright © 2013 Apache Accumulo Project. All Rights Reserved.