Package dovetaildb.dbservice

Examples of dovetaildb.dbservice.BagEntryFactory


  public static DbService makeMemoryDb() {
    BagIndexBridge b = new BagIndexBridge();
    final ProcessTransactionMapper mapper = new ProcessTransactionMapper();
    mapper.addRevsForTxn(0, new HashMap<String,Long>());
    b.setBagIndexFactory(new BagEntryFactory() {
      public BagEntry makeBagEntry(String bagName) {
        MemoryBlueSteelBagIndex bagIndex = new MemoryBlueSteelBagIndex();
        mapper.introduceBag(bagName, bagIndex);
        return new BagEntry(bagIndex);
      }
View Full Code Here


    }
    DbServiceFactory factory = new DbServiceFactory() {
      @Override
      public DbService makeDbService(final File subDbServiceHome, final DbService prevService) {
        BagIndexBridge b = new BagIndexBridge(subDbServiceHome);
        b.setBagIndexFactory(new BagEntryFactory() {
          public BagEntry makeBagEntry(String bagName) {
            BlueSteelBagIndex bsBagIndex = new FsBlueSteelBagIndex(sync);
            BagIndex bagIndex = bsBagIndex;
            bagIndex.setHomedir(new File(subDbServiceHome, "bag_"+bagName).getAbsolutePath());
            if (prevService != null) {
View Full Code Here

public abstract class ApiServiceTest  extends TestCase {

  protected DbService createDbService() {
    BagIndexBridge b = new BagIndexBridge();
    b.setBagIndexFactory(new BagEntryFactory() {
      public BagEntry makeBagEntry(String bagName) {
        return new BagEntry(new TrivialBagIndex(), new DefaultTermEncoder(), 0);
      }
    });
    b.setTxnMapper(new ProcessTransactionMapper());
View Full Code Here

  protected DbService createDbService() {
    BagIndexBridge b = new BagIndexBridge();
    final ProcessTransactionMapper mapper = new ProcessTransactionMapper();
    mapper.addRevsForTxn(0, new HashMap<String,Long>());
    b.setBagIndexFactory(new BagEntryFactory() {
      public BagEntry makeBagEntry(String bagName) {
        TrivialBagIndex bagIndex = new TrivialBagIndex();
        mapper.introduceBag(bagName, bagIndex);
        return new BagEntry(bagIndex);
      }
View Full Code Here

TOP

Related Classes of dovetaildb.dbservice.BagEntryFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.