當前位置: 首頁>>代碼示例>>Java>>正文


Java DBMaker.compressionEnable方法代碼示例

本文整理匯總了Java中org.mapdb.DBMaker.compressionEnable方法的典型用法代碼示例。如果您正苦於以下問題:Java DBMaker.compressionEnable方法的具體用法?Java DBMaker.compressionEnable怎麽用?Java DBMaker.compressionEnable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.mapdb.DBMaker的用法示例。


在下文中一共展示了DBMaker.compressionEnable方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: open

import org.mapdb.DBMaker; //導入方法依賴的package包/類
@Override
public void open() {
	File file = new File(databaseDir_);
	if (!file.exists()) {
		file.mkdirs();
	}
	try {
		File dbFile = File.createTempFile(DATABASE_NAME, "db", file);
		DBMaker maker = DBMaker
			    .newFileDB(dbFile)
			    .transactionDisable()
			    .asyncWriteQueueSize(5000)
			    .mmapFileEnableIfSupported();
		if(this.getCompressMode()){
		    maker.compressionEnable();
		}
		mdb_ = maker.make();
		map_ = mdb_.createHashMap(MAP_NAME)
			.hasher(Hasher.BYTE_ARRAY)
			.makeOrGet();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
開發者ID:ppdai,項目名稱:sessdb,代碼行數:26,代碼來源:MdbBenchmark.java

示例2: start

import org.mapdb.DBMaker; //導入方法依賴的package包/類
@Override
public void start() {
   expiryEntryQueue = new LinkedBlockingQueue<ExpiryEntry>(configuration.expiryQueueSize());
   File location = new File(configuration.location());
   location.mkdirs();
   File dbFile = new File(location, "mapdb");
   DBMaker<?> dbMaker = DBMaker.newFileDB(dbFile)
         .transactionDisable()
         .asyncWriteDisable();
   
   if (configuration.compression())
      dbMaker.compressionEnable();
   
   this.db = dbMaker.make();
   
   
   this.store = db.createHashMap(STORE_DB_NAME)
         .makeOrGet();
   this.expired = db.createHashMap(EXPIRY_DB_NAME)
         .makeOrGet();
}
 
開發者ID:saturnism,項目名稱:infinispan-cachestore-mapdb,代碼行數:22,代碼來源:MapDBStore.java

示例3: start

import org.mapdb.DBMaker; //導入方法依賴的package包/類
@Override
public void start() {
   expiryEntryQueue = new LinkedBlockingQueue<ExpiryEntry>(configuration.expiryQueueSize());
   DBMaker<?> dbMaker = DBMaker.newDirectMemoryDB()
         .transactionDisable().asyncWriteDisable();
         //.asyncFlushDelay(100);
   
   if (configuration.compression())
      dbMaker.compressionEnable();
   
   this.db = dbMaker.make();
   
   
   this.store = db.createHashMap(STORE_DB_NAME + cache.getName())
         .makeOrGet();
   this.expired = db.createHashMap(EXPIRY_DB_NAME + cache.getName())
         .makeOrGet();
}
 
開發者ID:saturnism,項目名稱:infinispan-cachestore-offheap,代碼行數:19,代碼來源:OffheapStore.java

示例4: init

import org.mapdb.DBMaker; //導入方法依賴的package包/類
private void init() {
  DBMaker maker;
  if (file == null)
    maker = DBMaker.newMemoryDB();
  else {
    if (overwrite)
      wipe(file);
    maker = DBMaker.newFileDB(new File(file));
    maker = maker.cacheSize(cache_size);
    if (async) {
      maker = maker.asyncWriteEnable();
      maker = maker.asyncWriteFlushDelay(10000);
    }
    if (mmap)
      maker = maker.mmapFileEnableIfSupported();
    if (compression)
      maker = maker.compressionEnable();
    if (snapshot)
      maker = maker.snapshotEnable();
    if (notxn)
      maker = maker.transactionDisable();
  }

  db = maker.make();

  if (!db.exists("idmap"))
    idmap = db.createHashMap("idmap")
      .valueSerializer(new RecordSerializer())
      .make();
  else
    idmap = db.getHashMap("idmap");
}
 
開發者ID:enricopal,項目名稱:STEM,代碼行數:33,代碼來源:MapDBBlockingDatabase.java


注:本文中的org.mapdb.DBMaker.compressionEnable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。