thredds.inventory.bdb
Class MetadataManager

java.lang.Object
  extended by 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

Nested Class Summary
 class MetadataManager.KeyValue
           
 
Constructor Summary
MetadataManager(String collectionName)
           
 
Method Summary
 void close()
           
static void closeAll()
           
 void delete(Map<String,MFile> current)
           
 void delete(String theKey)
           
static void delete(String collectionName, String key)
           
static void deleteCollection(String collectionName)
           
 byte[] get(byte[] key)
           
 String get(String key)
           
 byte[] getBytes(String key)
           
static String getCacheLocation()
           
static List<String> getCollectionNames()
           
 List<MetadataManager.KeyValue> getContent()
           
static void main(String[] args)
           
 void put(byte[] key, byte[] value)
           
 void put(String key, byte[] value)
           
 void put(String key, String value)
           
static void setCacheDirectory(String dir, long _maxSizeBytes, int _jvmPercent)
           
static void showEnvStats(Formatter f)
           
 void showStats(Formatter f)
           
static void sync()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataManager

public MetadataManager(String collectionName)
                throws com.sleepycat.je.DatabaseException,
                       IOException
Throws:
com.sleepycat.je.DatabaseException
IOException
Method Detail

setCacheDirectory

public static void setCacheDirectory(String dir,
                                     long _maxSizeBytes,
                                     int _jvmPercent)

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.