thredds.inventory.bdb
Class MetadataManager
java.lang.Object
thredds.inventory.bdb.MetadataManager
public class MetadataManager
- extends Object
MetadataManager using Berkeley DB Java Edition.
Single environment, with multiple databases.
All threads share one environment; multiple processes can only have one writer at a time.
Each collection is a "database".
Each database has a set of key/value pairs.
default root dir is ${user.home}/.unidata/bdb
default TDS uses {tomcat_home}/content/thredds/cache/collection
- Since:
- Aug 20, 2008
- Author:
- caron
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MetadataManager
public MetadataManager(String collectionName)
throws com.sleepycat.je.DatabaseException,
IOException
- Throws:
com.sleepycat.je.DatabaseException
IOException
setCacheDirectory
public static void setCacheDirectory(String dir)
closeAll
public static void closeAll()
showEnvStats
public static void showEnvStats(Formatter f)
getCacheLocation
public static String getCacheLocation()
sync
public static void sync()
getCollectionNames
public static List<String> getCollectionNames()
deleteCollection
public static void deleteCollection(String collectionName)
throws Exception
- Throws:
Exception
delete
public static void delete(String collectionName,
String key)
put
public void put(String key,
String value)
put
public void put(byte[] key,
byte[] value)
put
public void put(String key,
byte[] value)
get
public byte[] get(byte[] key)
getBytes
public byte[] getBytes(String key)
get
public String get(String key)
delete
public void delete(String theKey)
delete
public void delete(Map<String,MFile> current)
close
public void close()
showStats
public void showStats(Formatter f)
getContent
public List<MetadataManager.KeyValue> getContent()
throws com.sleepycat.je.DatabaseException,
UnsupportedEncodingException
- Throws:
com.sleepycat.je.DatabaseException
UnsupportedEncodingException
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.